I have a raster with a SRID of 4326 and a polygon of SRID 2275. The raster was uploaded to postgis with 90x90 tiles using the following raster2pgsql cmd...
raster2pgsql -s 4326 -I -M -b 1 nlcd_2011_clip_wgs84.tif -F -t 90x90 public.nlcd_2011_clip_wgs84 | psql -h localhost -U postgres -d routing
I need to clip raster to extent of polygon (different SRID).
I am having some success using the following postgis query...
DROP TABLE IF EXISTS nlcd_clip_2275; SELECT rid, rast, filename, st_intersects(polygon.geom, ST_Transform(raster.rast,2275))AS result INTO nlcd_clip_2275 FROM public.nlcd_2011_clip_wgs84 as raster, public.buffer2275 polygon; DELETE FROM nlcd_clip_2275 WHERE result = false
But the processing is slooooooowww!
Is there a faster postgis logic for both projecting and clipping the raster?