Code Monkey home page Code Monkey logo

geos's Introduction

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.

The official Git repository is at OSGEO Gitea.

Build status

CI Main 3.9 3.8 3.7
GitHub github github github github
GitLab CI gitlab-ci gitlab-ci gitlab-ci gitlab-ci
Debbie debbie debbie debbie debbie
Winnie winnie winnie winnie winnie
Dronie dronie dronie dronie dronie
AppVeyor appveyor appveyor appveyor appveyor
Bessie bessie bessie bessie bessie
Bessie32 bessie32 bessie32 bessie32 bessie32
Berrie64 berrie64 berrie64 berrie64
Berrie berrie berrie berrie

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 available via RGeo.

PHP

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

Python

Python bindings are available via:

  1. Shapely
  2. PyGEOS
  3. Calling functions from libgeos_c via Python ctypes

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 here.

Tools

  • geosop - a CLI for GEOS. Documentation is here.

geos's People

Contributors

abellgithub avatar brendan-ward avatar caspervdw avatar cfis avatar cvvergara avatar davidblasby avatar dbaston avatar doskabouter avatar dr-jts avatar eyal0 avatar gergondet avatar gszy avatar hobu avatar jericks avatar jorisvandenbossche avatar komzpa avatar mloskot avatar mwtoews avatar nilason avatar okft avatar pramsey avatar robe2 avatar rouault avatar schwehr avatar sir-sigurd avatar strk avatar swongu avatar szekerest avatar warmerdam avatar whuaegeanse avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.