Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

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

The strange thing is, that tiles in PostgreSQL/PostGIS have doubled dimensions: 200x200; 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 100x100-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!

share|improve this question
add comment

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

share|improve this answer
    
Thanks a lot! This explains the trick pretty well, because I'm using a raster-resolution of 0.02m. –  knutella Apr 11 '13 at 21:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.