Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3095 closed defect (invalid)

raster2pgsql ignores srid, outdb empty

Reported by: martinl Owned by: Bborie Park
Priority: medium Milestone: PostGIS 2.1.7
Component: raster Version: 2.1.x
Keywords: raster2pgsql Cc:

Description

I have imported GeoTIFF (1) to PostGIS as

IN-DB

raster2pgsql -s 5514 -Y dmt.tif ukol_1.dmt | psql pokusnik 2>err

and OUT-DB

raster2pgsql -s 5514 -R `pwd`/dmt.tif ukol_1.dmt_link | psql pokusnik 2>err

Two issues confuses me:

SELECT r_table_schema,r_table_name,srid,out_db FROM raster_columns;
 r_table_schema | r_table_name | srid | out_db 
----------------+--------------+------+--------
 ukol_1         | dmt          |    0 | 
 ukol_1         | dmt_link     |    0 | 
  1. srid is 0 even I entered -s 5514 (this code exists in spatial_ref_sys)
  1. out_db is empty in both cases

(1) http://training.gismentors.eu/geodata/eu-dem/dmt.zip

Change History (2)

comment:1 by robe, 9 years ago

Resolution: invalid
Status: newclosed

You are reading raster_columns table. That gets populated by constraints.

You need to add the -C to your load to make that populate right.

If you just want to confirm your srid is set do

SELECT ST_SRID(rast)
from dmt LIMIT 1

Please post future questions like this not to our bug tracker, but to users mailing list

http://lists.osgeo.org/mailman/listinfo/postgis-users

in reply to:  1 comment:2 by martinl, 9 years ago

Replying to robe:

You need to add the -C to your load to make that populate right.

oh, it really hidden and confusing. I would expect opposite behaviour, create constraints by default, optionally could be switched off by flag.

Thanks for quick answer. Martin

Note: See TracTickets for help on using tickets.