How to get the coordinates of the polygon area - coordinates

How to get the coordinates of the polygon area:
http://wikimapia.org/#lang=en&lat=49.964473&lon=36.262436&z=12&m=b&show=/20421408/Chervonozavodsky-district

You need to use the place.Search function of The Wikimapia API and enter the latitude, longitude and the name of the place as parameters.
The API returns a lot of data separated in blocks. The one you are interested in is the geometry.
You can make tests with the Wikimapia API to filter the results to your needs. With the lat lon parameters and the district name you provided I was able to get the area you needed as the first result.
The places[0].polygon is what you need. A JSON array of coordinates.
HereĀ“s the url I used to get the results:
http://api.wikimapia.org/?key=example&function=place.search&q=Chervonozavodsky-district&lat=49.964473&lon=36.262436&format=json&pack=&language=en&data_blocks=geometry%2C&page=1&count=1
Note that in this example i made the request for a JSON result. But you can also ask for a XML if you prefer.
Hope it helps!

Related

Get buildings polygons points from mapbox with fetch API only

I try to get the buildings geometry coordinates polygons from features, but i cant seem to find a way for this to work without the javascript method queryRenderedFeatures or SourceFeatures.
This question Getting building information from mapbox api uses the javascript method, but i want something to work with a link, that i can fetch a json from.
I have managed to come close with something like this:
https://api.mapbox.com/v4/mapbox.mapbox-streets-v8/tilequery/27.598505,47.162098.json?radius=30&layers=road,poi_label,building,geometry&access_token=ACCESS_TOKEN_HERE.
But this has a major flaw:
It only returns geometry as a point:
{"type":"FeatureCollection","features":[{"type":"Feature","id":235028771,"geometry":{"type":"Point","coordinates":[27.598497434198464,47.16209573500234],"type":"building"...}}
You can observe that it returns a point even though it is a building.
Is there a way to do this?
The queryRenderedFeatures method DOES return a polygon. Somehow the information reaches the Map object that i query but how can i fetch through an api that info?
What you're trying to do is not possible. Mapbox doesn't provide complete polygon datasets. At best, there are ways of retrieving polygons from vector tilesets (such as query-remote-tiles, which does something similar to TileQuery). But these will only retrieve the part of the polygon within a given vector tile, which may not be what you want. (queryRenderedFeatures has the same issue).

How do I get the boundingBox for the MapQuest API?

The traffic incidents needs the boundingBox param (https://developer.mapquest.com/documentation/traffic-api/incidents/get/) and it docs use a location that is geocoded, I would assume to get the boundingBox info but the geocodding api doesn't return anything for it (https://developer.mapquest.com/documentation/geocoding-api/address/get/). How can I get and/or calculate the bounding box? It seems to be related to the lat/lang but it's not obvious.
A default bounding box can be built around a geocode result by adding/subtracting generous values around the returned lat/lng. But usually the bounding box is a result of a user looking at a map and grabbing the bounds of that map.

Get Node from Coordinates (long, lat) in Open street maps

Using OSRM API, I found the coordinates of the intersections along a route.
I want to know what are the corresponding node IDs.
Is there any API to find the node IDS from the coordinate points?
Is there any API to find the node IDS from the coordinate points?
Yes. You need to pass annotations=nodes as additional query parameter. routes[i].legs[j].annotations.nodes will be an array of OSM IDs that you can use to link the data with OSM.
Linking this to the coordinates in the step is a little bit complicated: You would need to concatenate all RouteStep.geometry and remove the duplicated coordinates (steps[i].geometry[-1] == steps[i+1].geometry[0]).

drawing line between two coordinates on google map

I am having two coordinate points on Google map. I calculated the distance between that points. But I want to draw a straight line between them. Please help me to draw.
You have to use google direction api for that follow the Direction API Link .
Make request using NSURLConnection with direction api url and pass required addresses from it it and catch its response.
From that you will get json or xml formatted response, which contains paths in the form of polyline encoded string .
Then parse it and retrieve polyline encoded string.
You have to simply decode it it then you will get all points of your path and pass it to viewForOverlay method of MKMapViewDelegate which will draw the path.
For more information follow my question Stackoveflow question link .
If you have any more quires let me know. Hope this will help you....:)

how can i get distance bettween two place?

hello i want distance between two place ... means i have two places latitude and longitude then i want distance between that two place
i want something like this...
http://maps.google.com/maps?saddr=23.029772,72.527871&daddr=23.1901748,72.0127743
not like php or .net or java function that give calculate distance ...
if i search result by function it give me 55.61 output for this latitude and logitude and in map it give me 65.5 output. how can i get this in json ot xml or any other formate ?
...there's an in-built function in iOS that will do this for you. Check out the CLLocation documentation. Particularly distanceFromLocation:, which as the name suggests returns the difference between two locations in meters. You can create a CLLocation object using lat and lon.
If you don't want a straight line distance, you need to use the Google Directions API, which is well documented here: http://code.google.com/apis/maps/documentation/directions/