This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Retrieve information in an ordered pattern

0

Hi Guys, please I'm working on a project and we are planning to integrate with openstreetmap. Is it possible to query OSM and get the data returned in a particular order? For example, if I have the user's coordinates (longitude and latitude), and I can generate a user's radius based on the coordinates, how do I retrieve information on certain objects (e.g. building) within the user's radius in an ordered pattern, let's say getting objects' information from behind the user right to the objects in front of the user in the given radius?

Thanks

This question is marked "community wiki".

asked 15 Jan '22, 00:58

Segunlakata's gravatar image

Segunlakata
16131316
accept rate: 0%


One Answer:

2

The overpass service lets you request information in a certain area but geometric ordering is not possible. You need to retrieve the data, construct the geometries, and then run your own algorithm to determine what is "in front of" and "behind" the user.

answered 15 Jan '22, 15:51

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .