33
v.3.0 USA Layer User’s Guide

v.3.0 USA Layer User’s Guide - Pitney Bowesreference1.mapinfo.com/.../geo_cartridge30_us_userguide.pdfNote: When running this file in SQL*Plus, ensure your working directory is the

Embed Size (px)

Citation preview

v.3.0USA LayerUser’s Guide

Information in this document is subject to change without notice and does not represent a commitment on the part of the vendor or its representatives. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, without the written permission of MapInfo Corporation, One Global View, Troy, New York 12180-8399.© 2002 MapInfo Corporation. All rights reserved. MapInfo, the MapInfo logo and MapMarker are trademarks of MapInfo Corporation and/or its affiliates. MapInfo Corporate Headquarters:Voice: (518) 285-6000Fax: (518) 285-6060Sales Info Hotline: (800) 327-8627Government Sales Hotline: (800) 619-2333Technical Support Hotline: (518) 285-7283Technical Support Fax: (518) 285-6080Contact information for North American offices is located at: http://www.mapinfo.com/company/contact_corporate.cfm.Contact information for European and Middle East offices is located at: http://www.mapinfo.com/company/contact_europe.cfm.Contact information for Asia Pacific offices is located at: http://www.mapinfo.com/company/contact_asiapacific.cfm.Adobe Acrobat® is a registered trademark of Adobe Systems Incorporated in the United States.Products named herein may be trademarks of their respective manufacturers and are hereby recognized. Trademarked names are used editorially, to the benefit of the trademark owner, with no intent to infringe on the trademark.February 2003

Table of Contents

Chapter 1: MapInfo Geocoding Cartridge USA Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Installing MapInfo Geocoding Cartridge USA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Uninstalling the MapInfo Geocoding Cartridge USA Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Chapter 2: USA Layer Packages and Object Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12USA Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Introduction to the USA Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13The GEOADDRESS2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14The CANDIDATE2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16The ADDRESSRANGE2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18The ADDRESSRANGEUNIT2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20The MM_PREFERENCE2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21The INPUTTABLEINFO2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23The OUTPUTTABLEINFO2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Appendix A: MapInfo Geocoding Cartridge USA Layer Examples . . . . . . . . . . . . . . . . 28single_fields.sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29table_fields.sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29table_geoaddr.sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30trigger_fields.trg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Appendix B: Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Glossary of Address and Geocoding Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

MapInfo Geocoding Cartridge USA Layer

In this chapter:

Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Installing MapInfo Geocoding Cartridge USA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Uninstalling the MapInfo Geocoding Cartridge USA Layer . . . . . . . . . . . . . . . . . . . . . . . 11

1

User’s Guide Chapter 1: MapInfo Geocoding Cartridge USA Layer

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 5 GeocodingCartridge.pdf

Overview

The MapInfo Geocoding Cartridge USA layer is available to extend the functionality of the MapInfo Geocoding Cartridge to all traditional USA street geocoding. Preferences such as expanded radius search and get multi-unit flag are available. The new USA layer returns all fields generated by the new MapMarker J Server 3.0.

Installing MapInfo Geocoding Cartridge USA

The installation of MapInfo Geocoding Cartridge is a two step process. First run the installer on the product CD to lay down the MapInfo Geocoding Cartridge files (see Running the Installer below). Once the installation from the CD is complete, you must run the system.sql and misys.sql files to actually install the MapInfo Geocoding Cartridge (see Installing the Files on page 10).

Note: MapInfo Geocoding Cartridge 3.0 must be completely installed prior to installing MapInfo Geocoding Cartridge USA.

Running the InstallerTo install MapInfo Geocoding Cartridge USA:

1. Place the MapInfo Geocoding Cartridge software CD in your CD-ROM drive.2. Run install.htm from the MapInfo Geocoding Cartridge CD. Select the installation package

for your platform. The installation is copied to a temporary location on your system. Alternatively, you can bypass the browser. Go to the appropriate OS folder on the product CD under /InstData and run the install executable.

The Introduction dialog displays.

3. On the Introduction dialog, click NEXT to proceed.

User’s Guide Chapter 1: MapInfo Geocoding Cartridge USA Layer

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 6 GeocodingCartridge.pdf

The Important Information dialog displays.

4. Read the release information and then click NEXT.The License Agreement dialog displays.

5. Accept the agreement and then click NEXT to proceed.

User’s Guide Chapter 1: MapInfo Geocoding Cartridge USA Layer

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 7 GeocodingCartridge.pdf

The Choose Install Folder dialog displays.

6. At the Choose Install Folder dialog, accept the default location to install MapInfo Geocoding Cartridge USA or browse to another location. Click NEXT.

The Choose type of Installation dialog displays.

7. Select whether you are installing on an ORACLE CLIENT machine or an ORACLE SERVER and then click NEXT.Perform a Client installation if you are installing on a machine that will connect to an Oracle server elsewhere on your network. Perform a Server installation if you are installing on the Oracle server machine.

If you select ORACLE SERVER, continue with step 9.

User’s Guide Chapter 1: MapInfo Geocoding Cartridge USA Layer

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 8 GeocodingCartridge.pdf

The DataBase Alias Name dialog displays.

8. Specify the database alias to which your Oracle Client connects in the DATABASE ALIAS field and then click NEXT.The MISYS Account Information dialog displays.

9. Type your MISYS password into the corresponding field and then click NEXT.

User’s Guide Chapter 1: MapInfo Geocoding Cartridge USA Layer

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 9 GeocodingCartridge.pdf

The Choose Shortcut Folder dialog displays.

10. At the Choose Shortcut Folder dialog, accept the default location in which to install a documentation shortcut, browse to another location, or choose one of the other available options. Click NEXT.The Pre-Installation Summary dialog displays.

11. Review the information in the Pre-Installation Summary dialog, making sure all settings are correct. If you need to make any corrections, click PREVIOUS to navigate back through the installation wizard and make the necessary changes on the appropriate dialogs. If all settings are correct, click INSTALL to start the product installation. The Installing MapInfo(TM)GeocodingCartridge3.0-USA dialog displays.

If you decide you do not want to install MapInfo Geocoding Cartridge USA, click CANCEL.

User’s Guide Chapter 1: MapInfo Geocoding Cartridge USA Layer

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 10 GeocodingCartridge.pdf

Once the installation process is finished, the View Read Me File dialog displays.

12. Select YES and click NEXT to view the readme file. The readme displays within the installer. Click NEXT.The Install Complete dialog displays.

13. At the Install Complete dialog, click DONE to exit the software installer.

Installing the FilesAfter you run the MapInfo Geocoding Cartridge 3.0 installer, you must run the misys.sql file as MISYS to finish the product installation.

Note: When running this file in SQL*Plus, ensure your working directory is the same directory where the .sql file is located.

User’s Guide Chapter 1: MapInfo Geocoding Cartridge USA Layer

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 11 GeocodingCartridge.pdf

Uninstalling the MapInfo Geocoding Cartridge USA Layer

To remove the MapInfo Geocoding Cartridge USA objects from the database:

1. Open an SQL*Plus session and connect as the MISYS user.2. Navigate to the USA\install\sql directory under the product installation directory.3. Execute the drop_cart_objs.sql script.4. Log out of the SQL*Plus session.

To remove the files installed on your machine, launch the uninstall program located in the USA\UninstallerData folder of your product installation directory:

Uninstall MapInfo(TM)GeocodingCartridge3.0-USA.exe

USA Layer Packages and Object Types

In this chapter:

USA Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Introduction to the USA Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13The GEOADDRESS2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14The CANDIDATE2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16The ADDRESSRANGE2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18The ADDRESSRANGEUNIT2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20The MM_PREFERENCE2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21The INPUTTABLEINFO2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23The OUTPUTTABLEINFO2 Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 13 GeocodingCartridge.pdf

USA Packages

Two packages ship with the MapInfo Geocoding Cartridge USA layer: MM_USA (mm_usa.sql) and USA_UTIL (usautil.sql). These packages, found in the USA\install\sql folder of your product installation directory, provide the MapInfo Geocoding Cartridge with easier access to the USA objects and provide methods for testing USA addresses.

MM_USA PackageThis package allows easier access to USA specific fields in the MISYS.GEOADDRESS2, MISYS.CANDIDATE2, MISYS.ADDRESSRANGE2 and MISYS.ADDRESSRANGEUNIT2 objects of the cartridge. There are also methods for helping create MISYS.MM_PREFERENCE2 objects with USA specific fields.

USA_UTIL PackageThis package contains some useful methods for testing USA addresses, validating the candidates within the GEOADDRESS2 object.

Introduction to the USA Objects

The objects used by the MapInfo Geocoding Cartridge USA layer are the same objects as in the core MapInfo Geocoding Cartridge product. However, the types of data used by the objects is specific to the United States and its territories. For example, the core product provides generic fields that will accept any 256 character string, but the USA implementation of MapInfo Geocoding Cartridge uses these fields to store very specific types of data, such as census block, carrier route, and delivery point information. The tables presented below are the same tables found in the core documentation, but are updated to reflect the USA-specific treatment of the fields.

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 14 GeocodingCartridge.pdf

The GEOADDRESS2 Object

The GEOADDRESS2 object type defines the attributes and functions required to geocode single addresses. It is also used for table geocoding where you wish to look at address range information or store results for more than one candidate. The address information to be geocoded is placed in the appropriate fields of the GEOADDRESS2 object, and the findLocation function geocodes the address and populates the CANDIDATESET2 with the returned candidates.

The parts of the GEOADDRESS2 object are described below.

Field Type Description

country VARCHAR2(3) Input: the ISO standard abbreviation for the country of the input address

genericField1 VARCHAR2(256) Input: street2; secondary address information such as a Post Office box or apartment number

genericField2 VARCHAR2(256) not used for USA geocoding

genericField3 VARCHAR2(256) Input: PMB designator

genericField4 VARCHAR2(256) Input: PMB range

genericField5 VARCHAR2(256) not used for USA geocoding

genericField6 VARCHAR2(256) not used for USA geocoding

genericField7 VARCHAR2(256) not used for USA geocoding

genericField8 VARCHAR2(256) not used for USA geocoding

genericField9 VARCHAR2(256) not used for USA geocoding

genericField10 VARCHAR2(256) not used for USA geocoding

genericField11 VARCHAR2(256) not used for USA geocoding

genericField12 VARCHAR2(256) not used for USA geocoding

placeName VARCHAR2(256) Input: placename, usually a business name or well known landmark

preAddress VARCHAR2(256) not used for USA geocoding

addressNumber VARCHAR2(256) Input: address numberThis may be blank and the address number included in the mainAddress.

preDirectional VARCHAR2(256) Input: pre direction of a parsed input street

preThoroughfareType VARCHAR2(256) Input: pre type of a parsed input street

mainAddress VARCHAR2(256) Input: street address

postThouroughfareType VARCHAR2(256) Input: post type of a parsed input street

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 15 GeocodingCartridge.pdf

postDirectional VARCHAR2(256) Input: post directional of a parsed input street

postAddress VARCHAR2(256) Input: the lastline; the postal code and any areanames in unparsed format

postCode1 VARCHAR2(256) Input: zip code

postCode2 VARCHAR2(256) Input: zip+4

areaName1 VARCHAR2(256) Input: state

areaName2 VARCHAR2(256) Input: county Note: Currently unsupported by the MapMarker

Geocoding Server.

areaName3 VARCHAR2(256) Input: city

areaName4 VARCHAR2(256) Input: urbanization

unitValue VARCHAR2(256) Input: unit value

unitType VARCHAR2(256) Input: unit type

TotalCands NUMBER Output: total number of candidates found by the geocoder for the input address

ReturnedCands NUMBER Output: size of the candidates collection. This is the number of the total candidates that the cartridge returned and is at most the number of total candidates.

CloseCands NUMBER Output: number of the total candidates that the geocoder considered close matches

errorCode NUMBER Output: number corresponding to a type of address related error. Does not include server, user and database errors, as these errors abort the geocoding process.

errorMsg VARCHAR2(256) Output: text of an address related error

candidates CANDIDATESET2 Output: all of the available/requested candidates for this address after geocoding

ranges ADDRESSRANGESET2 Output: all of the available/requested address ranges for this address after geocoding

units ADDRESSRANGEUNITSET2 Output: all of the available/requested range units for this address after geocoding

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 16 GeocodingCartridge.pdf

The CANDIDATE2 Object

The CANDIDATE2 object is used to hold the candidates returned by the cartridge when the GEOADDRESS2 is geocoded. These candidates contain address information as well as location information. The actual contents of some fields is dependant on the country and the implementation of the geocoding solution used.

Field Type Description

country VARCHAR2(3) the ISO standard abbreviation for the country this candidate is in

genericField1 VARCHAR2(256) PMB information if genericField12 contains ‘T’

genericField2 VARCHAR2(256) census block

genericField3 VARCHAR2(256) PMB designator

genericField4 VARCHAR2(256) PMB range

genericField5 VARCHAR2(256) carrier route

genericField6 VARCHAR2(256) check digit

genericField7 VARCHAR2(256) delivery point

genericField8 VARCHAR2(256) LACS

genericField9 VARCHAR2(256) multi-unit flag

genericField10 VARCHAR2(256) record type

genericField11 VARCHAR2(256) precision code

genericField12 VARCHAR2(256) PMBOutAddr2 flag; ‘T’ (true) if genericField1 contains PMB information, ‘F’ (false) if it does not contain PMB information

placeName VARCHAR2(256) the placename of a candidate address

formattedStreet VARCHAR2(256) the formatted street address (not parsed into individual fields, for example: ’10 Main St Apt 2’)

preAddress VARCHAR2(256) not used for USA geocoding

addressNumber VARCHAR2(256) the address number for the candidate (some implementations may return this combined with street address info in one or more of the following fields)

preDirectional VARCHAR2(256) the String assigned by the country geocoder to preDirectional

preThoroughfareType VARCHAR2(256) the String assigned by the country geocoder to the preThoroughfareType

mainAddress VARCHAR2(256) the String assigned by the country geocoder to the mainAddress field. In most countries candidates this will be the complete street address, and may include the address number.

postThoroughfareType VARCHAR2(256) the post type for the street address, if available

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 17 GeocodingCartridge.pdf

postDirectional VARCHAR2(256) the post directional, if available

PostAddress VARCHAR2(256) lastline

postCode1 VARCHAR2(256) zip code

postCode2 VARCHAR2(256) zip+4.

areaName1 VARCHAR2(256) state

areaName2 VARCHAR2(256) county (not currently supported)

areaName3 VARCHAR2(256) city

areaName4 VARCHAR2(256) urbanization

unitValue VARCHAR2(256) the unit value for this candidate

unitType VARCHAR2(256) the unit type for this candidate

rangeCount NUMBER the count of how many elements in the GEOADDRESS2 ranges are for this candidate

firstRange NUMBER the position of the first ADDRESSRANGE2 in the GEOADDRESS2 ranges collection. This will be 0 in the case where the rangeCount is 0, and 1 or greater otherwise. This marks an improvement in handling ranges and allows users to access to correct ADDRESSRANGE2 without having to iterate through all of the previous CANDIDATE2 objects to count how many ADDRESSRANGE2 objects each has.

X NUMBER the longitude coordinate for the candidate

Y NUMBER the latitude coordinate for the candidate

SRID NUMBER the Oracle SRID, which represents the coordinate system the latitude and longitude should be interpreted in

closeMatchFlag CHAR(1) ’T’ if true (if the geocoder considered this candidate a closematch). ’F’ if false.

resultCode VARCHAR2(256) the result code for the candidate. This corresponds to the type of point returned as well as which fields in the input address matches the corresponding fields in this candidate.

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 18 GeocodingCartridge.pdf

The ADDRESSRANGE2 Object

The ADDRESSRANGE2 lists the street house ranges for a match candidate. The parts of an ADDRESSRANGE2 object are described below:

Field Type Description

country VARCHAR2(3) the ISO standard abbreviation for the country this candidate is in

genericField1 VARCHAR2(256) not used for USA geocoding

genericField2 VARCHAR2(256) not used for USA geocoding

genericField3 VARCHAR2(256) not used for USA geocoding

genericField4 VARCHAR2(256) not used for USA geocoding

genericField5 VARCHAR2(256) carrier route

genericField6 VARCHAR2(256) not used for USA geocoding

genericField7 VARCHAR2(256) not used for USA geocoding

genericField8 VARCHAR2(256) LACS

genericField9 VARCHAR2(256) not used for USA geocoding

genericField10 VARCHAR2(256) record type

genericField11 VARCHAR2(256) not used for USA geocoding

genericField12 VARCHAR2(256) not used for USA geocoding

placeName VARCHAR2(256) placename, usually a business name or well known landmark

preAddress VARCHAR2(256) not used for USA geocoding

addressNumber VARCHAR2(256) not used for USA geocoding

preDirectional VARCHAR2(256) not used for USA geocoding

preThoroughfareType VARCHAR2(256) not used for USA geocoding

mainAddress VARCHAR2(256) not used for USA geocoding

postThouroughfareType VARCHAR2(256) not used for USA geocoding

postDirectional VARCHAR2(256) not used for USA geocoding

postAddress VARCHAR2(256) not used for USA geocoding

postCode1 VARCHAR2(256) zip code

postCode2 VARCHAR2(256) zip+4

areaName1 VARCHAR2(256) not used for USA geocoding

areaName2 VARCHAR2(256) not used for USA geocoding

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 19 GeocodingCartridge.pdf

areaName3 VARCHAR2(256) not used for USA geocoding

areaName4 VARCHAR2(256) not used for USA geocoding

unitValue VARCHAR2(256) unit value

unitType VARCHAR2(256) unit type

candidateIndex NUMBER a field that holds the number of the candidate that this range belongs

rangeUnitCount NUMBER the number of ADDRESSRANGEUNIT2 object for this range

firstRange Unit NUMBER the index of the first rangeUnit for this range

lowHouse VARCHAR2(256) the low address of the range

highHouse VARCHAR2(256) the high address of the range

rangeCondition VARCHAR2(256) information related to what address numbers are between the from and the to. In the USA these conditions would be (O)dd, (E)ven, (B)oth. In some other countries it may have other meanings. So a from of 1 and a to of 9 with a range condition of Odd would also contain 3, 5, and 7. If the condition were Both it would contain all the integers from 1 to 9. A Even condition for this range would not be correct.

rangeSide NUMBER 0 = left, 1 = right (default to left if the side is not known)

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 20 GeocodingCartridge.pdf

The ADDRESSRANGEUNIT2 Object

This object holds the data associated with a CandidateRangeUnit from the server. The server allows for returning multiple RangeUnits per range. It contains all of the address fields as well as specific unit fields.

Field Type Description

country VARCHAR2(3) the ISO standard abbreviation for the country this candidate is in

genericField1 VARCHAR2(256) not used for USA geocoding

genericField2 VARCHAR2(256) not used for USA geocoding

genericField3 VARCHAR2(256) not used for USA geocoding

genericField4 VARCHAR2(256) not used for USA geocoding

genericField5 VARCHAR2(256) not used for USA geocoding

genericField6 VARCHAR2(256) not used for USA geocoding

genericField7 VARCHAR2(256) not used for USA geocoding

genericField8 VARCHAR2(256) not used for USA geocoding

genericField9 VARCHAR2(256) not used for USA geocoding

genericField10 VARCHAR2(256) not used for USA geocoding

genericField11 VARCHAR2(256) not used for USA geocoding

genericField12 VARCHAR2(256) not used for USA geocoding

placeName VARCHAR2(256) placename, usually a business name or well known landmark

preAddress VARCHAR2(256) not used for USA geocoding

addressNumber VARCHAR2(256) not used for USA geocoding

preDirectional VARCHAR2(256) not used for USA geocoding

preThoroughfareType VARCHAR2(256) not used for USA geocoding

mainAddress VARCHAR2(256) not used for USA geocoding

postThouroughfareType VARCHAR2(256) not used for USA geocoding

postDirectional VARCHAR2(256) not used for USA geocoding

postAddress VARCHAR2(256) not used for USA geocoding

postCode1 VARCHAR2(256) not used for USA geocoding

postCode2 VARCHAR2(256) zip+4

areaName1 VARCHAR2(256) not used for USA geocoding

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 21 GeocodingCartridge.pdf

The MM_PREFERENCE2 Object

The MM_PREFERENCE2 object type is used to define how a geocode request is handled. Different preferences can be created to match different geocoding needs.

To modify the default settings in the MapInfo Geocoding Cartridge, create or modify a preferences object in the MISYS_PREFERENCES2 table, and then use MM_ADMIN.set_default_preferences to make that preference the single entry in the MISYS_DEFAULT_PREFERENCES2 table. Other preferences may be stored in the MISYS_PREFERENCES2 table and passed to the geocoding engine when the row is being geocoded. The parts of an MM_PREFERENCE2 object are as follows.

areaName2 VARCHAR2(256) not used for USA geocoding

areaName3 VARCHAR2(256) not used for USA geocoding

areaName4 VARCHAR2(256) not used for USA geocoding

unitValue VARCHAR2(256) unit value

unitType VARCHAR2(256) unit type

rangeIndex NUMBER a field that holds the number of the candidate that this range belongs

lowUnit VARCHAR2(256) a field holding the low unit value for this unit

highUnit VARCHAR2(256) a field holding the high unit value for this unit

Field Type Description

name VARCHAR2(32) the name of the preference. All access to the preferences may be by name so as to avoid needing to have the various object and package members updated whenever a change to the preference type is required. The Java side of the cartridge will be responsible for retrieving the information of a preference.

CloseOnly CHAR(1) field to determine if only closematches will be returned. ‘T’ = true, ‘F’ = false.

maxCandidates NUMBER the maximum number of candidates to return for an input address geocode

maxRangesPerCandidate NUMBER the maximum number of ADDRESSRANGE2 objects to return for each candidate

MaxRangeUnitsPerRange NUMBER the maximum number of ADDRESSRANGEUNIT2 objects to return for each range

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 22 GeocodingCartridge.pdf

serverURL VARCHAR2(256) the URL of the server. This is used by the Java side code to open a connection to the server from the client.

batchSize NUMBER how often output info is committed in the database.

postalFallback CHAR(1) determines if the geocoder can attempt to fallback to a postal centroid in the event that no closematches are found on street geocoding. The country implementation must support this for any centroids to be returned. ‘T’ = true, ‘F’ = false.

geographicFallback CHAR(1) not used for USA geocoding

cornerOffsetUnit CHAR(2) corresponds to the defined unit types for controlling how the offset distances should be interpreted

cornerOffsetDistance NUMBER the number of distUnits the segment on which interpolation should be shrunk. The effect in practice is to move the two end-point addresses in cornerOffset distance and compute all in between addresses from this imaginary segment.

streetOffsetUnit CHAR(2) the unit of measurement to interpret the streetOffset in

streetOffsetDistance NUMBER the number of distUnits the street result should be offset from the center-line of the street segment. Only applies to points interpolated based on address ranges.

RequestSRID NUMBER the SRID coordinates should be returned in. Will be overridden for table geocoding with an output SDO_GEOMETRY column.

mustMatchAddressNumber CHAR(1) If set to ‘T’, closematches must match the input address number. ‘T’ = true, ‘F’ = false.

mustMatchMainAddress CHAR(1) if set to ‘T’, the street name fields must match the input for closematches. ‘T’ = true, ‘F’ = false.

mustMatchAreaName1 CHAR(1) if set to ‘T’, close candidates must match the areaName1 given in input. ‘T’ = true, ‘F’ = false.

mustMatchAreaName2 CHAR(1) if set to ‘T’, close candidates must match the areaName2 given in input. ‘T’ = true, ‘F’ = false.

mustMatchAreaName3 CHAR(1) if set to ‘T’, close candidates must match the areaName3 given in input. ‘T’ = true, ‘F’ = false.

mustMatchAreaName4 CHAR(1) if set to ‘T’, close candidates must match the areaName4 given in input. ‘T’ = true, ‘F’ = false.

mustMatchPostal CHAR(1) if set to ‘T’, closematches must match the input postal code. ‘T’ = true, ‘F’ = false.

mustMatchInput CHAR(1) if set to ‘T’, the above preferences are also set to ‘T’ where appropriate. ‘T’ = true, ‘F’ = false.

genericFlag1 CHAR(1) if set to ‘T’, the preferred user dictionary is used. ‘T’ = true, ‘F’ = false.

genericFlag2 CHAR(1) if set to ‘T’, enable returned multi-unit flag. ‘T’ = true, ‘F’ = false.

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 23 GeocodingCartridge.pdf

The INPUTTABLEINFO2 Object

The INPUTTABLEINFO2 object serves as a pointer to address information stored in a given address. For each of the fields, specify the name of the column used to hold that value for the table or null if there is no column for that value (for example, input postCode1). All the named columns should contain character data.

genericFlag3 CHAR(1) if set to ‘T’, use expanded search. ‘T’ = true, ‘F’ = false.

genericFlag4 CHAR(1) if set to ‘T’, stay in state for expanded search. ‘T’ = true, ‘F’ = false.

genericFlag5 CHAR(1) if set to ‘T’, use CASS mode. ‘T’ = true, ‘F’ = false.

genericFlag6 CHAR(1) not used for USA geocoding

genericFlag7 CHAR(1) not used for USA geocoding

genericFlag8 CHAR(1) not used for USA geocoding

genericField1 VARCHAR2(256) expanded search radius (in miles)

genericField2 VARCHAR2(256) not used for USA geocoding

genericField3 VARCHAR2(256) not used for USA geocoding

genericField4 VARCHAR2(256) not used for USA geocoding

genericField5 VARCHAR2(256) not used for USA geocoding

genericField6 VARCHAR2(256) not used for USA geocoding

genericField7 VARCHAR2(256) not used for USA geocoding

genericField8 VARCHAR2(256) not used for USA geocoding

Field Type Description

tableName VARCHAR2(65) column in the named table containing a unique identifier naming the table that is described

KeyColumn VARCHAR2(32) column in the named table linking input to output

countryColumn VARCHAR2(32) the ISO standard abbreviation for the country of the input address

genericField1Column VARCHAR2(32) street2; secondary address information such as a Post Office box or apartment number

genericField2Column VARCHAR2(32) not used for USA geocoding

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 24 GeocodingCartridge.pdf

genericField3Column VARCHAR2(32) PMB designator

genericField4Column VARCHAR2(32) PMB range

genericField5Column VARCHAR2(32) not used for USA geocoding

genericField6Column VARCHAR2(32) not used for USA geocoding

genericField7Column VARCHAR2(32) not used for USA geocoding

genericField8Column VARCHAR2(32) not used for USA geocoding

genericField9Column VARCHAR2(32) not used for USA geocoding

genericField10Column VARCHAR2(32) not used for USA geocoding

genericField11Column VARCHAR2(32) not used for USA geocoding

genericField12Column VARCHAR2(32) not used for USA geocoding

placeNameColumn VARCHAR2(32) placename, usually a business name or well known landmark

preAddressColumn VARCHAR2(32) not used for USA geocoding

addressNumberColumn VARCHAR2(32) address numberThis may be blank and the address number included in the mainAddress.

preDirectionalColumn VARCHAR2(32) pre direction of a parsed input street

preThoroughfareTypeColumn VARCHAR2(32) pre type of a parsed input street

mainAddressColumn VARCHAR2(32) street address

postThoroughfareTypeColumn VARCHAR2(32) post type of a parsed input street

postDirectionalColumn VARCHAR2(32) post directional of a parsed input street

postAddressColumn VARCHAR2(32) the lastline; the postal code and any areanames in unparsed format

postCode1Column VARCHAR2(32) zip code

postCode2Column VARCHAR2(32) zip+4

areaName1Column VARCHAR2(32) state

areaName2Column VARCHAR2(32) county Note: Currently unsupported by the MapMarker

Geocoding Server.

areaName3Column VARCHAR2(32) city

areaName4Column VARCHAR2(32) urbanization

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 25 GeocodingCartridge.pdf

The OUTPUTTABLEINFO2 Object

The OUTPUTTABLEINFO2 object stores information that defines where the output from the geocoding request should be placed. The attributes of the OUTPUTTABLEINFO2 object are defined below, along with the suggested column type and minimum size for the output table, where appropriate. All attributes of the OUTPUTTABLEINFO2 object are String types.

unitValueColumn VARCHAR2(32) unit value

unitTypeColumn VARCHAR2(32) unit type

defaultCountry CHAR(3) column in the named table containing the default country to be used when the INPUTTABLEINFO2 country field is empty or a record in the input table does not have a value in this field.

Field Type Description

tableName VARCHAR2(65) column in the named table where the fully qualified output table name will be written

keyColumn VARCHAR2(32) column in the named table where the column name linking input to output will be written

countryColumn VARCHAR2(32) column in the named table where the ISO standard abbreviation for this candidate’s country will be written

genericField1Column VARCHAR2(32) column in the named table where the street2 will be written

genericField2Column VARCHAR2(32) column in the named table where the census block will be written

genericField3Column VARCHAR2(32) column in the named table where the PMB designator will be written

genericField4Column VARCHAR2(32) column in the named table where the PMB range will be written

genericField5Column VARCHAR2(32) column in the named table where the carrier route will be written

genericField6Column VARCHAR2(32) column in the named table where the check digit will be written

genericField7Column VARCHAR2(32) column in the named table where the delivery point will be written

genericField8Column VARCHAR2(32) column in the named table where the LACS will be written

genericField9Column VARCHAR2(32) column in the named table where the multi-unit flag will be written

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 26 GeocodingCartridge.pdf

genericField10Column VARCHAR2(32) column in the named table where the record type will be written

genericField11Column VARCHAR2(32) column in the named table where the precision code will be written

genericField12Column VARCHAR2(32) column in the named table where the PMBOutAddr2 flag will be written; ’T’ (true) if genericField1 contains PMB information, ’F’ (false) if it does not contain PMB information

placeNameColumn VARCHAR2(32) column in the named table where the placename of a candidate address will be written

formattedStreetColumn VARCHAR2(32) column in the named table where the formatted street address will be written (not parsed into individual fields, for example: ’10 Main St Apt 2’)

preAddressColumn VARCHAR2(32) not used for USA geocoding

addressNumberColumn VARCHAR2(32) column in the named table where the address number for the candidate will be written (some implementations may return this combined with street address info in one or more of the following fields)

preDirectionalColumn VARCHAR2(32) column in the named table where the String assigned by the country geocoder to preDirectional will be written

preThoroughfareTypeColumn VARCHAR2(32) column in the named table where the String assigned by the country geocoder to the preThoroughfareType will be written

mainAddressColumn VARCHAR2(32) column in the named table where the String assigned by the country geocoder to the mainAddress field will be written. In most countries candidates this will be the complete street address, and may include the address number.

postThoroughfareTypeColumn VARCHAR2(32) column in the named table where the post type for the street address will be written, if available

postDirectionalColumn VARCHAR2(32) column in the named table where the post directional will be written, if available

postAddressColumn VARCHAR2(32) column in the named table where the lastline will be written

postCode1Column VARCHAR2(32) column in the named table where the zip code will be written

postCode2Column VARCHAR2(32) column in the named table where the zip+4 will be written

areaName1Column VARCHAR2(32) column in the named table where the state will be written

areaName2Column VARCHAR2(32) column in the named table where the county will be written (not currently supported)

areaName3Column VARCHAR2(32) column in the named table where the city will be written

areaName4Column VARCHAR2(32) column in the named table where the urbanization will be written

Field Type Description

User’s Guide Chapter 2: USA Layer Packages and Object Types

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 27 GeocodingCartridge.pdf

unitValueColumn VARCHAR2(32) column in the named table where the unit value will be written

unitTypeColumn VARCHAR2(32) column in the named table where the unit type will be written

xColumn VARCHAR2(32) column in the named table where the longitude coordinate will be written

yColumn VARCHAR2(32) column in the named table where the latitude coordinate will be written

SRIDColumn VARCHAR2(32) column in the named table where the Oracle SRID will be written, which represents the coordinate system the latitude and longitude should be interpreted in

spatialObjectColumn VARCHAR2(32) column in the named table where the name of a MDSYS.SDO_GEOMETRY column to put the point returned by the geocoder will be written

closematchFlagColumn VARCHAR2(32) column in the named table that will contain a ’T’ if true (if the geocoder considered this candidate a closematch). ’F’ if false.

TotalCandidatesColumn VARCHAR2(32) column in the named table where the total number of candidates found by the geocoder will be written for the input address

TotalCloseCandidatesColumn VARCHAR2(32) column in the named table where the total number of candidates that the geocoder considered close matches will be written. Close candidates are ordered first in the candidate array.

resultCodeColumn VARCHAR2(32) column in the named table where the result code for the candidate will be written. This corresponds to the type of point returned as well as which fields in the input address matches the corresponding fields in this candidate.

errorCodeColumn VARCHAR2(32) column in the named table where the number corresponding to a type of address related error will be written. Does not include server, user and database errors, as these errors abort the geocoding process.

errorMessageColumn VARCHAR2(32) column in the named table where the text of an address related error will be written

Field Type Description

MapInfo Geocoding Cartridge USA Layer Examples

To learn how to geocode to MapMarker using the MapInfo Geocoding Cartridge USA layer, look at the demos in the MapInfoGeocodingCartridge3.0\USA\demo directory for example SQL scripts. To run them, log in as MISYS.

In this appendix:

single_fields.sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29table_fields.sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29table_geoaddr.sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30trigger_fields.trg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

A

User’s Guide Appendix A: MapInfo Geocoding Cartridge USA Layer Examples

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 29 GeocodingCartridge.pdf

single_fields.sql

This script demonstrates how to geocode a single address when you do not have a GEOADDRESS2 object.

Note: This script uses the first candidate even if there are multiple, equal matches.

1. The script turns on tracing so dbms_output will show up.2. Then it creates a MISYS.GEOADDRESS2 object containing the address to be geocoded.3. The script then geocodes using the MapInfo Geocoding Cartridge defaults.4. If successful, the longitude/latitude coordinates of the first candidate are shown.

After running this demonstration script, you can remove the temporary procedure created by this example by uncommenting and executing the last line in the script:

drop procedure usa_single_fields;

table_fields.sql

This script demonstrates how to geocode a table when address information is not contained in GEOADDRESS2 objects. To use the code contained in this script on your own table, you must replace the table and column names with names applicable to your table.

Note: This script uses only the street, zip, longitude and latitude fields. You may want to expand it to use other fields such and city, state, output firm, etc. It also uses the first candidate even if there are multiple, equal matches.

1. The script first drops table temp_geotable. This will show an error if the table does not exist.

2. It then creates and populates a temporary table and inserts the table metadata into USER_SDO_GEOM_METADATA.

3. Table temp_geotableout is then dropped. This will show an error if the table does not exist.4. A second temporary table is then created for storing geocode results.5. The script then creates a procedure named table_fields that assigns the

INPUTTABLEINFO2 and OUTPUTTABLEINFO2 objects and calls the geocode_table procedure. Next, the table_fields procedure is called and the results are selected from the tables.

After running this demonstration script, you can remove the temporary data created by this example by uncommenting and executing the last three lines in the script:

drop table temp_geotable;drop table temp_geotableout;drop procedure table_fields;

User’s Guide Appendix A: MapInfo Geocoding Cartridge USA Layer Examples

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 30 GeocodingCartridge.pdf

table_geoaddr.sql

This script demonstrates how to geocode a table when address information is contained in a GEOADDRESS2 object. It also shows how to create a new preferences object to use during the geocode. To use the code contained in this script on your own table, you must replace the table and geoaddress column names with names applicable to your table.

1. The script turns on tracing so dbms_output will show up.2. Table temp_geotable is then dropped. This will show an error if the table does not exist.3. The script then creates and populates a temporary table.4. A procedure that will geocode the table using new preference settings is then created. The

default preferences are modified to allow for 4 candidates, each with 3 ranges and 3 range units.

5. The table is then geocoded using the modified MapInfo Geocoding Cartridge settings.

After running this demonstration script, you can remove the temporary data created by this example by uncommenting and executing the last line in the script:

drop table temp_geotable;

trigger_fields.trg

This script demonstrates how to geocode a new or updated record when you do not have a GEOADDRESS2 column. If you don't have a MISYS.GEOADRESS2 column in your table you can use the code supplied within this script. You must replace the table and column names with names applicable to your table.

Note: This code uses the first candidate even if there are multiple, equal matches.

1. This script first drops table temp_coltrigger. This will show an error if the table does not exist.

2. Then a new table named temp_coltrigger is created containing company, add1, add2, city, state, and zip columns. Next, OutFirm, OutStreet, OutCity, OutState, OutZIP, longitude, latitude, and georesult columns are added to the table.

3. The trigger is then created.4. A new address is then inserted. After the insert, candidate information should be

automatically inserted into the temp_coltrigger table.

After running this demonstration script, you can remove the temporary data created by this example by uncommenting and executing the last line in the script:

drop table temp_coltrigger;

Glossary

In this appendix:

Glossary of Address and Geocoding Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

B

User’s Guide Appendix B: Glossary

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 32 GeocodingCartridge.pdf

Glossary of Address and Geocoding Terms

Carrier RouteUSPS address element that describes a given mail delivery or collection route within a 5-digit ZIP Code. There are five possible Carrier Route codes: Bnnn = P.O. Box; Hnnn = Highway Contract; Rnnn = Rural Route; Cnnn = City Delivery; and Gnnn = General Delivery (where n = a number).

CASS ModeA strict manner of geocoding records, based on the standards set by the USPS Coding and Accuracy Support System (CASS), which strives for accurate addresses for mail pieces. Geocoding in this way matches records to the exact house number, street name, and ZIP Code. Other geocoding preferences are overridden. The street name and postal code can vary.

Census BlockU.S. Census Bureau code that uniquely identifies a geographic area for census reporting. Up to a 15-digit alphanumeric code can be returned for a successful match, depending on the result code. The census value is interpreted as follows:

SSCCCTTTTTTGBB(B)

where:

S = State Federal Information Processing Standard (FIPS) code (2 characters)

C = County FIPS code (3 characters)

T = Census Tract (6 characters)

G = Census Block Group (1 character)

B = Census Block (typically 2 characters. The third character means the block was split from another block.)

S5 matches return the full code to the Census Block level. S1, S2, S3, Z1, Z2, and Z3 matches return the Block Group code (12 digits). No value is returned for S4 matches.

Check DigitA one-digit code that together with Delivery Point is used to form the delivery point bar code on U.S. mail pieces.

CountyName of subdivision of a state.

Delivery PointA two-digit code that along with the Check Digit is used to form the delivery point barcode on U.S. mail pieces.

Locatable Address Conversion System (LACS)A one-character code that indicates the record can be converted from a U.S. rural route address to a city-style address, using a separate USPS conversion product.

User’s Guide Appendix B: Glossary

MapInfo Geocoding Cartridge 3.0

© 2002 MapInfo Corporation. All rights reserved. 33 GeocodingCartridge.pdf

MapMarker Address DictionaryThe search dictionary used for matching U.S. addresses during geocoding.

Postal Code Add-onAdditional postal zone identifier. In the U.S. it is a 4-digit extension to the 5-digit ZIP Code.

Postal CodeUnique identifier for postal mailing zones. In the U.S. it is a 5- or 9-digit ZIP Code.

UrbanizationA subdivision of the city. Used in the U.S. for Puerto Rican urbanization areas.