Service that accepts queue requests and adds incline values to an OSW dataset.
- Listens to
REQUEST_TOPIC/REQUEST_SUBSCRIPTION. - Downloads the input OSW zip from
data.dataset_url. - Extracts files and reads
edges+nodesGeoJSON. - Resolves DEM tiles (NED 1/3 arc-second), computes incline via
osw-incline. - Updates edges with incline values.
- Creates a result zip and uploads to storage.
- Publishes success/failure status to
RESPONSE_TOPIC.
- Enriching street/path networks with incline for accessibility routing.
- Batch processing city-scale OSW datasets through queue-driven jobs.
- Running one-message-per-container jobs in CI/data pipelines, then auto-stopping the service.
- Processing very large GeoJSON inputs where zip validation is required before upload.
- Request received from queue.
- Request validated (
dataset_urlmust exist). - Incline processing executed.
- Output uploaded to storage.
- Response message published (with
success,message,file_upload_path, package versions). - Temporary files cleaned up.
- If
MAX_RECEIVABLE_MESSAGES > 0, service triggers graceful shutdown after processing available messages.
The project is built with Python + FastAPI.
| Software | Version |
|---|---|
| Python | 3.10+ |
PROVIDER=Azure
QUEUECONNECTION=xxx
STORAGECONNECTION=xxx
REQUEST_TOPIC=xxx
REQUEST_SUBSCRIPTION=xxx
RESPONSE_TOPIC=xxx
CONTAINER_NAME=xxx
MAX_CONCURRENT_MESSAGES=1 # Optional, default: 1
MAX_RECEIVABLE_MESSAGES=-1 # Optional, default: -1 (no receive limit)QUEUECONNECTION is used for queue consume/publish.
STORAGECONNECTION is used to download input and upload processed zip.
- Setup virtual environment:
python3.10 -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txtuvicorn src.main:app --reloadHealth endpoints:
GET /GET /healthGET|POST /pingGET|POST /health/ping
{
"messageId": "tdei_record_id",
"messageType": "workflow_identifier",
"data": {
"dataset_url": "https://.../input_osw.zip",
"user_id": "optional",
"jobId": "optional-job-id"
}
}{
"messageId": "tdei_record_id",
"messageType": "workflow_identifier",
"data": {
"message": "Successfully added inclination to the dataset.",
"success": true,
"file_upload_path": "https://.../jobs/<jobId>/<output>.zip",
"package": {
"python-ms-core": "x.y.z",
"osw-incline": "x.y.z"
}
}
}On failure, data.success=false and data.message contains the error reason.
.env is not required for unit tests.
Run tests:
python -m unittest discover -s testsRun coverage:
python -m coverage run --source=src -m unittest discover -s tests
coverage report
coverage html