Go to file
pramsey 24ac4f1e50 Merge branch 'main' of github.com:libgeos/geos 2024-08-22 15:38:21 -07:00
.github/workflows Turn MacOS CI back on 2024-08-22 15:38:09 -07:00
benchmarks Port of JTS [RelateNG](https://github.com/locationtech/jts/pull/1052), rewrite of boolean predicates and relate matrix calculations. 2024-08-13 09:14:06 -07:00
capi Add -Wsuggest-override for gcc, and add missing override qualifiers (#1138) 2024-08-16 01:34:55 +02:00
cmake Stop using deprecated exec_program command in cmake, references #1102 2024-06-06 12:30:11 -07:00
debian Complete Note#1 in the http://wiki.osgeo.org/wiki/GEOS_Provenance_Review to get out of incubation. 2012-01-16 18:00:20 +00:00
doxygen Merge in hugo web site and associated support files. 2021-10-21 12:23:13 -07:00
examples Remove binary from repository and add to gitignore, closes #1145 2024-08-16 12:26:54 -07:00
include Merge branch 'main' of github.com:libgeos/geos 2024-08-22 14:48:05 -07:00
src FIX: 3D coordinates handling of GeoJSON MultiLineString (#1151) 2024-08-22 15:13:39 -07:00
tests FIX: 3D coordinates handling of GeoJSON MultiLineString (#1151) 2024-08-22 15:13:39 -07:00
tools Include stdc++ in static linking, references GH-783 2023-03-08 15:25:22 -08:00
util Add -Wsuggest-override for gcc, and add missing override qualifiers (#1138) 2024-08-16 01:34:55 +02:00
web Add DL link for beta1 package 2024-08-16 11:59:21 -07:00
.astylerc Apply 4-spaces standard indenting, 2019-02-01 11:18:06 -08:00
.codecov.yml Squashed commit of the following: 2020-04-16 15:31:11 -07:00
.drone-1.0.yml [drone] Update link to syntax documentation 2022-02-26 10:31:10 +01:00
.editorconfig Remove redundant EditorConfig properties 2020-03-31 11:11:53 +02:00
.git-blame-ignore-revs Add reformatting commit to ignorable commits in blame 2019-02-01 11:25:13 -08:00
.gitignore Streamline git ignores 2024-06-19 14:37:26 +02:00
.gitlab-ci.yml Fix gitlab-ci make distcheck 2023-06-28 17:26:26 -04:00
.gitpod.yml First gitpod file 2022-02-25 17:26:07 -08:00
.mailmap Amend a few more .mailmap entries 2022-11-25 21:13:02 +13:00
AUTHORS Update Martin's email address 2018-08-01 19:13:27 -04:00
CMakeLists.txt Establish minimum CMake version 3.15 (#1143) 2024-08-16 12:27:46 -07:00
CODE_OF_CONDUCT.md Fix doc links, etc 2022-03-01 10:43:56 -08:00
COPYING Fix FSF address in license file (#662) 2013-09-10 07:06:18 +00:00
DEVELOPER-NOTES.md Update DEVELOPER-NOTES.md 2024-05-23 20:39:12 -07:00
HOWTO_RELEASE GEOS 3.12.1, 3.11.3, and 3.10.6 release notices 2023-11-11 23:35:23 -05:00
INSTALL.md Doc: Update doc references to C++11 2023-01-19 20:17:51 -05:00
NEWS.md Merge branch 'main' of github.com:libgeos/geos 2024-08-22 09:00:54 -07:00
README.md Remove AppVeyor testing (#737) 2022-11-27 19:31:25 -05:00
Version.txt bump version to next release candidate 2024-08-16 11:57:36 -07:00
configure Have ./configure --enable-debug use RelWithDebInfo build type 2022-03-03 18:21:15 +01:00

README.md

GEOS -- Geometry Engine, Open Source

GEOS is a C++ library for performing operations on two-dimensional vector geometries. It is primarily a port of the JTS Topology Suite Java library. It provides many of the algorithms used by PostGIS, the Shapely package for Python, the sf package for R, and others.

More information is available the project homepage.

The official Git repository is at GitHub.

Build Status

CI Status CI Status CI Status
GitHub github Bessie bessie Debbie debbie
GitLab CI gitlab-ci Bessie32 bessie32 Winnie winnie
Berrie berrie Dronie dronie
Berrie64 berrie64

Community Resources

Build/Install

See the INSTALL file.

Reference Docs

See also the C API tutorial and the C++ API tutorial. There are code examples in the code repository.

Client Applications

Using the C interface

GEOS promises long-term stability of the C API. In general, successive releases of the C API may add new functions but will not remove or change existing types or function signatures. The C library uses the C++ interface, but the C library follows normal ABI-change-sensitive versioning, so programs that link only against the C library should work without relinking when GEOS is upgraded. For this reason, it is recommended to use the C API for software that is intended to be dynamically linked to a system install of GEOS.

The geos-config program can be used to determine appropriate compiler and linker flags for building against the C library:

CFLAGS += `geos-config --cflags`
LDFLAGS += `geos-config --ldflags` -lgeos_c

All functionality of the C API is available through the geos_c.h header file.

Documentation for the C API is provided via comments in the geos_c.h header file. C API usage examples can be found in the GEOS unit tests and in the source code of software that uses GEOS, such as PostGIS and the sf package for R.

Using the C++ interface

The C++ interface to GEOS provides a more natural API for C++ programs, as well as additional functionality that has not been exposed in the C API. However, developers who decide to use the C++ interface should be aware that GEOS does not promise API or ABI stability of the C++ API between releases. Breaking changes in the C++ API/ABI are not typically announced or included in the NEWS file.

The C++ library name will change on every minor release.

The geos-config program can be used to determine appropriate compiler and linker flags for building against the C++ library:

CFLAGS += `geos-config --cflags`
LDFLAGS += `geos-config --ldflags` -lgeos

A compiler warning may be issued when building against the C++ library. To remove the compiler warning, define USE_UNSTABLE_GEOS_CPP_API somewhere in the program.

Commonly-used functionality of GEOS is available in the geos.h header file. Less-common functionality can be accessed by including headers for individual classes, e.g. #include <geos/algorithm/distance/DiscreteHausdorffDistance.h>.

#include <geos.h>

C++ usage examples can be found in examples.

Using other languages

GEOS has bindings in many languages, see the bindings page.

Documentation

API documentation can be generated using Doxygen. Documentation is not included in the default build. To build the documentation, run:

cmake -DBUILD_DOCUMENTATION=YES
cmake --build . --target docs

Style

To format your code into the desired style, use the astyle version included in source tree:

tools/astyle.sh <yourfile.cpp>

Testing

See documentation in tests/README.md.

Tools