Raster Clip Worker
Processes raster clip operations to extract raster data within a boundary.
Overview
The raster clip worker extracts raster data that intersects with a clipping boundary geometry.
Job Type
raster_clip
Input Parameters
{
"raster_dataset_id": 125,
"clip_geometry": {
"type": "Polygon",
"coordinates": [ ... ]
},
"output_dataset_id": 126
}
Parameters
raster_dataset_id(required): Source raster dataset IDclip_geometry(required): GeoJSON geometry for clipping boundaryoutput_dataset_id(required): Output raster dataset ID
Output
Creates a new raster dataset with clipped data:
Raster data within the clipping boundary
Original raster properties preserved
Proper spatial reference maintained
Algorithm
The worker uses PostGIS raster functions to:
Transform clipping geometry to raster SRID
Clip raster to boundary using
ST_ClipStore clipped raster in output table
Update raster metadata
Example
# Enqueue a raster clip job via API
curl -X POST "https://example.com/api/raster_clip_run.php" \
-H "Content-Type: application/json" \
-d '{
"raster_dataset_id": 125,
"clip_geometry": {
"type": "Polygon",
"coordinates": [[[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]]
},
"output_dataset_id": 126
}'
Background Jobs
This analysis runs as a background job. The worker:
Fetches queued
raster_clipjobsValidates input parameters
Executes PostGIS raster clip operations
Creates output raster dataset
Marks job as completed
Performance Considerations
Processing time depends on raster size and boundary complexity
Large rasters may require significant memory
Consider resampling for very large rasters
Clipping boundaries should match raster resolution