[GIS] Difference in raster size using raster2pgsql

loadingpostgispostgresqlraster

I use the PostGIS-build-in raster2pgsql to load SAGA-raster into the db. I tried to grid them into 100×100-tiles, just as seen in the code:

/usr/lib/postgresql/9.2/bin/raster2pgsql -s 32632 -a -F -Y ~/Desktop/examplerast.sdat -t 100×100 import.exampletable | psql testrun -h localhost -p 5432 -U dbmaster

The strange thing is, that tiles in PostgreSQL/PostGIS have doubled dimensions: 200×200; as can be seen here:

select st_asewkt(st_envelope(rast)) from grids.exampletable limit 1;


SRID=32632;POLYGON((589203.15 5954785.35,589203.15 5954787.35,589205.15 5954787.35,589205.15 5954785.35,589203.15 5954785.35))
(1 row)

In order to achieve the desired 100×100-tiles I have to load them with a dimension -t 50x50

Why this doubling of dimensions? How to get rid of it? Thanks in advance!

Best Answer

What is the the output of

SELECT ST_Metadata(rast) FROM gids.exampletable LIMIT 1

The -t flag of raster2pgsql dictates the number of pixels along the X and Y axes for each tile. For your -t of 100x100, each tile will have dimensions of 100 x 100 or less.