I am new to postgresql. I have imported a 256kb sample raster (.tiff) into postgres with tilesize 100x100. Now I need to select the area (rectangle) from the center of the image using sql query. Then to populate it into another raster table which then need to be visualize using QGIS.

Below is the raster and the red box is the area I want to select in postgres.

enter image description here

I understand that it is the similar situation in this post here. But I do not really have any clue how to begin, as I do not have the coordinates or other information.

Can someone help me with the first step on selecting only the bounded area within the raster?

Thank you.

  • I've never played with PostGIS rasters before, but my guess is that you need to use the ST_Clip function. I think you want something like the last example on the help page. – travis Oct 30 '13 at 17:47
  • I sort of managed to achieve what i wanted using ST_MakeEnvelope and ST_Insection function. Thanks travis for your response! – Adobeff Nov 6 '13 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.