postgis/deps/wagyu
2022-05-02 03:29:59 -04:00
..
include/mapbox Update wagyu to 0.5.0 2020-05-08 17:47:56 +02:00
.clang-format Disable clang format in deps/ 2020-01-10 16:28:44 +01:00
LICENSE.geometry Integrate wagyu to validate MVT polygons 2019-02-05 15:27:53 +00:00
LICENSE.README Integrate wagyu to validate MVT polygons 2019-02-05 15:27:53 +00:00
LICENSE.wagyu Integrate wagyu to validate MVT polygons 2019-02-05 15:27:53 +00:00
lwgeom_wagyu.cpp using ExecutorStart_hook to reset interrupt flags 2022-05-02 03:29:59 -04:00
lwgeom_wagyu.h using ExecutorStart_hook to reset interrupt flags 2022-05-02 03:29:59 -04:00
Makefile.in Allowing archiver program and flags options in ./configure 2022-02-25 10:27:07 +01:00
README.md Update wagyu to 0.5.0 2020-05-08 17:47:56 +02:00

Wagyu

Wagyu is a library that performs polygon clipping using the Vatti Clipping Algorithm. It is based on the Clipper Library but it adds an extra phase to correct the topology and guarantee validation accoding to the OGC specification.

Wagyu is a header only library but depends on Mapbox Geometry. It requires a C++ compiler that supports at least C++11.

liblwgeom bindings

To be able to use Wagyu in Postgis, several functions have been added as a bridge between liblwgeom's C code, and the C++ header only library:

  • lwgeom_wagyu_clip_by_box: Main function to clip and force validation over a polygon.
  • libwagyu_version: Returns a static string with the version of the wagyu library.
  • lwgeom_wagyu_interruptRequest: Function to request the interruption of the wagyu library.

It is integrated in the project as an static library inside postgis.so, so it doesn't require an extra dependency at runtime besides libstdc++ and libm which were a requisite.

Main considerations about the library

  • It works only with POLYGONTYPE or MULTIPOLYGONTYPE type geometries. Anything else will be dropped.
  • It's currently setup to use int32_t values internally for extra speed. It could be changed to use to int64_t or to double to match liblwgeom but, as it's only used by MVT, this isn't necessary.
  • The library is clipping the geometry to the bounding box passed. It also supports Intersection of 2 geometries, Union, Difference or XOR of 2 geometries but those functionalities aren't exposed.
  • The library outputs the geometry in the correct winding order for MVT, which is the opposite of OGC as the vertical order is switched.

Dependency changelog