Downloads administrative boundary datasets from the Humanitarian Data
Exchange (HDX) Common Operational Datasets (COD) platform and imports
them into OpenSPP areas with polygon geometries. Extends spp.area
with P-code fields for humanitarian coordination and provides GPS-based
area lookup using PostGIS spatial queries.
- Sync COD dataset metadata from HDX API by country
- Auto-detect field mappings from GeoJSON (P-code, name, parent P-code) using HXL tags
- Import admin boundaries with polygons from HDX or manually uploaded GeoJSON files
- Match imported features to existing areas by P-code or create new areas
- GPS-based area lookup using PostGIS
ST_Containsfor point-in-polygon queries - Standardize area identification with HDX P-codes for inter-agency coordination
| Model | Description |
|---|---|
spp.hdx.cod.source |
Tracks COD datasets available from HDX (one per country) |
spp.hdx.cod.resource |
Individual admin level dataset within a COD (e.g., Level 3) |
spp.hdx.cod.import.wizard |
Multi-step wizard to download from HDX or upload GeoJSON |
spp.area (extended) |
Adds hdx_pcode field and GPS
lookup methods |
After installing:
- Navigate to Area > Areas > HDX Integration > COD Sources
- Create a new COD Source, select a country
- Click Sync from HDX to fetch available admin level resources from HDX API
- Review detected resources under the Admin Levels tab
- Click Detect Field Mappings on each resource to auto-detect P-code and name fields
- Use Import COD menu to run the import wizard
- Menu: Area > Areas > HDX Integration > COD Sources
- Import: Area > Areas > HDX Integration > Import COD
- Area Records: Extended with HDX P-code field visible in area form view
| Group | Access |
|---|---|
group_hdx_user |
Read access to COD sources and resources |
group_hdx_manager |
Full CRUD on sources/resources, sync from HDX, run imports |
spp.area.find_by_coordinates(latitude, longitude, level=None)- Find area containing GPS pointspp.area.find_all_containing(latitude, longitude)- Find all areas in hierarchy containing pointspp.area.find_by_pcode(pcode)- Find area by HDX P-code or fallback to code field- Inherit
spp.hdx.cod.sourceto add country-specific dataset discovery logic - Inherit
spp.hdx.cod.import.wizard._process_features()to customize import behavior
spp_area, spp_gis
Table of contents
- Initial migration to OpenSPP2
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
- OpenSPP.org
Current maintainers:
This module is part of the OpenSPP/OpenSPP2 project on GitHub.
You are welcome to contribute.






