Postcode Lite Software providing Royal mail PAF data

Programmers SDK : Get Distance, Longitude and Latitude from a Postcode

This call will retrieve the Longitude/Latitude for a given Postcode.   This can also get the distance from your "home postcode" in kilometres.

Function : GetPostZonAddress(Postcode as string, DataKey as string, Location as string,  HomePostcode as string, Parms as string) as string

Parameter Description
Postcode Postcode you are trying to find
DataKey For Internet based data, use your data key, assigned when you opened an account.

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.


Location For Local Data, specify the location of the data files.
For example "C:\MyApp".  The correct license is assigned as part of the unlock process when using local data.
Homepostcode To calculate the distance to another postcode, supply the HOME postcode here, this is optional (in which case "")
Parms This is for future expansion

Returns:

This function returns true if search returned valid data, else .General_errormessage will contain the error, and .General_credits_display_text if problem with license.

This PostCodeLite Object contains the following properties:

Property Description
General_errormessage Error Message if error
General_credits_display_text Number of Credits/Users available
PostZon_OSreference OS Referance
PostZon_DistanceToHomePostcode Distance from between Postcode and Home Postcode in kilometers.
PostZon_Longitude_wgs84 Longitude
PostZon_Latitude_wgs84 Latitude
Address_Postcode Postcode Found

Example code : Visual Basic :

Dim PostCodeLite As Object, ReturnedData as string

 

Set PostCodeLite = CreateObject("IPostCodeLite.PostCode")

 

if PostCodeLite.GetPostZonAddress("PE132QL","I_HDI7...HU7ID","","AB10 1AW","")  then    

    Dim DataToShow$
    DataToShow = "Data Returned : " & vbCrLf
    DataToShow = DataToShow & " Status : " & .General_credits_display_text & vbCrLf
    DataToShow = DataToShow & " accountadminpage : " & .General_accountadminpage & vbCrLf
    DataToShow = DataToShow & "" & vbCrLf

    DataToShow = DataToShow & " postcode : " & .Address_Postcode & vbCrLf
    DataToShow = DataToShow & " Long : " & .PostZon_Longitude_wgs84 & vbCrLf
    DataToShow = DataToShow & " Lat : " & .PostZon_Latitude_wgs84 & vbCrLf
    DataToShow = DataToShow & " Distance : " & .PostZon_DistanceToHomePostcode & "km"
    msgbox DataToShow

else

  'Process and display error message 

end if

Set PostCodeLite = Nothing

 

 

 

     
Postcode Lite is brought to you by ComTek Accounts Ltd