[postgis-tickets] [PostGIS] #3626: Is there a existing ticket for raster nodata larger than numeric(16, 10)?

PostGIS trac at osgeo.org
Sun Sep 18 16:28:45 PDT 2016


#3626: Is there a existing ticket for raster nodata larger than numeric(16,10)?
-------------------------+--------------------------------------
  Reporter:  pauldzy     |      Owner:  robe
      Type:  defect      |     Status:  closed
  Priority:  low         |  Milestone:  PostGIS 2.3.0
 Component:  raster      |    Version:  2.2.x
Resolution:  worksforme  |   Keywords:  raster nodata constraint
-------------------------+--------------------------------------
Changes (by robe):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 Paul,

 Can you tell me which version of PostGIS you are running:


 {{{
 SELECT postgis_full_version();
 }}}

 I tested on PostGIS 2.2.2 as well as upcoming PostGIS 2.3.0rc1 and I'm not
 seeing an issue.


 To test I did this:


 {{{
 CREATE TABLE rt(rid integer, rast raster);

 INSERT INTO rt(rid, rast)
 SELECT 1, ST_AddBand(ST_MakeEmptyRaster(10, 10, 10, 10, 2, 2, 0, 0, 0), 1,
 '64BF', -1, -2147483647);

 SELECT AddRasterConstraints('rt', 'rast')

 }}}

 Which created a constraint as expected that looks like this:


 {{{
 ALTER TABLE rt
   ADD CONSTRAINT enforce_nodata_values_rast CHECK
 (_raster_constraint_nodata_values(rast) =
 '{-2147483647.0000000000}'::numeric[]);
 }}}

 I also tried


 {{{
 CREATE TABLE rt2(rid integer, rast raster);

 INSERT INTO rt2(rid, rast)
 SELECT 1, ST_AddBand(ST_MakeEmptyRaster(10, 10, 10, 10, 2, 2, 0, 0, 0), 1,
 '64BF', -1, -2147483647.1234567890);

 SELECT AddRasterConstraints('rt2', 'rast');

 }}}

 Which ends up creating a constraint


 {{{
 ALTER TABLE rt2
   ADD CONSTRAINT enforce_nodata_values_rast CHECK
 (_raster_constraint_nodata_values(rast) =
 '{-2147483647.1234600000}'::numeric[]);
 }}}

 So though you losse some precision, works too.

 And my raster_columns output looks like this:


 {{{
 SELECT r_table_name, nodata_values
  FROM raster_columns;

  r_table_name | nodata_values
 --------------+---------------
  rt           | {-2147483647}
  rt2          | {-2147483647.123456}
 (1 row)

 }}}

 So both look fine to me.  Is it possible that maybe not all your rasters
 have the same no data value?

 If you can give the error/notice you are seeing that would help.

 I'm marking this as a worksforme to get it out of the way.  Feel free to
 reopen if you have an example with PostGIS 2.2.2+ that replicates the
 issue or provide more info.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3626#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list