Overview of the mapinfo.geocoding namespace, Main geocoding classes – Pitney Bowes MapXtreme User Manual

Page 329

Advertising
background image

Chapter 18: Geocoding

Overview of the MapInfo.Geocoding Namespace

MapXtreme v7.1

336

Developer Guide

Overview of the MapInfo.Geocoding Namespace

The MapInfo.Geocoding namespace provides interfaces and classes for geocoding address
records. Geocoding is the process of determining the geographic location of a street address,
intersection, place or postal code in order to pinpoint the location on a map. The geocoding client
sends requests via HTTP to Pitney Bowes Software’s geocoding server or geocoding web service
product. The server and web service are not included in the purchase of MapXtreme.

Perhaps you are building a find the nearest application in which your users provide their geographic
location, in the form of an address, and receive a map that shows where they are in relation to the
closest ATM machine. To perform this task, you need more than an address to display a location on
a map. These geographic locations (addresses, buildings, points of interest) translate to coordinates
on the Earth’s surface. You need the Latitude/Longitude, or coordinate, values to pinpoint and map
the location. The MapXtreme geocoding client gives you these values determined (geocoded) from
a place name, street address, postal code, or from the intersection of two streets.

In addition to returning the coordinate values, the geocoding client can return a complete description
of the place, which is useful when only partial information is known. The geocoding client may return
zero, one, or more responses to a request depending on the request preferences, the method being
employed, the specified preferences, and the match criteria.

The MapXtreme geocoding client also has Gazetteer type functionality (world/country/city
Geocoder), that geocodes a partial address. For example, an address containing only a city, state,
place name, landmark, or airport.

Using the geocoding capabilities, you get those coordinates by matching the input address to one
that already has the coordinates. You supply one or more addresses in a single request document.
Incomplete addresses can be processed as well. The server returns a complete address that you
can use to clean up your input addresses. The server returns zero, one or more responses to a
service request, depending on the quality of the data and the request preferences. Responses
typically include a list of one or more potential matches, called candidates, and result codes that
indicate the positional accuracy of the candidates. Your application will then need to resolve the
response by choosing the appropriate address candidate to retrieve the coordinates.

Main Geocoding Classes

Geocoding is supported using either a MapInfo geocoding server or the Envinsa Location Utility
Service. One of these resources needs to be deployed and made available via a URL. To create the
appropriate geocoding client, use the GeocodeClientFactory class. The interface for both clients is
similar as they both use the same classes for geocode requests, preferences, and responses.

The main interface for using the geocoding client is called MapInfo.Geocoding.IGeocodeClient. This
interface defines a geocoding client object. It has a single method, Geocode, that takes a request as
input and returns a response containing candidate addresses (addresses that are a potential match
for the input address). Other classes include: GeocodeRequest, GeocodeResponse,
GeocodeClientFactory, GeocodingConstraints, AddressCandidates, GeocodeMatchCode, and
CandidateAddress.

Advertising