Opened 13 years ago

Closed 13 years ago

#1356 closed defect (invalid)

[raster] srid in raster_columns view is zero

Reported by: bnordgren Owned by: pracine
Priority: medium Milestone: PostGIS 2.0.0
Component: raster Version: master
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 (4)

comment:1 by Bborie Park, 13 years ago

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 comment:2 by bnordgren, 13 years ago

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". :)

comment:3 by Bborie Park, 13 years ago

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).

comment:4 by Bborie Park, 13 years ago

Resolution: invalid
Status: newclosed

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

Note: See TracTickets for help on using tickets.