Open model generator for 3D printable geography based on OpenStreetMap.
Find a file
2025-05-18 23:21:15 -07:00
data add readme 2025-05-18 21:54:55 -07:00
media add example screenshot 2025-05-18 21:54:59 -07:00
src reduce elev distortion from blocking 2025-05-18 23:21:15 -07:00
.gitignore add .gitignore 2025-05-18 21:54:57 -07:00
Dockerfile initial commit 2025-05-18 21:54:39 -07:00
LICENSE add license 2025-05-18 21:54:59 -07:00
README.md add example screenshot 2025-05-18 21:54:59 -07:00
requirements.txt parallelize rendering 2025-05-18 21:54:46 -07:00

Geo3DP

Open model generator for 3D printable geography based on OpenStreetMap.

example 3d map rendering

Downloading GIS Data

Geo3DP requires 2 types of data files as input:

  • OpenStreetMap data as a .osm.pbf file. Available via OSM by the Slice.
  • Elevation data as a GeoTiff file. Available from the SRTM GL1 dataset via OpenTopography.

Usage

The included Dockerfile takes care of installing dependencies. To run with Docker, (using the ./data folder for input and output files):

docker build -t geo3dp:latest ./
docker run --rm -it -v "$(pwd)/data:/app/data" geo3dp:latest \
    --osm "/app/data/<name of .osm.pbf file>" \
    --topo "/app/data/<name of .tif file>" \
    --bbox="<min. longitude>,<min. latitude>,<max. longitude>,<max. latitude>" \
    --edge-len "<length of long edge of model, typically in mm>" \
    --output "/app/data/output.stl"
  • Latitudes and longitudes are encoded as decimals. That is, values south of the equator or west of the prime meridian are expressed as negative numbers.
  • Note the "=" and quotes on the --bbox argument so that negative numbers are not parsed as separate CLI arguments.

Other available options include:

  • --square: crops the model area to a square centered within the bounding box
  • --baseplate-h: adjusts the height of the rectangular base
  • --water-cutouts: creates through holes where there are water features

Parallel Rendering

To improve performance, Geo3DP automatically splits the model area into multiple tiles to parallelize rendering across available CPU cores. In general, the more CPU cores available to the Docker engine, the faster a model will render. The number of tiles per side can be adjusted manually with the --slices option. Refer to --help for more details.

Known Issues

Combining Rendered Meshes

Due to limitations of the OpenSCAD STL exporter/importer, Geo3DP does not perform a proper union calculation of the resulting tiled geometry, but rather combines the tiled meshes by aligning them side-by-side. This results in a final STL file with a nonsensical internal geometry, but 3D printing slicers don't seem to mind. This issue may be at least partially addressed by running with --slices=1 to turn off tiling.

Topography Smoothing

Geo3DP applies simplistic smoothing to the computed elevation map to mitigate artifacts in the GeoTiff data. The smoothing algorithm works well in most cases, but could be improved to better handle smoothing at the edges of the model and consistency across varying map resolutions.