Skip to content

Installation

nimgeos requires a working installation of libgeos_c at both compile time and runtime. The GEOS C library provides the geometry engine that all operations delegate to.

Prerequisites

macOS

brew install geos

Debian / Ubuntu

sudo apt-get install libgeos-dev

Fedora / RHEL

sudo dnf install geos-devel

Windows

Windows support is experimental. GEOS binaries can be obtained from vcpkg, conda-forge, or by building from source.

# via vcpkg
vcpkg install geos

With the MSVC toolchain the linker must find the import library (geos_c.lib) through the LIB environment variable and geos_c.dll through PATH โ€” with vcpkg those are the installed\<triplet>\lib and installed\<triplet>\bin directories. With MinGW, libgeos_c must be on the linker's search path (-lgeos_c).

Verify the installation

Confirm that geos-config is on your PATH and reports a version:

geos-config --version   # e.g. 3.12.1

If this command fails, the GEOS development headers are not installed or geos-config is not on PATH.

Install the nimble package

nimble install nimgeos

Add to a project

Add the dependency to your .nimble file:

requires "nimgeos"

Platform support

Platform Status
Ubuntu LTS โœ… Supported
macOS โœ… Supported
Windows ๐Ÿงช Experimental

Build documentation

nimble docs

Output is written to src/htmldocs/.

Run tests

nimble test

Code example

import nimgeos

# Verify GEOS is reachable
var ctx = initGeosContext()
echo "GEOS version: ", ctx.version()   # e.g. 3.12.1