HTTP/XML : Get Distance, Longitude and Latitude from a Postcode
URL : XMLService/XMLSearchForPostZonData.aspx
This call will retrieve the Longitude/Latitude for a given
Postcode. This can also get the distance from your "home postcode"
in kilometres.
|
Parameter |
Description |
datakey |
Datakey, which is available when account
has been created, under the “DataKey” tab of the online
account administrator page.
When Postcode Lite is used within an
organisation use the data key beginning with "I", and buy
User licenses to access the data.
When supplying the address data to the general public, on a
web site, use the data key beginning with "W" and purchase
Web Credit Packs.
|
username |
When Postcode Lite is used within
an organisation (Web site or Application), this must provide
a unique name of the user workstation.
When supplying the address data to the general public, on a
web site, you do not need to specify this.
|
postcode |
Postcode to search for |
homepostcode |
To calculate the distance to another postcode,
supply the HOME postcode here, this is optional |
|
Failure to use the correct license may result in us with drawing
your service.
Elements Returned
Element |
Description |
pz_postcode |
Postcode in the PostZon record
|
pz_found
|
Found Yes or No. If no all data is
null
|
pz_latitude_wgs84 |
Latitude.
|
pz_longitude_wgs84 |
Longitude
|
pz_geodistancetohomepostcode |
Distance from HOME postcode
in Kilometres
-1 = Error
|
pz_osreference |
OS Reference.
e.g PE132QL ="TF4630009100"
This is our national coordinate system for topographic
mapping. It is used for Ordnance Survey mapping at all
scales, and for many private topographic surveys.
The OSGB36 part of the name refers to the geodetic datum
(system of latitude and longitude) used, and the National
Grid part refers to the map projection and grid referencing
convention for eastings and northings |
|
|
|
|
Example call
http://www.postcodelite.co.uk/xmlservice/XMLSearchForPostZonData.aspx
?datakey=xxxx&postcode=pe132ql&username=admin&homepostcode=SW12IO
Returns XML
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!DOCTYPE data [
<!ELEMENT data (found,credits_display_text,accountadminpage,errormessage,record)>
<!ELEMENT found (#PCDATA)>
<!ELEMENT credits_display_text (#PCDATA)>
<!ELEMENT accountadminpage (#PCDATA)>
<!ELEMENT errormessage (#PCDATA)>
<!ELEMENT record
(pz_latitude_wgs84,pz_longitude_wgs84,pz_osreference,
pz_geodistancetohomepostcode,pz_postcode)>
<!ELEMENT pz_latitude_wgs84 (#PCDATA)>
<!ELEMENT pz_longitude_wgs84
(#PCDATA)>
<!ELEMENT pz_osreference
(#PCDATA)>
<!ELEMENT
pz_geodistancetohomepostcode (#PCDATA)>
<!ELEMENT pz_postcode
(#PCDATA)>]>
<data>
<found>1</found>
<credits_display_text>Evaluation expires 1 Nov 2007</credits_display_text>
<accountadminpage>https://www.postcodelite.co.uk/...</accountadminpage>
<errormessage></errormessage>
<record>
<pz_latitude_wgs84>52.659888</pz_latitude_wgs84>
<pz_longitude_wgs84>0.161667</pz_longitude_wgs84>
<pz_osreference>TF4630009100</pz_osreference>
<pz_geodistancetohomepostcode>0</pz_geodistancetohomepostcode>
<pz_postcode>PE132QL</pz_postcode>
</record>
</data>
|