My Oracle Support Banner

Using sdo_geor.getCellValues() generates wrong result when the input to the function is a geometry (Doc ID 2669932.1)

Last updated on APRIL 12, 2022

Applies to:

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

Symptoms

SDO_GEOR.GETCELLVALUES can give incorrect results, as demonstrated in the following example:

create or replace PACKAGE ut_grids_util IS

--%suite(ut_grids_util)

--%suitepath(CDC_GEOR)

--%test(default positive behaviour using ptGeom and layer interface using model coordinates)
PROCEDURE getCellValues03;

--%test(default positive behaviour using ptGeom and layer interface using world coordinates with explicit transformation into model coordinate)
PROCEDURE getCellValues031;
END ut_grids_util;

create or replace PACKAGE BODY ut_grids_util IS
PROCEDURE getCellValues03 IS
l_actual pls_integer;
l_expected pls_integer;
l_actuals sdo_number_array;
singlePoint sdo_geometry := sdo_geometry(2001,4326,sdo_point_type(8.025,50.025, null),null,null);
multiPoint sdo_geometry := sdo_geometry(2005,4326,null,sdo_elem_info_array(1,1,2),sdo_ordinate_array(8.025,50.025,8.025,50.025));
bNum number := 8;
l_feature_code grids_deu.feature_code%type := 'GRD_DEU_P1Y_RR';
l_geor_rec grids_deu%rowtype;
BEGIN
select
r.* into l_geor_rec
from grids_deu r
where r.feature_code = l_feature_code;
l_expected := sdo_geor.getcellvalue(
georaster => l_geor_rec.georaster,
pyramidLevel => 0,
ptGeom => singlePoint,
layerNumber => bNum
);
l_actuals := sdo_geor.getcellvalues(
georaster => l_geor_rec.georaster,
pyramidLevel => 0,
ptGeom => multiPoint,
layerNumber => bNum
);
-- assert
ut.expect(l_actuals.count).to_equal(2);
ut.expect(l_actuals(1)).to_equal(l_expected);
END getCellValues03;
PROCEDURE getCellValues031 IS
l_actual pls_integer;
l_expected pls_integer;
l_actuals sdo_number_array;
singlePoint sdo_geometry := sdo_geometry(2001,4326,sdo_point_type(8.025,50.025, null),null,null);
multiPoint sdo_geometry := sdo_cs.transform(sdo_geometry(2005,4326,null,sdo_elem_info_array(1,1,2),sdo_ordinate_array(8.025,50.025,8.025,50.025)),1);
bNum number := 8;
l_feature_code grids_deu.feature_code%type := 'GRD_DEU_P1Y_RR';
l_geor_rec grids_deu%rowtype;
BEGIN
select
r.* into l_geor_rec
from grids_deu r
where r.feature_code = l_feature_code;
l_expected := sdo_geor.getcellvalue(
georaster => l_geor_rec.georaster,
pyramidLevel => 0,
ptGeom => singlePoint,
layerNumber => bNum
);
l_actuals := sdo_geor.getcellvalues(
georaster => l_geor_rec.georaster,
pyramidLevel => 0,
ptGeom => multiPoint,
layerNumber => bNum
);
-- assert
ut.expect(l_actuals.count).to_equal(2);
ut.expect(l_actuals(1)).to_equal(l_expected);
END getCellValues031;
END ut_grids_util;
/

exec UT_GRIDS_UTIL.getCellValues03;
Value expected: 574
Value actuals: 582

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.