Instructions and scripts to download and process OSM files for OpenMapKit deployments. This is a simple script that ingests a shapefile to produce a smaller, reduced OSM files for loading onto OpenMapKit.
- Shapefile with one or more polygon features. Shapefile should include a attribute field for naming output files (i.e ID field).
- OSM PBF file. Easily downloaded from HOT Export Tool. Example public export of Eastern Province in Zambia.
- Python 2.7+
- ogr2ogr (GDAL)
- OSMConvert
- Create an export job on the HOT Export Tool. Select and download the
.pbf
file format. - Mark AOI and OUTPUT IDs within your shapefile.
- Run the script:
./scripts/processOSM.sh /path/to/shapefile /path/to/osm.pbf AOI_ID OUTPUT_ID
Example:
./scripts/processOSM.sh /working/areas.shp /working/areas_osm.pbf ID ID
Use the working
folder to house your input OSM and AOI shapefile. This will help keep your input and output data organized. The script places all outputs into the output
folder.