[postgis-users] par_psql code for queries

Manaswini Ganjam manu.ganjam at gmail.com
Tue Nov 14 10:43:43 PST 2023


Hi, I want to do parallel processing for this code below:

CREATE TABLE clipped_rasters_f (
id serial PRIMARY KEY,
clipped_raster raster
filename text,
DECLARE
DO $$
);
min_lon numeric := -98;  -- Minimum Longitude
raster_row record;
min_lat numeric := 23;   -- Minimum Latitude
max_lon numeric := -74;  -- Maximum Longitude
crs integer := 4326;     -- Coordinate Reference System (CRS)
max_lat numeric := 41;   -- Maximum Latitude

BEGIN
FOR raster_row IN (SELECT id, filename, rast FROM gfdl_03_temp)
LOOP
INSERT INTO clipped_rasters (filename, clipped_raster_f)
SELECT raster_row.filename, ST_Clip(rast, ST_MakeEnvelope(min_lon, min_lat,
max_lon, max_lat, crs))
FROM gfdl_03_temp
WHERE id = raster_row.id;
END LOOP;
END $$; --&
Can someone guide me on understanding the mandatory edits in changing this
code or any postgis functions used in a query to convert to a par_psql
compatible query?

Thank you,
Manaswini Ganjam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20231114/a73c4ce5/attachment.htm>


More information about the postgis-users mailing list