Releases: peterstace/simplefeatures
v0.59.0
v0.58.0
2026-02-15
-
Add
PreparedGeometrytype andPreparefunction for efficient repeated spatial predicate evaluation. When a geometry is prepared, it caches spatial indices so that subsequent calls toIntersects,Contains,ContainsProperly,CoveredBy,Covers,Crosses,Disjoint,Overlaps,Touches, andWithinagainst different test geometries are fast. The implementation is based on a port of JTS. -
Add
Bufferfunction that computes the buffer of a geometry at a given distance. Options are available for controlling quad segments, end cap style (round, flat, square), join style (round, mitre, bevel), single-sided mode, and simplify factor. The implementation is based on a port of JTS. This means thatBufferis now available natively in Go without need for the GEOS dependency. -
Change
GeometryCollection.Dimension()to return -1 for empty geometry collections (previously returned 0). This change is consistent with GEOS. -
Fix overlay operations (Union, Intersection, Difference, SymmetricDifference) to return dimension-appropriate empty geometries. For example, the difference of two equal polygons now returns
POLYGON EMPTYrather thanGEOMETRYCOLLECTION EMPTY. -
Optimize Intersection to return early when input envelopes are disjoint.
-
Optimize overlay operations (Intersection, Difference) for GeometryCollections by using R-Tree indexing to reduce O(M×N) to O(M log N) complexity.
v0.57.0
2026-01-30
Special thanks to Albert Teoh for contributing to this release.
-
Port JTS to Go and use for all relate (covers, touches, etc.) and overlay (union, intersection etc.) operations. This fixes rare numerical stabilities issues that were present with the previous DCEL implementation.
-
Add additional validation to help prevent OOMs during WKB parsing.
-
Fix
ExactEqualswithIgnoreOrderincorrectly returning false for polygons with non-simple rings that differ only by rotation.
v0.56.0
2025-11-21
-
Refactors the internal representation of the
geom.Geometrytype to useanyinstead ofunsafe.Pointer. This makes geometries compatible withreflect.DeepEqual, which now produces the same result asExactEqualswhen called with no options. This change is not detectable externally except thatreflect.DeepEqualnow works correctly for exactly comparing geometries. -
Replaces all occurrences of
interface{}withanythroughout the codebase. This includes function parameters, return types, struct fields, and type assertions. -
Breaking change: The minimum required Go version is now 1.18 (previously 1.17). This is required to support the
anykeyword.
v0.55.0
2025-10-10
-
Breaking change: Adds support for foreign members in GeoJSON Feature Collections. This necessitates a breaking change to the
geom.GeoJSONFeatureCollectiontype. It was previously defined as[]geom.GeoJSONFeature, but is now defined as a struct with aFeatures []geom.GeoJSONFeaturefield and aForeignMembers map[string]json.RawMessagefield. -
Simplifies some internals for GeoJSON marshalling. This change is not detectable externally.
-
Adds support for XYZM coordinate types when unmarshalling GeoJSON.
v0.54.0
2025-06-16
Special thanks to @gamzeozgul for contributing to this release.
-
Adds a new package
github.com/peterstace/simplefeatures/projthat wraps the PROJ library. This package provides functionality for transforming geometries between a vast array of different coordinate reference systems. -
Adds new
ToleranceZandToleranceMoptions for use with theExactEqualsfunction. These options allow geometries to compare as equal, even when their Z and M values differ slightly. -
Adds UTM projection support to the
cartopackage. This allows projecting geometries between angular (lon/lat) coordinates and UTM (x/y) coordinates. -
Adds new
FlipCoordinatesmethods to each geometry type. This method creates a new geometry with the X and Y coordinates interchanged.
v0.53.0
2025-01-31
- Adds a new package github.com/nearmap/simplefeatures/carto package that provides cartography functionality for working with and making maps. Initially this includes transformations between angular (lon/lat) and planar (x/y) coordinates for various simple projections.
v0.52.0
2024-10-08
Special thanks to Albert Teoh for contributing to this release.
-
Upgrades
golangci-linttov1.61.0. -
Adds a new group of functions to the
geompackage that construct geometries. These functions have names in the formNew{Type}{Dimension}, whereTypeis one of {Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon}, andDimensionis one of {XY,XYZ,XYM,XYZM}. They accept coordinates at the appropriate level of nesting that corresponds to the geometry type. These functions panic if the number of coordinates provided is not consistent with the dimension (this behaviour is consistent with the behaviour of theNewSequencefunction).
v0.51.0
2024-08-19
Special thanks to Albert Teoh for contributing to this release.
-
Fixes a Polygon validation bug that falsely identified an invalid ring as being valid. The bug occurred in the rare edge case where an inner ring is outside the outer ring and the first control point of the inner ring touches the outer ring.
-
Upgrades
golangci-linttov1.59.1. -
Fixes a bug where geometry collections with mixed coordinate types were erroneously allowed during WKT and WKB parsing.
-
Fixes a bug where the
Simplifymethod would drop coordinate type to XY in some scenarios where the result is an empty geometry. -
Adds a wrapper to the
geospackage for theGEOSTopologyPreserveSimplify_rfunction (exposed asTopologyPreserveSimplify). -
Adds wrappers to the
geospackage for theGEOSCoverageSimplify_randGEOSCoverageSimplifyVW_rfunctions (exposed asCoverageIsValidandCoverageSimplifyVW). -
Breaking change: Overhauls the TWKB unmarshalling related functions in a breaking way:
-
Removes the
UnmarshalTWKBWithHeadersandUnmarshalTWKBBoundingBoxHeaderfunctions. -
Modifies the
UnmarshalTWKBEnvelopefunction to return anExtendedEnvelope(which is a regular XYEnvelopewith the addition of Z and M ranges). -
Adds
UnmarshalTWKBListandUnmarshalTWKBSizefunctions, which return the (optional) ID list and (optional) sizes of TWKBs without fully unmarshalling them.
-
v0.50.0
2024-05-07
Special thanks to Val Gridnev for contributing to this release.
- Adds "foreign member" support for GeoJSON features. This allows for additional properties to be included in GeoJSON features that are not part of the standard GeoJSON specification.