Global Navigation Bar

MapInfo Products Knowledge Base


Product: MapMarker J Server
Version: 3.1
Platform: Not Platform Related
Category: API

Summary:
MapMarker J Server 3.1 GeocodingConstraint settings of 2.1.1 GeocodingPreferences.

Question:
To migrate code from 2.1.1 to 3.1, the way in which preferences are set has changed. The following illustrates how settings (set in 2.1.1) are now specified in 3.1.

Answer:
MapMarker J Server 3.1 requires the creation a "GeocodingConstraints" object, in lieu of the GeocodingPreferences Object found in MapMarker J Server 2.1.1.

USA_GeocodeConstraints() myGC = newUSA_GeocodeConstraints();

Notice that the values are set by specifying "key-value pairs":
myGC.setProperty(java.lang.String key, java.lang.String value);

Listed below are the 2.1.1 settings under which are how to achieve those settings in a 3.1 application.

Several of the conditions that were able to be set in 2.1.1 are no longer "settable" in 3.1. The server automatically returns them (think of them as set to true) in the response as a matter of course and are specified where applicable.

2.1 - gcpTemp.setCloseMatchesOnly(true);
3.1's counterpart myGC.setProperty( KEY_CLOSEMATCHESONLY, "true" );


2.1 - gcpTemp.setDistanceUnit(GeocodingPreferences.DIST_UNIT_FOOT);
3.1's counterpart myGC.setProperty( KEY_CORNEROFFSETUNITS, "ft" );
myGC.setProperty( KEY_STREETOFFSETUNITS,"ft");
(use them both)

2.1 - gcpTemp.setExactMatchHouseNumber(true);
3.1's counterpart myGC.setProperty(KEY_MUST_MATCH_ADDRNUM,"true" );

2.1 - gcpTemp.setExactMatchPostalCode(true);
3.1's counterpart myGC.setProperty(KEY_MUST_MATCH_ZIPCODE, "true" );

2.1 - gcpTemp.setExactMatchStreetName(true);
3.1's counterpart myGC.setProperty(KEY_MUST_MATCH_STREET, "true" );

2.1 - gcpTemp.setExpandRadius((short)35); //miles
3.1's counterpart myGC.setProperty(KEY_EXPANDED_SEARCH_RADIUS,"25" );

2.1 - //gcpTemp.setExpandSearch(?); //miles
3.1's counterpart myGC.setProperty(KEY_USE_EXPANDED_SEARCH , "true");

2.1 - gcpTemp.setLinearOffset(20.0); //feet from corner
3.1's counterpart myGC.setProperty(KEY_CORNEROFFSet ,"20" );

2.1 - gcpTemp.setLimitExpandedSearch(true);
3.1's counterpart myGC.setProperty(KEY_EXPANDED_SEARCH_LIMIT_TO_STATE , "true" );

2.1 - gcpTemp.setMatchIntersections(false); //Note, this could be true.
//Automatically Returned.....

2.1 - gcpTemp.setMaxNumCandidates(1); //maximum number of candidates.
3.1's counterpart myGC.setProperty(KEY_MAXCANDIDATES, "3" );

2.1 - gcpTemp.setMaxNumRangesPerCandidate(1);
3.1's counterpart myGC.setProperty( KEY_MAXRANGES,"0" );

2.1 - gcpTemp.setPerpendicularSetback(25.0); //feet
3.1's counterpart myGC.setProperty(KEY_STREETOFFSET, "25" );

2.1 - gcpTemp.setReturnCensus(false);
//Automatically Returned.....

2.1 - gcpTemp.setReturnFirm(false); //Note, this is always the case!
//Automatically Returned.....

2.1 - gcpTemp.setReturnLastlineInfo(true);
//Automatically Returned.....

2.1 - gcpTemp.setReturnPostalInfo(false);
//Automatically Returned.....

2.1 - gcpTemp.setReturnStreets(true);
//Automatically Returned.....

2.1 - //gcpTemp.setUseCASSMode(?);
3.1's counterpart myGC.setProperty( KEY_CASS_MODE,"false"); // or true

Last Modified: 11/03/2003 03:12:39 PM
Global Navigation Bar