Changelog History
Page 3
-
v0.33.0 Changes
2021-10-11
๐ Special thanks to Albert Teoh for contributing to this release.
๐ฅ Breaking change: The
Envelopetype can now be an empty envelope. Previously, it was only able to represent a rectangle with some area, a horizontal or vertical line, or a single point. ItsAsGeometryreturns an emptyGeometryCollectionin the case where it's empty. The result ofAsGeometryis unchanged for non-empty envelopes.๐ฅ Breaking change: The
NewEnvelopefunction signature has changed. It now accepts a slice ofgeom.XYas the sole argument. The behaviour of the function is the same as before, except that if no XY values are provided then an empty envelope is returned without error.๐ฅ Breaking change: The
Envelopetype'sEnvelopeFromGeomsmethod has been removed. To replicate the behaviour of this method, users can construct aGeometryCollectionand call itsEnvelopemethod.๐ฅ Breaking change: The
Envelopetype'sMin,Max, andCentermethods now returnPoints rather thanXYs. When the envelope is empty,Min,Max, andCenterreturn empty points.๐ฅ Breaking change: The
Envelopetype'sDistancemethod now returns(float64, bool)rather thanfloat64. The returned boolean is only true if the distance between the two envelopes is defined (i.e. when they are both non-empty).๐ฅ Breaking change: The
Envelopemethod on theGeometry,GeometryCollection,Point,LineString,Polygon,MultiPoint,MultiLineString, andMultiPolygontypes now returnEnvelopeinstead of(Envelope, bool). The empty vs non-empty status is encoded inside the envelope instead of via an explicit boolean.The
Envelopetype now hasIsEmpty,IsPoint,IsLine, andIsRectanaglemethods. These correspond to the 4 possible envelope categories.
-
v0.32.0 Changes
2021-09-08
๐ Special thanks to Albert Teoh for contributing to this release.
๐ฅ Breaking change: Consolidates
MultiPointconstructors and simplifiesMultiPointinternal representation. Removes theBitSettype, previously used forMultiPointconstruction. Removes theNewMultiPointFromPointsandNewMultiPointWithEmptyMaskfunctions. Modifies theNewMultiPointfunction to accept a slice ofPoints rather than aSequence.๐ฅ Breaking change: Consolidates
Pointconstruction. Removes theNewPointFromXYfunction. It is replaced by a newAsPointmethod on theXYtype.๐จ Refactors internal test helpers.
โ Adds linting to CI using
golangci-lint.๐ฅ Breaking change: Renames geometry constructors for consistency.
NewPolygonFromRingsis renamed toNewPolygon.NewMultiLineStringFromLineStringsis renamed toNewMultiLineString.NewMultiPolygonFromPolygonsis renamed toNewMultiPolygon.๐ฅ Breaking change: Adds checks for anomalous
float64values (NaN and +/- infinity) during geometry construction.- The
NewPointfunction now returns(Point, error)rather thanPoint. The returned error is non-nil when the inputs contain anomalous values. - The
NewLineStringfunction's signature doesn't change, but now returns a non-nil error if the inputSequencecontains anomalous values. - The
OmitInvalidconstructor option now has implications when constructingPointandMultiPointtypes. - The
NewEnvelopefunction now returns(Envelope, error)rather thanEnvelope. The returned error is non-nil when when the input XYs contain anomalous values. - The
Envelopetype'sExtendToIncludePointmethod is renamed toExtendToIncludeXY(better matching its argument type). It now returns(Envelope, erorr)rather thanEnvelope. The returned error is non-nil if the inputs contain any anomalous values. - The
Envelopetype'sExpandBymethod is removed due to its limited utility and complex interactions with anomalous values.
- The
-
v0.31.0 Changes
2021-08-09
๐ Special thanks to Albert Teoh for contributing to this release.
๐ Fixes some minor linting (and other similar) issues identified by Go Report Card.
โ Adds a new
DumpCoordinatesmethod to geometry types. This method returns aSequencecontaining all of the control points that define the geometry.โ Adds a new
Summarymethod to all geometry types. This method gives a short and human readable summary of geometry values. The summary includes the geometry type, coordinates type, and component cardinalities where appropriate (e.g. number of rings in a polygon).โ Adds a new
Stringmethod to all geometry types, implementing thefmt.Stringerinterface. The method returns the same string as that returned by theSummarymethod.โ Adds a new
NumRingsmethod to thePolygontype. This method gives the total number of rings that make the polygon.
-
v0.30.0 Changes
2021-07-18
โ Adds
Dumpmethods toGeometry,MultiPoint,MultiLineString,MultiPolygon, andGeometryCollectiontypes. These methods break down composite geometries into their constituent non-multi type parts (i.e.Points,LineStrings, andPolygons) and return them as a slice.๐ Fixes a bug in the
BitSetdata structure. This data structure is used to specify which Points within a MultiPoint are empty during manual construction.
-
v0.29.0 Changes
2021-07-04
Modifies error string formatting to be more consistent. Errors should treated opaquely by users, so this change is only cosmetic.
โ Modifies the GEOS wrapper functions for testing spatial relationships between geometries to use direct pass through to their GEOS equivalents. These functions are
Equals,Disjoint,Touches,Contains,Covers,Intersects,Within,CoveredBy,Crosses, andOverlaps(all in thegeospackage). Previously, these functions passed through toGEOSRelatePattern_r(which calculates a DE-9IM Intersection Matrix), and the intersection relationship was calculated in Go afterwards. Using a more direct passthrough allows the GEOS library to make better optimisations in same case.
-
v0.28.1 Changes
2021-05-14
- Modifies the
Simplifyfunction to use an iterative rather than recursive approach. This prevents crashes for complex geometries.
- Modifies the
-
v0.28.0 Changes
2021-05-14
Reimplements the
ConvexHulloperation using a more robust and numerically stable algorithm. The new algorithm is the Monotone Chain algorithm (also known as Andrew's Algorithm).โ Adds a new
Simplifyfunction that simplifies geometries using the Ramer Douglas Peucker algorithm.
-
v0.27.0 Changes
2021-04-11
๐ Changes the
Boundarymethod to use GEOS style behaviour rather than PostGIS style behaviour for empty geometries. This means thatBoundarynow always returns a consistent geometry type.โ Adds back the RTree
InsertandDeletemethods. These were previously removed in v0.25.1.โ Adds
Scanmethods to each concrete geometry type, so that that they implement thedatabase/sql.Scannerinterface.
-
v0.26.0 Changes
2021-02-19
โ Adds a
Relatetop level function, which calculates the DE-9IM matrix describing the relationship between two geometries.โ Adds named spatial predicate top level functions, implemented in terms of DE-9IM matches. These are
Equals,Intersects,Disjoint,Contains,CoveredBy,Covers,Overlaps,Touches,Within, andCrosses.
-
v0.25.1 Changes
2021-01-31
๐ Fixes a noding bug in DCEL operations (
Intersection,Union,Difference, andSymmetricDifference) that occasionally caused a panic.๐ Changes the strategy for joining together geometries in DCEL operations using "ghost lines". Geometries were previously joining using a naive radial line approach, but are now joining using a euclidean minimum spanning tree. This greatly reduces the number of additional crossing control points introduced by DCEL operations.