A Julia package that converts geospatial data into Gmsh geometry (.geo) and
mesh (.msh) files. Built on the JuliaGeo
ecosystem — GeoInterface, GeometryOps, Proj, ArchGDAL — and accepts any
GeoInterface-compatible source: Shapefiles, GeoJSON, GeoPackage, GeoParquet,
NaturalEarth data, or raw geometries.
Flat 2D meshes from any geospatial boundary:
| Iberian Peninsula | Catalonia | Australia — geometry | Australia — mesh |
![]() |
![]() |
![]() |
![]() |
3D terrain manifolds by sampling a Digital Elevation Model at every mesh node:
| Mont Blanc | Everest |
![]() |
![]() |
- Universal reader — load any geospatial format (Shapefile, GeoJSON, GeoPackage, GeoParquet, …) through a single
read_geodatacall backed by GDAL. Read directly from ZIP archives via/vsizip/. - Reproject — convert between coordinate systems via Proj.jl (e.g. geographic degrees → UTM metres).
- Simplify —
MinEdgeLengthremoves short edges;AngleFiltersuppresses zig-zag spikes; compose algorithms with∘. - Segmentize — subdivide long edges to control maximum element size.
- Rescale — normalise geometry into a dimensionless bounding box so
mesh_sizeis consistent. - 3D terrain — lift a 2D mesh to terrain elevation by sampling a DEM raster at every node.
- Output —
.geoscript or.mshfile via the Gmsh API; linear/quadratic elements, triangle or quad recombination.
using Pkg
Pkg.add(url = "https://github.com/JordiManyer/GeoGmsh.jl")using GeoGmsh, NaturalEarth
# No files needed — NaturalEarth.jl provides built-in country boundaries
countries = naturalearth("admin_0_countries", 110)
geoms_to_msh(countries, "france";
select = row -> get(row, :NAME, "") == "France" && row.ring == 1,
target_crs = "EPSG:3857",
simplify_alg = MinEdgeLength(tol = 5_000.0),
bbox_size = 100.0,
mesh_size = 2.0,
)
# → france.mshusing GeoGmsh
# 3D terrain mesh from a bounding box + DEM
geoms_to_msh_3d("bbox.geojson", "dem_utm.tif", "terrain";
target_crs = "EPSG:32632",
simplify_alg = MinEdgeLength(tol = 500.0),
mesh_size = 500.0,
)
# → terrain.msh (node z-coordinates sampled from DEM)See the documentation for the full pipeline guide, API reference, and worked examples.
- Natural Earth: naturalearthdata.com — free vector map data.
- NUTS: Eurostat / GISCO, © European Union.
- ASGS Edition 3: Australian Bureau of Statistics.
- Copernicus GLO-30 DEM: © DLR / Airbus.





