I have a set of raster coverages. Some of them are really far from each other. When I use ST_Union function to union them, the function fill the area between them. I explain it in a simple example: I have a grid of polygons and select 2 of them (by their id) that are not neighbours.
Now, I have two different polygons in a table. Then, I used ST_AsRaster() to make two rasters out of the two polygons. At the end I used ST_Union() to make a union of those rasters.
select * INTO test1 from grid where id= 277765 or id = 277762; select st_asraster(tile_border,100,100, '8BSI'::text, 0, -1) as rast into test1_rast_1 from test1 ; select ST_Union(rast) into test1_rast_1_union from test1_rast_1;
I want the area between to be no-value but the ST_union fills it with 0. The created raster is as follows:
My real data consists of the raster coverages that are really far from each other and I have many layers that I want to union them. How can I use ST_Union in a way that it does not fill the area between the two geometries? because I think filling it for each iteration takes a long long time.