User Tools

Site Tools


api:dk11:delphi:gisgeocoding.tgis_geocoding

TGIS_Geocoding class

DK for Delphi | GisGeocoding.TGIS_Geocoding | Classes | Constructors | Methods | Properties | Events

Class encapsulates Geocoding support.

Available also on: .NET | Java | ActiveX | Python.

Syntax

// Delphi
type
  TGIS_Geocoding = class( TGIS_BaseObjectDisposable )
  end;
// C++ Builder
class PASCALIMPLEMENTATION TGIS_Geocoding : public TGIS_BaseObjectDisposable
{
};

Inheritance

Constructors

Inherited Overrides Protected
Name Visibility Description
Create(TGIS_LayerVector) public Construct instance.
Create(TGIS_LayerVector; TGIS_ShapeType) public Construct instance.

Methods

Inherited Overrides Protected
Name Visibility Description
AddPoint public Add a new node connection point to the network
Clear public Clear any results from geocoding.
LoadFormulas(String; String) public Sets address formulas definition and other settings used by geocoding and reverse geocoding.
LoadFormulas(String; String; String) public Sets address formulas definition and other settings used by geocoding and reverse geocoding.
Match public Parses given address line.
Parse(String) public Parse an address line.
Parse(String; Boolean; Boolean) public Parse an address line.
ParseEx(String; Boolean; Boolean; Boolean) public Parses given address line.
ParseEx(TGIS_ObjectList; TGIS_ObjectList; Boolean; Boolean; Boolean) public Finds address point(s), or intersection(s) according to given matches.
ReverseGeocode(TGIS_Point; Double; TGIS_Shape; String) public Returns the closest address to the given point.
ReverseGeocode(TGIS_Point; Double; TGIS_Shape; String; String) public Returns the closest address to the given point.

Properties

Inherited Protected
Name Visibility Description
CityName public Field for the city name.
FormulasString public String in form of an INI file contents with address formulas definition.
HouseNumber public Field for the house number
LayerGeocoded public Layer with geocoded address.
LFrom public Field name for the starting number on the left side of the street.
LTo public Field name for the ending number on the left side of the street.
Offset public Offset describes the size of the space between street and address point.
OSMGeocoding public If true the local geocoding resource is ignored and the requests are send to the TatukGIS online geocoding service.
Point public List of address points.
Query public String with processed query.
QueryEx public String with process query.
ReverseRestrictQuery public String with a query defined for reverse geocoding at the address formulas definition.
RFrom public Field name for the starting number on the right side of the street.
RoadName public Field for the feature name.
RTo public Field name for the ending number on the right side of the street.
StreetName public Field for the street name.
Uid public List of resolved streets Uids.
UidEx public List of resolved street Uids.
UniqueName public Field for a name of a special key indicating a unique street identifier.

Events

Inherited Protected
Name Visibility Description
AddressEvent published Event which will be fired on each found address.

Remarks

Currently arc- and point layers are supported. Any street fragment from intersection to intersection must be a separate shape. There are two ways the class can work:

  1. operating on addresses in the form of: “name 12xxx” (known from previous versions);
  2. basing on self-defined address formulas (see TGIS_AddressMatching class for more details how

to build the formulas).

Supports also Reverse Geocoding.

Example

Delphi

var
  geoObj : TGIS_Geocoding ;
  layerSrc : TGIS_LayerVector ;
  r : Integer ;
  sname : String;
begin
 
  // let's get a source layer
  layerSrc := TGIS_LayerVector(TGIS_LayerSHP(GIS.Items[0]));
  if not Assigned( layerSrc ) then
    exit ;
 
  // let's create a geocoding object
  geoObj := TGIS_Geocoding.Create( layerSrc, TGIS_ShapeType.Arc ) ;
 
  geoObj.offset := 0.0001  ;
  geoObj.LoadFormulas( GisSamplesDataDir + 'us_addresses.geo',
    GisSamplesDataDir + 'tiger_file.geo'
  ) ;
 
  // let's find 'WallStreet' street
  sname:='WallStreet';
  r := geoObj.ParseEx(sname) -1 ;
 
  // if not found, maybe let's try to be more specific
  if r <= 0 then
    sname := sname + ' ???' ;

References

2025/01/31 01:07

Page Tools