The Geocoding API
What is Geocoding?
Geocoding is the process by which an address is translated into a geographical coordinate. This service provides a way to does this via an HTTP request. The converse operation is also available, i.e. take a geographical coordinate and translate that into an address.
This service supports Basic Authentication.
Requests to the Geocode service can by made either by Address components, Coordinate or property ID.
By Address Parts
An Address Geocode request supports the following parameters:
street- The street portion of the address, e.g. 110 Pacific Highway.
locality- The locality portion of the address, e.g. Greenwich.
postcode- The postcode portion of the address, e.g. 2065.
region- The region portion of the address, e.g. NSW.
country- The country portion of the address, e.g. Australia.
A Coordinate Geocode request supports the following parameters (in decimal degrees):
latitude- The latitude portion of the coordinate, e.g. -33.825071.
longitude- The longitude portion of the coordinate, e.g. 151.1904.
By Property Id
A Property Id Geocode request supports the following parameters:
Property Id- The property id of the property parcel e.g. GANSU705290690
The format of a Geocode response can be controlled by setting the accepts header. Currently the only supported type is XML.
In this example an address geocode request is made for 110 Pacific Highway, Greenwich 2065 NSW, Australia.
The returned XML is shown below.
<geocode> <copyright>Copyright © 2013 MapData Services and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from MapData Services.</copyright> <status>OK</status> <results> <result> <address> <formattedaddress>110 Pacific Highway, Greenwich 2065 NSW, Australia</formattedaddress> <streetnumber>110</streetnumber> <route>Pacific Highway</route> <locality>Greenwich</locality> <postcode>2065</postcode> <region>NSW</region> <country>Australia</country> </address> <geometry> <location> <lat>-33.825071</lat> <lng>151.1904</lng> </location> <location_type>ROOFTOP</location_type> </geometry> </result> </results> </geocode>
status field within the response describes the type of response.
status field will contain one of the following values:
OKindicates that no errors occured. The address or coordinate was successfully parsed and at least one geocode was returned.
The service response contains an array of
A typical result is made up of the following:
formattedaddress- The formatted address
streetnumber- The building number.
route- The name of the street.
locality- The locality.
postcode- The postcode.
region- The region.
country- The country.