tomtom-international / openlr

Reference implementation of OpenLR. A map agnostic, dynamic location referencing method.
Other
90 stars 30 forks source link

checkLRPCoverage Intention Question #43

Open earlHammond opened 4 years ago

earlHammond commented 4 years ago

I ran into something that is presumably an edge case where an LRP of a LineLocation is marked as a pointOnLine. When this happens we hit this if statement in the checkLRPCoverage: https://github.com/tomtom-international/openlr/blob/983ef6afd237179eec4a7c43504581cd8d3b2d43/encoder/src/main/java/openlr/encoder/locRefAdjust/LocationReferenceAdjust.java#L282

Which prevents the lines from that segment from being added to the total list of lines and we subsequently fail the location ref validation. After reviewing the OpenLR white paper it seems that it should prefer valid nodes over invalid nodes, however I didn't notice in the spec that an LRP must be on a node. However, the validation logic requires that all LRPs be at nodes.

So, the question is... Is this a bug? Or must all LRPs be at nodes and never at points on a line?

Thanks

ghost commented 4 years ago

You are correct. Location reference points should preferably be placed on valid nodes but nothing in the specification stops them being placed on invalid nodes, or even along a line.

I would like to understand a bit more about how you are using the encoder and what line location you are trying to encode. The encoder might place a location reference point along a line if the distance to the previous location reference point exceeds the maximum 15km. Is this the case with the location you are encoding? Any details on reproducing the issue would help a lot to try to fix this. Thanks!