C# Class Azavea.Open.Geocoding.Google.GoogleGeocoder

Geocoder source for Google Geocoder.
Inheritance: GeocoderSource
Datei anzeigen Open project: azavea/net-omgeo

Public Methods

Method Description
GoogleGeocoder ( Config config, string component ) : System

Constructor for the Google geocoder source.

Protected Methods

Method Description
InternalGeocode ( GeocodeRequest geocodeRequest ) : GeocodeResponse

This is where actual source-specific geocoding happens. It is called internal because clients use Geocode which sandwiches this call between pre- and post-processing.

Private Methods

Method Description
ChildNodeText ( XmlNode node, string tagName ) : string
ScoreCandidate ( XmlNode XMLCandidate ) : double

Create a score for the geocoder match.

The v2 Geocoder returned an "accuracy" parameter that used to be retuned as the score. I have roughly mapped the match type to this old numeric scale: 0 Unknown location. 1 Country level accuracy. 2 Region (state, province, prefecture, etc.) level accuracy. 3 Sub-region (county, municipality, etc.) level accuracy. 4 Town (city, village) level accuracy. 5 Post code (zip code) level accuracy. 6 Street level accuracy. 7 Intersection level accuracy. 8 Address level accuracy. 9 Premise (building name, etc) level accuracy I weighted street_address over point_of_interest because this library primarily targeted at geocoding street addresses.

XMLCandidate2GeocodeCandidate ( XmlNode XMLCandidate ) : GeocodeCandidate
XMLList2GeocodeCandidates ( string xmlList ) : IList

Method Details

GoogleGeocoder() public method

Constructor for the Google geocoder source.
public GoogleGeocoder ( Config config, string component ) : System
config Azavea.Open.Common.Config The config to use to construct the Google geocoder.
component string The component in the config in which to look for /// the configuration parameters.
return System

InternalGeocode() protected method

This is where actual source-specific geocoding happens. It is called internal because clients use Geocode which sandwiches this call between pre- and post-processing.
protected InternalGeocode ( GeocodeRequest geocodeRequest ) : GeocodeResponse
geocodeRequest GeocodeRequest The request to be geocoded.
return GeocodeResponse