Skip to content

Releases: peterstace/simplefeatures

v0.38.0

29 Sep 00:58
Compare
Choose a tag to compare

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 are InterpolatePoint and InterpolateEvenlySpacedPoints.

  • Fixes a bug in the TransformXY method where empty MultiPoint and MultiLineStrings would have their coordinates type downgraded to XY.

  • Add a new DumpRings method to the Polygon type, which gives the rings of the polygon as a slice of LineStrings.

  • 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

29 Sep 00:58
Compare
Choose a tag to compare

2022-03-29

Special thanks to Lachlan Patrick and Albert Teoh for contributing to this release.

  • Improves performance of ForceCW and ForceCCW 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

29 Sep 00:58
Compare
Choose a tag to compare

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 and IsCCW methods, which check if geometries have consistent clockwise or counterclockwise winding orientation.

v0.35.0

29 Sep 00:58
Compare
Choose a tag to compare

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 the encoding/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 the Geometry type. Users upgrading can just change function invocations that look like simp, err := geom.Simplify(g, tolerance) to method invocations that look like simp, err := g.Simplify(tolerance).

  • Adds Simplify methods to the concrete geometry types LineString, MultiLineString, Polygon, MultiPolygon, and GeometryCollection. These methods may be used if one of these concrete geometries is to be simplified, rather than converting to a Geometry, calling Simplify, 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 the GEOSMakeValid_r function (exposed as MakeValid).

v0.34.0

29 Sep 00:58
Compare
Choose a tag to compare

2021-11-02

Special thanks to Albert Teoh for contributing to this release.

  • Breaking change: Renames the AsFoo methods of the Geometry type to MustAsFoo (where Foo is a concrete geometry type such as Point). 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 any AsFoo methods they are calling to MustAsFoo.

  • Breaking change: Adds new methods named AsFoo to the Geometry type. These methods have the signature AsFoo() (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 the Is and As call only specified once. Users now just have to call AsFoo, and can then check the flag. This helps to eliminate the class of bugs there the type specified with IsFoo erroneously differs from the type specified by AsFoo.

v0.33.1

29 Sep 00:58
Compare
Choose a tag to compare

2021-10-14

Special thanks to Albert Teoh for contributing to this release.

  • Adds a new method MinMaxXYs (XY, XY, bool) to the Envelope 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).

v0.33.0

29 Sep 00:58
Compare
Choose a tag to compare

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. Its AsGeometry returns an empty GeometryCollection in the case where it's empty. The result of AsGeometry is unchanged for non-empty envelopes.

  • Breaking change: The NewEnvelope function signature has changed. It now accepts a slice of geom.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's EnvelopeFromGeoms method has been removed. To replicate the behaviour of this method, users can construct a GeometryCollection and call its Envelope method.

  • Breaking change: The Envelope type's Min, Max, and Center methods now return Points rather than XYs. When the envelope is empty, Min, Max, and Center return empty points.

  • Breaking change: The Envelope type's Distance method now returns (float64, bool) rather than float64. 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 the Geometry, GeometryCollection, Point, LineString, Polygon, MultiPoint, MultiLineString, and MultiPolygon types now return Envelope 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 has IsEmpty, IsPoint, IsLine, and IsRectanagle methods. These correspond to the 4 possible envelope categories.

v0.32.0

29 Sep 00:58
Compare
Choose a tag to compare

2021-09-08

Special thanks to Albert Teoh for contributing to this release.

  • Breaking change: Consolidates MultiPoint constructors and simplifies MultiPoint internal representation. Removes the BitSet type, previously used for MultiPoint construction. Removes the NewMultiPointFromPoints and NewMultiPointWithEmptyMask functions. Modifies the NewMultiPoint function to accept a slice of Points rather than a Sequence.

  • Breaking change: Consolidates Point construction. Removes the NewPointFromXY function. It is replaced by a new AsPoint method on the XY type.

  • Refactors internal test helpers.

  • Adds linting to CI using golangci-lint.

  • Breaking change: Renames geometry constructors for consistency. NewPolygonFromRings is renamed to NewPolygon. NewMultiLineStringFromLineStrings is renamed to NewMultiLineString. NewMultiPolygonFromPolygons is renamed to NewMultiPolygon.

  • Breaking change: Adds checks for anomalous float64 values (NaN and +/- infinity) during geometry construction.

    • The NewPoint function now returns (Point, error) rather than Point. 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 input Sequence contains anomalous values.

    • The OmitInvalid constructor option now has implications when constructing Point and MultiPoint types.

    • The NewEnvelope function now returns (Envelope, error) rather than Envelope. The returned error is non-nil when when the input XYs contain anomalous values.

    • The Envelope type's ExtendToIncludePoint method is renamed to ExtendToIncludeXY (better matching its argument type). It now returns (Envelope, erorr) rather than Envelope. The returned error is non-nil if the inputs contain any anomalous values.

    • The Envelope type's ExpandBy method is removed due to its limited utility and complex interactions with anomalous values.

v0.31.0

29 Sep 00:58
Compare
Choose a tag to compare

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 DumpCoordinates method to geometry types. This method returns a Sequence containing all of the control points that define the geometry.

  • Adds a new Summary method 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 String method to all geometry types, implementing the fmt.Stringer interface. The method returns the same string as that returned by the Summary method.

  • Adds a new NumRings method to the Polygon type. This method gives the total number of rings that make the polygon.

v0.30.0

29 Sep 00:58
Compare
Choose a tag to compare

2021-07-18

  • Adds Dump methods to Geometry, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection types. These methods break down composite geometries into their constituent non-multi type parts (i.e. Points, LineStrings, and Polygons) and return them as a slice.

  • Fixes a bug in the BitSet data structure. This data structure is used to specify which Points within a MultiPoint are empty during manual construction.