guidorice/libgeos.zig
Zig bindings for the GEOS C library; compile libgeos in your build.zig.
Zig bindings for the GEOS C library (libgeos)
GEOS (Geometry Engine, Open Source) is a C/C++ library for spatial computational geometry of the sort generally used by “geographic information systems” software. GEOS is a core dependency of PostGIS, QGIS, GDAL, and Shapely.
3.10.2-CAPI-1.16.0
0.9.1
, 0.10.0-dev
Requires only zig
. Don't forget to clone/init the submodule!
git clone --recurse-submodules https://github.com/guidorice/libgeos.zig.git
cd libgeos.zig/
zig build
zig build test
$ zig build --help
$ zig build run-ex1
Geometry A: POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))
Geometry B: POLYGON((5 5, 15 5, 15 15, 5 15, 5 5))
Intersection(A, B): POLYGON ((10 10, 10 5, 5 5, 5 10, 10 10))
std::runtime_error
, which is not currently
captured by the Zig wrapper code. As a result, there is no way to recover from
some error conditions, for example, failing to parse some WKT formatted string.
see issue #9std:runtime_error
conditions (see known issues)See also vendor/geos/README for how libgeos is updated within this repo.