Address Class |
See also GeocodeAddress for the address type returned from forward geocoding.
Namespace: Telogis.GeoBase
The Address type exposes the following members.
Name | Description | |
---|---|---|
City |
The name of the city. This value may be null if relevant city data is unavailable.
| |
Country |
The Country in which this Address is located.
| |
County |
The name of the county. This value may be null if relevant county data
is unavailable or not applicable at this location.
| |
ExtendedNameInfo |
Array of street name information for the street (some streets may have more than one name).
| |
FormattedAddress |
Returns a long line formatted string representing a structured address returned from a geocoding operation.
| |
Line1 | Obsolete. Returns a formatted string representing the first line of a
street address.
| |
Names |
Array of street names for the street (some streets may have more than one name).
| |
Number |
Number on street, -1 if no number.
| |
PostalCode |
The postal (ZIP) code associated with this address.
| |
PrimaryName |
The primary name for the street.
| |
Region |
Name of the largest administrative region (for example: State name in the USA,
Bundesländer name in Germany, or the Province name in Britain). Region may be
null if no data is available.
| |
Regions |
Contains the list of regions for this address, with the
most specific region (eg suburb or city) first.
| |
StreetNumberFull |
The street number of the address e.g. 20, 5b or 10-12.
| |
SubRegions |
Suburb and regions where this address is located that subdivide the city.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToGeocodeResult |
Returns the raw address used for a geocoding operation as a GeocodeResult.
| |
ToString |
Returns a formatted string containing address information, such as may be printed
on an envelope.
(Overrides ObjectToString.) |
Related articles: Geocoding Concept, Searching for a Location, Creating a Simple Web Application, Drill-down Geocoder Tutorial, Creating the Basic Project, Using a Navigator.
public string getFormattedAddress(LatLon location) { // Use the location LatLon to lookup the Address. Address addr = Telogis.GeoBase.GeoCoder.ReverseGeoCode(location); string formattedAddress; // "Found 455 Blenheim Rd [Sh 73a], Christchurch, Christchurch City, Canterbury, 8042" formattedAddress += "Found " + addr.FormattedAddress; // Add the first alternative name (if present) in parentheses // NOTE: Alternate names aren't ranked if (addr.Names.Length > 1) { formattedAddress += (" (" + addr.Names[1] + ")"); } // Add the country, if not the USA if (addr.Country != Country.USA) { formattedAddress += (" in " + CountryToString.ToString(addr.Country)); } // "Found 455 Blenheim Rd [Sh 73a], Christchurch, Christchurch City, Canterbury, 8042 (Blenheim Rd [Sh 73a]) in New Zealand" // or, if Blenheim Road was in the US, simply: "Found 455 Blenheim Rd [Sh 73a], Christchurch, Christchurch City, Canterbury, 8042 (Blenheim Rd [Sh 73a])" return formattedAddress; }