Geoprocessing job lifecycle¶
Native application path: gRPC for live data and edits; PMTiles, GeoParquet and COG through the CDN. Start there for browser gRPC-Web setup, signed private URLs and regeneration after changes. OGC API and GeoServices REST examples below are compatibility workflows.
Server contract first¶
HonuaGeoprocessing and AsyncHonuaGeoprocessing operate registered OGC API
Processes exposed by Honua Server. They do not upload or execute arbitrary
Python code and expose no execution-backend selector.
| Item | Contract |
|---|---|
| Capability | process.ogc-api-processes |
| Discover / Describe | GET /ogc/processes/processes and GET /ogc/processes/processes/{processId} |
| Submit | POST /ogc/processes/processes/{processId}/execution (optional Idempotency-Key header, max 512 chars) |
| Status | GET /ogc/processes/jobs/{jobId} |
| Results | GET /ogc/processes/jobs/{jobId}/results |
| Cancel | DELETE /ogc/processes/jobs/{jobId} (200 OK confirmed terminal dismissed; 202 Accepted requested non-terminal; 409 Conflict terminal/unsupported) |
| Auth | HonuaClient / AsyncHonuaClient API key, bearer token, or refreshable auth provider |
| Result href | Same-origin absolute and relative links use the bound client. Off-origin links are refused unless explicitly allowlisted via with_approved_artifact_origins(...); allowlisted signed downloads never forward Honua credentials and refuse redirects. |
| Spilled streams | honua-feature-stream: URIs stay server-side; pass them into downstream processes via LayerReference.from_result(...) or ArtifactReference.from_results(...). |
Typed handles and vector chaining¶
Construct catalog-layer inputs, selections, CRS handles, result references, and
governed destinations with the typed models in honua_sdk.geoprocessing:
LayerReference.from_catalog_layer(layer_id, selection=..., output_crs=...)targets a catalog layer withLayerSelection(where,object_ids,bboxorgeometry/geometry_type/in_sr/spatial_rel,time/time_relation,out_fields) andCrsReference(outSrid).LayerReference.from_result(results, crs=...)andArtifactReference.from_results(results)extract inlinedata:URIs, spilledhonua-feature-stream:references, or inline GeoJSON outputs so one process's output feeds straight into the next (Buffer -> Clip -> Dissolve).LayerDestination(layer=..., target_srid=..., load_mode=...)targets governed persistence viasink.honua-layer(submit_persist_layer/persist_layer) and decodes its durableCommittedSinkReceipt.
Sync and async examples¶
For a single registered process, run the focused lifecycle script:
python examples/geoprocessing_job_lifecycle.py \
--process-id geometry.buffer \
--inputs-json '{"inputGeoJson":"{}","distance":100}'
For the full vector chain (discover/describe processes, authenticated submit
with Idempotency-Key, bounded poll and reconnect by job_id,
analytics.buffer-aggregate -> overlay.clip -> analytics.buffer-aggregate-managed,
governed persistence via sink.honua-layer, and Source query read-back), run
examples/geoprocessing_vector_chain.py in sync or async mode:
python examples/geoprocessing_vector_chain.py \
--source-layer-id 1 \
--clip-aoi-json '{"type":"FeatureCollection","features":[]}' \
--destination-layer buffered_output \
--reopen-service-id buffered_output
python examples/geoprocessing_vector_chain.py \
--async-mode \
--source-layer-id 1 \
--clip-aoi-json '{"type":"FeatureCollection","features":[]}' \
--destination-layer buffered_output \
--reopen-service-id buffered_output
These commands belong to the example scripts. The product honua CLI currently
has no process submission subcommands (honua gp inspect and honua gp logs
read job diagnostics only).
Truthful retries, timeouts, cancellation, and receipts¶
- No silent duplicate submission:
HonuaClientdoes not auto-retryPOSTrequests after ambiguous transport errors. Supply an explicitSubmissionOptions(idempotency_key=...)when submitting so a caller-driven replay after a lost response converges on the original durable job ID; a reused key with modified inputs surfaces409 Conflictwith itsTerminalFailureReceipt. - Client timeout vs server state:
wait_for_job(job, WaitOptions(timeout=..., dismiss_on_timeout=False))raisesGeoprocessingTimeoutError(a subclass of bothHonuaErrorandTimeoutError) carrying recoverableexc.job_idandexc.jobwithout cancelling the job, allowing callers to reconnect viagp.job(exc.job_id)and resume polling.wait(...)retains best-effort dismissal on timeout and records anyDismissOutcomeonexc.dismiss_outcome. - Requested vs confirmed cancellation:
dismiss_job(job_id)returns aDismissOutcomethat reportsstate="requested"on HTTP202 Accepted(or non-terminal status) andstate="confirmed"only when the server confirms terminaldismissedstatus on HTTP200 OK. Continue pollinggp.job(job_id)until a terminal state is confirmed. - Committed writes: When cancellation races after a sink commit, the server
preserves
status="successful"and emits aCommittedSinkReceipt(committed=True,features_written,batch_id) rather than claiming a rollback. - Machine-readable error receipts: HTTP failures (
401,403,404,409,410,413,503) preserveHonuaHttpError.receipt(TerminalFailureReceipt), andGeoprocessingJobErrorexposesjob_id,status, and any structuredreceipt.
Synchronous execution¶
respond_async=False lets the server return document outputs in the submission
response. The SDK marks that execution successful and stores its qualified
outputs in job.inline_results. Pass the job object to results() so the same
code also works when the server chooses asynchronous execution:
job = gp.submit_inputs("geometry.area", inputs, respond_async=False)
terminal = gp.wait(job, timeout=120)
outputs = gp.results(terminal)
The async client uses the same contract with await. A synchronous response may
have no durable job ID; retain the job object to retrieve its inline results.
Scope boundary: native GP vs honua-gp vs custom code¶
- Native GP (
honua-sdk):HonuaGeoprocessing/AsyncHonuaGeoprocessingtarget Honua Server's canonical OGC API Processes surface directly with typed handles, result interop (geopandas,raster), and truthful lifecycle control. - Desktop GIS compatibility layer (
honua-gp):honua-gpis a separate Apache-2.0 compatibility distribution for teams migrating legacy desktop GIS Python scripts; do not conflate its tool-emulation matrix with the nativehonua-sdkOGC Processes contract. - Unsupported custom-code authoring: Operator-authored custom Python GP
execution is AWS-Batch-only server-side (ADR-0063). The Python SDK provides
no custom-code authoring or submission API and no execution-backend selector.
Do not substitute
submit_inputs()orsubmit_request()for that surface.