URI
/coordtransfer[.<format>]
Supported methods
Parent resource
Child resources
Introduction
The coordTransfer resource represents projected coordinate system transfer result. By sending POST request to this resource, you can execute projected coordinate system transfer with an array of points or a set of geometries.Steps are as follows:
-
Execute POST request to coordTransfer, with required arguments contained in request body to return a certain result resource(coordtransferResult resource) URI;
-
Execute GET request to the returned URI to get transfer result.
Supported Methods:
- GET: Gets the forms to execute POST request.
- POST: Creates a projected coordinate system transfer result by given result.
- HEAD: Checks whether the coordTransfer resource exists or whether there is a permission to access the resource.
Supported output formats: rjson, json, html, xml.
Resource hierarchy
HTTP request methods
Implement the HTTP request on the following URI, where supermapiserver is the server name, with rjson being the output format.
http://supermapiserver:8090/iserver/services/data-world/rest/data/coordtransfer.rjson
GET request
Gets the forms to execute POST request.
POST request
Creates a projected coordinate system transfer result by given result.
Request parameter
The following arguments need to be contained within request body:
Name | Type | Description |
sourcePoints | Point2D[] | Array of source points. example: [{"x":113.98533886568,"y":4.39179640504}]. Whether SourcePoints or sourceGeometry is required. |
sourceGeometries | Geometry[] | Source Geometries. Used when line and region need to be transferred. Different types of geometries can be transmitted in a request. Example: [{"type":"REGION","points":[{"x":30,"y":60},{"x":60,"y":60},{"x":60,"y":30},{"x":30,"y":60}]},{"type":"LINE","points":[{"x":45,"y":70},{"x":80,"y":80},{"x":60,"y":30}]}]. Whether SourcePoints or sourceGeometry is required. |
sourceEpsgCode |
int | The correspondingEPSG Code to source points or source geometries. Whether sourceEpsgCode or sourcePrj is required. |
sourcePrj | PrjCoordSys | Coordinate system description in json of source points array or geometries. Used when coordinate system has no EpsgCode. Whether sourceEpsgCode or sourcePrj is required. |
targetPrj | PrjCoordSys | Target projected coordinate system. Target projected coordinate system to transfer to. Used when coordinate system has no EpsgCode. Need to be constructed according to PrjCoordSys fields structure when used. Whether targetPrj or targetEpsgCode is required. |
targetEpsgCode | int | EPSG Code corrsponding to target projected corrdinate system. Whether targetPrj or targetEpsgCode is required. |
Response structure
Execute POST request on coordTransfer resource. The returned constructed result is as follows:
Field | Type | Description |
succeed | boolean | Whether it's successful to execute data search. |
newResourceID | String | Resource ID of created coordTransferResult. |
newResourceLocation | String | Resource URI of created coordTransferResult. |
Example 1
Execute POST request on coordTransfer resource:http://supermapiserver:8090/iserver/services/data-world/rest/data/coordtransfer.rjson to transfer the coordinate system of geometries passed in.(to create a coordTransferResult resource). Both source coordinate system and target coordinate system are set by Epsg Code. Following arguments should be included in the request body:
{
"sourcePoints":[{"x":113.98533886568,"y":4.39179640504}],
"sourceEpsgCode":4326,
"targetEpsgCode":3857
}
The returned rjson format representation after implementing the POST request:
{
"newResourceID": "159790bc662f49579a938a5a52ca1415_eb5271f601aa4067905273c18fcc17a5",
"newResourceLocation": "http://localhost:8090/iserver/services/data-world/rest/data/coordtransfer/159790bc662f49579a938a5a52ca1415_eb5271f601aa4067905273c18fcc17a5.rjson",
"postResultType": "CreateChild",
"succeed": true
}
Example 2
Execute POST request on coordTransfer resource:http://supermapiserver:8090/iserver/services/data-world/rest/data/coordtransfer.rjson to transfer the coordinate system of geometries passed in.(to create a coordTransferResult resource). Both source coordinate system and target coordinate system are set by PrjCoordSys in json. Following arguments should be included in the request body:
{
"sourcePoints":[{"x":113.98533886568, "y":4.39179640504}],
"sourcePrj":{
"distanceUnit":"METER",
"projectionParam":null,
"epsgCode":4326,
"coordUnit":"DEGREE",
"name":"Longitude / Latitude Coordinate System---GCS_WGS_1984",
"projection":null,
"type":"PCS_EARTH_LONGITUDE_LATITUDE",
"coordSystem":{
"datum":{
"name":"D_WGS_1984",
"type":"DATUM_WGS_1984",
"spheroid":{
"flatten":0.00335281066474748,
"name":"WGS_1984", "axis":6378137,
"type":"SPHEROID_WGS_1984"
}
},
"unit":"DEGREE",
"patialRefType":"SPATIALREF_EARTH_LONGITUDE_LATITUDE",
"name":"GCS_WGS_1984",
"type":"GCS_WGS_1984",
"primeMeridian":{
"longitudeValue":0,
"name":"Greenwich",
"type":"PRIMEMERIDIAN_GREENWICH"
}
}
},
"targetPrj":{
"distanceUnit":"METER",
"projectionParam":{
"centralParallel":0,
"firstPointLongitude":0,
"rectifiedAngle":0,
"scaleFactor":1,
"falseNorthing":0,
"centralMeridian":0,
"secondStandardParallel":0,
"secondPointLongitude":0,
"azimuth":0, "falseEasting":0,
"firstStandardParallel":0
},
"epsgCode":3857,
"coordUnit":"METER",
"name":"User Define",
"projection":{
"name":"SPHERE_MERCATOR",
"type":"PRJ_SPHERE_MERCATOR"},
"type":"PCS_USER_DEFINED",
"coordSystem":{
"datum":{
"name":"D_WGS_1984",
"type":"DATUM_WGS_1984",
"spheroid":{
"flatten":0.00335281066474748,
"name":"WGS_1984",
"axis":6378137,
"type":"SPHEROID_WGS_1984"}},
"unit":"DEGREE",
"spatialRefType":"SPATIALREF_EARTH_LONGITUDE_LATITUDE",
"name":"GCS_WGS_1984",
"type":"GCS_WGS_1984",
"primeMeridian":{
"longitudeValue":0,
"name":"Greenwich",
"type":"PRIMEMERIDIAN_GREENWICH"
}
}
}
}
The returned rjson format representation after implementing the POST request:
{
"newResourceID": "159790bc662f49579a938a5a52ca1415_e9d2badac8bf4be4a562a31e2103f7f4",
"newResourceLocation": "http://localhost:8090/iserver/services/data-World/rest/data/coordtransfer/159790bc662f49579a938a5a52ca1415_e9d2badac8bf4be4a562a31e2103f7f4.rjson",
"postResultType": "CreateChild",
"succeed": true
}
HEAD request
Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information contained in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.
HEAD request can be used to check whether the coordTransfer resource exists, or whether the the client has the permission to access it. It can also determine if the coordTransfer resource supports an output format <format> if performed on a URI with .<format> included.