Click or drag to resize

GeocodeAddressToGeocodeResult Method

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Stores the address used to generate a geocode result as a RawAddress. The result is found in FoundAddress.

Namespace:  Telogis.GeoBase
Assembly: (in Version:
public virtual IGeocodeResult ToGeocodeResult()

Return Value

Type: IGeocodeResult
An IGeocodeResult containing the raw address.
// Geocode an address
GeocodeAddress[] address = GeoCoder.GeoCode("20 Enterprise, Aliso Viejo, California", Country.USA);

// Store the result as an IGeocodeResult
IGeocodeResult result = address[0].ToGeocodeResult();

// Print the unformatted structured result, including empty address components
Console.WriteLine("Unformatted result is {0}", result.FoundAddress.ToString());
// 'Unformatted result is 20,Enterprise,,California,Aliso Viejo,USA,0,0,,,33.584444,-117.731874'

// Format for readability
String formatted_geocode_output = AddressFormatter.Default.GetShortLineForm(result.FoundAddress, "US");

// Retrieve the raw data provided for the geocode
String onelineaddress_raw_input = AddressFormatter.Default.GetShortLineForm(result.RawAddress, "US");

// Write the formatted raw and result
Console.WriteLine("Raw in: '{0}'. Result out: '{1}'", onelineaddress_raw_input, formatted_geocode_output);
// 'Raw in: '20 Enterprise, Aliso Viejo, California'. Result out: '20 Enterprise''
See Also