Coordinate system transformation
Transforms longitude and latitude coordinates from a specified coordinate system to another. Supported coordinate systems include GCJ02, WGS84, CGCS2000, and BD09.
Test
You can test the API in the Address Purification console.
Request parameters
Name | Type | Required | Example | Description |
Action | String | Yes | TransferCoord | A required parameter. Set the value to TransferCoord. |
AppKey | String | Yes | Axqwerasdf1a | The AppKey of your project. |
ServiceCode | String | Yes | addrp | A static field. The value is addrp. |
Text | String | Yes | 120.026268,30.279164 | The longitude and latitude coordinates, separated by a comma (,). The coordinate values must be numbers. |
SrcCoord | String | Yes | gcj02 | The name of the input coordinate system. Supported values are gcj02, wgs84, cgcs2000, and bd09. |
DefaultProvince | String | No | Zhejiang Province | The default province. |
DefaultCity | String | No | Hangzhou | The default city. |
DefaultDistrict | String | No | Yuhang District | The default administrative region. |
Response data
Name | Type | Sample value | Description |
Data | String | {"coord_transfer":{"BD09":"120.032768,30.285238","CGCS2000":"120.021519,30.281543","WGS84":"120.021519,30.281543","GCJ02":"120.026268,30.279164"},"status":"OK","time_used":{"rt":{"coord_transfer":0.00026416778564453125},"start":1619320226.3847773}} | coord_transfer: The result of the coordinate system transformation. time_used: The time taken by the algorithm to process the request. status: The status of the request. |
RequestId | String | E0627DDE-28D7-4C00-A611-E047DF81AF05 | RequestId |
Examples
Request example
http(s)://[Endpoint]/?Action=TransferCoord
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=120.026268,30.279164
&SrcCoord=gcj02
&<Common request parameters>Response example
XML format
<RequestId>0C95C4A0-0C40-40FF-B342-EDABCB90704E</RequestId>
<Data>
<coord_transfer>
<BD09>120.032768,30.285238</BD09>
<CGCS2000>120.021519,30.281543</CGCS2000>
<WGS84>120.021519,30.281543</WGS84>
<GCJ02>120.026268,30.279164</GCJ02>
</coord_transfer>
<status>OK</status>
<time_used>
<rt>
<coord_transfer>0.00026416778564453125</coord_transfer>
</rt>
<start>1619320226.3847773</start>
</time_used>
</Data>JSON format
{
"RequestId": "0C95C4A0-0C40-40FF-B342-EDABCB90704E",
"Data": {
"coord_transfer": {
"BD09": "120.032768,30.285238",
"CGCS2000": "120.021519,30.281543",
"WGS84": "120.021519,30.281543 ",
"GCJ02 ": "120.026268,30.279164 "
},
"status ": "OK ",
"time_used ": {
"rt ": {
"coord_transfer": 0.00026416778564453125
},
"start": 1619320226.3847773
}
}
}Error codes
HTTP code | Error code | Error message | Description |
403 | Forbidden.NoAuth | Failed to perform user authentication. | User authentication failed. |
500 | InternalError | A service error occurred. | An internal service error occurred. |
400 | InvalidParameter | The parameter is invalid. | The parameter is invalid. |
404 | ResourceDoesNotExist | The resource does not exist. | The resource does not exist. |
429 | Throttling.User | Flow control has been triggered. | Throttling was triggered. |
400 | UserStatusInvalid | The user status is invalid. | The user status is invalid. |
For more information about error codes, see the Error Center.