This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,588 Users
  • 2,269,776 Discussions
  • 7,916,825 Comments

Discussions

GeoRaster NODATA question

Simon Greener
Simon Greener Member Posts: 810 Silver Badge
edited Dec 12, 2022 12:58AM in Spatial Discussions

I have a single (band) GeoRaster object in a table.

The raster is cookie cut by a polygon to produce statistics using SDO_GEOR.generateStatistics.

Some of the pixels in the raster have -Infinity values. When these are within the polygon generateStatistics fails to produce valid values like MIN. I tried to set the -infinity value as the NODATA value:

DECLARE

 gr sdo_georaster;

BEGIN

 SELECT raster INTO gr FROM carbon WHERE id=1 FOR UPDATE;

 SDO_GEOR.addNODATA(gr, 0, sdo_range_array(sdo_range(-1*binary_double_infinity,0)));

 UPDATE carbon SET raster=gr WHERE id=1;

 COMMIT;

END;

/

But after doing so the following nodata query returns 0 and not -Infinity.

SELECT SDO_GEOR.getNODATA(raster, 0) NODATA FROM carbon WHERE id=1;

NODATA(LB, UB) 

-------------------------------------------------

SDO_RANGE_ARRAY(SDO_RANGE(0, NULL))

The generateStatistics query looks like this:

SELECT rownum as measure, 

        t.column_value

     FROM carbon a,

        (select geom from property where id = 524) b,

        SDO_GEOR.generateStatistics(

          georaster   => a.raster,

          pyramidLevel  => 0,

          samplingFactor => 'samplingFactor=1',

          samplingWindow => SDO_GEOM.SDO_INTERSECTION(b.geom,a.raster.spatialExtent,0.05),

          bandNumbers  => '0',

          nodata     => 'TRUE',

          polygonClip  => 'TRUE', 

          parallelParam => NULL

        ) t

Resulting in:

  MEASURE Result Sequence

---------- ---------------

     1 -Infinity    

     2   452.327681

     3 -Infinity    

     4 -Infinity    

     5 -Infinity    

(Doesn't produce all 7 rows for some reason.)

Can anyone help?

Best Answers

  • Fechen-Oracle
    Fechen-Oracle Member Posts: 52 Employee
    Answer ✓

    Currently GeoRaster doesn't support NODATA value as binary_double_infinity. Will it be possible to use an actual value as NODATA in the raster?

  • Fechen-Oracle
    Fechen-Oracle Member Posts: 52 Employee

    From your script above, it seems that all of your normal pixel values are above 0. If so, you can use the following script to change the -infinity value to another value <new value>:

    declare

    gr sdo_georaster;

    begin

    select raster into gr from carbon where id=1;

    sdo_geor_ra.rasterUpdate(gr, 0, SDO_STRING2_ARRAY('{0}<0'), SDO_STRING2_ARRAYSET(SDO_STRING2_ARRAY('<new value>')));

    commit;

    end;

    /

    This script changes any cell value less than 0 on band 0 to a new value.

Answers

  • Fechen-Oracle
    Fechen-Oracle Member Posts: 52 Employee
    Answer ✓

    Currently GeoRaster doesn't support NODATA value as binary_double_infinity. Will it be possible to use an actual value as NODATA in the raster?

  • Simon Greener
    Simon Greener Member Posts: 810 Silver Badge

    How can I recode the currently loaded GeoRaster with the -Infinite values?

  • Fechen-Oracle
    Fechen-Oracle Member Posts: 52 Employee

    From your script above, it seems that all of your normal pixel values are above 0. If so, you can use the following script to change the -infinity value to another value <new value>:

    declare

    gr sdo_georaster;

    begin

    select raster into gr from carbon where id=1;

    sdo_geor_ra.rasterUpdate(gr, 0, SDO_STRING2_ARRAY('{0}<0'), SDO_STRING2_ARRAYSET(SDO_STRING2_ARRAY('<new value>')));

    commit;

    end;

    /

    This script changes any cell value less than 0 on band 0 to a new value.