1.9 KiB
Clip Worker
Processes clip operations to extract features within a boundary.
Overview
The clip worker extracts features from a dataset that intersect with a clipping boundary geometry.
Job Type
clip
Input Parameters
{
"dataset_id": 123,
"clip_geometry": {
"type": "Polygon",
"coordinates": [ ... ]
},
"output_dataset_id": 124
}
Parameters
dataset_id(required): Source dataset IDclip_geometry(required): GeoJSON geometry for clipping boundaryoutput_dataset_id(required): Output dataset ID
Output
Creates a new dataset with clipped features:
- Features that intersect the clipping boundary
- Geometry clipped to boundary
- Original attributes preserved
Algorithm
The worker uses PostGIS ST_Intersection to:
- Transform clipping geometry to dataset SRID
- Find features that intersect the boundary
- Clip geometries to boundary
- Store results in output table
Example
# Enqueue a clip job via API
curl -X POST "https://example.com/api/datasets_clip_run.php" \
-H "Content-Type: application/json" \
-d '{
"dataset_id": 123,
"clip_geometry": {
"type": "Polygon",
"coordinates": [[[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]]
},
"output_dataset_id": 124
}'
Background Jobs
This analysis runs as a background job. The worker:
- Fetches queued
clipjobs - Validates input parameters
- Executes PostGIS clip queries
- Creates output dataset
- Marks job as completed
Performance Considerations
- Processing time depends on dataset size and boundary complexity
- Complex clipping boundaries may slow processing
- Spatial indexes improve intersection performance
- Consider simplifying geometries before clipping
PostGIS
Mobile
QGIS
MapBender
GeoServer
GeoNode
GeoNetwork
Novella
Solutions