Is there any way to check with Geotools if a point is placed on a LineString. I am trying to retrieve street names of a route obtained from a routing algorithm. The route is displayed in gps coordinates and i was thinking to look for the name of the street by checking if the point is placed on the LineString.

If you have other suggestions, i would be grateful.


I'm not sure if there is a built in function that does that but you could make your own by testing if a small circle/square around your point intersects a street feature.

It is likely that if you even super close to a road, numerical error would creep in and no amount of testing would say a point is EXACTLY ON a segment. (unless it was a vertex point)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.