Skip to content

Releases: peterstace/simplefeatures

v0.59.0

27 Mar 03:51

Choose a tag to compare

  • Add geos.ClipByRect function that clips a geometry to an axis-aligned rectangle (defined by a geom.Envelope). This wraps the GEOS GEOSClipByRect operation, which is faster than computing a full Intersection with a rectangular polygon.

v0.58.0

15 Feb 08:44

Choose a tag to compare

2026-02-15

  • Add PreparedGeometry type and Prepare function for efficient repeated spatial predicate evaluation. When a geometry is prepared, it caches spatial indices so that subsequent calls to Intersects, Contains, ContainsProperly, CoveredBy, Covers, Crosses, Disjoint, Overlaps, Touches, and Within against different test geometries are fast. The implementation is based on a port of JTS.

  • Add Buffer function 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 that Buffer is 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 EMPTY rather than GEOMETRYCOLLECTION 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

30 Jan 04:09

Choose a tag to compare

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 ExactEquals with IgnoreOrder incorrectly returning false for polygons with non-simple rings that differ only by rotation.

v0.56.0

20 Nov 23:23

Choose a tag to compare

2025-11-21

  • Refactors the internal representation of the geom.Geometry type to use any instead of unsafe.Pointer. This makes geometries compatible with reflect.DeepEqual, which now produces the same result as ExactEquals when called with no options. This change is not detectable externally except that reflect.DeepEqual now works correctly for exactly comparing geometries.

  • Replaces all occurrences of interface{} with any throughout 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 any keyword.

v0.55.0

10 Oct 04:52

Choose a tag to compare

2025-10-10

  • Breaking change: Adds support for foreign members in GeoJSON Feature Collections. This necessitates a breaking change to the geom.GeoJSONFeatureCollection type. It was previously defined as []geom.GeoJSONFeature, but is now defined as a struct with a Features []geom.GeoJSONFeature field and a ForeignMembers map[string]json.RawMessage field.

  • Simplifies some internals for GeoJSON marshalling. This change is not detectable externally.

  • Adds support for XYZM coordinate types when unmarshalling GeoJSON.

v0.54.0

16 Jun 01:44

Choose a tag to compare

2025-06-16

Special thanks to @gamzeozgul for contributing to this release.

  • Adds a new package github.com/peterstace/simplefeatures/proj that wraps the PROJ library. This package provides functionality for transforming geometries between a vast array of different coordinate reference systems.

  • Adds new ToleranceZ and ToleranceM options for use with the ExactEquals function. These options allow geometries to compare as equal, even when their Z and M values differ slightly.

  • Adds UTM projection support to the carto package. This allows projecting geometries between angular (lon/lat) coordinates and UTM (x/y) coordinates.

  • Adds new FlipCoordinates methods to each geometry type. This method creates a new geometry with the X and Y coordinates interchanged.

v0.53.0

31 Jan 00:08

Choose a tag to compare

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

07 Oct 18:16

Choose a tag to compare

2024-10-08

Special thanks to Albert Teoh for contributing to this release.

  • Upgrades golangci-lint to v1.61.0.

  • Adds a new group of functions to the geom package that construct geometries. These functions have names in the form New{Type}{Dimension}, where Type is one of {Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon}, and Dimension is 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 the NewSequence function).

v0.51.0

18 Aug 19:39

Choose a tag to compare

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-lint to v1.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 Simplify method would drop coordinate type to XY in some scenarios where the result is an empty geometry.

  • Adds a wrapper to the geos package for the GEOSTopologyPreserveSimplify_r function (exposed as TopologyPreserveSimplify).

  • Adds wrappers to the geos package for the GEOSCoverageSimplify_r and GEOSCoverageSimplifyVW_r functions (exposed as CoverageIsValid and CoverageSimplifyVW).

  • Breaking change: Overhauls the TWKB unmarshalling related functions in a breaking way:

    • Removes the UnmarshalTWKBWithHeaders and UnmarshalTWKBBoundingBoxHeader functions.

    • Modifies the UnmarshalTWKBEnvelope function to return an ExtendedEnvelope (which is a regular XY Envelope with the addition of Z and M ranges).

    • Adds UnmarshalTWKBList and UnmarshalTWKBSize functions, which return the (optional) ID list and (optional) sizes of TWKBs without fully unmarshalling them.

v0.50.0

07 May 00:52

Choose a tag to compare

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.