Skip to content
Commits on Source (15)
......@@ -10,10 +10,10 @@ end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
# C++ files want tab indentation
[*.{h,cpp}]
indent_style = tab
indent_size = 2
# C/C++ files want 4-space indentation
[*.{h,cpp,inl,h.in,c}]
indent_style = space
indent_size = 4
# Makefiles want tab indentation
[Makefile.am]
......@@ -37,26 +37,11 @@ end_of_line = crlf
[CMakeLists.txt]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
# CMake modules
[*.cmake]
indent_style = space
indent_size = 2
# operation/union directories were found to be using spaces
[src/operation/union/*.cpp]
indent_style = space
indent_size = 2
[include/geos/operation/union/*.{h,inl}]
indent_style = space
indent_size = 2
# XMLTester.cpp wants 2-space indent
[tests/xmltester/XMLTester.cpp]
indent_style = space
indent_size = 4
# Stackwalker.cpp wants 4-space indent
[tests/xmltester/Stackwalker.cpp]
indent_style = space
indent_size = 2
This diff is collapsed.
This diff is collapsed.
Compatibility notes
===================
## Building GEOS From Source
OS/X 10.6, compile with gcc-4.0 rather than the default gcc that
comes with XCode.
### Prerequisites
CC=gcc-4.0 CXX=g++-4.0 ./configure
GEOS has no external library dependencies and can be built with any C++11
compiler.
Quickstart
==========
### Unix
As root:
GEOS can be built on Unix systems using either the autotools or CMake build
systems.
./configure
make
make install
#### Using Autotools:
The default install location for GEOS is /usr/local.
When building GEOS using autotools, a `configure` script must first be generated
using the `autogen.sh` file included in the root of the repository:
Linux: Make sure that /usr/local/lib is added to /etc/ld.so.conf
Make sure that you run /sbin/ldconfig afterwards
./autogen.sh
Solaris: Make sure that /usr/local/lib is added to LD_LIBRARY_PATH
An out-of-tree build can then be initiated by creating a subdirectory and
running the generated `configure` script from that subdirectory:
mkdir obj && cd obj && ../configure
Basic Installation
==================
Once the `configure` script has run, GEOS can be built by running `make` and
installed by running `make install`. The test suite can be run using `make
check`.
The simplest way to compile this package is:
#### Using CMake:
To build `GEOS` using CMake, create a build directory and run the `cmake` command
from that location:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
Setting `CMAKE_BUILD_TYPE` to `Release` is necessary to enable compiler
optimizations.
2. Type `make' to compile the package.
Once the `cmake` tool has run, GEOS can be built by running `make` and
installed by running `make install`.
3. Optionally, type `make check' to run any self-tests that come with
the package.
The entire test suite can be run using `make check`.
Alternatively, the `ctest` command can be used, which provides more control over test execution.
For example, `ctest -R unit-capi -j2` uses a regular expression to run all tests
associated with the C API, using two processes in parallel.
A list of available tests can be obtained using `ctest -N`.
4. Type `make install' to install the programs and any data files and
documentation.
### Microsoft Windows
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
GEOS can be built with Microsoft Visual C++ by opening the `CMakeLists.txt` in
the project root using `File > Open > CMake`.
If you prefer the command-line
Compilers and Options
=====================
#### Build with CMake generator for Ninja (fast)
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
In the Visual Studio 2019 command prompt, `x64 Native Tools Command Prompt for VS 2019` or `x64_x86 Cross Tools Command Prompt for VS 2019`:
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
```
cmake -S . -B _build_vs2019_ninja -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build _build_vs2019_ninja -j 16 --verbose
```
#### Build with CMake generator for MSBuild (default)
Installation Names
==================
In the non-specific Command Prompt:
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
##### 64-bit
```
cmake -S . -B _build_vs2019x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_GENERATOR_TOOLSET=host=x64
cmake --build _build_vs2019x64 --config Release -j 16 --verbose
```
Operation Controls
==================
##### 32-bit
`configure' recognizes the following options to control how it
operates.
```
cmake -S . -B _build_vs2019x32 -G "Visual Studio 16 2019" -A x32 -DCMAKE_GENERATOR_TOOLSET=host=x64
cmake --build _build_vs2019x32 --config Release -j 16 --verbose
```
--cache-file=FILE
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
#### Test using CMake
--help
Print a summary of the options to `configure', and exit.
```
cd <build directory>
ctest --show-only
ctest
ctest --output-on-failure
ctest -V
ctest -VV
```
--quiet
--silent
-q
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
--srcdir=DIR
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
--version
Print the version of Autoconf used to generate the `configure'
script, and exit.
--prefix
Change the default installation location
`configure' also accepts some other, not widely useful, options.
......@@ -20,15 +20,15 @@ SUBDIRS = \
macros \
swig \
tests \
benchmarks \
tools
BUILT_SOURCES = geos_revision.h
BUILT_SOURCES =
EXTRA_DIST = acsite.m4 .editorconfig makefile.vc nmake.opt autogen.bat CMakeLists.txt \
cmake/modules/CheckPrototypeExists.cmake \
cmake/modules/COPYING-CMAKE-SCRIPTS \
cmake/modules/GenerateSourceGroups.cmake \
cmake/cmake_uninstall.cmake.in geos_revision.h \
EXTRA_DIST = acsite.m4 .editorconfig \
Version.txt CMakeLists.txt \
cmake/cmake_uninstall.cmake.in \
cmake/geos-config.cmake \
README.md
ACLOCAL_AMFLAGS = -I macros
......@@ -49,23 +49,25 @@ gen-ChangeLog:
apidoc doxygen:
cd doc && make $@
doxygen-checked:
( set -o pipefail; \
! make doxygen 2>&1 > /dev/null | \
grep -v '\(not documented\|ignoring unsupported tag\)'; \
)
authors.git: authors.svn
cd $(srcdir) && sed -e 's/:/ = /' authors.svn > authors.git
svnrebase: authors.git
cd $(srcdir) && git svn rebase --authors-file authors.git
geos_revision.h:
top_srcdir=$(srcdir) sh $(srcdir)/tools/repo_revision.sh
VALGRIND = $(LIBTOOL) --mode=execute valgrind --leak-check=full --error-exitcode=1
valgrindcheck:
$(VALGRIND) tests/unit/geos_unit
.PHONY: geos_revision.h
check-local:
! find . -name '*.cpp' -o -name '*.h' | \
! find $(srcdir) -name '*.cpp' -o -name '*.h' | \
grep -v tests/xmltester/tinyxml | \
grep -v include/geos/algorithm/ttmath | \
xargs grep -n '[[:space:]]$$'
......@@ -119,8 +119,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/config.h \
$(top_builddir)/include/geos/platform.h
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
......@@ -180,8 +179,8 @@ CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS COPYING INSTALL NEWS \
TODO compile config.guess config.sub install-sh ltmain.sh \
missing py-compile
compile config.guess config.sub install-sh ltmain.sh missing \
py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
......@@ -256,6 +255,7 @@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN_LOGFILE = @DOXYGEN_LOGFILE@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
......@@ -272,9 +272,6 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERFACE_AGE = @INTERFACE_AGE@
INTERFACE_CURRENT = @INTERFACE_CURRENT@
INTERFACE_REVISION = @INTERFACE_REVISION@
JTS_PORT = @JTS_PORT@
LD = @LD@
LDFLAGS = @LDFLAGS@
......@@ -410,14 +407,14 @@ SUBDIRS = \
macros \
swig \
tests \
benchmarks \
tools
BUILT_SOURCES = geos_revision.h
EXTRA_DIST = acsite.m4 .editorconfig makefile.vc nmake.opt autogen.bat CMakeLists.txt \
cmake/modules/CheckPrototypeExists.cmake \
cmake/modules/COPYING-CMAKE-SCRIPTS \
cmake/modules/GenerateSourceGroups.cmake \
cmake/cmake_uninstall.cmake.in geos_revision.h \
BUILT_SOURCES =
EXTRA_DIST = acsite.m4 .editorconfig \
Version.txt CMakeLists.txt \
cmake/cmake_uninstall.cmake.in \
cmake/geos-config.cmake \
README.md
ACLOCAL_AMFLAGS = -I macros
......@@ -917,23 +914,25 @@ gen-ChangeLog:
apidoc doxygen:
cd doc && make $@
doxygen-checked:
( set -o pipefail; \
! make doxygen 2>&1 > /dev/null | \
grep -v '\(not documented\|ignoring unsupported tag\)'; \
)
authors.git: authors.svn
cd $(srcdir) && sed -e 's/:/ = /' authors.svn > authors.git
svnrebase: authors.git
cd $(srcdir) && git svn rebase --authors-file authors.git
geos_revision.h:
top_srcdir=$(srcdir) sh $(srcdir)/tools/repo_revision.sh
valgrindcheck:
$(VALGRIND) tests/unit/geos_unit
.PHONY: geos_revision.h
check-local:
! find . -name '*.cpp' -o -name '*.h' | \
! find $(srcdir) -name '*.cpp' -o -name '*.h' | \
grep -v tests/xmltester/tinyxml | \
grep -v include/geos/algorithm/ttmath | \
xargs grep -n '[[:space:]]$$'
# Tell versions [3.59,3.63) of GNU make to not export all variables.
......
Changes in 3.8.0
2019-MM-DD
- New things:
- CAPI: GEOSBuildArea (#952, Even Rouault)
- CAPI: GEOSMakeValid (#952, Even Rouault)
- CAPI: GEOSPolygonize_valid (#727, Dan Baston)
- CAPI: GEOSCoverageUnion (Dan Baston)
- CAPI: GEOSCoordSeq_setXY, GEOSCoordSeq_setXYZ,
GEOSCoordSeq_getXY, GEOSCoordSeq_getXYZ (Dan Baston)
- CAPI: GEOSMinimumBoundingCircle (#735)
- CAPI: GEOSGeom_createPointFromXY (Dan Baston)
- Improvements:
- Improve overall performance by reducing of heap allocations (Dan Baston)
- Improve performance and robustness of GEOSPointOnSurface (Martin Davis)
- Improve performance of GEOSPolygonize for cases with many potential
holes (#748, Dan Baston)
- Support extended precision calculations (ttmath) and port JTS
improvements related to extended precision (Paul Ramsey, Mateusz Loskot)
- Improve performance of GEOSPolygonize for cases with many or complex
shells (Dan Baston, Martin Davis)
- Improve performance of Delaunay triangulations / Voronoi Diagrams
(Dan Baston)
- Improve performance of prepared geometry operations (Dan Baston)
- Improve robustness of Delaunay triangulations (Paul Ramsey, Martin Davis)
- Improve performance of unary union for lines (Dan Baston)
- Improve general predicate, overlay, and buffer performance (Dan Baston, Paul Ramsey)
- Improve cascaded union performance (Paul Ramsey, Martin Davis)
- Allocate default GeometryFactory singleton on the stack (Sandro Mani)
- Harmonize XML tests with JTS and harmonize cmake/autoconf
test running (Paul Ramsey)
- CMake modernization (Mateusz Loskot, Paul Ramsey, Dan Baston)
- Return unique_ptr from most methods that produce a new geometry (Dan Baston)
- Changes:
- Constructive geometry functions in CAPI now preserve SRID
of input arguments in output (#896)
Changes in 3.7.2
2019-05-02
......@@ -35,14 +75,13 @@ Changes in 3.7.0
GEOSGeom_getYMin, GEOSGeom_getYMax (#871, Dan Baston)
- CAPI: GEOSFrechetDistance (#797, Shinichi SUGIYAMA)
- CAPI: GEOSReverse (#872, Dan Baston)
- CAPI: GEOSSegmentIntersection (#873, Dan Baston)
- CAPI: GEOSGeomGetZ (#581, J Smith)
- Improvements
- Interruptible snap operation (Paul Ramsey)
- Numerous packaging, doc, and build changes
(Debian group: Bas Couwenberg, Francesco Paolo Lovergine)
(NetBSD: Greg Troxel)
- Allow static library with C API for CMake builds (#878, Dakota Hawkins)
- C++ API changes:
- Require defining USE_UNSTABLE_GEOS_CPP_API for use without
......@@ -55,18 +94,6 @@ Changes in 3.7.0
- Fix CommonBits::getBit to correctly handle i >= 32
(#834, Kurt Schwehr)
Changes in 3.7.0rc2
2018-09-03
Fixes / enhancements since 3.7.0rc1
- Drop ? from extended regular expression,
so that the expression strictly conforms to the POSIX ERE rules.
(#917, Greg Troxel, Bas Couwenberg)
- include .editorconfig in tar ball,
fixes Cmake on VS (#920, Jeff Mckenna, Regina Obe)
- Ignore error in CoordinateArraySequenceFactoryTest
failing on FreeBSD/macOS Clang (#894)
Changes in 3.7.0rc1
2018-08-19
Fixes / enhancements since 3.7.0beta2
......@@ -74,7 +101,6 @@ Fixes / enhancements since 3.7.0beta2
- Collection with Empty components crashes overlay (#782, Dan Baston)
- Allow static library with C API for CMake builds (#878, Dakota Hawkins)
Changes in 3.7.0beta2
2018-08-06
Fixes since 3.7.0beta1
......@@ -83,6 +109,7 @@ Fixes since 3.7.0beta1
to address clang warnings (Dan Baston)
- Add missing CMake files to tarball (#895, Regina Obe)
Changes in 3.7.0beta1
2018-06-25
See 3.7.0 latest notes
......
GEOS -- Geometry Engine, Open Source
====================================
Project homepage: http://geos.osgeo.org/
GEOS is a C++11 library for performing operations on two-dimensional vector
geometries. It is primarily a port of the [JTS Topology
Suite](https://github.com/locationtech/jts) Java library. It provides many of
the algorithms used by [PostGIS](http://www.postgis.net/), the
[Shapely](https://pypi.org/project/Shapely/) package for Python, the
[sf](https://github.com/r-spatial/sf) package for R, and others.
More information is available the [project homepage](https://trac.osgeo.org/geos).
## Build status
| branch / CI | Debbie | Winnie | Dronie | Travis CI | GitLab CI | AppVeyor | Bessie | Bessie32 |
|:--- |:--- |:--- |:--- |:--- |:--- |:--- |:--- |:--- |
| 3.7 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_3.7/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_3.7/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_3.7/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?ref=refs/heads/3.7)](https://drone.osgeo.org/geos/geos?branch=3.7) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=3.7)](https://travis-ci.com/libgeos/geos?branch=3.7) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/3.7/build.svg)](https://gitlab.com/geos/libgeos/commits/3.7) | [![appveyor](https://ci.appveyor.com/api/projects/status/ao909hwpsb1yu062/branch/3.7?svg=true)](https://ci.appveyor.com/project/OSGeo/geos/branch/3.7) | [![bessie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie&BRANCH=3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie) | [![bessie32](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie32&BRANCH=3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie32) ||
| 3.7 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Branch_3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_Branch_3.7/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.7/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.7/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?ref=refs/heads/3.7)](https://dronie.osgeo.org/geos/geos?branch=3.7) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=3.7)](https://travis-ci.com/libgeos/geos?branch=3.7) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/3.7/build.svg)](https://gitlab.com/geos/libgeos/commits/3.7) | [![appveyor](https://ci.appveyor.com/api/projects/status/ao909hwpsb1yu062/branch/3.7?svg=true)](https://ci.appveyor.com/project/OSGeo/geos/branch/3.7) |
More on: https://trac.osgeo.org/geos#BuildandInstall
## Building, testing, installing
### Prerequisites
Building GEOS requires a C++11 compiler
### Unix
#### Using Autotools:
./autogen.sh # in ${srcdir}, if obtained from SVN or GIT
(mkdir obj && cd obj && ../configure)
#### Using CMake:
(mkdir build && cd build && cmake ..)
#### Either Autotools or CMake
make
make check
make install # (as root, assuming PREFIX is not writable by the build user)
On a GNU/Linux system, if installed in a system prefix:
ldconfig # as root
### Microsoft Windows
If you use Microsoft Visual C++ (7.1 or later) compiler, you can build
GEOS using NMAKE program and provided `makefile.vc` files.
If you are building from SVN or GIT checkout, first run: `autogen.bat`
Then:
| master | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Master/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Master/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Master/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?branch=master)](https://dronie.osgeo.org/geos/geos?branch=master) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=master)](https://travis-ci.com/libgeos/geos?branch=master) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/master/build.svg)](https://gitlab.com/geos/libgeos/commits/master) | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/master?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/master) | [![bessie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie&BRANCH=master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie) | [![bessie32](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie32&BRANCH=master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie32) ||
| 3.7 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Branch_3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_Branch_3.7/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.7/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.7/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?branch=3.7)](https://dronie.osgeo.org/geos/geos?branch=3.7) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=3.7)](https://travis-ci.com/libgeos/geos?branch=3.7) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/svn-3.7/build.svg)](https://gitlab.com/geos/libgeos/commits/3.7) | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/3.7?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/3.7) ||
| 3.6 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Branch_3.6)](https://debbie.postgis.net/view/GEOS/job/GEOS_Branch_3.6/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.6/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.6/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?branch=svn-3.6)](https://dronie.osgeo.org/geos/geos?branch=svn-3.6) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=svn-3.6)](https://travis-ci.com/libgeos/geos?branch=svn-3.6) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/svn-3.6/build.svg)](https://gitlab.com/geos/libgeos/commits/svn-3.6) | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/svn-3.6?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/svn-3.6) |
nmake /f makefile.vc MSVC_VER=1400
where 1400 is version number of Visual C++ compiler, here Visual C++ 8.0
from Visual Studio 2005 (supported versions are 1300, 1310, 1400, 1500,
1600, 1700, 1800 and 1900).
The bootstrap.bat step is required to generate a couple of header files.
In order to build debug configuration of GEOS, additional flag `DEBUG=1`
is required:
nmake /f makefile.vc MSVC_VER=1400 DEBUG=1
## Build/install
See INSTALL file
## Client applications
### Using the C interface (recommended)
GEOS promises long term stability of C API
### Using the C interface
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.
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.
To compile programs against the C lib (recommended):
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
#include <geos_c.h>
Example usage:
All functionality of the C API is available through the `geos_c.h` header file.
capi/geostest.c contains basic usage examples.
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 (no stability promise)
### Using the C++ interface
Developers who decide to use the C++ interface should be aware GEOS
does not promise API or ABI stability of C++ API between releases.
Moreover C++ API/ABI breaking changes may not even be announced
or include in the NEWS file
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 because
it is too hard to know if there have been ABI changes.
The C++ library name will change on every minor release.
To compile programs against the C++ lib:
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>
Basic usage examples can be found in `doc/example.cpp`.
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 bindings are fully supported. To build, use the `--enable-ruby` option
#### Ruby
Ruby bindings are part of GEOS. To build, use the `--enable-ruby` option
when configuring:
./configure ... --enable-ruby
./configure .. --enable-ruby
Since version 3.7.0 PHP bindings are not included in the core
library anymore but available as a separate project:
#### PHP
https://git.osgeo.org/gogs/geos/php-geos
PHP bindings for GEOS are available separately from
[php-geos](https://git.osgeo.org/gitea/geos/php-geos).
Since version 3.0, the Python bindings are unsupported. Recommended options:
#### Python
Python bindings are available via:
1. [Shapely](http://pypi.python.org/pypi/Shapely) package.
2. Calling functions from `libgeos_c` via Python ctypes.
1. Become or recruit a new maintainer.
2. Use [Shapely](http://pypi.python.org/pypi/Shapely) with Python
versions 2.4 or greater.
3. Simply call functions from `libgeos_c` via Python ctypes.
## Documentation
To build Doxygen 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>
GEOS TODO:
- Feed PrecisionModel to OverlayResultValidator to set _TOLERANCE
- Test unit tests for snapround package
- DoubleBits misregards BYTE_ENDIAN, must check it.
- BUILD CORRECTNESS:
- include <geos/config.h> from all .cpp files
- WKB tester in doc/examples.cpp should do point-by-point comparison.
- Implement Safe's idea of a compile-time enabled 2d-only
inlineable CoordinateSequence
- WKB extension with LINEARRING ?
- Check how to disable GEOS_VERSION define on command line
(or make GEOS_VERSION define in version.h optional)
not a major problems, just makes the compiler issue some warninigs.
- Check GeometryEditor behaviour (modify passed geom or create a new one ?)
[not documented]
- Add distinct binary predicates test support in XMLTester
# GEOS Versions
GEOS_VERSION_MAJOR=3
GEOS_VERSION_MINOR=8
GEOS_VERSION_PATCH=0
# OPTIONS: "", "dev", "rc1" etc.
GEOS_PATCH_WORD=beta1
# GEOS CAPI Versions
#
# Always increase the revision value.
# Increase the current value whenever an interface has been
# added, removed or changed.
# Increase the age value only if the changes made to the ABI
# are backward compatible.
CAPI_INTERFACE_CURRENT=13
CAPI_INTERFACE_REVISION=0
CAPI_INTERFACE_AGE=12
# JTS Port
JTS_PORT=1.13.0
@ECHO OFF
REM
REM This script generates headers for use with Visual C++ only
REM
REM Usage:
REM .\autogen.bat
REM nmake -f makefile.vc
REM
REM NOTE: DO NOT include this script in GEOS sources distribution
REM
set GEOS_HEADERS=include\geos
COPY %GEOS_HEADERS%\version.h.vc %GEOS_HEADERS%\version.h
COPY %GEOS_HEADERS%\platform.h.vc %GEOS_HEADERS%\platform.h
COPY capi\geos_c.h.in capi\geos_c.h
REM Empty string as dummy git SHA-1
@ECHO #define GEOS_REVISION "" > geos_revision.h
################################################################################
# Part of CMake configuration for GEOS
#
# Copyright (C) 2018 Mateusz Loskot <mateusz@loskot.net>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU Lesser General Public Licence as published
# by the Free Software Foundation.
# See the COPYING file for more information.
################################################################################
add_executable(perf_class_sizes ClassSizes.cpp)
target_link_libraries(perf_class_sizes PRIVATE geos)
add_subdirectory(algorithm)
add_subdirectory(operation)
add_subdirectory(capi)
......@@ -19,14 +19,27 @@
#include <geos/geom/GeometryFactory.h>
#include <geos/io/WKTReader.h>
#include <geos/geom/CoordinateArraySequence.h>
#include <geos/geom/FixedSizeCoordinateSequence.h>
#include <geos/geom/Geometry.h>
#include <geos/geom/Point.h>
#include <geos/geom/LinearRing.h>
#include <geos/geom/LineString.h>
#include <geos/geom/Polygon.h>
#include <geos/geom/GeometryCollection.h>
#include <geos/geom/MultiPoint.h>
#include <geos/geom/MultiLineString.h>
#include <geos/geom/MultiPolygon.h>
#include <geos/geomgraph/Depth.h>
#include <geos/geomgraph/DirectedEdge.h>
#include <geos/geomgraph/Edge.h>
#include <geos/geomgraph/EdgeEnd.h>
#include <geos/geomgraph/PlanarGraph.h>
#include <geos/noding/NodedSegmentString.h>
#include <geos/profiler.h>
#include <geos/platform.h>
#include <geos/constants.h>
#include <iostream>
#include <geos/geomgraph/index/SweepLineEvent.h>
using namespace std;
using namespace geos;
......@@ -37,10 +50,27 @@ using namespace geos;
int
main()
{
check(geomgraph::PlanarGraph);
check(geomgraph::EdgeEnd);
check(geomgraph::Depth);
check(geomgraph::DirectedEdge);
check(geomgraph::DirectedEdgeStar);
check(geomgraph::Edge);
check(geomgraph::EdgeEnd);
check(geomgraph::PlanarGraph);
check(geomgraph::TopologyLocation);
check(geomgraph::index::SweepLineEvent);
check(noding::NodedSegmentString);
check(geom::Geometry);
check(geom::Point);
check(geom::LineString);
check(geom::LinearRing);
check(geom::Polygon);
check(geom::GeometryCollection);
check(geom::MultiPoint);
check(geom::MultiLineString);
check(geom::MultiPolygon);
check(geom::CoordinateArraySequence);
check(geom::FixedSizeCoordinateSequence<1>);
check(geom::FixedSizeCoordinateSequence<2>);
check(int64);
}
......@@ -2,6 +2,7 @@
# This file is part of project GEOS (http://trac.osgeo.org/geos/)
#
SUBDIRS = \
algorithm \
operation \
capi
......
......@@ -90,7 +90,7 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
noinst_PROGRAMS = ClassSizes$(EXEEXT)
subdir = tests/perf
subdir = benchmarks
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/macros/ac_pkg_swig.m4 \
$(top_srcdir)/macros/ac_python_devel.m4 \
......@@ -108,8 +108,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/config.h \
$(top_builddir)/include/geos/platform.h
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
......@@ -132,7 +131,7 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/include/geos
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/ClassSizes.Po
......@@ -257,6 +256,7 @@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN_LOGFILE = @DOXYGEN_LOGFILE@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
......@@ -273,9 +273,6 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERFACE_AGE = @INTERFACE_AGE@
INTERFACE_CURRENT = @INTERFACE_CURRENT@
INTERFACE_REVISION = @INTERFACE_REVISION@
JTS_PORT = @JTS_PORT@
LD = @LD@
LDFLAGS = @LDFLAGS@
......@@ -404,6 +401,7 @@ top_srcdir = @top_srcdir@
# This file is part of project GEOS (http://trac.osgeo.org/geos/)
#
SUBDIRS = \
algorithm \
operation \
capi
......@@ -423,9 +421,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/perf/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu benchmarks/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/perf/Makefile
$(AUTOMAKE) --gnu benchmarks/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
......
#################################################################################
#
# CMake configuration for GEOS benchmarks/operation/predicate tests
#
# Copyright (C) 2017 Mateusz Loskot <mateusz@loskot.net>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU Lesser General Public Licence as published
# by the Free Software Foundation.
# See the COPYING file for more information.
#
#################################################################################
add_executable(perf_interiorpoint_area InteriorPointAreaPerfTest.cpp)
target_link_libraries(perf_interiorpoint_area geos)
add_executable(perf_voronoi VoronoiPerfTest.cpp)
target_link_libraries(perf_voronoi geos)
add_executable(perf_unaryunion_segments UnaryUnionSegmentsPerfTest.cpp)
target_link_libraries(perf_unaryunion_segments geos)
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: perf/operation/predicate/RectangleIntersectsPerfTest.java r378 (JTS-1.12)
*
**********************************************************************/
#include <geos/geom/PrecisionModel.h>
#include <geos/geom/GeometryFactory.h>
#include <geos/util/GeometricShapeFactory.h>
#include <geos/precision/SimpleGeometryPrecisionReducer.h>
#include <geos/geom/util/SineStarFactory.h>
#include <geos/geom/Geometry.h>
#include <geos/geom/Polygon.h>
#include <geos/geom/Point.h>
#include <geos/profiler.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <sstream>
#include <memory>
using namespace geos::geom;
using namespace geos::io;
using namespace std;
class InteriorPointAreaPerfTest {
public:
InteriorPointAreaPerfTest()
:
pm(),
fact(GeometryFactory::create(&pm, 0))
{
showHeader();
}
void
test(int nPts)
{
Coordinate origin(ORG_X, ORG_Y);
std::unique_ptr<geos::geom::Polygon> sinePoly =
createSineStar(origin, SIZE, nPts);
/**
* Make the geometry "crinkly" by rounding off the points.
* This defeats the MonotoneChain optimization in the full relate
* algorithm, and provides a more realistic test.
*/
using geos::precision::SimpleGeometryPrecisionReducer;
double scale = nPts / SIZE;
PrecisionModel p_pm(scale);
SimpleGeometryPrecisionReducer reducer(&p_pm);
std::unique_ptr<Geometry> sinePolyCrinkly(reducer.reduce(sinePoly.get()));
sinePoly.reset();
//cout << sinePolyCrinkly->toText() << endl;
test(*sinePolyCrinkly);
}
const double ORG_X = 100.0;
const double ORG_Y = 100.0;
const double SIZE = 100.0;
const int N_ARMS = 20;
const double ARM_RATIO = 0.3;
const int N_ITER = 100;
private:
PrecisionModel pm;
GeometryFactory::Ptr fact;
void
showHeader() {
cout << "Interior Point Area perf test" << endl;
cout << "# Iterations: " << N_ITER << endl;
cout << "SineStar: origin: ("
<< ORG_X << ", " << ORG_Y
<< ") size: " << SIZE
<< " # arms: " << N_ARMS
<< " arm ratio: " << ARM_RATIO
<< endl;
}
void
test(geos::geom::Geometry& poly)
{
geos::util::Profile sw("");
sw.start();
for(int i = 0; i < N_ITER; i++) {
std::unique_ptr<geos::geom::Point> pt( poly.getInteriorPoint() );
}
sw.stop();
cout << poly.getNumPoints() << " points: " << sw.getTotFormatted() << endl;
}
std::unique_ptr<geos::geom::Polygon>
createSineStar(const Coordinate& origin,
double size, int nPts)
{
using geos::geom::util::SineStarFactory;
SineStarFactory gsf(fact.get());
gsf.setCentre(origin);
gsf.setSize(size);
gsf.setNumPoints(nPts);
gsf.setArmLengthRatio( ARM_RATIO );
gsf.setNumArms( N_ARMS );
std::unique_ptr<geos::geom::Polygon> poly = gsf.createSineStar();
return poly;
}
};
int
main()
{
InteriorPointAreaPerfTest tester;
tester.test(100);
tester.test(1000);
tester.test(10000);
tester.test(100000);
tester.test(1000000);
}
#
# This file is part of project GEOS (http://trac.osgeo.org/geos/)
#
prefix=@prefix@
top_srcdir=@top_srcdir@
top_builddir=@top_builddir@
noinst_PROGRAMS = InteriorPointAreaPerfTest
InteriorPointAreaPerfTest_SOURCES = InteriorPointAreaPerfTest.cpp
InteriorPointAreaPerfTest_LDADD = $(top_builddir)/src/libgeos.la
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/src/io/markup
EXTRA_DIST = CMakeLists.txt
This diff is collapsed.
#################################################################################
################################################################################
# Part of CMake configuration for GEOS
#
# CMake configuration for GEOS perf tests
#
# Copyright (C) 2017 Mateusz Loskot <mateusz@loskot.net>
# Copyright (C) 2018 Mateusz Loskot <mateusz@loskot.net>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU Lesser General Public Licence as published
# by the Free Software Foundation.
# See the COPYING file for more information.
#
#################################################################################
set(STATUS_MESSAGE "Enable GEOS performance tests build")
set(STATUS_RESULT "OFF")
if(GEOS_ENABLE_TESTS)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(perf_class_sizes ClassSizes.cpp)
target_link_libraries(perf_class_sizes geos)
add_test(perf_class_sizes
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/perf_class_sizes)
add_subdirectory(operation)
add_subdirectory(capi)
set(STATUS_RESULT "ON")
endif()
message(STATUS "${STATUS_MESSAGE} - ${STATUS_RESULT}")
################################################################################
add_executable(perf_memleak_mp_prep memleak_mp_prep.c)
# test_perf_memleak_mp_prep is not dependant against geos target,
# but geos_c only, so need explicit include directories.
target_include_directories(perf_memleak_mp_prep
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
target_link_libraries(perf_memleak_mp_prep PRIVATE geos_c)
add_executable(perf_geospreparedcontains GEOSPreparedContainsPerfTest.cpp)
target_link_libraries(perf_geospreparedcontains PRIVATE geos geos_c)
add_executable(perf_intersection IntersectionPerfTest.cpp)
target_link_libraries(perf_intersection PRIVATE geos geos_c)