Street address geocoding – Pitney Bowes MapXtreme User Manual

Page 334

Advertising
background image

Chapter 18: Geocoding

Geocoding a Location

MapXtreme v7.1

341

Developer Guide

street address, intersections, primary and secondary postal codes, place names, and a country
code. The level of information included in the input address will determine the level and accuracy of
the geocode result candidates.

Using the geocoding client, you can perform various levels of geocoding:

Street Address Geocoding

You can use geocoded street address information to display on a map or to perform spatial searches
and queries. For example, this is useful for displaying store locations and the customers who are
part of a store loyalty program on a map to determine market regions. For street address geocoding,
use the Address class to specify the available information for the input address.

How do I Geocode an Address?

The following example shows how to geocode a street address in C# using the geocoding client.
There are three sections to a geocode request: Define the parameters, create the street and
address objects, and create the geocode request.

See also a Geocode sample application provided in
..MapInfo\MapXtreme\7.x.x\Samples\Desktop\Features\Geocode\cs.

Define your Parameters

To populate the address object you must define your address parameters. In addition to the address
parameters, you must also define the server or service URL.

//Define the server URL

String MMJUrl = "";

//Define the address parameters

String streetName = "One Global View";
String cityName = "Troy";
String stateName = "NY";
String zipCode = "12180";
String countryCode = "USA";

//The following are optional address parameters

String directionalPrefix = "";
String typePrefix = "";
String typeSuffix = "";
String directionalSuffix = "";

Create the Address

Populate the address by creating the Street, StreetAddress, and Address objects.

//Create a Street object
MapInfo.Geocoding.Street street =

new MapInfo.Geocoding.Street(
directionalPrefix,
typePrefix,
streetName,
typeSuffix,

Advertising