Skip to content

Commit

Permalink
upgrade GEOS to 3.13.0 (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev authored Jan 11, 2025
1 parent 49fc917 commit 59c67a0
Show file tree
Hide file tree
Showing 322 changed files with 16,695 additions and 2,602 deletions.
4 changes: 3 additions & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"${workspaceFolder}/deps/libgdal/gdal/apps",
"${workspaceFolder}/deps/libgdal/arch/unix",
"${workspaceFolder}/deps/libproj/proj/src",
"${workspaceFolder}/deps/libgeos/include",
"${workspaceFolder}/deps/libgeos/geos/include",
"${workspaceFolder}/node_modules/nan"
]
},
Expand Down Expand Up @@ -48,4 +50,4 @@
}
],
"version": 4
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- GDAL 3.10.0
- GEOS 3.13.0
- Apple ARM support on macOS 15 and later
- Node.js 23 support
- Implement RFC101 support, see [`ASYNCIO.md`](https://github.com/mmomtchev/node-gdal-async/blob/main/ASYNCIO.md) for more information
Expand Down
2 changes: 1 addition & 1 deletion deps/libgeos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/libgeos"

GEOS_VERSION=3.12.1
GEOS_VERSION=3.13.0
dir_geos=./geos

#
Expand Down
12 changes: 0 additions & 12 deletions deps/libgeos/geos/.astylerc

This file was deleted.

16 changes: 0 additions & 16 deletions deps/libgeos/geos/.mailmap

This file was deleted.

27 changes: 22 additions & 5 deletions deps/libgeos/geos/DEVELOPER-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* This is just history, JTS was written first and GEOS was a slavish port.
* Being memory managed, JTS is an easier language to prototype in.
* Having various visual tooling, JTS is an easier platform to debug spatial algorithms in.
* Being Java, JTS has less language legacy than GEOS, which was originally ported when STL was still not part of the standard, and therefor reflects a mix of styles and eras.

* Ideally, new algorithms will be implemented in JTS and then ported to GEOS.
* Smaller performance optimizations in GEOS can travel back to JTS.
* Being Java, JTS has less language legacy than GEOS, which was originally ported when STL was not part of the standard, and therefore reflects a mix of styles and eras.

* Ideally, new algorithms are implemented in JTS and then ported to GEOS.
* Sometimes GEOS gains new functionality; ideally this is backported to JTS
* Performance optimizations in GEOS can backport to JTS.
* Short circuits, indexes, other non-language optimizations, should be ticketed in JTS when they are added to GEOS.

### Follow JTS as Much as Possible
Expand All @@ -20,10 +20,17 @@
* Method names
* Variable names
* Class members
* If class members are shadowed by local variables, use the `m_` prefix convention for the member.

* Yes, we know in your last job you were taught all member variables are prefixed with `m_`, but please don't.
## C/C++ Guidelines

C++ is a large, complex language, with many patterns that have evolved over the years.
The GEOS codebase has also evolved over the years, but parts still exhibit obsolete language
and project patterns.
When porting or adding code, follow the style of the most recently written code (use the commit history to find this).

In general, we follow the [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines).
The following summarizes some of the key patterns used in GEOS.

### Manage Lifecycles

Expand Down Expand Up @@ -58,6 +65,16 @@ public:
* You can pass pointers to the object to other methods using `std::unique_ptr<>.get()`.
### Resource Management
[Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#r-resource-management).
* [A raw pointer (a T*) is non-owning](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-ptr)
* [A raw reference (a T&) is non-owning](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-ref)
### Function calling conventions
* Prefer T* over T& when “no argument” is a valid option
### Avoid Many Small Heap Allocations
* Heap allocations (objects created using `new`) are more expensive than stack allocations, but they can show up in batchs in JTS in places where structures are built, like index trees, or graphs.
Expand Down
81 changes: 61 additions & 20 deletions deps/libgeos/geos/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,58 @@
## Changes in 3.13.0
2024-09-06

## Changes in 3.12.1
2023-11-11
- New things:
- Add Angle::sinCosSnap to avoid small errors, e.g. with buffer operations (GH-978, Mike Taves)
- Add classes for curved geometry types: CircularString, CompoundCurve, CurvedPolygon, MultiCurve,
MultiSurface (GH-1046, Dan Baston/German QGIS users group/Canton of Basel-Landschaft/Canton of Zug)
- Support curved geometry types in WKT/WKB readers/writers (GH-1046, GH-1104, GH-1106, Dan Baston)
- 3D read and write support for GeoJSON (GH-1150, Oreilles)
- Port of RelateNG https://github.com/locationtech/jts/pull/1052 (Martin Davis, Paul Ramsey)
- Rewrite of boolean predicates and relate matrix calculations
- "Prepared" mode now available for all predicates and relate matrix
- CAPI functions GEOSPreparedRelate and GEOSPreparedRelatePattern expose new functionality
- CAPI implementations of GEOSPreparedTouches, etc, that were previously defaulting
into non-prepared implementations now default into the RelateNG prepared implementation
- Prepared implementations for Intersects, Covers, still use the older implementations
- https://lin-ear-th-inking.blogspot.com/2024/05/jts-topological-relationships-next.html
- https://lin-ear-th-inking.blogspot.com/2024/05/relateng-performance.html

- Breaking Changes
- Zero-length linestrings (eg LINESTRING(1 1, 1 1)) are now treated as equivalent to points (POINT(1 1)) in boolean predicates
- CMake 3.15 or later is requried (GH-1143, Mike Taves)

- Fixes:
- Remove undefined behaviour in use of null PrecisionModel (GH-931, Jeff Walton)
- Explicitly set endianness for some tests so that output matches expected (GH-934, Paul Ramsey)
- Fixes/Improvements:
- WKTReader: Points with all-NaN coordinates are not considered empty anymore (GH-927, Casper van der Wel)
- WKTWriter: Points with all-NaN coordinates are written as such (GH-927, Casper van der Wel)
- ConvexHull: Performance improvement for larger geometries (JTS-985, Martin Davis)
- Distance: Improve performance, especially for point-point distance (GH-1067, Dan Baston)
- Intersection: change to using DoubleDouble computation to improve robustness (GH-937, Martin Davis)
- Fix LargestEmptyCircle to respect polygonal obstacles (GH-939, Martin Davis)
- Fix WKTWriter to emit EMPTY elements in multi-geometries (GH-952, Mike Taves)
- Fix IncrementalDelaunayTriangulator to ensure triangulation boundary is convex (GH-953, Martin Davis)
- Improve scale handling for PrecisionModel (GH-956, Martin Davis)
- Fix PreparedLineStringDistance for lines within envelope and polygons (GH-959, Martin Davis)
- Improve scale handling for PrecisionModel (GH-956, Martin Davis)
- Fix error in CoordinateSequence::add when disallowing repeated points (GH-963, Dan Baston)
- Fix WKTWriter::writeTrimmedNumber for big and small values (GH-973, Mike Taves)
- Fix InteriorPointPoint to handle empty elements (GH-977, Martin Davis)
- Skip over testing empty distances for mixed collections. (GH-979, Paul Ramsey)
- Fix TopologyPreservingSimplifier endpoint handling to avoid self-intersections (GH-986, Martin Davis)
- Build warnings with Visual Studio (GH-929, Jeff Mckenna, Paul Ramsey)
- Fix CMake on Windows with Visual Studio (GH-945, Aaron Barany)
- Fix spatial predicates for MultiPoint with EMPTY (GH-989, Martin Davis)
- Fix DiscreteHausdorffDistance for LinearRing (GH-1000, Martin Davis)
- Fix IsSimpleOp for MultiPoint with empty element (GH-1005, Martin Davis)
- Fix PreparedPolygonContains for GC with MultiPoint (GH-1008, Martin Davis)
- Fix reading WKT with EMPTY token with white space (GH-1025, Mike Taves)
- Fix buffer Inverted Ring Removal check (GH-1056, Martin Davis)
- Add PointLocation.isOnSegment and remove LineIntersector point methods (GH-1083, Martin Davis)
- Densify: Interpolate Z coordinates (GH-1094)
- GEOSLineSubstring: Fix crash on NaN length fractions (GH-1088, Dan Baston)
- MinimumClearance: Fix crash on NaN inputs (GH-1082, Dan Baston)
- Centroid: Fix crash on polygons with empty holes (GH-1075, Dan Baston)
- GEOSRelatePatternMatch: Fix crash on invalid DE-9IM pattern (GH-1089, Dan Baston)
- CoveragePolygonValidator: add section performance optimization (GH-1099, Martin Davis)
- TopologyPreservingSimplifier: fix to remove ring endpoints safely (GH-1110, Martin Davis)
- TopologyPreservingSimplifier: fix stack overflow on degenerate inputs (GH-1113, Dan Baston)
- DouglasPeuckerSimplifier: fix stack overflow on NaN tolerance (GH-1114, Dan Baston)
- GEOSConcaveHullOfPolygons: Avoid crash on zero-area input (GH-1076, Dan Baston)

## Changes in 3.12.0
2023-06-27
Expand Down Expand Up @@ -82,13 +121,13 @@
- MaximumInscribedCircle: Fix infinite loop with non-finite coordinates (GH-843, Dan Baston)
- DistanceOp: Fix crash on collection containing empty point (GH-842, Dan Baston)
- OffsetCurve: improve behaviour and add Joined mode (JTS-956, Martin Davis)
- GeometryPrecisionReducer: preserve input collection types (GH-846, Paul Ramsey)
- OffsetCurve: handle zero-distance offsets (GH-850, Martin Davis)
- OffsetCurve: fix EndCap parameter handling (GH-899, Martin Davis)
- GeometryPrecisionReducer: preserve input collection types (GH-846, Paul Ramsey)
- Tri: add exceptions for invalid indexes (GH-853, Martin Davis)
- LargestEmptyCircle: enhance boundary to allow any polygonal geometry (GH-859, Martin Davis)
- Fix MaximumInscribedCircle and LargestEmptyCircle performance and memory issues (GH-883, Martin Davis)
- GEOSHasZ: Fix handling with empty geometries (GH-887, Mike Taves)
- OffsetCurve: fix EndCap parameter handling (GH-899, Martin Davis)
- Reduce artifacts in single-sided Buffers: (GH-665 #810 and #712, Sandro Santilli)
- GeoJSONReader: Fix 2D empty geometry creation (GH-909, Mike Taves)
- GEOSClipByRect: Fix case with POINT EMPTY (GH-913, Mike Taves)
Expand Down Expand Up @@ -141,6 +180,8 @@
- Fix BufferOp inverted ring check (JTS-878, Martin Davis)
- Fix OverlayNG geomunion to avoid lines in result (Martin Davis)

- Changes:
- Offset curves now have the same direction as the input line, for both positive and negative offsets.

## Changes in 3.10.0
2021-10-20
Expand Down Expand Up @@ -189,7 +230,7 @@
- Autoconf build system is dropped in favour of CMake
See README.md and INSTALL.md for examples of usage
- Libtool is no longer used for in favour of CMake
Therefor libgeos.la is no longer built/installed
Therefore libgeos.la is no longer built/installed
- #1094, #1090: Drop inlines.cpp to address duplicate symbols on many platforms
(Regina Obe)
- GH475: Do not return NaN from GEOSProjectNormalized_r (Paul Ramsey)
Expand All @@ -214,7 +255,7 @@
- Update geos-config tool for consistency
and escape paths (https://git.osgeo.org/gitea/geos/geos/pulls/99)
changes mostly affect CMake MSVC builds (#1015, Mike Taves)
- Testing on Rasberry Pi 32-bit (berrie) (#1017, Bruce Rindahl, Regina Obe)
- Testing on Raspberry Pi 32-bit (berrie) (#1017, Bruce Rindahl, Regina Obe)
- Replace ttmath with JTS DD double-double implementation (Paul Ramsey)
- Fix bug in DistanceOp for geometries with empty components (#1026, Paul Ramsey)
- Remove undefined behaviour in CAPI (#1021, Greg Troxel)
Expand Down Expand Up @@ -466,7 +507,7 @@ See 3.7.0 notes
- Fix area boundary return from GEOSPointOnSurface (#623)
- Speedup GEOSWKBReader_read (#621)
- Fix RobustLineIntersector handling of invalid intersection points (#622)
- Reduce likelyhood of invalid output from snap operation (#629, #501)
- Reduce likelihood of invalid output from snap operation (#629, #501)
- Reduce memory fragmentation of prepared Polygon/Point intersection op
- Fix mingw64 compile (#630)
- Fix bug in HotPixel constructor (#635)
Expand Down Expand Up @@ -497,7 +538,7 @@ See 3.7.0 notes
2012-11-15 -- that's Post-GIS day !

- Bug fixes / improvements
- Add support for testing with phpunit 3.6 (not loosing support for 3.4)
- Add support for testing with phpunit 3.6 (not losing support for 3.4)
- Segfault from intersection (#586, #598, #599)

## Changes in 3.3.5
Expand Down Expand Up @@ -578,7 +619,7 @@ See 3.7.0 notes
GEOSGeom_createEmptyPolygon, GEOSGeom_createEmptyCollection
- CAPI: GEOSGeom_extractUniquePoints
- CAPI: GEOSGetGeometryN support for single geometries
- CAPI: GEOSPolygonize_full to return all informations computed by
- CAPI: GEOSPolygonize_full to return all information computed by
the polygonizer
- CAPI: GEOSOrientationIndex
- CAPI: GEOSSharedPaths to find shared paths and their orientation
Expand Down Expand Up @@ -671,7 +712,7 @@ See 3.7.0 notes
- New operation/predicate package
- Added CGAlgorithms::isPointInRing() version working with
Coordinate::ConstVect type (faster!)
- Added getAt(int pos, Coordinate &to) funtion to CoordinateSequence
- Added getAt(int pos, Coordinate &to) function to CoordinateSequence
class.
- Moved GetNumGeometries() and GetGeometryN() interfaces
from GeometryCollection to Geometry class.
Expand Down Expand Up @@ -743,12 +784,12 @@ See 3.7.0 notes
- Namespaces mapping JTS packages
- Renamed classes after JTS names (namespaces use made this possible
w/out name clashes)
- Splitted headers, for build speedup and possible API reduction.
- Split headers, for build speedup and possible API reduction.
- Moved source/bigtest and source/test to tests/bigtest
and test/xmltester
- Moved C-API in it's own top-level dir capi/
- Reworked automake scripts to produce a static lib for each subdir
and then link all subsystem's libs togheter
and then link all subsystem's libs together
- Renamed DefaultCoordinateSequence to CoordinateArraySequence.
- Renamed OverlayOp opcodes by prepending the 'op' prefix, and
given the enum a name (OpCode) for type-safety.
Expand Down Expand Up @@ -784,7 +825,7 @@ See 3.7.0 notes
use unsigned int rather then int
- Changed EdgeEndStar to maintain a single container for EdgeEnds
- Changed PlanarGraph::addEdges to take a const vector by ref
rathern then a non-const vector by pointer
rather then a non-const vector by pointer
- Changed EdgeList::addAll to take a const vector by ref
rather then a non-const vector by pointer
- Added apply_rw(CoordinateFilter *) and apply_ro(CoordinateFilter *)
Expand Down
10 changes: 5 additions & 5 deletions deps/libgeos/geos/Version.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# GEOS Versions
GEOS_VERSION_MAJOR=3
GEOS_VERSION_MINOR=12
GEOS_VERSION_PATCH=1
GEOS_VERSION_MINOR=13
GEOS_VERSION_PATCH=0

# OPTIONS: "", "dev", "rc1" etc.
GEOS_PATCH_WORD=
Expand All @@ -15,9 +15,9 @@ GEOS_PATCH_WORD=
# - Deleting interfaces / compatibility issues - bump CURRENT, others to zero
# ( THIS MUST BE CAREFULLY AVOIDED )
#
CAPI_INTERFACE_CURRENT=19
CAPI_INTERFACE_REVISION=1
CAPI_INTERFACE_AGE=18
CAPI_INTERFACE_CURRENT=20
CAPI_INTERFACE_REVISION=0
CAPI_INTERFACE_AGE=19

# JTS Port
JTS_PORT=1.18.0
Loading

0 comments on commit 59c67a0

Please sign in to comment.