API

LocationBox API

Encode Geometry

Encode Geometry Service encodes your geometric information based on some criterias which you can find below.

A EncodeGeometry request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=EncodeGeometry&Typ=output_format&Geometry=geometry


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (Distance)
Typ: Response format. (XML or JSON)
Geometry: Geometry Array

Response Parameters


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=EncodeGeometry&Typ=XML&Geometry=41.1/29.1,41.2/29.1

The response will be as following:

<response>
 <transactionid>LBS_50297040</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <geometry>_jzyF_rrpD_pR?</distance>


JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=EncodeGeometry&Typ=JSON&Geometry=41.1/29.1,41.2/29.1

The response will be as following:


{ "transactionid": "LBS_50297037", "status": 0, "geometry": "_jzyF_rrpD_pR?" }

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.

geometry: encoded geometry.

DecodeGeometry

Decode Geometry Service decodes your geometric information based on some criterias which you can find below.

Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (IlceList)
Typ: Response format. (XML or JSON)
Geometry: Encoded geometry string.


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=DecodeGeometry&Typ=XML&Geometry=_jzyF_rrpD_pR?

The response will be as following:


<response>
 <transactionid>LBS_50297040</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <coors>
  <latitude>41.1</latitude>
  <longitude>29.1</longitude>
  <latitude>41.2</longitude>
  <longitude>29.1</longitude>
 </coors>

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=DecodeGeometry&Typ=JSON&Geometry=jzyF_rrpD_pR?

The response will be as following:


{ "transactionid": "LBS_50297460", "status": 0, "coors": [ { "latitude": 41.1, "longitude": 29.1 }, { "latitude": 41.2, "longitude": 29.1 } ] }

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.
20022 City is not found.
20023 Town is not found.
20024 District is not found.

latitude & longitude: decoded geometry.