0

I have information about different locations in a Java List. Each location has it's coordinates (longitude and latitude) For example:

longitude = 2.37364
latitude = 42.38473

I need to look up using an API which bus stations are near each location (in a radius of 500m).

I want to know how can I relate the coordinate system with meters to filter the search.

Vince
  • 20,017
  • 15
  • 45
  • 64
  • There is an ellipsoidal relation between geodesic coordinates and meters over the ellipsoid. I do not know anything about Java, but you can look there: https://geographiclib.sourceforge.io/html/java/ – Gabriel De Luca Feb 10 '20 at 21:02
  • Geographic degrees to geodesic meters is partial differential equation, only solvable through iterative means. You really want to find an open-source provider for this. – Vince Feb 10 '20 at 21:39
  • For a search radius of 500m the earth is practically flat, and if you don't need much precision, you could scale the longitude by the lat-long aspect ratio at that latitude, then convert to approximate metres. Quick and dirty. Might get you 1m precision... – Spacedman Feb 10 '20 at 22:27
  • possible duplicate of https://stackoverflow.com/questions/44249945/how-to-use-geometricshapefactory-in-geotools-to-create-a-circle-on-map – Ian Turton Feb 11 '20 at 08:53
  • possible duplicate of https://stackoverflow.com/questions/36481651/how-do-i-create-a-circle-with-latitude-longitude-and-radius-with-geotools/36528805 – Ian Turton Feb 11 '20 at 08:53
  • or possible duplicate of https://gis.stackexchange.com/questions/311272/create-dynamic-circle-polygon-from-specific-lat-long-using-geotools – Ian Turton Feb 11 '20 at 08:54
  • but you may need to read https://gis.stackexchange.com/questions/268639/jts-geometricshapefactory-generate-an-ellipse-properly – Ian Turton Feb 11 '20 at 08:55

0 Answers0