GeocodeAddressToGeocodeResult Method |
Namespace: Telogis.GeoBase
// 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''