“PostZon” Geographic Data - .Net Assembly API
Simply call GetPostZonAddressRecord (Postcode) as Boolean
This call will retrieve the PostZon Data for a given Postcode, OSRef, Longitude/Latitude or "Town, County". This PostZon data is collected from many different source by the Royal mail. The most useful information is Distance from Home Postcode (in Kilometers), Longitude and Latitude.
This call can be used with Local Data or Internet based data.
To get the PostZon record by OSRef, simply set postcode to the OSRef, when calling GetPostZonData.
To get the PostZon record by Longtitude/Latitude,
(closest within 10Km) set postcode to the "Longtitude|Latitude"
(separated by |).
Postcode Lookup Example:
This code will get PostZon data from our database:
VB.Net |
'Set Data key, to identify your
account SimplyPostCodeLookup.SetDataKey("Your Date Key") With SimplyPostCodeLookup 'Set optional Home Postcode to get straight line distance .SetHomePostCode(Me.txtHomePostcode.Text) If .GetPostZonAddressRecord(Me.txtPostcode.Text) Then Long = .PostZon_Longitude_wgs84 Lat = .PostZon_Latitude_wgs84 Distance = .PostZon_DistanceToHomePostcode GetLongLat=true Else MsgBox(.General_credits_display_text & vbCrLf & .General_errormessage, vbCritical, "SimplyPostcode Lookup") End If Me.Text = "Simply Postcode Lookup : " & .General_credits_display_text End With |
C# .NET |
//Set Data key, to identify
your account string DataKey; DataKey = "Your Date Key"; SimplyPostCodeLookup.SetDataKey(DataKey); //Set optional Home Postcode to get straight line distance string OptionalHomePostCode =txtHomePostcode.Text; SimplyPostCodeLookup.SetHomePostCode(OptionalHomePostCode); string PostCodeToFind = txtPostcode.Text; if (SimplyPostCodeLookup.GetPostZonAddressRecord(PostCodeToFind) == true) { //Return PostZon data Lat = SimplyPostCodeLookup.PostZon_Latitude_wgs84; Long = SimplyPostCodeLookup.PostZon_Longitude_wgs84; Distance = SimplyPostCodeLookup.PostZon_DistanceToHomePostcode; } else { if (SimplyPostCodeLookup.General_errormessage != "") { MessageBox.Show(SimplyPostCodeLookup.General_credits_display_text + " " + SimplyPostCodeLookup.General_errormessage, "Simply Postcode Lookup"); } else { MessageBox.Show("Not found!"); } } this.Text = "Simply Postcode Lookup : " + SimplyPostCodeLookup.General_credits_display_text; |
To get distance between two points
Simply call:
GetDistance(Latitude1, Longtitude1, Latitude2,
Longtitude2) As Double
Data Returned
See data returned by Geographical data
more information about getting distance/Longitude/Latitude using .NET assembly.
Related "Geographic" topics
Features | SOAP API |
HTTP/XML API | JSON API |
NET API. | Data Returned |
Download Example Code | Request a Quote and Brochure |
Open a 30 day evaluation account |