GeocodeInfo() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns any and all attributes that were set on a connection using the Set Connection Geocode statement. In addition, GeocodeInfo() can also return some status values from the last geocode command issued using each connection. There is also an attribute to handle the maximum number of addresses that the server will permit to be sent to the service at a time. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

GeoCodeInfo( connection_handle, attribute )

connection_handle is an Integer.

attribute is an Integer code, indicating which type of information should be returned.

Return Value

Float, Integer, SmallInt, Logical, or String, depending on the attribute parameter.

Description

The GeoCodeInfo() function returns the properties defaulted by the connection or the properties that have been changed using Set GeoCode. Like many functions of this type in MapBasic, the return values vary according to the attribute parameter. All the codes for these values are listed in MAPBASIC.DEF.

attribute Value ID GeoCodeInfo() Return Value
GEOCODE_STREET_NAME 1 Logical representing whether or not a match for StreetName is set.
GEOCODE_STREET_NUMBER 2 Logical representing whether or not a match for StreetNumber is set.
GEOCODE_MUNICIPALITY 3 Logical representing whether or not a match for municipality is set.
GEOCODE_MUNICIPALITY2 4 Logical representing whether or not a match for MunicipalitySubdivision is set.
GEOCODE_COUNTRY_SUBDIVISION 5 Logical representing whether a match for CountrySubdivision is set.
GEOCODE_COUNTRY_SUBDIVISION2 6 Logical representing whether or not a match for CountrySecondarySubdivision is set.
GEOCODE_POSTAL_CODE 7 Logical representing whether or not a match for PostalCode is set.
GEOCODE_DICTIONARY 9 SmallInt value representing one of these five values:
  • DICTIONARY_ALL
  • DICTIONARY_ADDRESS_ONLY
  • DICTIONARY_USER_ONLY
  • DICTIONARY_PREFER_ADDRESS
  • DICTIONARY_PREFER_USER
GEOCODE_BATCH_SIZE 10 Integer value representing the batch size.
GEOCODE_FALLBACK_GEOGRAPHIC 11 Logical representing whether or not the geocoder should fall back to a geographic centroid when other options fail.
GEOCODE_FALLBACK_POSTAL 12 Logical representing whether or not the geocoder should fall back to a postal centroid when other options fail.
GEOCODE_OFFSET_CENTER 13 Float value representing the distance from the center of the road that the point is returned.
GEOCODE_OFFSET_CENTER_UNITS 14 String value representing the units of the center of the road values.
GEOCODE_OFFSET_END 15 Float value representing the distance from the end of the road that the point is returned.
GEOCODE_OFFSET_END_UNITS 16 String value representing the units of the offset from end of street value
GEOCODE_MIXED_CASE 17 Logical representing whether MapInfo Pro should format the strings returned in mixed case or leave them as uppercase. This option may not be available for all countries. The option uses a country specific algorithm that has knowledge of what address parts and what items should be capitalized and what should be made lower case.
GEOCODE_RESULT_MARK_MULTIPLE 18 Logical representing whether MapInfo Pro should change the result code returned from the server by adding an indicator to the result code that the result was based on an arbitrary choice between multiple close matches. This flag only affects the behavior under the following circumstances:
  1. The geocoding was not interactive so no possibility of presenting the candidates dialog was possible.
  2. The non-interactive command flag was to pick the first candidate returned rather than none. (see Geocode command "First"). This forces MapInfo Pro to pick one of the candidates.
  3. The actual request returned more than one close match for a particular record.
GEOCODE_COUNT_GEOCODED 19 Integer value representing the number of records geocoded during the last operation.
GEOCODE_COUNT_NOTGEOCODED 20 Integer value representing the number of records not geocoded during the last operation.
GEOCODE_UNABLE_TO_CONVERT_DATA 21 Logical representing whether a column was not updated during the last operation because of a data type problem. The case where this occurs is when integer columns are erroneously specified for non-numeric postal codes.
GEOCODE_MAX_BATCH_SIZE 22 Integer value representing the maximum number of records (for example, addresses) that the server will permit to be sent to the service at one time.
GEOCODE_PASSTHROUGH 100 Integer specifying the number of passthrough items set on this connection. There are two items for each pair. This value is used to know when to stop the enumeration of these values without error.
GEOCODE_PASSTHROUGH + n 100 String values alternately representing name and value for each passthrough pair. n is valid up to the value returned via GEOCODE_INFO_PASSTHROUGH.

Example

The following MapBasic snippet will print the Envinsa Location Utility Constraints to the message window in MapInfo Pro:

Include "MapBasic.Def"
declare sub main
sub main
dim iConnect as integer
Open Connection Service Geocode Envinsa 
		URL 
"http://envinsa_server:8066/LocationUtility/services/LocationUtility"
		User "john"
		Password "green"
		into variable iConnect
Print "Geocode Max Batch Size: " + 
GeoCodeInfo(iConnect,GEOCODE_MAX_BATCH_SIZE)
end sub

See Also:

Open Connection statement, Set Connection Geocode statement