(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.
The query includes an address or several addresses as input, the service returns for each item, one or several possible responses (if there is any ambiguity), including the address recognised, the position, the geocoding score and the type of geocoding.
This geocoding service interrogates the configured reference table thanks to the Geoconcept Web Administration interface.
Earlier versions of the web service are conserved in Geoconcept Web to ensure compatibility with previous developments. We recommend using the most recent version.
Changes in relation to v2
- Deletion of the "projection" parameter, replaced by "srs".
- Deletion of the "geocodeScore" parameter, replaced by "score"
- Deletion of the "projection", "srs" and "maxResponses" parameters in the "initialAddress" block.
- The "postalCode" parameter has been renamed "postCode".
Input
parameter | description | optional | default |
---|---|---|---|
address (geocodeInitialAddress) |
The addresses to geocode |
no |
|
streetMinScore |
the value of this parameter will vary, like the score, between 0 and 100 (Cf. full description in the geocoding web service) |
yes |
|
srs |
projection (EPSG code such as epsg:4326 or wgs 84) |
yes |
Without projection, the result is in native projection of the geocoding index, usually wgs84. |
maxResponses |
maximum number of address results in the response |
yes |
Addresses (geocodeInitialAddress)
parameter | description | optional | default |
---|---|---|---|
addressLine |
address including the number, repetition index, type of street and street name. |
yes * |
|
city |
town |
yes * |
|
region |
State, County, ..; |
yes |
|
countryCode |
countries on 2 or 3 letters (3166-1 ISO code) for example "fr" or "fra", |
yes |
|
postCode |
post code |
yes * |
(*) At least one of the three parameters postCode, addressLine and city must be filled.
Output
parameter | type | min/max | description |
---|---|---|---|
geocodedAddress (or geocodedAddresses in JSON / JSON-P) |
geocodedAddress (or array in JSON / JSON-P) |
0/unlimited |
Geocoded addresses |
initialAddress |
geocodeInitialAddress |
0/1 |
Initial address |
Geocoded addresses (geocodedAddress)
parameter | type | min/max | description |
---|---|---|---|
addressLine |
string |
0/1 |
street found and, where appropriate, the number |
city |
string |
0/1 |
town found |
region |
string |
0/1 |
State, County, found, varies as a function of country, and could also be empty |
countryCode |
string |
1/1 |
cf. description of the input parameter |
postCode |
string |
0/1 |
post code found |
secondaryZone |
string |
0/1 |
zone that depends on the geocoding index, usually in France this will be the IRIS code |
score |
double |
1/1 |
geocoding score, ranging from 0 to 100, with 100 for a perfect match. |
geocodeType |
int |
1/1 |
type of geocoding: - town = 1 - street = 2 - improved street = 3 - street number = 4 - non-geocoded = 0 |
x |
double |
1/1 |
X coordinates |
y |
double |
1/1 |
Y coordinates |
place (or places in JSON / JSON-P) |
string (or array in JSON / JSON-P) |
0/unlimited |
list of attributes. Value of attributes for the address found, in relation with placeTypes (for example["751010206","930005Y001XCHE"]). Varies as a function of the repository used. |
placeType (or placeTypes in JSON / JSON-P) |
string (or array in JSON / JSON-P) |
0/unlimited |
list of attribute types (for example ["IRIS","FANTOIR"]). Varies as a functiion of the repository used. |
streetNumber |
string |
0/1 |
street number |
streetWayType |
string |
0/1 |
type of street (avenue, street, etc) |
streetWayName |
string |
0/1 |
name of the street |
streetWay |
string |
0/1 |
full name of the street |
Initial address (initialAddress)
parameter | type | min/max | description |
---|---|---|---|
addressLine |
string |
0/1 |
street found and, where appropriate, the number |
city |
string |
0/1 |
town found |
region |
string |
0/1 |
State, County, found, varies as a function of country, and could also be empty |
countryCode |
string |
1/1 |
cf. description of the input parameter |
postCode |
string |
0/1 |
post code found |
WSDL
http://<server>
/<webapp>
/api/ws/geocodeService?wsdl
Query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas"> <soapenv:Header/> <soapenv:Body> <sch:batchGeocodeV2> <!--Optional:--> <addresses> <!--Zero or more repetitions:--> <address> <!--Optional:--> <addressLine>23, rue de la gare</addressLine> <!--Optional:--> <city>Saint-Herblain</city> <!--Optional:--> <region></region> <!--Optional:--> <countryCode>FR</countryCode> <!--Optional:--> <postCode>44800</postCode> </address> <address> <!--Optional:--> <addressLine>32 Route de Pornic</addressLine> <!--Optional:--> <city>Bouguenais</city> <!--Optional:--> <region></region> <!--Optional:--> <countryCode>FR</countryCode> <!--Optional:--> <postCode>44340</postCode> </address> <address> <!--Optional:--> <addressLine>5, Avenue Victor Hugo</addressLine> <!--Optional:--> <city>Sainte-Luce-sur-Loire</city> <!--Optional:--> <region></region> <!--Optional:--> <countryCode>FR</countryCode> <!--Optional:--> <postCode>44980</postCode> </address> <streetMinScore></streetMinScore> <!--Optional:--> <srs></srs> <maxResponses>2</maxResponses> </addresses> </sch:batchGeocodeV2> </soapenv:Body> </soapenv:Envelope>
Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:batchGeocodeV2Response xmlns:ns2="http://geoconcept.com/gc/schemas"> <BatchGeocodeResult> <status>OK</status> <result> <status>OK</status> <geocodedAddress> <addressLine>23 RUE DE LA GARE</addressLine> <city>SAINT-HERBLAIN</city> <countryCode>FR</countryCode> <postCode>44800</postCode> <srs>epsg:4326</srs> <secondaryZone>441620701</secondaryZone> <score>100.0</score> <geocodeType>4</geocodeType> <x>-1.656851</x> <y>47.21028</y> <places> <place>441620701</place> <place>441620701_010</place> <place>4401621080</place> <place>44162</place> </places> <placeTypes> <placeType>IRIS</placeType> <placeType>ILOT</placeType> <placeType>FANTOIR</placeType> <placeType>INSEE</placeType> </placeTypes> <streetNumber>23</streetNumber> <streetWayType>RUE</streetWayType> <streetWayName>DE LA GARE</streetWayName> <streetWay>RUE DE LA GARE</streetWay> </geocodedAddress> <initialAddress> <addressLine>23, rue de la gare</addressLine> <city>Saint-Herblain</city> <region/> <countryCode>FR</countryCode> <postCode>44800</postCode> </initialAddress> </result> <result> <status>OK</status> <geocodedAddress> <addressLine>ROUTE DE PORNIC</addressLine> <city>BOUGUENAIS</city> <countryCode>FR</countryCode> <postCode>44340</postCode> <srs>epsg:4326</srs> <secondaryZone>440200106</secondaryZone> <score>100.0</score> <geocodeType>2</geocodeType> <x>-1.581521</x> <y>47.189556</y> <places> <place>440200106</place> <place>440200106_038</place> <place>4400202800</place> <place>44020</place> </places> <placeTypes> <placeType>IRIS</placeType> <placeType>ILOT</placeType> <placeType>FANTOIR</placeType> <placeType>INSEE</placeType> </placeTypes> <streetNumber/> <streetWayType>ROUTE</streetWayType> <streetWayName>DE PORNIC</streetWayName> <streetWay>ROUTE DE PORNIC</streetWay> </geocodedAddress> <initialAddress> <addressLine>32 Route de Pornic</addressLine> <city>Bouguenais</city> <region/> <countryCode>FR</countryCode> <postCode>44340</postCode> </initialAddress> </result> <result> <status>OK</status> <geocodedAddress> <addressLine/> <city>SAINTE-LUCE-SUR-LOIRE</city> <countryCode>FR</countryCode> <postCode>44980</postCode> <srs>epsg:4326</srs> <secondaryZone>44172</secondaryZone> <score>100.0</score> <geocodeType>1</geocodeType> <x>-1.48669</x> <y>47.24961</y> <places> <place>44172</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber/> <streetWayType/> <streetWayName/> <streetWay/> </geocodedAddress> <initialAddress> <addressLine>5, Avenue Victor Hugo</addressLine> <city>Sainte-Luce-sur-Loire</city> <region/> <countryCode>FR</countryCode> <postCode>44980</postCode> </initialAddress> </result> </BatchGeocodeResult> </ns2:batchGeocodeV2Response> </soap:Body> </soap:Envelope>
Query
Query
http://<server>/<webapp>/api/lbs/geocode/batch/v2.xml
Data (XML)
<?xml version="1.0" encoding="UTF-8"?> <batchGeocodeRequestV2> <address> <addressLine>23, rue de la gare</addressLine> <city>Saint-Herblain</city> <region></region> <countryCode>FR</countryCode> <postCode>44800</postCode> </address> <address> <addressLine>32 Route de Pornic</addressLine> <city>Bouguenais</city> <region></region> <countryCode>FR</countryCode> <postCode>44340</postCode> </address> <address> <addressLine>5, Avenue Victor Hugo</addressLine> <city>Sainte-Luce-sur-Loire</city> <region></region> <countryCode>FR</countryCode> <postCode>44980</postCode> </address> <streetMinScore></streetMinScore> <srs>epsg:4326</srs> <maxResponses>2</maxResponses> </batchGeocodeRequestV2>
Response
The response is always in UTF-8 format.
XML format
<batchGeocodeResultV2> <status>OK</status> <result> <status>OK</status> <geocodedAddress> <addressLine>23 RUE DE LA GARE</addressLine> <city>SAINT-HERBLAIN</city> <countryCode>FR</countryCode> <postCode>44800</postCode> <srs>epsg:4326</srs> <secondaryZone>441620701</secondaryZone> <score>100.0</score> <geocodeType>4</geocodeType> <x>-1.656851</x> <y>47.21028</y> <places> <place>441620701</place> <place>441620701_010</place> <place>4401621080</place> <place>44162</place> </places> <placeTypes> <placeType>IRIS</placeType> <placeType>ILOT</placeType> <placeType>FANTOIR</placeType> <placeType>INSEE</placeType> </placeTypes> <streetNumber>23</streetNumber> <streetWayType>RUE</streetWayType> <streetWayName>DE LA GARE</streetWayName> <streetWay>RUE DE LA GARE</streetWay> </geocodedAddress> <initialAddress> <addressLine>23, rue de la gare</addressLine> <city>Saint-Herblain</city> <region/> <countryCode>FR</countryCode> <postCode>44800</postCode> </initialAddress> </result> <result> <status>OK</status> <geocodedAddress> <addressLine>ROUTE DE PORNIC</addressLine> <city>BOUGUENAIS</city> <countryCode>FR</countryCode> <postCode>44340</postCode> <srs>epsg:4326</srs> <secondaryZone>440200106</secondaryZone> <score>100.0</score> <geocodeType>2</geocodeType> <x>-1.581521</x> <y>47.189556</y> <places> <place>440200106</place> <place>440200106_038</place> <place>4400202800</place> <place>44020</place> </places> <placeTypes> <placeType>IRIS</placeType> <placeType>ILOT</placeType> <placeType>FANTOIR</placeType> <placeType>INSEE</placeType> </placeTypes> <streetNumber/> <streetWayType>ROUTE</streetWayType> <streetWayName>DE PORNIC</streetWayName> <streetWay>ROUTE DE PORNIC</streetWay> </geocodedAddress> <initialAddress> <addressLine>32 Route de Pornic</addressLine> <city>Bouguenais</city> <region/> <countryCode>FR</countryCode> <postCode>44340</postCode> </initialAddress> </result> <result> <status>OK</status> <geocodedAddress> <addressLine/> <city>SAINTE-LUCE-SUR-LOIRE</city> <countryCode>FR</countryCode> <postCode>44980</postCode> <srs>epsg:4326</srs> <secondaryZone>44172</secondaryZone> <score>100.0</score> <geocodeType>1</geocodeType> <x>-1.48669</x> <y>47.24961</y> <places> <place>44172</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber/> <streetWayType/> <streetWayName/> <streetWay/> </geocodedAddress> <initialAddress> <addressLine>5, Avenue Victor Hugo</addressLine> <city>Sainte-Luce-sur-Loire</city> <region/> <countryCode>FR</countryCode> <postCode>44980</postCode> </initialAddress> </result> </batchGeocodeResultV2>
Query
JSON query
http://<server>/<webapp>/api/lbs/geocode/batch/v2.json
JSON
{ "addresses" : [ { "addressLine" : "23, rue de la gare", "city" : "Saint-Herblain", "region" : "", "countryCode" : "FR", "postCode" : "44800" }, { "addressLine" : "32 Route de Pornic", "city" : "Bouguenais", "region" : "", "countryCode" : "FR", "postCode" : "44340" }, { "addressLine" : "5, Avenue Victor Hugo", "city" : "Sainte-Luce-sur-Loire", "region" : "", "countryCode" : "FR", "postCode" : "44980" } ], "streetMinScore" : 80 , "srs" : "epsg:4326", "maxResponses" : 2 }
Response
The response is always in UTF-8 format.
JSON format
{ "message": null, "status": "OK", "results": [ { "message": null, "status": "OK", "geocodedAddresses": [ { "addressLine": "23 RUE DE LA GARE", "city": "SAINT-HERBLAIN", "countryCode": "FR", "postCode": "44800", "srs": "epsg:4326", "secondaryZone": "", "score": 100, "geocodeType": 4, "x": -1.65801, "y": 47.20903, "places": [""], "placeTypes": ["IRIS"], "streetNumber": "23", "streetWayType": "RUE", "streetWayName": "DE LA GARE", "streetWay": "RUE DE LA GARE" }], "initialAddress": { "addressLine": "23, rue de la gare", "city": "Saint-Herblain", "region": "", "countryCode": "FR", "postCode": "44800" } }, { "message": null, "status": "OK", "geocodedAddresses": [ { "addressLine": "32 ROUTE DE PORNIC", "city": "BOUGUENAIS", "countryCode": "FR", "postCode": "44340", "srs": "epsg:4326", "secondaryZone": "", "score": 100, "geocodeType": 3, "x": -1.58862, "y": 47.18768, "places": [""], "placeTypes": ["IRIS"], "streetNumber": "32", "streetWayType": "ROUTE", "streetWayName": "DE PORNIC", "streetWay": "ROUTE DE PORNIC" }], "initialAddress": { "addressLine": "32 Route de Pornic", "city": "Bouguenais", "region": "", "countryCode": "FR", "postCode": "44340" } }, { "message": null, "status": "OK", "geocodedAddresses": [ { "addressLine": "", "city": "SAINTE-LUCE-SUR-LOIRE", "countryCode": "FR", "postCode": "44980", "srs": "epsg:4326", "secondaryZone": "", "score": 100, "geocodeType": 1, "x": -1.48669, "y": 47.24961, "places": [""], "placeTypes": ["IRIS"], "streetNumber": "", "streetWayType": "", "streetWayName": "", "streetWay": "" }], "initialAddress": { "addressLine": "5, Avenue Victor Hugo", "city": "Sainte-Luce-sur-Loire", "region": "", "countryCode": "FR", "postCode": "44980" } } ] }
Case of an address found (batchGeocodeResponse/batchGeocodeResult/status is OK)
<ns2:batchGeocodeV2Response xmlns:ns2="http://geoconcept.com/gc/schemas"> <BatchGeocodeResult> <status>OK</status> <result> <status>OK</status> <geocodedAddress> <addressLine>23 RUE DE LA GARE</addressLine> <city>SAINT-HERBLAIN</city> <countryCode>FR</countryCode> <postCode>44800</postCode> <srs>epsg:4326</srs> <secondaryZone>441620701</secondaryZone> <score>100.0</score> <geocodeType>4</geocodeType> <x>-1.656851</x> <y>47.21028</y> <places> <place>441620701</place> <place>441620701_010</place> <place>4401621080</place> <place>44162</place> </places> <placeTypes> <placeType>IRIS</placeType> <placeType>ILOT</placeType> <placeType>FANTOIR</placeType> <placeType>INSEE</placeType> </placeTypes> <streetNumber>23</streetNumber> <streetWayType>RUE</streetWayType> <streetWayName>DE LA GARE</streetWayName> <streetWay>RUE DE LA GARE</streetWay> </geocodedAddress> <initialAddress> <addressLine>23, rue de la gare</addressLine> <city>Saint-Herblain</city> <region/> <countryCode>FR</countryCode> <postCode>44800</postCode> </initialAddress> </result> <result> [...] </result> </BatchGeocodeResult> </ns2:batchGeocodeV2Response>
Case of an address that is not found (batchGeocodeResponse/BatchGeocodeResult/status is OK and no geocodedAddress)
<BatchGeocodeResult> <status>OK</status> <result> <status>OK</status> <initialAddress> <addressLine/> <city>#hdkvnjsdvn</city> <region/> <countryCode/> <postCode/> </initialAddress> </result> </BatchGeocodeResult>
Case of a query with an XML error or that does not respect the WSDL ⇒ error with faultstring that contains the description
<soap:Fault> <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode> <faultstring>Message part {http://geoconcept.com/gc/schemas}batchGeocodeV2fff was not recognized. (Does it exist in service WSDL?)</faultstring> </soap:Fault>
Case of a query with a non-existent reprojection system ⇒ error with faultstring that contains the description
<soap:Fault> <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode> <faultstring>Geocode failed Failed to process geocoding task Unsupported coordinate system 'epsg:432666666'</faultstring> </soap:Fault>
Input
parameter | description | optional | default |
---|---|---|---|
address (geocodeInitialAddress) |
The addresses to geocode |
no |
|
streetMinScore |
the value of this parameter will vary, like the score, between 0 and 100 (Cf. full description in the geocoding web service) |
yes |
|
srs |
projection (EPSG code such as epsg:4326 or wgs 84) |
yes |
Without projection, the result is in native projection of the geocoding index, usually wgs84. |
maxResponses |
maximum number of address results in the response |
yes |
Addresses (geocodeInitialAddress)
parameter | description | optional | default |
---|---|---|---|
addressLine |
address including the number, repetition index, type of street and street name. |
yes * |
|
city |
town |
yes * |
|
region |
State, County, ..; |
yes |
|
countryCode |
country in two letters (ISO code 3166-1 or ccTLD) for eample "fr", |
yes |
|
postalCode |
post code |
yes * |
|
projection |
deprecated |
yes |
|
srs |
deprecated |
yes |
|
maxResponses |
deprecated |
yes |
(*) At least one of the three parameters postalCode, addressLine and city must be assigned values.
Output
parameter | type | min/max | description |
---|---|---|---|
geocodedAddress (or geocodedAddresses in JSON / JSON-P) |
geocodedAddress (or array in JSON / JSON-P) |
0/unlimited |
Geocoded addresses |
initialAddress |
geocodeInitialAddress |
0/1 |
Initial address |
Geocoded addresses (geocodedAddress)
parameter | type | min/max | description |
---|---|---|---|
secondaryZone |
string |
0/1 |
zone that depends on the geocoding index, usually in France this will be the IRIS code |
score |
double |
1/1 |
geocoding score, ranging from 0 to 100, with 100 for a perfect match. |
geocodeType |
int |
1/1 |
type of geocoding: - town = 1 - street = 2 - improved street = 3 - street number = 4 - non-geocoded = 0 |
x |
double |
1/1 |
X coordinates |
y |
double |
1/1 |
Y coordinates |
place (or places in JSON / JSON-P) |
string (or array in JSON / JSON-P) |
0/unlimited |
list of attributes. The value of attributes for the address found, in relation to placeTypes (for example, ["751010206","930005Y001XCHE"]). Depends on the repository used. |
placeType (or placeTypes in JSON / JSON-P) |
string (or array in JSON / JSON-P) |
0/unlimited |
list of types of attributes (for example ["IRIS","FANTOIR"]). Depends on the reference table used. |
streetNumber |
string |
0/1 |
street number |
streetWayType |
string |
0/1 |
type of street (avenue, street, etc) |
streetWayName |
string |
0/1 |
name of the street |
streetWay |
string |
0/1 |
full name of the street |
Initial address (initialAddress)
parameter | type | min/max | description |
---|---|---|---|
addressLine |
string |
0/1 |
street found and, where appropriate, the number |
city |
string |
0/1 |
town found |
region |
string |
0/1 |
State, County, found, varies as a function of country, and could also be empty |
countryCode |
string |
1/1 |
cf. description of the input parameter |
postalCode |
string |
0/1 |
post code found |
WSDL
http://<server>
/<webapp>
/api/ws/geocodeService?wsdl
Query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas"> <soapenv:Header/> <soapenv:Body> <sch:batchGeocode> <!--Optional:--> <addresses> <!--Zero or more repetitions:--> <address> <!--Optional:--> <addressLine>23, rue de la gare</addressLine> <!--Optional:--> <city>Saint-Herblain</city> <!--Optional:--> <region></region> <!--Optional:--> <countryCode>FR</countryCode> <!--Optional:--> <postalCode>44800</postalCode> <!--Optional:--> <projection></projection> <!--Optional:--> <srs>epsg:4326</srs> <!--Optional:--> <maxResponses></maxResponses> </address> <address> <!--Optional:--> <addressLine>32 Route de Pornic</addressLine> <!--Optional:--> <city>Bouguenais</city> <!--Optional:--> <region></region> <!--Optional:--> <countryCode>FR</countryCode> <!--Optional:--> <postalCode>44340</postalCode> <!--Optional:--> <projection></projection> <!--Optional:--> <srs>epsg:4326</srs> <!--Optional:--> <maxResponses></maxResponses> </address> <address> <!--Optional:--> <addressLine>5, Avenue Victor Hugo</addressLine> <!--Optional:--> <city>Sainte-Luce-sur-Loire</city> <!--Optional:--> <region></region> <!--Optional:--> <countryCode>FR</countryCode> <!--Optional:--> <postalCode>44980</postalCode> <!--Optional:--> <projection></projection> <!--Optional:--> <srs>epsg:4326</srs> <!--Optional:--> <maxResponses></maxResponses> </address> <streetMinScore></streetMinScore> <!--Optional:--> <srs>epsg:4326</srs> <maxResponses>2</maxResponses> </addresses> </sch:batchGeocode> </soapenv:Body> </soapenv:Envelope>
Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:batchGeocodeResponse xmlns:ns2="http://geoconcept.com/gc/schemas"> <BatchGeocodeResult> <status>OK</status> <result> <status>OK</status> <geocodedAddress> <addressLine>23 RUE DE LA GARE</addressLine> <city>SAINT-HERBLAIN</city> <countryCode>FR</countryCode> <postalCode>44800</postalCode> <projection>epsg:4326</projection> <srs>epsg:4326</srs> <secondaryZone>441620701</secondaryZone> <geocodeScore>20.0</geocodeScore> <score>100.0</score> <geocodeType>4</geocodeType> <x>-1.6568714</x> <y>47.2102641</y> <places> <place>441620701</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber>23</streetNumber> <streetWayType>RUE</streetWayType> <streetWayName>DE LA GARE</streetWayName> <streetWay>RUE DE LA GARE</streetWay> </geocodedAddress> <initialAddress> <addressLine>23, rue de la gare</addressLine> <city>Saint-Herblain</city> <region/> <countryCode>FR</countryCode> <postalCode>44800</postalCode> <projection/> <srs>epsg:4326</srs> <maxResponses/> </initialAddress> </result> <result> <status>OK</status> <geocodedAddress> <addressLine>ROUTE DE PORNIC</addressLine> <city>BOUGUENAIS</city> <countryCode>FR</countryCode> <postalCode>44340</postalCode> <projection>epsg:4326</projection> <srs>epsg:4326</srs> <secondaryZone>440200106</secondaryZone> <geocodeScore>20.0</geocodeScore> <score>100.0</score> <geocodeType>2</geocodeType> <x>-1.5799805</x> <y>47.1901969</y> <places> <place>440200106</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber/> <streetWayType>ROUTE</streetWayType> <streetWayName>DE PORNIC</streetWayName> <streetWay>ROUTE DE PORNIC</streetWay> </geocodedAddress> <initialAddress> <addressLine>32 Route de Pornic</addressLine> <city>Bouguenais</city> <region/> <countryCode>FR</countryCode> <postalCode>44340</postalCode> <projection/> <srs>epsg:4326</srs> <maxResponses/> </initialAddress> </result> <result> <status>OK</status> <geocodedAddress> <addressLine/> <city>SAINTE-LUCE-SUR-LOIRE</city> <countryCode>FR</countryCode> <postalCode>44980</postalCode> <projection>epsg:4326</projection> <srs>epsg:4326</srs> <secondaryZone>441720105</secondaryZone> <geocodeScore>20.0</geocodeScore> <score>100.0</score> <geocodeType>1</geocodeType> <x>-1.4787216</x> <y>47.2565577</y> <places> <place>441720105</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber/> <streetWayType/> <streetWayName/> <streetWay/> </geocodedAddress> <initialAddress> <addressLine>5, Avenue Victor Hugo</addressLine> <city>Sainte-Luce-sur-Loire</city> <region/> <countryCode>FR</countryCode> <postalCode>44980</postalCode> <projection/> <srs>epsg:4326</srs> <maxResponses/> </initialAddress> </result> </BatchGeocodeResult> </ns2:batchGeocodeResponse> </soap:Body> </soap:Envelope>
Query
Query
http://<server>/<webapp>/api/lbs/geocode/batch/v1.xml
Data (XML)
<?xml version="1.0" encoding="UTF-8"?> <batchGeocodeRequest> <address> <addressLine>23, rue de la gare</addressLine> <city>Saint-Herblain</city> <region></region> <countryCode>FR</countryCode> <postalCode>44800</postalCode> <projection></projection> </address> <address> <addressLine>32 Route de Pornic</addressLine> <city>Bouguenais</city> <region></region> <countryCode>FR</countryCode> <postalCode>44340</postalCode> <projection></projection> </address> <address> <addressLine>5, Avenue Victor Hugo</addressLine> <city>Sainte-Luce-sur-Loire</city> <region></region> <countryCode>FR</countryCode> <postalCode>44980</postalCode> <projection></projection> </address> <streetMinScore></streetMinScore> <srs>epsg:4326</srs> <maxResponses>2</maxResponses> </batchGeocodeRequest>
Response
The response is always in UTF-8 format.
XML format
<batchGeocodeResult> <status>OK</status> <result> <status>OK</status> <geocodedAddress> <addressLine>23 RUE DE LA GARE</addressLine> <city>SAINT-HERBLAIN</city> <countryCode>FR</countryCode> <postalCode>44800</postalCode> <projection>epsg:4326</projection> <srs>epsg:4326</srs> <secondaryZone>441620701</secondaryZone> <geocodeScore>20.0</geocodeScore> <score>100.0</score> <geocodeType>4</geocodeType> <x>-1.6568714</x> <y>47.2102641</y> <places> <place>441620701</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber>23</streetNumber> <streetWayType>RUE</streetWayType> <streetWayName>DE LA GARE</streetWayName> <streetWay>RUE DE LA GARE</streetWay> </geocodedAddress> <initialAddress> <addressLine>23, rue de la gare</addressLine> <city>Saint-Herblain</city> <region/> <countryCode>FR</countryCode> <postalCode>44800</postalCode> <projection/> </initialAddress> </result> <result> <status>OK</status> <geocodedAddress> <addressLine>ROUTE DE PORNIC</addressLine> <city>BOUGUENAIS</city> <countryCode>FR</countryCode> <postalCode>44340</postalCode> <projection>epsg:4326</projection> <srs>epsg:4326</srs> <secondaryZone>440200106</secondaryZone> <geocodeScore>20.0</geocodeScore> <score>100.0</score> <geocodeType>2</geocodeType> <x>-1.5799805</x> <y>47.1901969</y> <places> <place>440200106</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber/> <streetWayType>ROUTE</streetWayType> <streetWayName>DE PORNIC</streetWayName> <streetWay>ROUTE DE PORNIC</streetWay> </geocodedAddress> <initialAddress> <addressLine>32 Route de Pornic</addressLine> <city>Bouguenais</city> <region/> <countryCode>FR</countryCode> <postalCode>44340</postalCode> <projection/> </initialAddress> </result> <result> <status>OK</status> <geocodedAddress> <addressLine/> <city>SAINTE-LUCE-SUR-LOIRE</city> <countryCode>FR</countryCode> <postalCode>44980</postalCode> <projection>epsg:4326</projection> <srs>epsg:4326</srs> <secondaryZone>441720105</secondaryZone> <geocodeScore>20.0</geocodeScore> <score>100.0</score> <geocodeType>1</geocodeType> <x>-1.4787216</x> <y>47.2565577</y> <places> <place>441720105</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber/> <streetWayType/> <streetWayName/> <streetWay/> </geocodedAddress> <initialAddress> <addressLine>5, Avenue Victor Hugo</addressLine> <city>Sainte-Luce-sur-Loire</city> <region/> <countryCode>FR</countryCode> <postalCode>44980</postalCode> <projection/> </initialAddress> </result> </batchGeocodeResult>
Case of an address found (batchGeocodeResponse/batchGeocodeResult/status is OK)
<ns2:batchGeocodeResponse xmlns:ns2="http://geoconcept.com/gc/schemas"> <BatchGeocodeResult> <status>OK</status> <result> <status>OK</status> <geocodedAddress> <addressLine>23 RUE DE LA GARE</addressLine> <city>SAINT-HERBLAIN</city> <countryCode>FR</countryCode> <postalCode>44800</postalCode> <projection>epsg:4326</projection> <srs>epsg:4326</srs> <secondaryZone>441620701</secondaryZone> <geocodeScore>20.0</geocodeScore> <score>100.0</score> <geocodeType>4</geocodeType> <x>-1.6568714</x> <y>47.2102641</y> <places> <place>441620701</place> </places> <placeTypes> <placeType>IRIS</placeType> </placeTypes> <streetNumber>23</streetNumber> <streetWayType>RUE</streetWayType> <streetWayName>DE LA GARE</streetWayName> <streetWay>RUE DE LA GARE</streetWay> </geocodedAddress> <initialAddress> <addressLine>23, rue de la gare</addressLine> <city>Saint-Herblain</city> <region/> <countryCode>FR</countryCode> <postalCode>44800</postalCode> <projection/> <srs>epsg:4326</srs> <maxResponses/> </initialAddress> </result> <result> ... </result> </BatchGeocodeResult> </ns2:batchGeocodeResponse>
Case of an address that is not found (batchGeocodeResponse/BatchGeocodeResult/status is OK and no geocodedAddress)
<ns2:batchGeocodeResponse xmlns:ns2="http://geoconcept.com/gc/schemas"> <BatchGeocodeResult> <status>OK</status> <initialAddress> <city>#hdkvnjsdvn</city> </initialAddress> </BatchGeocodeResult> </ns2:batchGeocodeResponse>
Case of a query with an XML error or that does not respect the WSDL ⇒ error with faultstring that contains the description
<soap:Fault> <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode> <faultstring>Message part {http://geoconcept.com/gc/schemas}geocodeABCD was not recognized. (Does it exist in service WSDL?)</faultstring> </soap:Fault>
Case of a query with a non-existent reprojection system ⇒ error with faultstring that contains the description
<soap:Fault> <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode> <faultstring>Geocode failed Failed to process geocoding task Unsupported coordinate system 'epsg:432666666'</faultstring> </soap:Fault>
See Geocoding Web service.
1. |
How can one geocode via the cURL command? |
You will need to call an address file, here in json format, with the following command line: |
curl -X POST "https://<server>/<webapp>/api/lbs/geocode/batch/v2.json" -H "Content-Type: application/json" --data-binary @"adresses.json"
Fichier : adresses.json
{ "addresses":[ { "addressLine":"200 Quai Charles de Gaulle", "city":"Lyon", "region":"", "countryCode":"FR", "postCode":"69006" }, { "addressLine":"Bruno Kreisky Platz 1", "city":"Wien", "region":"", "countryCode":"AT", "postCode":"1220" }, { "addressLine":"Route des Morillons 15", "city":"Genève", "region":"", "countryCode":"CH", "postCode":"1202" } ], "streetMinScore":80, "srs":"epsg:4326", "maxResponses":2 }