Nim bindings to GEOS geometry library generated by nimterop.
Install GEOS library to your system. Check your package manager for available version.
sudo apt install libgeos-3.9.0
import geos
var context = GEOS_init_r()
var writer = GEOSWKTWriter_create_r(context)
GEOSWKTWriter_setRoundingPrecision_r(context, writer, 3)
var geometry = GEOSGeom_createPointFromXY_r(context, 1, 2)
echo GEOSWKTWriter_write_r(context, writer, geometry) # "POINT (1.000 2.000)"
GEOSWKTWriter_destroy_r(context, writer)
GEOS_finish_r(context)
# get headers
sudo apt install libgeos-dev
nimble install nimterop
./generate-nim-binding.sh
This copies GEOS header file to lib directory with some modifications. Then generates nim library into src directory and runs tests.