StreetDataToGeocodeResult Method |
Namespace: Telogis.GeoBase
// Create a drill down geocoder to search for a location in the USA DrillDownGeoCoder ddgc = new DrillDownGeoCoder(Country.USA); // Search for a region named 'Aliso Viejo' RegionSearchResult region_search = ddgc.GetRegions(2, "Aliso Viejo"); // Create a Region object using the region search result RegionData region = region_search.Results[0]; // Perform a street search for 'Enterprise' within the found region StreetSearchResult street_search_result = region.GetStreets("Enterprise"); // Convert the first street search result (Enterprise, Aliso Viejo, USA) to an igeocoderesult object IGeocodeResult myResults = street_search_result.Results[0].ToGeocodeResult(); // Check that the geocoded result object isn't empty... if (myResults != null) { Console.WriteLine("Street found is '{0}' in county '{1}'.", myResults.FoundAddress.StreetNames[0], myResults.FoundAddress.County); // Prints out >> Street found is 'Enterprise' in county 'Orange'. } else { Console.WriteLine("No results found!"); }