API

LocationBox API

Spatial Analysis

Spatial Analysis Service lists special points, regions and POI based on criterias which you can find below.

A SpatialAnalysis request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=SpatialAnalysis&Typ=output_format&Type=analysetype&IlId=ilId
&TargetLayer=analysetargetlayer&TargetBrand=targetbrand
&TargetCategory=targetcategory&TargetWhereClause=targetwhereclause
&SearchLayer=searchlayer&SearchBrand=searchbrand&SearchCategory=searchcategory
&SearchWhereClause=searchwhereclause&SearchDistance=searchdistance


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (SpatialAnalysis)
Typ: Response format. (XML or JSON)
Type: Spatial Analysis type. (Interact & Disjoint)
IlId: City id.
TargetLayer: Target Layer type. (Poi, UserPoint, UserRegion)
TargetBrand: Brand of TargetLayer. (for Poi selection on TargetLayer)
TargetCategory: Category of TargetLayer. (for Poi selection on TargetLayer)
TargetWhereClause : Target where clause. (for UserPoint & UserRegion selection on TargetLayer)
SearchLayer: Search Layer type. (Poi, UserPoint, UserRegion)
SearchBrand: Brand of SearchLayer. (for Poi selection on SearchLayer)
SearchCategory: Category of SearchLayer. (for Poi selection on SearchLayer)
SearchWhereClause : Search where clause. (for UserPoint & UserRegion selection on SearchLayer)
SearchDistance : Searching on the search layer around. (meter)

Response Parameters


XML Response

SpatialAnalysis response returns in XML format when the Typ parameter is set as "XML".

Below is an example for a SpatialAnalysis request which is expected to return a response in XML format.

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=SpatialAnalysis&Typ=XML&Type=Interact&TargetLayer=Poi&TargetBrand=BIMEKS
&SearchLayer=Poi&SearchCategory=BANKA&SearchDistance=1000


The response will be as following:

<response>
 <transactionid>LBS_37538710</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <analysis>
  <poilist>
   <poi>
    <id>34200113208</id>
    <name>Bimeks-Ýstanbul Forum AVM</name>
    <address>Kocatepe MAH. Paþa Caddesi 34045 Bayrampaþa Ýstanbul</address>
    <phone>+90 212 6403670</phone>
    <latitude>41.04716</latitude>
    <longitude>28.89756</longitude>
    <distance>0</distance>

...
   <poi>
    <id>34200052046</id>
    <name>Bimeks-Ýstanbul Beylikdüzü (Carrefour)</name>
    <address>Güzel Yurt MAH. Mustafa Kemal Caddesi Esenyurt Ýstanbul</address>
    <phone>+90 212 8529927</phone>
    <latitude>41.00747</latitude>
    <longitude>28.67369</longitude>
    <distance>0</distance>
  </poilist>
 </analysis>
</response>

JSON Response

SpatialAnalysis response returns in JSON format when the Typ parameter is set as "JSON".

Below is an example for a SpatialAnalysis request which is expected to return a response in JSON format.

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=SpatialAnalysis&Typ=JSON&Type=Interact&TargetLayer=Poi&TargetBrand=BIMEKS
&SearchLayer=Poi&SearchCategory=BANKA&SearchDistance=1000


The response will be as following:


{ "transactionid": "LBS_31968", "status": 0, "analysis": { "poilist": [ { "id": 34200113208, "name": "Bimeks-Ýstanbul Forum AVM", "address": "Kocatepe MAH. Paþa Caddesi 34045 Bayrampaþa Ýstanbul", "phone": "+90 212 6403670", "latitude": 41.04716, "longitude": 28.89756, "distance": 0 },
...
, { "id": 34200052046, "name": "Bimeks-Ýstanbul Beylikdüzü (Carrefour)", "address": "Güzel Yurt MAH. Mustafa Kemal Caddesi Esenyurt Ýstanbul", "phone": "+90 212 8529927", "latitude": 41.00747, "longitude": 28.67369, "distance": 0 } ] } }


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 code
errdesc: Error definition

Error 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.