Coordinates transformation service

(fr) Cette page n’est plus maintenue depuis la version 2022 de Geoconcept Web. Pour accéder à la documentation à jour de ce web service, veuillez suivre ce lien.

Basic principles

This web service transforms pairs of coordinates from one projection to another. For example, from Lambert 2 Extended to WGS84.

Availability

This web service is available at all times with Geoconcept Web.

V1

Parameters / properties

Input

parameter description optional default

inSrs

input projection (EPSG code such as epsg:4326 or wgs84)

no

outSrs

output projection (EPSG code such as epsg:4326 or wgs84)

no

point (or points in JSON / JSON-P)

Coordinates for points
in SOAP, you have to fill the coordinates in each of the dedicated <x></x> and <y></y> tags
in REST the points are separated by “,”. The points are characterised by an XY coordinate pair separated by “;”.

no

Output

Transformed points (srsTransformResult)

parameter type min/max description

point (or points in JSON / JSON-P)

geographicPoint (or array in JSON / JSON-P)

0/unlimited

transformed points

Points(geographicPoint)

parameter type min/max description

x

double

1/1

first coordinate or longitude

y

double

1/1

second coordonnée or latitude

SOAP

WSDL

http://<server>/<webapp>/api/ws/srsTransformService?wsdl

Query

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas">
   <soapenv:Header/>
   <soapenv:Body>
      <sch:srsTransform>
         <!--Optional:-->
         <request>
            <!--Optional:-->
            <inSrs>epsg:27572</inSrs>
            <!--Optional:-->
            <outSrs>epsg:4326</outSrs>
            <!--Zero or more repetitions:-->
            <point>
               <x>246087</x>
               <y>2262265</y>
            </point>
             <point>
               <x>255081</x>
               <y>2262679</y>
            </point>
            <point>
               <x>298976</x>
               <y>2254643</y>
            </point>
         </request>
      </sch:srsTransform>
   </soapenv:Body>
</soapenv:Envelope>

Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:srsTransformResponse xmlns:ns2="http://geoconcept.com/gc/schemas">
         <srsTransformResult>
            <status>OK</status>
            <point>
               <x>-2.343140132718342</x>
               <y>47.26525078744117</y>
            </point>
            <point>
               <x>-2.2248034057039128</x>
               <y>47.27372258177934</y>
            </point>
            <point>
               <x>-1.6400114587002539</x>
               <y>47.22297983102492</y>
            </point>
         </srsTransformResult>
      </ns2:srsTransformResponse>
   </soap:Body>
</soap:Envelope>
REST (POST)

Query

Query 

http://<server>/<webapp>/api/lbs/srsTransform.xml

Data (XML) 

<?xml version="1.0" encoding="UTF-8"?>
<srsTransformRequest>
  <inSrs>epsg:27572</inSrs>
  <outSrs>epsg:4326</outSrs>
  <point>
    <x>246087</x>
    <y>2262265</y>
  </point>
  <point>
    <x>255081</x>
    <y>2262679</y>
   </point>
   <point>
    <x>298976</x>
    <y>2254643</y>
    </point>
</srsTransformRequest>

Response

The response is always in UTF-8 format.

XML format 

<srsTransformResult>
   <status>OK</status>
   <point>
      <x>-2.343140132718342</x>
      <y>47.26525078744117</y>
   </point>
   <point>
      <x>-2.2248034057039128</x>
      <y>47.27372258177934</y>
   </point>
   <point>
      <x>-1.6400114587002539</x>
      <y>47.22297983102492</y>
   </point>
</srsTransformResult>

REST (GET)

Query

JSON query 

http://<server>/<webapp>/api/lbs/srsTransform.json?&inSrs=epsg:27572&outSrs=epsg:4326&points=246087,2262265;255081,2262679;298976,2254643

JSON-P query 

http://<server>/<webapp>/api/lbs/srsTransform.json?&inSrs=epsg:27572&outSrs=epsg:4326&points=246087,2262265;255081,2262679;298976,2254643&callback=MyCallBack

XML query 

http://<server>/<webapp>/api/lbs/srsTransform.xml?&inSrs=epsg:27572&outSrs=epsg:4326&points=246087,2262265;255081,2262679;298976,2254643

Response

The response is always in UTF-8 format.

JSON format 

{
   "message": null,
   "status": "OK",
   "points":    [
            {
         "x": -2.343140132718342,
         "y": 47.26525078744117
      },
            {
         "x": -2.2248034057039128,
         "y": 47.27372258177934
      },
            {
         "x": -1.6400114587002539,
         "y": 47.22297983102492
      }
   ]
}

JSON-P format 

myCallback(
    {
       "message": null,
       "status": "OK",
       "points":    [
                {
             "x": -2.343140132718342,
             "y": 47.26525078744117
          },
                {
             "x": -2.2248034057039128,
             "y": 47.27372258177934
          },
                {
             "x": -1.6400114587002539,
             "y": 47.22297983102492
          }
       ]
    }
);

XML format 

<srsTransformResult>
   <status>OK</status>
   <point>
      <x>-2.343140132718342</x>
      <y>47.26525078744117</y>
   </point>
   <point>
      <x>-2.2248034057039128</x>
      <y>47.27372258177934</y>
   </point>
   <point>
      <x>-1.6400114587002539</x>
      <y>47.22297983102492</y>
   </point>
</srsTransformResult>

Possible responses

Case of an itinerary found (routeTransformResult/status is OK) 

<srsTransformResult>
    <status>OK</status>
    <point>
       <x>-2.343140132718342</x>
       <y>47.26525078744117</y>
    </point>
    <point>
       <x>-2.2248034057039128</x>
       <y>47.27372258177934</y>
    </point>
    <point>
       <x>-1.6400114587002539</x>
       <y>47.22297983102492</y>
    </point>
</srsTransformResult>

Case of an empty start projection 

<soap:Fault>
    <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode>
    <faultstring>inSrs can't be null or empty</faultstring>
</soap:Fault>

Case of an empty destination projection 

<soap:Fault>
    <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode>
    <faultstring>outSrs can't be null or empty</faultstring>
</soap:Fault>

Case of an incorrect projection 

<soap:Fault>
    <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode>
    <faultstring>inSrs or outSrs do not exist</faultstring>
</soap:Fault>

Case of a coordinate for an empty point 

<soap:Fault>
    <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode>
    <faultstring>Unmarshalling Error:</faultstring>
</soap:Fault>

Case of a faulty typing entry on the coordinates for a series of points 

<soap:Fault>
    <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode>
    <faultstring>Unmarshalling Error: 488degree
488degree
488degree
488degre</faultstring>
</soap:Fault>