SRTM3 elevation data are stored in HGT files each containing 1201x1201 values. I want to store this information in a PostGIS raster column with a single band.

To optimize my queries, I wanted to split these files in a smaller set. For example 50x50 (and some with 50x51 and 51x50 for the edge values).

When I ran the raster2pgsql command, it has generated a table with this constraint :

enforce_same_alignment_rast" CHECK (st_samealignment(rast, '010000000...'::raster))

It seems that it will fail the check if I split with my previous scheme. But 1201 is a prime number ...

So my question is this : is it possible to store different raster scale in the same raster column ? And if yes, will it have any negative impact ?

1 Answer 1


I misunderstood the St_SameAlignement function.

As the doc says :

ST_SameAlignment — Returns true if rasters have same skew, scale, spatial ref, and offset (pixels can be put on same grid without cutting into pixels) and false if they don't with notice detailing issue.

So the width and height of a raster don't have any impact. Only the skew (rotation), scale (the size of a square inside the raster), spatial ref (the spatial reference system SRID) and offset.

Your Answer

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

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