Service API
Address
POI
Route
Map
Indoor
Dynamic Information
Campaign
Demography
Traffic
User Data
Risk
Analysis
- Spatial Analysis
- Add Service Area
- Add Buffered Line To User Region
- Add Buffered Route To User Region
- Add Route To User Line
LocationBox API
Distance Service gives distance between two location based on criterias which you can find below.
A Distance request must look like this:
http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=Distance&Typ=output_format&FromLatitude=fromlatitude&FromLongitude=fromlongitude&ToLatitude=tolatitude&ToLongitude=tolongitude
Key
: LocationBox user key. (Register for user key) Cmd
: LocationBox service name. (Distance)Typ
: Response format. (XML or JSON)FromLatitude
: Latitude of first position.FromLongitude
: Longitude of first position.ToLatitude
: Latitude of second position.ToLongitude
: Longitude of second position.Distance response returns in XML format when the Typ
parameter is set as "XML".
Below is an example for a Distance request which is expected to return a response in XML format .
http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=Distance&Typ=XML&FromLatitude=41.1
&FromLongitude=29.1&ToLatitude=41.16&ToLongitude=29.05
The response will be as following:
<response>
<transactionid>LBS_196</transactionid>
<status>0</status>
<errno />
<errdesc />
<distance>7875.78290193609</distance>
Distance response returns in JSON format when the Typ
parameter is set as "JSON".
Below is an example for a Distance request which is expected to return a response in JSON format .
http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=Distance&Typ=JSON&FromLatitude=41.1
&FromLongitude=29.1&ToLatitude=41.16&ToLongitude=29.05
The response will be as following:
{
"transactionid": "LBS_49942734",
"status": 0,
"distance": 7875.78290193609
}
transactionid
: The id of response given by LocationBox Service. Every response can be tracked using transactionid when necessary.status
: Response format. (XML or JSON)Status Codes
0 -- Success
1 -- Fail
errno
: Error codeerrdesc
: Error definitionError Codes
10001 Error processing your request. Please try again soon.
Cmd parameter is misspelled/not found.
10011 Error processing your request. Please check the Cmd parameter.
Cmd is not specified.
10012 Error processing your request. Please check the Key parameter.
Key is not specified.
10013 Error processing your request. Please check the Key parameter.
Key is invalid.
20012 No data found.
distance
: distance (meter).