2

This is a follow-up question (or inverse) of the question Converting a PostGIS raster back to vector.

I am trying to create a workflow that converts a PostGIS raster into a regular grid of polygons, which will be then used to work with vector datasets (e.g. finding distances or even performing map algebra with another vector grid). Hopefully, this will circumvent the speed issues with PostGIS rasters.

My question is:

After converting a raster A to vector using ST_DumpAsPolygons or ST_Polygon, is there an efficient way to convert the polygon grid back into a raster that is compatible with the original raster A?

I know that one can "burn" an individual line or other geometry into a raster as ST_AsRaster. But I'm interested in an inverse function of ST_Polygon that converts a regular polygon grid back to raster form.

tinlyx
  • 11,057
  • 18
  • 71
  • 119
  • 1
    Did you read this? http://geospatialelucubrations.blogspot.com/2014/05/a-guide-to-rasterization-of-vector.html – Pierre Racine Jun 01 '21 at 14:53
  • @PierreRacine Thanks! I guess what I asked about here is a special case of the linked article. It's probably the simplest special case because the vector to rasterize came from a raster and is already regular. – tinlyx Jun 01 '21 at 16:42

0 Answers0