I often propose OSM as a resource on this site, but actually I don't know how to use it very well. (I'll post this first to OpenData but maybe it's more appropriate for GIS.)
If I have a single latitude and longitude point, how can I find the dimensions or geo-coordinates of the object?
Here's an example:
- latitude/longitude = (47.382844, 8.503754) - Satellite Image
- On OSM, it looks like this (link):
- And I'm looking for the coordinates of this rectangle:
- According to the color legend, it's either "Sports centre" or "Sports pitch" (probably the former).
- On the Overpass Turbo (OSM API) I can find the object - 168927595
- And the Nodes underneath are actually the corners.
BUT how can I do this all programatically, via a URL, webservice or API?
I have to do only a handful of queries spread over months, so I can use a public resource with limited quotas. My geography is only in Switzerland for the moment.
I've tried the Nominatim API
http://nominatim.openstreetmap.org/reverse?format=xml&lat=47.382844&lon=8.503754&zoom=18&addressdetails=0&polygon_geojson=1
results:
<result place_id="71071014" osm_type="way" osm_id="28733849" ref="Stadion Letzigrund" lat="47.38282055" lon="8.50373866657526" boundingbox="47.3817046,47.3838748,8.502166,8.5051997" geojson="{"type":"Polygon","coordinates":[[[8.502166,47.3824916],[8.5021808,47.3826066],[8.5022493,47.3827219],[8.5023643,47.382886],[8.5027706,47.3832445],[8.5031899,47.3835916],[8.5033192,47.3836894],[8.5034696,47.3837748],[8.5036004,47.383825],[8.5037349,47.3838587],[8.5038731,47.3838743],[8.5040127,47.3838748],[8.5041689,47.3838591],[8.5043265,47.3838209],[8.5045304,47.3837468],[8.504745,47.3836457],[8.5049314,47.3835164],[8.5050552,47.3833863],[8.505141,47.383244],[8.5051831,47.3831285],[8.5051997,47.3830107],[8.5051826,47.3828853],[8.5051352,47.3827558],[8.5050291,47.3826127],[8.5049168,47.3824909],[8.5042159,47.3819128],[8.5041256,47.381865],[8.5040485,47.3818273],[8.5039701,47.3817961],[8.5038053,47.3817439],[8.5035874,47.381712],[8.5033799,47.3817046],[8.5032385,47.3817138],[8.5030521,47.3817444],[8.5028884,47.3817959],[8.5027417,47.3818565],[8.5026008,47.3819327],[8.5024694,47.3820137],[8.5023528,47.3821055],[8.5022551,47.3822116],[8.5022036,47.3822879],[8.5021698,47.3823797],[8.502166,47.3824916]]]}">
Stadion Letzigrund, Herdernstrasse, Erismannhof, Hard, Aussersihl, Zurich, Bezirk Zürich, Zurich, 8004, Switzerland
</result>
But the GeoJSON results don't give the corner points of the rectanlge (viewer)