Changelog History
Page 1
-
v0.40.0 Changes
2022-09-28
Special thanks to @missinglink and Albert Teoh for contributing to this ๐ release.
๐ Fix a bug where the original coordinates type was not retained when using the
OmitInvalid
constructor option on invalidLineString
s andPolygon
s.๐ Improves the performance of WKB parsing.
โ Add a
TransformXY
method to theEnvelope
type.
-
v0.39.0 Changes
2022-06-10
Special thanks to David McLeish and Albert Teoh for contributing to this ๐ release.
- โ Add support for
GeometryCollection
s inUnion
,Intersection
,Difference
,SymmetricDifference
, andRelate
.
- โ Add support for
-
v0.38.0 Changes
2022-05-27
๐ Special thanks to Sameera Perera and Albert Teoh for contributing to this release.
โ Add initial linear referencing methods to
LineString
. The initial methods areInterpolatePoint
andInterpolateEvenlySpacedPoints
.๐ Fixes a bug in the
TransformXY
method where emptyMultiPoint
andMultiLineString
s would have their coordinates type downgraded to XY.โ Add a new
DumpRings
method to thePolygon
type, which gives the rings of the polygon as a slice ofLineString
s.๐ Uses
unsafe.Slice
for internal WKB conversions. This increases the minimum Go version required to use simplefeatures from 1.14 to 1.17.
-
v0.37.0 Changes
2022-03-29
๐ Special thanks to Lachlan Patrick and Albert Teoh for contributing to this release.
๐ Improves performance of
ForceCW
andForceCCW
methods by eliminating unneeded memory allocations.โ Adds full support for TWKB (Tiny Well Known Binary) as a serialisation format.
๐ Fixes a vet warning affecting Go 1.18 relating to printf verbs in tests.
๐ Fixes a bug in
ExactEquals
that incorrectly compares empty points of unequal coordinate type as being equal.
-
v0.36.0 Changes
2022-01-24
๐ Special thanks to Lachlan Patrick and Albert Teoh for contributing to this release.
Eliminates redundant calls to the optional user supplied transform func during area calculations.
โ Adds
IsCW
andIsCCW
methods, which check if geometries have consistent clockwise or counterclockwise winding orientation.
-
v0.35.0 Changes
2021-11-23
๐ Special thanks to Albert Teoh and Sameera Perera for contributing to this release.
๐ Fixes spelling of "Marshaller" when referring to the interface defined in the
encoding/json
package.โ Adds
UnmarshalJSON
methods to each concrete geometry type (GeometryCollection
,Point
,MultiPoint
,LineString
,MultiLineString
,Polygon
,MultiPolygon
). This causes these types to implement theencoding/json.Unmarshaler
interface. GeoJSON can now be unmarshalled directly into a concrete geometry type.๐ Uses the
%w
verb for wrapping errors internally. Note that simplefeatures does not yet currently expose any sentinel errors or error types.๐ฅ Breaking change: Changes the
Simplify
package level function to become a method on theGeometry
type. Users upgrading can just change function invocations that look likesimp, err := geom.Simplify(g, tolerance)
to method invocations that look likesimp, err := g.Simplify(tolerance)
.โ Adds
Simplify
methods to the concrete geometry typesLineString
,MultiLineString
,Polygon
,MultiPolygon
, andGeometryCollection
. These methods may be used if one of these concrete geometries is to be simplified, rather than converting to aGeometry
, callingSimplify
, then converting back to the concrete geometry type.๐ Fixes a bug in Simplify where invalid interior rings would be omitted rather than producing an error.
โ Adds a wrapper in the
geos
package for theGEOSMakeValid_r
function (exposed asMakeValid
).
-
v0.34.0 Changes
2021-11-02
๐ Special thanks to Albert Teoh for contributing to this release.
๐ฅ Breaking change: Renames the
AsFoo
methods of the Geometry type toMustAsFoo
(whereFoo
is a concrete geometry type such asPoint
). This follows the go convention that methods and functions prefixed with Must may panic if preconditions are not met. Note that there's no change in behaviour here, it's simply a rename (these methods previously panicked). Users may resolve this breaking change by just updating the names of anyAsFoo
methods they are calling toMustAsFoo
.๐ฅ Breaking change: Adds new methods named
AsFoo
to the Geometry type. These methods have the signatureAsFoo() (Foo, bool)
. The boolean return value indicates if the conversion was successful or not. These methods are useful because they allow concrete geometries to be extracted from a Geometry value, with the concrete type for theIs
andAs
call only specified once. Users now just have to callAsFoo
, and can then check the flag. This helps to eliminate the class of bugs there the type specified withIsFoo
erroneously differs from the type specified byAsFoo
.
-
v0.33.1 Changes
2021-10-14
๐ Special thanks to Albert Teoh for contributing to this release.
- โ Adds a new method
MinMaxXYs (XY, XY, bool)
to theEnvelope
type. The first two return values are the minimum and maximum XY values in the envelope, and the third return value indicates whether or not the first two are defined (they are only defined for non-empty envelopes).
- โ Adds a new method
-
v0.33.0 Changes
2021-10-11
๐ Special thanks to Albert Teoh for contributing to this release.
๐ฅ Breaking change: The
Envelope
type 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. ItsAsGeometry
returns an emptyGeometryCollection
in the case where it's empty. The result ofAsGeometry
is unchanged for non-empty envelopes.๐ฅ Breaking change: The
NewEnvelope
function signature has changed. It now accepts a slice ofgeom.XY
as 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
Envelope
type'sEnvelopeFromGeoms
method has been removed. To replicate the behaviour of this method, users can construct aGeometryCollection
and call itsEnvelope
method.๐ฅ Breaking change: The
Envelope
type'sMin
,Max
, andCenter
methods now returnPoint
s rather thanXY
s. When the envelope is empty,Min
,Max
, andCenter
return empty points.๐ฅ Breaking change: The
Envelope
type'sDistance
method 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
Envelope
method on theGeometry
,GeometryCollection
,Point
,LineString
,Polygon
,MultiPoint
,MultiLineString
, andMultiPolygon
types now returnEnvelope
instead of(Envelope, bool)
. The empty vs non-empty status is encoded inside the envelope instead of via an explicit boolean.The
Envelope
type now hasIsEmpty
,IsPoint
,IsLine
, andIsRectanagle
methods. 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
MultiPoint
constructors and simplifiesMultiPoint
internal representation. Removes theBitSet
type, previously used forMultiPoint
construction. Removes theNewMultiPointFromPoints
andNewMultiPointWithEmptyMask
functions. Modifies theNewMultiPoint
function to accept a slice ofPoint
s rather than aSequence
.๐ฅ Breaking change: Consolidates
Point
construction. Removes theNewPointFromXY
function. It is replaced by a newAsPoint
method on theXY
type.๐จ Refactors internal test helpers.
โ Adds linting to CI using
golangci-lint
.๐ฅ Breaking change: Renames geometry constructors for consistency.
NewPolygonFromRings
is renamed toNewPolygon
.NewMultiLineStringFromLineStrings
is renamed toNewMultiLineString
.NewMultiPolygonFromPolygons
is renamed toNewMultiPolygon
.๐ฅ Breaking change: Adds checks for anomalous
float64
values (NaN and +/- infinity) during geometry construction.- The
NewPoint
function now returns(Point, error)
rather thanPoint
. The returned error is non-nil when the inputs contain anomalous values. - The
NewLineString
function's signature doesn't change, but now returns a non-nil error if the inputSequence
contains anomalous values. - The
OmitInvalid
constructor option now has implications when constructingPoint
andMultiPoint
types. - The
NewEnvelope
function now returns(Envelope, error)
rather thanEnvelope
. The returned error is non-nil when when the input XYs contain anomalous values. - The
Envelope
type'sExtendToIncludePoint
method 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
Envelope
type'sExpandBy
method is removed due to its limited utility and complex interactions with anomalous values.
- The