Built Up Area And Postal Code Are Different In MATCHVECTOR For GEOCODE And GEOCODE_ADDR (Doc ID 1500790.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Spatial - Version 11.2.0.3 and later
Information in this document applies to any platform.

Symptoms

Using 11.2.0.3 on Linux x86-64bit

The results of the GEOCODE and GEOCODE_ADDR are the same but the MATCHVECTOR is different for the components: Built up area And Postal Code

result using GEOCODE matchVector
? reserve
? reserve
? address point

1 poi name
0 house number
1 street prefix

0 street base name
1 street suffix
0 street type

1 secondary unit
0 built up area (different value)
? reserve

? reserve
0 region
0 country

0 postal code (different value)
? postal add on code

---
result using GEOCODE_ADDR matchVector
? reserve
? reserve
? address point

1 poi name
0 house number
1 street prefix

0 street base name
1 street suffix
0 street type

1 secondary unit
4 built up area (different value)
? reserve

? reserve
0 region
0 country

4 postal code(different value)
? postal add on code


0: The input attribute is not null and is matched with a non-null value.
1: The input attribute is null and is matched with a null value.
2: The input attribute is not null and is replaced by a different non-null value.
3: The input attribute is not null and is replaced by a null value.
4: The input attribute is null and is replaced by a non-null value.


This is the use of GEOCODE and GEOCODE_ADDR

Summary of the functions used:
GEOCODE - Geocodes an unformatted address and returns the result as an SDO_GEO_ADDR object.
GECODE_ADDR - Geocodes an input address using attributes in an SDO_GEO_ADDR object, and returns the first matched address as an SDO_GEO_ADDR object.

As GEOCODE uses unformatted address the call is using the address as text
As GEOCODE_ADDR uses formatted address the call is using addr variable with structured address


***** START PROGRAM ****
DECLARE
 -- Local variables here
 result_array mdsys.sdo_geo_addr;
 addr sdo_geo_addr;
BEGIN

 -- geocode using 'geocode' oracle function
 -- NOTE: I believe this does return the correct result.
 SELECT sdo_gcdr.geocode('geocode_2010_q3',
  sdo_keywordarray('A4 stonehedge dr',
  'south burlington, vt 05403'),
  'US',
  'DEFAULT')
  INTO result_array
  FROM dual;

 dbms_output.put_line('result using GEOCODE');
 dbms_output.put_line('housenumber=' || result_array.housenumber);
 dbms_output.put_line('streetname=' || result_array.streetname);
 dbms_output.put_line('settlement=' || result_array.settlement);
 dbms_output.put_line('state=' || result_array.region);
 dbms_output.put_line('long=' || result_array.longitude);
 dbms_output.put_line('lat=' || result_array.latitude);
 dbms_output.put_line('edgeid=' || result_array.edgeid);
 dbms_output.put_line('matchVector=' || result_array.matchvector);

 -- geocode using geocode_addr() oracle function
 -- NOTE: I believe this not return the correct result.
 -- NOTE: Regardless, it is a different result than using geocode() function.
 addr := sdo_geo_addr();
 addr.housenumber := 'A4';
 addr.basename := 'stonehedge';
 addr.streettype := 'dr';
 addr.settlement := 'south burlington';
 addr.region := 'vt';
 addr.fullpostalcode := '05403';
 addr.country := 'US';
 addr.matchmode := 'DEFAULT';
 addr.streetname := 'stonehedge dr';

 SELECT sdo_gcdr.geocode_addr('geocode_2010_q3',
  addr)
  INTO result_array
  FROM dual;

 dbms_output.put_line('------------------------------------');
 dbms_output.put_line('result using GEOCODE_ADDR');
 dbms_output.put_line('housenumber=' || result_array.housenumber);
 dbms_output.put_line('streetname=' || result_array.streetname);
 dbms_output.put_line('settlement=' || result_array.settlement);
 dbms_output.put_line('state=' || result_array.region);
 dbms_output.put_line('long=' || result_array.longitude);
 dbms_output.put_line('lat=' || result_array.latitude);
 dbms_output.put_line('edgeid=' || result_array.edgeid);
 dbms_output.put_line('matchVector=' || result_array.matchvector);

END;
***** END PROGRAM ****

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms