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

Find coordinates of bounding box

3
1

Hello. I started using OSM, great services and all, but I'm struggling on one point. I have an JS object that contains a list of places, with coordinates etc. I have my actual location with the geolocation API. I want to do a research within 300m and see if some of those places are into the radius. So I have found how to call the "radius", with the bounding box, but I can't find how to simply get the 4 needed coordinates from my position (assuming I'm at the center of the circle/rectangle, of course). If anyone can help me, it'd be greatly appreciated.

EDIT: So, I've found a piece of code that convert two sets of lat/long in meters, so I compare all my values. Not the most efficient thing ever, but for my need, it was alright. I let my code here, in case anybody needs it someday.
Gist

asked 21 Jan '13, 11:12

kilik2049's gravatar image

kilik2049
56225
accept rate: 0%

edited 22 Jan '13, 12:55


One Answer:

3

alt text

answered 21 Jan '13, 22:43

andy%20mackey's gravatar image

andy mackey
13.2k87143285
accept rate: 4%

so position map on the area you want and click on export. then you can see the lat lons of top, left right and bottom

(21 Jan '13, 22:46) andy mackey

Yeah, but I was talking about doing it automatically in my code. Thanks anyway.

(22 Jan '13, 12:53) kilik2049

Source code available on GitHub .