introduction mapinfo

Upload: dobridorin

Post on 02-Jun-2018

276 views

Category:

Documents


3 download

TRANSCRIPT

  • 8/10/2019 Introduction MAPINFO

    1/21

    Introduction

    Welcome to the MapInfoEnvinsa Location Platform Web Services. This guide provides descriptions andexamples for the developer ho is riting applications that access the Location !tilit" Service.

    In this section#

    What is the Location !tilit" Service$

    Location !tilit" %unctionalit"

    &everse 'eocoding %unctionalit"

    'a(etteer %unctionalit"

    Location Utility Functionality

    The Location !tilit" Service has three ma)or divisions of functionalit"# 'eocoding* &everse 'eocoding* and'a(etteer.

    Geocoding Functionality

    'eocoding turns ordinar" data records containing address information into geographic ob)ects that displa" on amap b" finding the geographic coordinates of the address. This helps visuali(e data relationships. %or example*once address records are geocoded* the" can be used b" the &oute Service to displa" them as driving directionsbeteen to addresses +locations,. -nce data has geographic references* spatial searches can be performed to

    anser uestions such as /%ind all customers ithin 01 miles of this location./ 2ll geocode reuests can#

    'eocode an incomplete address and return a complete set of address information +a

    normali(ed address,.

    Indicate the number of exact or close matches in the response for a particular address supplied

    in the geocoding reuest.

    Process one or more addresses in a single geocoding reuest.

    Provide information on the ualit" of the result b" using a match code.

    The folloing sections highlight potential a"s to appl" this capabilit"#

    3etermining Service 4apabilities5 The Location !tilit" Service is able to describe its

    capabilities. It indicates hat feature t"pes it can service and hat operations are supported oneach feature t"pe. The service can return hat feature t"pes +contents, are available based onthe feature t"pe alias.

    'eocoding a Street 2ddress5 'eocode address information in order to displa" it on a map or to

    perform spatial searches and ueries. This is useful for displa"ing store locations and thecustomers ho are part of a store lo"alt" program on a map to determine mar6et regions.

    'eocoding a Street Intersection5 'eocode a street intersection in order to displa" it on a map.

    %or example* a mobile subscriber could enter the nearest street intersection to vie a map of

    their location on the mobile device.

    http://wwhclickedpopup%28%27envinsa%27%2C%20%27envinsa-1-3.html/#wp1402994');http://wwhclickedpopup%28%27envinsa%27%2C%20%27envinsa-1-3.html/#wp1403014');http://wwhclickedpopup%28%27envinsa%27%2C%20%27envinsa-1-3.html/#wp1402994');http://wwhclickedpopup%28%27envinsa%27%2C%20%27envinsa-1-3.html/#wp1403014');
  • 8/10/2019 Introduction MAPINFO

    2/21

    'eocoding a Postal 4ode 4entroid5 Postal code centroids represent the centre of a postal

    code region. 7eing able to locate these centroids on a map lets "ou perform demographicanal"sis to find mar6et regions to target for advertising or direct mail.

    'eocoding a Point of Interest from a Place 4ode5 'eocode a point of interest in order to

    displa" it on a map or perform searches and ueries. %or example* locate a specific restaurant

    and then find all of the nearest automated ban6ing machines +2TM,. The result ould bedispla"ed on a subscriber8s mobile device.

    Reverse Geocoding Functionality

    &everse5'eocoding is one of the basic capabilities provided b" the Location !tilit" Service. This service returns apostal code* cit"* cit" subdivision* MS2 +Metropolitan Statistical 2rea,* region t"pe +urban* suburban* rural,* streetintersections* and street addresses associated ith a given geographic location +position or geometr",. Multiplelocations can be submitted in a single reuest document. The folloing operations are supported b" the &everse'eocoder Service#

    'iven a Position* the service is able to return one or more locations* such as addresses ith

    associated Point geometries* and optionall"* the address ranges of these locations from the

    given position as it is defined in the Position 23T +2bstract 3ata T"pe 5 a point location in aell56non coordinate s"stem,.

    The form of the returned addresses is based upon the preference as stated in the reuest. 9ou

    can specif" a preference of street address* street intersection* or Position-fInterest +Postal4ode* 4it"* and State name,. If not specified* the service defaults to street address.

    The service is capable of returning all location information of a preferred t"pe ithin an area

    +4ircle* Ellipse* Pol"gon* and Point,.

    The service is able to indicate the number of matches in the response +including (ero, for a

    given reuest. The service also can limit the number of responses returned. %or example* "oucan set the service to return onl" the : closest matches.

    The folloing sections highlight potential a"s to appl" this capabilit"#

    %inding the Street 2ddress from a Position5 3etermine an address of a given longitude;latitude

    for both real5time* such as call center* situation and for an after5the5fact situation* such ascomparing the surroundings of a location to determine if an individual as near an off5limitsarea.

    'etting a Position-fInterest from a Position5 Provide a mobile subscriber ith a list of the

    nearest postal code* cit"* and state* given their current location.

    Multi5Language Support5 Provide reverse geocoding results in multiple languages for those

    countries that have more than one official language.

    Gazetteer Functionality

    2s part of the Location !tilit" Service* the 'a(etteer service performs a orld* countr"* or cit" geocode operationthat can find the position of a partial address containing onl" the cit"* state* or a place name* such as a landmar6or airport. The folloing operations are supported b" the 'a(etteer Service#

    Search* based on countr"* countr" subdivision* cit"* cit" subdivision* landmar6* or airport to

    return the position.

    The pattern search capabilit" supports a ildcard character +

  • 8/10/2019 Introduction MAPINFO

    3/21

    Specif"ing T"pes of 'a(etteer Searches5 Specif" the t"pe of search to perform* such as

    searching all cities* tons* and airports ithin a specific countr"* to return a list of match resultsto choose from.

    Performing a 'a(etteer &euest5 Search a database of places around the orld in order to

    uic6l" displa" a map centered on a specific place in a countr" such as La6e 4omo* Ital".

    = >11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]
  • 8/10/2019 Introduction MAPINFO

    4/21

    Location Utility Geocode Capabilities

    -nce a 'eocoder Service determines a position from a partial or complete address* then the pertaininginformation becomes a location5based resource. This resource is easil" used b" another service* such as the3irector" or the &oute Service.

    This section describes ho to develop and use the geocode capabilities of the Location !tilit" Service.

    Note:2ll code samples can be tried using the Envinsa3emo application included in the default Envinsainstallation.

    In this section#

    3etermining Service 4apabilities

    'eocoding a Street 2ddress

    'eocoding a Street Intersection

    'eocoding a Postal 4ode 4entroid

    'eocoding a Point of Interest from a Place 4ode

    Parsed versus !nparsed Street 2ddresses

  • 8/10/2019 Introduction MAPINFO

    5/21

    Determining Service Capabilities

    The Location !tilit" Service is made up of three sub5services* 'eocode* &everse'eocode* and 'a(etteer. Each

    of these sub services have different sets of preferences or support different geographic areas and t"pes ofcapabilities. The Location !tilit" Service is uniue* as the geocoding engines behind the service are differentdepending on the localit" or deplo"ment. Therefore their capabilities ma" be different. 7efore sending a reuest tothe Location !tilit" Service* determine hat capabilities are available b" sending it a 'et4apabilities reuest.

    Inputs and e!aviors

    7ecause of the varied capabilities the service can return* the 'et4apabilities reuest must be customi(ed to theparticular information desired. The 'et4apabilities reuest can be focused on the capabilit" t"pe +geocode orreverse geocode,* the t"pe of geocode;reverse geocode* or a specific countr".

    2 'et4apabilities reuest can ta6e the folloing inputs#

    InputRequired

    Description

    4apabilit"T"pe

    Ao Specif" 'eocode or &everse 'eocode. This returns the list of supported countries*supported levels of geocoding* and the preferences for the Location !tilit" Service.

    'eocodeT"pe

    Ao The folloing level t"pes can be supported#

    Street2ddress

    Intersection2ddress

    Position-fInterest

    Postal4ode

    2dministrative&egions 5 'eocoding and reverse geocoding based on the administrativeareas. These can contain different content levels# countr" subdivision* countr" secondar"subdivision* municipalit"* and municipalit" subdivision.

    4ustom 5 This is available for reverse geocoding onl". It returns the content of an"custom la"er here the given position is located.

    In response to this reuest* the service returns all of the available countries that supportthese geocode t"pes.

    4ountr" Ao 7" specif"ing an IS-> or IS-B countr" code +for example* 42 or !S2,* the servicereturns a response that includes hether the specified countr" is supported and all thecapabilities specific to that countr".

    4ustom4ontent

    Ao This value is used for 'et4apabilities reuests specific to &everse 'eocode. This valueof 4ustom 4ontent is sent so that the reverse geocode ueries some other content

  • 8/10/2019 Introduction MAPINFO

    6/21

    rather than the predefined content +Street2ddress* Interesction2ddress* orPosition-fInterest,. Some examples of alternate ueries include 4it" and State. Thecustom content must be defined in the Location !tilit" Service configuration+see&everse 'eocode Preferencesfor more information,.

    "utputs

    3epending on the t"pe of 'et4apabilities reuest that is sent* the service returns an appropriate response. Eachresponse includes the general preferences and their default values* all the geocode t"pes available for thespecified countr"* as ell as the geocode engine version* data version* license information* an" additional fieldsdefined* local geocode preferences* an" address and user dictionaries defined* and the order that thesedictionaries are searched.

    Capability #ype Response

    In response to a successful 'et4apabilities capabilit" t"pe reuest* the service returns a response that includes

    the different levels of geocoding or reverse geocoding that are available and hich countries support that level* asell as all the other general information detailed previousl".

    Geocode #ype Response

    In response to a successful 'et4apabilities capabilit" t"pe reuest* the service returns a response that includesthe information for the geocode t"pe specified in the reuest. as ell as all the other information detailedpreviousl".

    Country Speci$ic Response

    In response to a successful 'et4apabilities countr" reuest* the service returns a response that includes all the

    geocode t"pes available for the specified countr"* as ell as all the other information detailed previousl".

    %ava Code Sample

    The folloing example returns hether the geocode capabilities for the !S and 4anadian services+set4ountr"+ne StringCD/!S/* /42A/F,, support Street 2ddress geocoding +setLevelT"pe+/Intersection2ddress/,,*and return all of the capabilities* including preferences for the 4anadian service +set4ountr"+ne StringCD/42/F,,.

    LocationCapability[] geocode = new LocationCapability[2];geocode[0] = new LocationCapability();// query the street address leel geocode capabilities!geocode[0]!setLeel"ype(LocationCapability!"#$%&'"%%"&**%'');geocode[0]!setCountry(new 'tring[] + ,-',. ,C, );

    geocode[1] = new LocationCapability();// query the street interseciton leel geocode capabilities!geocode[1]!setLeel"ype(LocationCapability!"#$%&"%'%C"3&**%'');geocode[1]!setCountry(new 'tring[] + ,C, );request!set4eocodeCapabilities(geocode);

    &N'# Code Sample

    The folloing example returns all of the preferences for the 4anadian service +ctr G /42A/F,. The levels ofgeocoding are not returned for this reuest +has'eocodeLevelT"pe G false,.

    priate static 4etCapabilityequest getCapabilityequest()

    + 4etCapabilityequest gC = new 4etCapabilityequest();

  • 8/10/2019 Introduction MAPINFO

    7/21

    4eocodeCapability [] gcap = new 4eocodeCapability[2];gcap[0] = new 4eocodeCapability();string [] ctr = +,C,;gcap[0]!Country'3 = ctr;gC!4eocodeCapability = gcap;4eocodeCapability [] gcap1 = new 4eocodeCapability[1];

    gcap1[0] = new 4eocodeCapability();string [] ctr1 = +,-',;gcap1[0]!Country'3 = ctr1;gC!eerse4eocodeCapability = gcap1;return gC;

    ()L Sample

    The folloing example returns all of the geocode capabilities and preferences for the 4anadian service and all ofthe &everse 'eocode capabilities for the !S service.

    5&equest$ara6eters 7si8type=,ns984etCapabilitiesequest"ype,76lns8ns9=,http8//www!6apin:o!co6/locationutility,

    5ns984eocode5ns98CountryC5/ns98Country

    5/ns984eocode5ns98eerse4eocode

    5ns98Country-'5/ns98Country5/ns98eerse4eocode

    5/&equest$ara6eters

    = >11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]
  • 8/10/2019 Introduction MAPINFO

    8/21

    Geocoding a Street *ddressThe Location !tilit" Service can geocode various forms of a Street 2ddress. These addresses could be made upof different address t"pes* address elements* levels of accurac"* or preferences.

    *ddress #ypesThere are to main t"pes of addresses that can be geocoded b" the Location !tilit" Service.

    Free Form Address (Unformatted)

    The %ree %orm 2ddress has all the address segments as ell as the countr" and postal code in one string. TheLocation !tilit" reuires that the %ree %orm 2ddress follos certain rules. The format of the address is read b" theservice as# Street 2ddress* Municipalit"* 4ountr"SubdivisionH Postal4ode.

    2 comma is the separator beteen the different address segments. 2 semicolon is the separator of the addresssegments and the postal code +if the postal code exists,. The Street 2ddress can consist of address elementssuch as Street Aumber* 3irection Prefix* StreetT"pePrefix* Street Aame* StreetT"peSuffix* and 3irectionSuffix.The seuence of these elements can var" for different countries.

    If onl" one item is specified beteen the Street 2ddress and Postal 4ode* it is treated as the 4ountr"Subdivision.If the Municipalit" and 4ountr"Subdivision segments do not exist in the %ree %orm 2ddress* the Postal 4ode mustbe provided.

    The folloing are some examples of valid !S2 %ree %orm 2ddresses#

    2ddress ith street address* cit"* state and postal code#

    10 wall 't!. ew #orall 't!. #2ddress ith street address and postal code#

    10 wall 't!; 1000

    Formatted Address

    The %ormatted 2ddress is defined using a uniue element for each of the segments that ma6e up the address.The %ormatted 2ddress can be either a Street2ddress or StreetIntersection.

    2 description of the format for a Street2ddress and StreetIntersection can be found in the schema or S3. %orboth a Street2ddress or StreetIntersection "ou can specif" the countr" subdivision* countr" secondar"subdivision* municipalit"* and municipalit" subdivision elements

    7oth of these to formatted address ma" also have a Postal 4ode. If there is no countr" subdivision ormunicipalit" specified in the %ormatted 2ddress* the Postal 4ode is reuired. If the address contains onl" thePostal 4ode* a Postal 4ode centroid geocoding is performed.

    Inputs and e!avior2 reuest contains to 6e" elements in order to obtain the geocoded location of an address#

    Input Required Description

    2ddress 9es The 2ddress element is specified at the location to be geocoded. The address

    consists of a %ree%orm2ddress* Street2ddress* 4ountr"Subdivision* Municipalit"*

  • 8/10/2019 Introduction MAPINFO

    9/21

  • 8/10/2019 Introduction MAPINFO

    10/21

    &N'# Code SampleThe folloing sample geocodes a free form street address +01 Wall St.* Ae 9or6* A9H 0111:,. The maximumnumber of response candidates for this reuest is five +Maximum&esponses G /:/,. -nl" the close matches isreturned +'eocodePreference.E9closeMatches-nl"* /true/,* and to street address numbers is returnedclosest to the position +'eocodePreference.E9max&anges* />/,.

    priate static equest new?ree?or6ddress4eocodeequest()+

    4eocodeequest gr = new 4eocodeequest();//set request identi:iergr!equest* = ,1,;//set the 6a7i6u6 nu6ber o: candidates in the responsegr!@a7i6u6esponses = ,,;//set geocoding pre:erences4eocode$re:erence gp = new 4eocode$re:erence();gp!set$roperty(4eocode$re:erence!E%#&close@atches3nly. ,true,);gp!set$roperty(4eocode$re:erence!E%#&6a7anges. ,2,);gr!4eocode$re:erence = gp;//set the address in the request

    ddress addr = new ddress();addr!CountryCode =,-',;addr!ddressee = ,-' ddress,;addr!?ree?or6ddress = ,10 >all 't!. ew #orall 't!. ew #or

  • 8/10/2019 Introduction MAPINFO

    11/21

    = >11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]
  • 8/10/2019 Introduction MAPINFO

    12/21

    Interpolating *ddress +oints7" default* hen "ou tr" to geocode an address* Envinsa estimates the location of the address based on thestreet numbers at either end of street segment. %or example* if a street segment runs from 011 Main St. to >11Main St.* then a reuest for 0:1 Main St. ill return a location in the middle of the segment. This match

    If "ou have a point user dictionar"* such as ParcelPrecision* then Envinsa can use these 6non addresses tofurther refine geocode results. This process is called 2ddress Point Interpolation. 4ontinuing the previousexample* suppose e use 2ddress Point Interpolation and the geocoder finds the position of 01 Main St. in theParcelPrecision user dictionar"* hich is about to5thirds of the a" don the street. Ao* the geocoder canestimate the position of our target address based on 011 and 01 Main St. In this case* the geocoder estimatesthe location of the address slightl" aa" from the center of the segment.

    If "ou do not have a point user dictionar"* then there is no benefit to using address point interpolation. Thestandard Envinsa geocode data does not include enough address points to support this feature.

    7" default* address point interpolation is disabled for geocode reuests. The folloing examples demonstrate ho"ou can enable this feature.

    = >11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]
  • 8/10/2019 Introduction MAPINFO

    13/21

    %ava Code SampleTo use 2ddress Point Interpolation ith the Java S3* "ou must setthe 4eocodeequest%7!-'%&**%''$3"&"%$3L"3 propert" to true.

    The folloing example geocodes an address using address point interpolation#

    public equest createequest%7()+

    //Create a street addressddress address = new ddress(,-',);'treetddress streetddress = new 'treetddress(,F0G @yrtle e,);address!set'treetddress(streetddress);address!setCountry'ubdiision(,#,);address!set@unicipality(,lbany,);address!set$ostalCode(,1220DH990F,);// Create a 4eocoding 'treet ddress request4eocodeequest%7 request%7 = new 4eocodeequest%7(address);$roperties pre:s = new $roperties();pre:s!set$roperty(4eocodeequest%7!CL3'%&@"CA%'&3L#. ,true,);pre:s!set$roperty(4eocodeequest%7!@-'"@"CA&**&-@. ,true,);pre:s!set$roperty(4eocodeequest%7!@-'"@"CA&@&**. ,true,);pre:s!set$roperty(4eocodeequest%7!@-'"@"CA&C3-"#&'-I*J'3.

    ,true,);pre:s!set$roperty(4eocodeequest%7!@-'"@"CA&@-C$L"#. ,true,);pre:s!set$roperty(4eocodeequest%7!@-'"@"CA&$3'"L&C3*%. ,true,);// use address point interpolation!

    prefs.setProperty(GeocodeRequestEx.USE_ADDRESSPOINT_INTERPOLATION,true!"

    request%7!set4eocode$re:erence(pre:s);return request%7;

    = >11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]
  • 8/10/2019 Introduction MAPINFO

    14/21

    &N'# Code SampleTo use 2ddress Point Interpolation ith the .AET S3* "ou must setthe 4eocode$re:erence!E%#&useddress$ointnterpolation propert" to true.

    The folloing example geocodes an address using address point interpolation#

    priate static equest newddressnterpolationequest()+

    4eocodeequest gr = new 4eocodeequest();//set request identi:iergr!equest* = ,1,;//set the 6a7i6u6 nu6ber o: candidates in the responsegr!@a7i6u6esponses = ,10,;//set geocoding pre:erences to use address point interpolation4eocode$re:erence gp = new 4eocode$re:erence();gp!set$roperty(4eocode$re:erence!E%#&close@atches3nly. ,:alse,);#p.setProperty(GeocodePrefere$ce.%E&_useAddressPo'$tI$terpo)t'o$,

    true!"gr!4eocode$re:erence = gp;//set the address in the requestddress addr = new ddress();addr!CountryCode =,-',;addr!ddressee = ,-' ddress,;'treetddress streetddress = new 'treetddress();streetddress!Jalue = ,F0G @yrtle e,;addr!'treetddress = streetddress;addr!Country'ubdiision = ,#,;addr!@unicipality = ,lbany,;addr!$ostalCode = ,1220DH990F,;ddress[] addrs = +addr ;gr!ddress = addrs;return gr;

    = >11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]
  • 8/10/2019 Introduction MAPINFO

    15/21

    Geocoding a Street IntersectionThe Location !tilit" Service can geocode street intersections. These street intersections could be made up ofdifferent address t"pes or address elements* and the reuest ma" have different levels of accurac" orpreferences.

    Inputs and e!aviorsThe reuest contains three 6e" elements in order to obtain the geocoded location of a street intersection#

    Input Required Description

    2ddress 9es The 2ddress specifies the location of the street intersection. To determine the positionof the street intersection the address reuires the 4ountr" Subdivision andMunicipalit" here the to streets are located.

    Street 9es -ne of the streets for the intersection.

    IntersectingStreet

    9es The other street for the street intersection.

    "utputThe response for a street intersection geocode reuest contains a list of geocoded street intersection positions.The list of geocoded addresses contains three 6e" pieces of information#

    Output Description

    Aumber of2ddresses

    The number of matching street intersection positions found for the specified addresses in thereuest. The number of intersections found is the number of 'eocode 2ddress ob)ects returned.

    Position The geocoded position of the street intersection. This position consists of the geocoded pointand the spatial reference s"stem name.

    2ddress The address specified in the reuest is returned ith all available information for the streetintersection. The number for each street at the intersection is returned* as ell as the postalcode for the to street addresses.

    %ava Code SampleThe folloing example finds the geocoded position for the intersection of /Wall St./ and /William St./ in Ae 9or6

    4it". The first street is defined using setStreet2ddress* hile the intersecting street is defined usingsetIntersectingStreet2ddress.

    public equest createequest() throws %7ception+

    //Create an intersection addressddress address = new ddress(,-',);'treetddress st = new 'treetddress(,>all 't!,);'treetddress int't = new 'treetddress(,>illia6 't!,);address!set'treetddress(st);address!setntersecting'treetddress(int't);address!setCountry'ubdiision(,#,);

    address!set@unicipality(,ew #or

  • 8/10/2019 Introduction MAPINFO

    16/21

    return request;

    &N'# Code SampleThe folloing example finds the geocoded position for the intersection of /Wall St./ and /William St./ in Ae 9or64it". 7oth streets are defined using Street2ddress* then added to IntersectingStreet2ddress to ma6e the street

    intersection.

    priate static equest new'treetntersection4eocodeequest()+

    4eocodeequest gr = new 4eocodeequest();//set request identi:iergr!equest* = ,,;//set the 6a7i6u6 nu6ber o: candidates in the responsegr!@a7i6u6esponses = ,,;//set the address intersection in the requestddress addr = new ddress();addr!CountryCode =,-',;addr!@unicipality =,ew #orall 't!,);saddrs[1] = new 'treetddress(,>illia6 't!,);

    addr!ntersecting'treetddress = saddrs;ddress[] addrs = +addr ;gr!ddress = addrs;return gr;

    ()L SampleThe folloing example finds the geocoded position for the intersection of /Wall St./ and /William St./ in Ae 9or6

    4it". The first street is defined using Street element* hile the intersecting street is defined usingIntersectingStreet element.

    5&equest$ara6eters 7si8type=,ns284eocodeequest"ype,5ddress countryCode=,-', 7si8type=,ns28ddress"ype,

    5'treetddress 7si8type=,ns28'treetddress"ype,5'treet 7si8type=,ns28'treeta6e"ype,>all

    't!5/'treet5'treet 7si8type=,ns28'treeta6e"ype,>illia6

    't!5/'treet5/'treetddress5$lace type=,Country'ubdiision,

    7si8type=,ns28a6ed$lace"ype,#5/

    $lace5$lace type=,@unicipality, 7si8type=,ns28a6ed$lace"ype,ew

    #or11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]
  • 8/10/2019 Introduction MAPINFO

    17/21

    Geocoding a +ostal Code CentroidThe Location !tilit" Service can geocode postal codes.

    Inputs and e!aviorsThe reuest contains one 6e" element in order to obtain the geocoded location of a postal code centroid#

    Input Required Description

    2ddress 9es The 2ddress specifies the postal code being geocoded. To determine the position of apostal code centroid the address reuires the 4ountr" code be specified.

    %ava Code SampleThe folloing example finds the geocoded centroid for the !S postal code /0111:/.

    public equest createequest() throws %7ception +//Create a postal code addressddress address = new ddress(,-',);address!set$ostalCode(,1000,);//Create a 4eocoding $ostal ddress request4eocodeequest request = new 4eocodeequest(address);return request;

    &N'# Code SampleThe folloing example finds the geocoded centroid for the !S postal code /0111:/.

    priate static equest new$ostalCodeddress4eocodeequest()+

    4eocodeequest gr = new 4eocodeequest();//set request identi:iergr!equest* = ,2,;//set the 6a7i6u6 nu6ber o: candidates in the responsegr!@a7i6u6esponses = ,9,;//set the address in the requestddress addr = new ddress();addr!CountryCode = ,-',;addr!$ostalCode = ,1000,;ddress[] addrs = +addr ;gr!ddress = addrs;

    return gr;

    ()L SampleThe folloing example finds the geocoded centroid for the !S postal code /0111:/.

    5&equest$ara6eters 7si8type=,ns284eocodeequest"ype,5ddress addressee=,-' ddressee, countryCode=,-',

    5$ostalCode10005/$ostalCode5/ddress

    5/&equest$ara6eters

    = >11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]
  • 8/10/2019 Introduction MAPINFO

    18/21

  • 8/10/2019 Introduction MAPINFO

    19/21

    Geocoding a +oint o$ Interest $rom a +lace CodeThe Location !tilit" Service can geocode specific Points of Interest +P-Is, using the name and place code of theP-I.

    Inputs and e!aviorsThe reuest contains the folloing 6e" elements in order to obtain the geocoded location of a point of interestfrom a place code#

    Input Required Description

    4ountr"4ode

    9es Specif"ing the countr" directs the uer" to the correct geocoding engine

    Aame of theP-I

    9es The full name of the point of interest.

    Place 4ode 9es The place code of the point of interest. Place codes are also referred to as mi4odesand more information can be found in the Data Guidefoundat http#;;.envinsa.com.

    Some examples of commonl" used mi4odes are as follos#

    irports 10910000%ducational / 'chools 10210000Aospital / $olyclinic 10290100$ar< 10190201'hopping @alls / 'hopping Center 10010K00'ports Center / 'tadiu6 10120100

    4ountr"Subdivision

    Ao Including the countr" subdivision helps to avoid unanted results

    Municipalit" Ao Including the name of the municipalit" helps to avoid unanted results.

    "utputThe response for a point of interest from a place code reuest contains#

    Output Description

    S&S Aame of the spatial reference s"stem used for the location point.

    Aumber of P-Is %ound The number of matching P-Is positions found for the reuest.

    Location %or each P-I found* the Lat;Long position is returned.

    4ountr" 4ode %or each P-I found* the countr" code is returned.

    Aame of the P-I The full name of the point of interest.

    Place 4ode The place code of the point of interest.

    4ountr" Subdivision The countr" subdivision of the point of interest.

    4ountr" Secondar" Subdivision The countr" secondar" subdivision of the P-I is returned.

    Municipalit" The name of the municipalit" in hich the P-I is located.

    %ava Code SampleThe folloing example finds the school called Loell School in Teanec6* Ae Jerse".

    http://www.envinsa.com/http://www.envinsa.com/http://www.envinsa.com/
  • 8/10/2019 Introduction MAPINFO

    20/21

    ddress%7 address = new ddress%7(,-',);address!setCountry'ubdiision(,ew ersey,);address!set@unicipality(,"eanec

  • 8/10/2019 Introduction MAPINFO

    21/21

    +arsed versus Unparsed Street *ddresses2fter a successful geocode reuest* the service returns a response hich includes the address submitted in thereuest* as ell as the desired response* the N9 coordinate.

    There are a fe a"s that an address can be expressed in both the reuests and the responses. These methodscan be referred to as Parsed and !nparsed. While addresses can be included in reuests as either parsed orunparsed* the response ala"s contains the unparsed version of the address +geocode responses also includethe parsed address,. 7oth versions of the address are euivalent. 3epending on the particular clientimplementation* there ma" be advantages of using one method over the other.

    = >11?MapInfo 4orporation.2ll rights reserved. Email#[email protected]

    http://www.mapinfo.com/http://www.mapinfo.com/http://www.mapinfo.com/mailto:[email protected]:[email protected]://www.mapinfo.com/mailto:[email protected]