Ticket #1356 (closed defect: invalid)

Opened 18 months ago

Last modified 17 months ago

[raster] srid in raster_columns view is zero

Reported by: bnordgren Owned by: pracine
Priority: medium Milestone: PostGIS 2.0.0
Component: raster Version: trunk
Keywords: Cc:

Description

Not sure if this is a bug or not. As of r8322, I tried:

raster2pgsql.py -r $asciigrid -t gfed.burned_area -s 4326 -F | psql gfed

(It's a tiny raster so no blocking. Also, "gfed" is a brand new database created after r8322 was installed.)

The raster_columns view reports srid=0 as follows:

gfed=# select r_table_schema, r_table_name, r_raster_column, srid from raster_columns ; 
 r_table_schema | r_table_name | r_raster_column | srid 
----------------+--------------+-----------------+------
 gfed           | burned_area  | rast            |    0
(1 row)

But the raster itself knows it's srid:

gfed=# select ST_srid(rast) from gfed.burned_area ; 
 st_srid 
---------
    4326
(1 row)

I looked thru the ticket related to the conversion of raster_columns to a view, but didn't see anything declaring this intent (I could have missed it tho.)

Change History

follow-up: ↓ 2   Changed 18 months ago by dustymugs

Are any constraints specified on the raster table? You can add the constraints using one of the AddRasterConstraints? functions. All values in the view raster_columns (except for catalog, schema, table and column) are derived from table constraints, so if your raster table/column has no constraints, most of the columns in raster_columns will be empty or default to the appropriate unknown value.

in reply to: ↑ 1   Changed 18 months ago by bnordgren

Replying to dustymugs:

Are any constraints specified on the raster table? You can add the constraints using one of the AddRasterConstraints? functions.

I did not add any constraints. The table was created with the sql generated by raster2pgsql.py.

This may be a nonissue...it sounds like it's working the way you intend. I just got confused by the "0". :)

  Changed 18 months ago by dustymugs

raster2pgsql.py is currently stunted as far as adding any constraints to the rasters loaded into the table. This is because of the upcoming replacement C-based loader which will do all the appropriate constraint setting (assuming you flag it to) so no effort is being made to update the python version.

Should be a non-issue. By default, if a raster column does NOT have a SRID constraint, the view will have the SRID column default to SRID_UNKNOWN (which is 0).

  Changed 17 months ago by dustymugs

  • status changed from new to closed
  • resolution set to invalid

Invalid as behavior is as expected when no SRID constraint is set.

Note: See TracTickets for help on using tickets.