35.24 SDO_UTIL.GEO_SEARCH

Format

SDO_UTIL.GEO_SEARCH(
     name  IN VARCHAR2, 
     fuzzy IN NUMBER DEFAULT NULL  
    ) RETURN SDO_GEO_SEARCH_TABLE;

Description

Queries the table with the geographic name hierarchy (ELOC_ADMIN_AREA_SEARCH).

Parameters

name

One or more names from the table with the geographic name hierarchy. Use commas to separate multiple name values.

This table is described in ELOC_ADMIN_AREA_SEARCH Table.

fuzzy

Determines whether Oracle Text fuzzy matching will be used in finding matches for the name value or values. 0 (zero, the default) does not use fuzzy matching; 1 uses fuzzy matching. However, see the Usage Notes for further explanation and examples.

Usage Notes

To use this function, you must understand the concepts in Location Data Enrichment, which also describes the necessary setup actions.

For the fuzzy parameter, if the value is 0 (the default), the values in name must match in spelling the values in the data set for the location, although for a location the data set may permit many variations in spelling and case. If the value is 1, minor errors in name values (like spelling mistakes) will also be considered as matching the location. For example:

  • fuzzy=>0 will match ‘nashua, nh, usa’ and ‘nashua, new hampshire, usa’ to the same standard name.

  • fuzzy=>1, in addition to matching values included for 0, will match ‘nashuaa,NH,usa’ (where the city name is misspelled) to that same standard name.

Examples

The following example searches for information about San Francisco. It does not use fuzzy matching.

SELECT * from TABLE(sdo_util.geo_search('San Francisco,Ca,UNITED STATES'));

The following example uses fuzzy matching (fuzzy value of 1), and therefore will find matches for San Francisco, California, despite the misspelling of the city name in the name parameter (Sanf Fracisco).

SELECT * from TABLE(sdo_util.geo_search('Sanf Fracisco,Ca,UNITED STATES', 1));