Official GEOS git repository
 
 
 
 
 
 
Go to file
pramsey 14b98cfd8f add note about trac milestone 2020-03-12 09:05:10 -07:00
benchmarks Add generic perf test for unary operations 2019-12-06 11:41:46 -05:00
capi Fix -Wmismatched-tags warning related to WK[T/B][Reader/Writer] 2020-02-13 09:22:34 +01:00
cmake Remove GIT_COMMIT_HASH entirely 2019-05-23 13:47:38 -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
doc Fix memory leak in GEOSLineMerge 2020-01-15 16:24:46 -05:00
examples/client Modernize CMake configuration 2019-05-16 15:19:23 -05:00
include Merge remote-tracking branch 'rouault/add_deleted_copyconstructors' 2020-03-02 13:11:46 -05:00
macros Autotools: Add std=c++11 automatically to the builds 2020-02-20 16:38:10 +01:00
src Fixed https://trac.osgeo.org/geos/ticket/894 and https://github.com/libgeos/geos/issues/285 2020-02-27 17:59:40 +03:00
swig Applying patches for Closes #742 2018-06-14 10:03:22 -05:00
tests reorder tests for #1018 2020-03-09 14:48:47 -07:00
tools Add berrie to jenkins slavebot worker runs - references #1017 for GEOS 3.9 2020-03-07 15:06:03 -05:00
.astylerc Apply 4-spaces standard indenting, 2019-02-01 11:18:06 -08:00
.azure-pipelines.yml Disable AzP MSVC C++20 build affected by compiler bug 2019-11-08 12:39:31 -05:00
.codecov.yml Disable coverage comments on PRs [ci skip] 2019-05-29 20:31:03 -04:00
.drone-1.0.yml Remark out valgrind tests. they are always failing 2020-02-17 15:16:59 -05:00
.editorconfig Modernize CMake configuration 2019-05-16 15:19:23 -05:00
.git-blame-ignore-revs Add reformatting commit to ignorable commits in blame 2019-02-01 11:25:13 -08:00
.gitignore Fix CMake build without tests 2019-11-30 11:35:13 -05:00
.gitlab-ci.yml [automake] Enable silent rule, use in Dronie and Gitlab-CI 2019-05-25 11:40:35 +02:00
.mailmap Add Paul van der Linden merge email 2019-05-16 20:24:53 +02:00
.travis.yml Update scanbuild job to clang 9 2020-02-21 16:54:37 +01:00
AUTHORS Update Martin's email address 2018-08-01 19:13:27 -04:00
CMakeLists.txt Update geos-config tool for consistency and escape paths 2020-02-17 14:25:27 +13:00
COPYING Fix FSF address in license file (#662) 2013-09-10 07:06:18 +00:00
HOWTO_RELEASE add note about trac milestone 2020-03-12 09:05:10 -07:00
INSTALL Move build section from README.md to INSTALL 2019-09-19 17:58:03 +02:00
Makefile.am Add in CMake artifacts necessary to build/check in the 2019-10-03 09:36:20 -07:00
NEWS Add berrie to jenkins slavebot worker runs - references #1017 for GEOS 3.9 2020-03-07 15:06:03 -05:00
README.md Fix README badge URLs 2020-01-14 12:58:18 -05:00
Version.txt Bump versions for master development to 3.9 2019-10-10 18:07:47 +00:00
acsite.m4 git-svn-id: http://svn.osgeo.org/geos/trunk@3855 5242fede-7e19-0410-aef8-94bd7d2200fb 2013-07-31 14:13:07 +00:00
appveyor.yml Try to get clean appveyor build 2019-05-23 14:44:21 -07:00
autogen.sh Stop symlinking README.md as README 2016-10-27 14:13:56 +00:00
configure.ac Autotools: Remove deprecated macros 2020-02-20 16:38:10 +01:00

README.md

GEOS -- Geometry Engine, Open Source

GEOS is a C++11 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.

Build status

branch / CI Debbie Winnie Dronie Travis CI GitLab CI AppVeyor Bessie Bessie32
master debbie winnie dronie travis gitlab-ci appveyor bessie bessie32
3.8 debbie winnie dronie travis gitlab-ci appveyor
3.7 debbie winnie dronie travis gitlab-ci appveyor

Build/install

See INSTALL file

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>

Documentation for the C++ API is available at https://geos.osgeo.org/doxygen/, and basic C++ usage examples can be found in doc/example.cpp.

Scripting language bindings

Ruby

Ruby bindings are part of GEOS. To build, use the --enable-ruby option when configuring:

./configure .. --enable-ruby

PHP

PHP bindings for GEOS are available separately from php-geos.

Python

Python bindings are available via:

  1. Shapely package.
  2. Calling functions from libgeos_c via Python ctypes.

Documentation

Doxygen documentation can be generated using either the autotools or CMake build systems.

Using Autotools:

cd doc
make doxygen-html

Using CMake:

cmake -DBUILD_DOCUMENTATION=YES
make docs

Style

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

tools/astyle.sh <yourfile.cpp>