Skip to content

Commit

Permalink
Update to GEOS 3.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
macdrevx committed Dec 19, 2020
1 parent 9bd66b7 commit 709a485
Show file tree
Hide file tree
Showing 494 changed files with 27,772 additions and 36,960 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ at least controversial. Use of geos without dynamic linking is discouraged.

1. Update your `Cartfile` to include:

github "GEOSwift/geos" ~> 5.0.0
github "GEOSwift/geos" ~> 5.1.0

2. Finish updating your project by following the [typical Carthage
workflow](https://github.com/Carthage/Carthage#quick-start).
Expand All @@ -43,7 +43,7 @@ workflow](https://github.com/Carthage/Carthage#quick-start).

1. Update the top-level dependencies in your `Package.swift` to include:

.package(url: "https://github.com/GEOSwift/geos.git", from: "5.0.0")
.package(url: "https://github.com/GEOSwift/geos.git", from: "5.1.0")

2. Update the target dependencies in your `Package.swift` to include

Expand Down Expand Up @@ -90,5 +90,6 @@ how to get from the GEOS source to the end result in this repo.
continued support for CocoaPods, Carthage, and Swift PM.
6. Test all your changes on the full matrix of supported configs (CocoaPods,
Carthage, Swift PM) x (iOS, macOS, tvOS) + Swift PM x Linux.
7. Update the version numbers in `Resources/Info.plist` and `geos.podspec`
7. Update the version numbers in `Resources/Info.plist`, `geos.podspec`,
and `README.md`
8. Update this README with any relevant information.
2 changes: 1 addition & 1 deletion Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.0.0</string>
<string>5.1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
84 changes: 65 additions & 19 deletions Sources/geos/capi/geos_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
#include <geos/io/WKBReader.h>
#include <geos/io/WKTWriter.h>
#include <geos/io/WKBWriter.h>
#include <geos/operation/overlay/OverlayOp.h>
#include <geos/operation/union/CascadedPolygonUnion.h>
#include <geos/algorithm/distance/DiscreteHausdorffDistance.h>
#include <geos/algorithm/distance/DiscreteFrechetDistance.h>
#include <geos/util/Interrupt.h>

#include <stdexcept>
Expand All @@ -39,10 +35,10 @@
#define GEOSPreparedGeometry geos::geom::prep::PreparedGeometry
#define GEOSCoordSequence geos::geom::CoordinateSequence
#define GEOSSTRtree geos::index::strtree::STRtree
#define GEOSWKTReader_t geos::io::WKTReader
#define GEOSWKTWriter_t geos::io::WKTWriter
#define GEOSWKBReader_t geos::io::WKBReader
#define GEOSWKBWriter_t geos::io::WKBWriter
#define GEOSWKTReader geos::io::WKTReader
#define GEOSWKTWriter geos::io::WKTWriter
#define GEOSWKBReader geos::io::WKBReader
#define GEOSWKBWriter geos::io::WKBWriter
typedef struct GEOSBufParams_t GEOSBufferParams;

#include "geos_c.h"
Expand Down Expand Up @@ -74,11 +70,7 @@ using geos::io::WKTWriter;
using geos::io::WKBReader;
using geos::io::WKBWriter;

using geos::index::strtree::STRtree;

using geos::operation::overlay::OverlayOp;
using geos::operation::overlay::overlayOp;
using geos::operation::geounion::CascadedPolygonUnion;

typedef std::unique_ptr<Geometry> GeomPtr;

Expand Down Expand Up @@ -415,6 +407,12 @@ extern "C" {
return GEOSIntersection_r(handle, g1, g2);
}

Geometry*
GEOSIntersectionPrec(const Geometry* g1, const Geometry* g2, double gridSize)
{
return GEOSIntersectionPrec_r(handle, g1, g2, gridSize);
}

Geometry*
GEOSBuffer(const Geometry* g, double width, int quadrantsegments)
{
Expand Down Expand Up @@ -457,6 +455,18 @@ extern "C" {
return GEOSMinimumRotatedRectangle_r(handle, g);
}

Geometry*
GEOSMaximumInscribedCircle(const Geometry* g, double tolerance)
{
return GEOSMaximumInscribedCircle_r(handle, g, tolerance);
}

Geometry*
GEOSLargestEmptyCircle(const Geometry* g, const Geometry* boundary, double tolerance)
{
return GEOSLargestEmptyCircle_r(handle, g, boundary, tolerance);
}

Geometry*
GEOSMinimumWidth(const Geometry* g)
{
Expand All @@ -481,6 +491,12 @@ extern "C" {
return GEOSDifference_r(handle, g1, g2);
}

Geometry*
GEOSDifferencePrec(const Geometry* g1, const Geometry* g2, double gridSize)
{
return GEOSDifferencePrec_r(handle, g1, g2, gridSize);
}

Geometry*
GEOSBoundary(const Geometry* g)
{
Expand All @@ -493,18 +509,36 @@ extern "C" {
return GEOSSymDifference_r(handle, g1, g2);
}

Geometry*
GEOSSymDifferencePrec(const Geometry* g1, const Geometry* g2, double gridSize)
{
return GEOSSymDifferencePrec_r(handle, g1, g2, gridSize);
}

Geometry*
GEOSUnion(const Geometry* g1, const Geometry* g2)
{
return GEOSUnion_r(handle, g1, g2);
}

Geometry*
GEOSUnionPrec(const Geometry* g1, const Geometry* g2, double gridSize)
{
return GEOSUnionPrec_r(handle, g1, g2, gridSize);
}

Geometry*
GEOSUnaryUnion(const Geometry* g)
{
return GEOSUnaryUnion_r(handle, g);
}

Geometry*
GEOSUnaryUnionPrec(const Geometry* g, double gridSize)
{
return GEOSUnaryUnionPrec_r(handle, g, gridSize);
}

Geometry*
GEOSCoverageUnion(const Geometry* g)
{
Expand Down Expand Up @@ -1264,22 +1298,34 @@ extern "C" {
return GEOSPreparedWithin_r(handle, pg1, g2);
}

STRtree*
CoordinateSequence*
GEOSPreparedNearestPoints(const geos::geom::prep::PreparedGeometry* g1, const Geometry* g2)
{
return GEOSPreparedNearestPoints_r(handle, g1, g2);
}

int
GEOSPreparedDistance(const geos::geom::prep::PreparedGeometry* g1, const Geometry* g2, double *dist)
{
return GEOSPreparedDistance_r(handle, g1, g2, dist);
}

GEOSSTRtree*
GEOSSTRtree_create(size_t nodeCapacity)
{
return GEOSSTRtree_create_r(handle, nodeCapacity);
}

void
GEOSSTRtree_insert(geos::index::strtree::STRtree* tree,
GEOSSTRtree_insert(GEOSSTRtree* tree,
const geos::geom::Geometry* g,
void* item)
{
GEOSSTRtree_insert_r(handle, tree, g, item);
}

void
GEOSSTRtree_query(geos::index::strtree::STRtree* tree,
GEOSSTRtree_query(GEOSSTRtree* tree,
const geos::geom::Geometry* g,
GEOSQueryCallback cb,
void* userdata)
Expand All @@ -1288,7 +1334,7 @@ extern "C" {
}

const GEOSGeometry*
GEOSSTRtree_nearest(geos::index::strtree::STRtree* tree,
GEOSSTRtree_nearest(GEOSSTRtree* tree,
const geos::geom::Geometry* g)
{
return GEOSSTRtree_nearest_r(handle, tree, g);
Expand All @@ -1304,23 +1350,23 @@ extern "C" {
}

void
GEOSSTRtree_iterate(geos::index::strtree::STRtree* tree,
GEOSSTRtree_iterate(GEOSSTRtree* tree,
GEOSQueryCallback callback,
void* userdata)
{
GEOSSTRtree_iterate_r(handle, tree, callback, userdata);
}

char
GEOSSTRtree_remove(geos::index::strtree::STRtree* tree,
GEOSSTRtree_remove(GEOSSTRtree* tree,
const geos::geom::Geometry* g,
void* item)
{
return GEOSSTRtree_remove_r(handle, tree, g, item);
}

void
GEOSSTRtree_destroy(geos::index::strtree::STRtree* tree)
GEOSSTRtree_destroy(GEOSSTRtree* tree)
{
GEOSSTRtree_destroy_r(handle, tree);
}
Expand Down
Loading

0 comments on commit 709a485

Please sign in to comment.