itinero / OpenLR

A C# Implementation of the OpenLR specification using Itinero.
https://www.itinero.tech
Other
18 stars 12 forks source link

Incorrect offset position encoding/decoding #91

Open AndersHGP opened 5 years ago

AndersHGP commented 5 years ago

Hi!

According to the OpenLR Physical data format binary specification regarding Line Location.

The positive and negative offset bytes are optional. This means that the negative offset can be found at byte number 17 instead of byte number 18 if only a negative offset is included. This is not handled currently in the library.

I know this is not clearly stated in the spec but i can confirm that TomTom themselves are delivering data in this way.

xivk commented 5 years ago

Can you refer to the spec for this? I'm not sure if I follow completely.

If I remember correctly the presence of the offsets is determined by the total size in bytes of an encoded line.

AndersHGP commented 5 years ago

Version: OpenLR-Whitepaper_v1.5.pdf Page 53 of 156 As you can see you have flags in byte 16 indicating if POff and Noff are included. The thing not so clear here is that the negative offset can be in byte 17 instead of 18 if no positive offset is included. The lib assumes that POFF can always be found at 17 and NOFF at 18.

xivk commented 5 years ago

Ah ok, I see now thanks! :+1:

xivk commented 5 years ago

Note to self: