Geocode XML POST リクエストとレスポンス
XML POST リクエスト
以下は、Geocode サービスに対する XML POST リクエストの例です。この例は、中央線オフセット機能を customPreferences で有効にしたりmatchOnAddressNumber および matchOnStreetName フィールドを mustMatchFields オブジェクト内で設定したりする方法を示しています。mustMatchFields 設定を有効にするために、matchMode フィールドは CUSTOM に設定されています。
POST http://myserver:8080/rest/GlobalGeocode/geocode.xml HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<geocodeRequest>
<type>ADDRESS</type>
<preferences>
<returnAllCandidateInfo
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true" />
<fallbackToGeographic
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true" />
<fallbackToPostal
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true" />
<maxReturnedCandidates
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true" />
<distance
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true" />
<streetOffset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true" />
<cornerOffset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true" />
<matchMode>CUSTOM</matchMode>
<mustMatchFields>
<matchOnAddressNumber>true</matchOnAddressNumber>
<matchOnPostCode1>false</matchOnPostCode1>
<matchOnPostCode2>false</matchOnPostCode2>
<matchOnAreaName1>false</matchOnAreaName1>
<matchOnAreaName2>false</matchOnAreaName2>
<matchOnAreaName3>false</matchOnAreaName3>
<matchOnAreaName4>false</matchOnAreaName4>
<matchOnAllStreetFields>false</matchOnAllStreetFields>
<matchOnStreetName>true</matchOnStreetName>
<matchOnStreetType>false</matchOnStreetType>
<matchOnStreetDirectional>false</matchOnStreetDirectional>
<matchOnPlaceName>false</matchOnPlaceName>
<matchOnInputFields>false</matchOnInputFields>
</mustMatchFields>
<customPreferences>
<entry>
<key
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">CENTERLINE_OFFSET_UNIT</key>
<value
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">FEET</value>
</entry>
<entry>
<key
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">CENTERLINE_OFFSET</key>
<value xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">30.0</value>
</entry>
<entry>
<key
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">USE_CENTERLINE_OFFSET</key>
<value
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">true</value>
</entry>
</customPreferences>
</preferences>
<addresses>
<mainAddressLine>
36 Rue de la Haute Moline Champagne-Ardenne 10800
</mainAddressLine>
<country>FRA</country>
</addresses>
</geocodeRequest>
XML POST レスポンス
以下は、先ほどのリクエストによって返される XML レスポンスです。
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeServiceResponseList>
<responses>
<totalPossibleCandidates>1</totalPossibleCandidates>
<totalMatches>1</totalMatches>
<candidates>
<precisionLevel>1</precisionLevel>
<formattedStreetAddress>
36 rue de la Haute Moline
</formattedStreetAddress>
<formattedLocationAddress>
10800 Saint-Julien-les-Villas
</formattedLocationAddress>
<identifier>65277882</identifier>
<precisionCode>S5HPNTS-ZA</precisionCode>
<sourceDictionary>0</sourceDictionary>
<geometry>
<type>Point</type>
<coordinates>4.10284503209829</coordinates>
<coordinates>48.28588205764661</coordinates>
<crs>
<type>name</type>
<properties>
<name>epsg:4326</name>
</properties>
</crs>
</geometry>
<address>
<mainAddressLine>36 rue de la Haute Moline</mainAddressLine>
<addressLastLine>
10800 Saint-Julien-les-Villas
</addressLastLine>
<placeName />
<areaName1>Champagne-Ardenne</areaName1>
<areaName2>Aube</areaName2>
<areaName3>Saint-Julien-les-Villas</areaName3>
<areaName4 />
<postCode1>10800</postCode1>
<postCode2 />
<country>FRA</country>
<addressNumber>36</addressNumber>
<streetName>de la Haute Moline</streetName>
<customFields />
</address>
<ranges>
<lowHouse>34</lowHouse>
<highHouse>38</highHouse>
<side>RIGHT</side>
<oddEvenIndicator>EVEN</oddEvenIndicator>
<customValues />
</ranges>
</candidates>
</responses>
</GeocodeServiceResponseList>