PTV xServer Coordinate Shifting Service

Coordinate Shifting Service

Chinese legislation requires that all digital map data is stored in China in a specific coordinate system. This coordinate system is also used in the PTV China Map. GPS based coordinates usually conform to the WGS-84 projection.
To map those two projections, PTV provides a service to convert WGS-84 based coordinates to the China specific coordinate system. No other formats are supported at this time. The service can be addressed as a simple REST web service via the following url:
The payload of the request consists of an array of coordinates:
[{"longitude":121.47004, latitude":31.23136}, {"longitude":116.46, "latitude":39.92}]
Accordingly, the response is an array of coordinates, too:
Example on how to convert one coordinate via cURL:
curl -X POST "" --data "[{"latitude":31.23136, "longitude":121.47004}]"
Example on how to convert several coordinates via cURL:
curl -X POST "" --data "[{"latitude":31.23136, "longitude":121.47004}, {"latitude":39.92, "longitude":116.46}]"
Example on how to address the service in JavaScript:
var objXMLHttpRequest = new XMLHttpRequest();"POST", "", false);
objXMLHttpRequest.setRequestHeader("Content-Type", "application/json; charset=ISO-8859-1");
objXMLHttpRequest.send("[{'latitude':31.23136, 'longitude':121.47004}]");
var response = JSON.parse(objXMLHttpRequest.response);
var shiftedLat = response[0].latitude;
var shiftedLon = response[0].longitude;
Please note that this a very basic example, using neither a framework like jQuery nor calling the service asynchronously - which usually is a good idea. Example on how to address the service in Python:
import requests
import json
r ="", json=[{"latitude":31.23136, "longitude":121.47004}])
print r.text