2

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!

asked Apr 11, 2013 at 9:31

1 Answer 1

3

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.

answered Apr 11, 2013 at 14:46
1
  • Thanks a lot! This explains the trick pretty well, because I'm using a raster-resolution of 0.02m. Commented Apr 11, 2013 at 21:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.