I have a raster table in PostGIS. When I run ST_SetValue(rast, geom , value) on it to change the pixel value at a point, it works very slowly. Do you know how can I create spatial index for a raster column? (I could not create it using PgAdmin interface with gist method)

  • 1
    Did you tile your raster? It makes a big difference to pixel access speeds and spatial search in general. – John Powell Jul 12 at 16:36
  • Usually, for rasters, you tile the bounding box of each tile, even though mutliple tiles constitute a complete coverage. Obviously, indexing each pixel is pointless and indexing the bounding box of the raster is pointless, but indexing each sub-tile of the raster will make this a lot quicker, as you have to open much fewer points before you can run ST_SetValue. See this answer, for example. – John Powell Jul 15 at 11:21
  • or this one: gis.stackexchange.com/questions/43053/… – John Powell Jul 15 at 11:25

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.