# How-to extract all gps coordiantes in a specific area?

Hello all,
im new to osm and would like to use it in my project.

I need to implement some kind of sliding window which extracts the gps coordinates inside that window.
All i can see in osm is nodes, ways and relations, but how do i extract gps coordinates only?
(preferably using python)

bear with me, im a newbie

EDIT:

so the application is related to drones. I have a drone that gives me its lat/long position via an installed gps device.
i want to construct a 3D shape (a trapezoid prisim ex: https://www.google.de/url?sa=i&rct=j&q=&esrc=s&source=imgres&cd=&cad=rja&uact=8&ved=0ahUKEwipo4m8y7_UAhVISRoKHXsIBSgQjRwIBw&url=https%3A%2F%2Fwww.quora.com%2FHow-do-you-calculate-the-volume-of-a-trapezoidal-prism&psig=AFQjCNEuUxMDjYW6YFziIXa4UdSkigVT4w&ust=1497607135245212 ) centered around the drones position.
As the drone moves, so does the shape surrounding it. At every movement of the drone, i have to check whether the droneâ€™s lat/long is inside that trapezoid prism or not.

Can you explain a bit more about what youâ€™re trying to do? Do you mean â€śGPS Co-ordinatesâ€ť as in the GPS points that people have uploaded to OSM via â€śGPS Traces / Uploadâ€ť on the main site, or do you mean the real-world locations of things that people have added to OSM?

It would very much help if you described your ultimate goal, as having the coordinates in OSM in an area doesnâ€™t seem useful.

For a start, there is an uncountably infinite set of coordinates in any specific area.

Even if you limit yourself to OSM ways, there is still an uncountably infinite set of coordinates.

As such, the only mathematically meaningful thing to do would be to limit yourself to nodes. However it is difficult to see why you would want the construction nodes, in the middle of a way, without the way itself.

Once you have the nodes, it is a simple case of either parsing the XML properly, or using something like sed, awk or perl, to parse it based on the de facto layout of the XML, and then convert the result into whatever your representation of a GPS coordinate should be.

Note I have actually ignored â€śGPSâ€ť, as many of the latitudes and longitudes, in OSM, are not from GPS, and GPS coordinates can be represented in more than the WGS-84 coordinates used in OSM. If you want only the GPS derived coordinates from the map, that is not possible, as contributors are not rigorous enough about specifying the source of the coordinates for one to distinguish them from ones obtained by other means.

i edited the post to describe the application

Unfortunately I donâ€™t think that OpenStreetMap (a project about mapping things that exist on the ground) is going to help you. You might be able to use OSM data on a map to display the location of your drone on a map, but OSM itself isnâ€™t going to help with your problem.

I still donâ€™t think you have described your real goal, and I donâ€™t even understand the intermediate step. If you move the trapezoid with the drone, surely the drone is always within the trapezoid.

Do you, by any chance, want to know the WGS-84 corner coordinates of all the slippy map tiles. Iâ€™m fairly sure that the same system is used for other maps, not just OSM. The longitudes are multiples of the value obtained by dividing 360 degrees by n * 2^z, where n is a small integer and z is the zoom level. The latitudes are determined so as to make the ground distance the same on both x and y axes. n should be fairly obvious, by inspection. The exact formula for latitudes will take more research than I want to do now, but should be easy to find. You can always linearly interpolate longitude. Latitude can be linearly interpolated if you are working sufficiently far from the poles, and over a sufficiently small area, that you can ignore the curvature of the earth;