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.
2024-10-08
Special thanks to Albert Teoh for contributing to this release.
-
Upgrades
golangci-lint
tov1.61.0
. -
Adds a new group of functions to the
geom
package that construct geometries. These functions have names in the formNew{Type}{Dimension}
, whereType
is one of {Point
,LineString
,Polygon
,MultiPoint
,MultiLineString
,MultiPolygon
}, andDimension
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 theNewSequence
function).
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
tov1.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 theGEOSTopologyPreserveSimplify_r
function (exposed asTopologyPreserveSimplify
). -
Adds wrappers to the
geos
package for theGEOSCoverageSimplify_r
andGEOSCoverageSimplifyVW_r
functions (exposed asCoverageIsValid
andCoverageSimplifyVW
). -
Breaking change: Overhauls the TWKB unmarshalling related functions in a breaking way:
-
Removes the
UnmarshalTWKBWithHeaders
andUnmarshalTWKBBoundingBoxHeader
functions. -
Modifies the
UnmarshalTWKBEnvelope
function to return anExtendedEnvelope
(which is a regular XYEnvelope
with the addition of Z and M ranges). -
Adds
UnmarshalTWKBList
andUnmarshalTWKBSize
functions, which return the (optional) ID list and (optional) sizes of TWKBs without fully unmarshalling them.
-
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.
2024-04-19
Special thanks to Daniel Cohen for contributing to this release.
- Fixes two bugs in TWKB marshalling and unmarshalling. The first bugfix correctly rounds coordinates (rather than truncating them) and the second bugfix fixes a numerical stability issue when calculating the scale factor.
2024-04-15
Special thanks to Val Gridnev and Albert Teoh for contributing to this release.
-
Adds new
Densify
methods on each concrete geometry types that add additional linearly interpolated control points such that the distance between any two consecutive control points is at most a fixed distance. This can be useful when transforming geometries from one projection to another. -
Adds a new method
SnapToGrid
to each concrete geometry type. The method returns a copy of the geometry with its control points snapped to a base 10 grid. -
Make LERP operations robust in all edge cases.
-
Upgrades
golangci-lint
tov1.56.2
. -
Adds wrappers in the
geos
package for theGEOSConcaveHull_r
function (exposed asConcaveHull
).
2024-04-15
- Adds support for the
sfnopkgconfig
build tag, which has an effect on the build process of thegithub.com/peterstace/geos
package. It causes the#cgo pkg-config
directive to be replaced with the#cgo LDFLAGS: -lgeos_c
directive (which was the previous behaviour, before v0.47.1). This is useful in environments wherepkg-config
is not available or thegeos.pc
file is not installed. The majority of systems won't need to use thesfnopkgconfig
build tag.
2024-03-08
Special thanks to Val Gridnev and Albert Teoh for contributing to this release.
- Uses
#cgo pkg-config
directives in thegithub.com/peterstace/geos
library, rather than manipulatingLDFLAGS
directly. This fixes an issue where the library could not be built on some Mac environments.
2024-01-19
Special thanks to Albert Teoh for contributing to this release.
-
Adds new functions
RotatedMinimumAreaBoundingRectangle
andRotatedMinimumWidthBoundingRectangle
. These functions calculate the non-axis-aligned (rotated) bounding rectangles for geometries, minimising either the area or width. -
Eliminates some redundant benchmarks, improving the execution speed of the benchmark suite.
-
Unify the GEOS wrappers used for the
github.com/peterstace/simplefeatures/geos
package and the package used for reference implementation tests.
2023-11-24
Special thanks to Albert Teoh for contributing to this release.
-
Fixes two DCEL renoding bugs. The first affected some inputs that had overlapping line segments. The second affected some inputs that caused the location of line vs. line intersections to differ on which input was being renoded.
-
Adds a method with signature
Envelope() Envelope
to typeSequence
. -
Simplifies the internal representation of the
Envelope
type. -
Upgrades
golangci-lint
tov1.55.2
. -
Breaking change: Renames
Envelope
'sExtendToIncludeXY
method toExpandToIncludeXY
. This makes the names of theExpandToIncludeXY
andExpandToIncludeEnvelope
methods have consistent naming. -
Breaking change: Alters the signature (and behaviour) of the
NewEnvelope
function. It previously returned anEnvelope
and anerror
, and new just returns anEnvelope
. It no longer validates that its inputs don't contain NaN or +/- infinity (this can be checked via theValidate
method if desired). It also now accepts a variadic list ofXY
values, rather than a slice ofXY
values.
2023-09-29
- Fixes a bug in
Envelope
'sTransformXY
method, where (depending on the transform) invariants in the newly createdEnvelope
value would be violated.
2023-09-29
Special thanks to Albert Teoh for contributing to this release.
This release contains a large number of breaking changes, primarily surrounding geometry validation. See #525 for background and an overview of the changes.
-
Breaking change: The
geom.ConstructorOption
type has been removed. Previous uses ofgeom.DisableAllValidations
can be replaced withgeom.NoValidate
. Previous uses ofOmitInvalid
should be managed manually (no replacement for this functionality is provided). -
A
Validate() error
method is added toGeometry
and each concrete geometry type. This allows geometry constraints to be checked after geometry construction. -
Breaking change: Geometry results from GEOS (wrapped by the
github.com/peterstace/simplefeatures/geos
package) are no longer validated. The variadic constructor options in function signatures have been removed. If users wish to validate these results, thenValidate()
can be called manually. -
Breaking change: The
TransformXY
methods no longer validate geometry constraints of the result. The variadic constructor options have been removed as method parameters, as have the error returns. If users wish to validate these results, thenValidate()
can be called manually. -
Breaking change: The direct geometry constructors (
NewPoint
,NewLineString
,NewPolygon
,NewMultiPoint
,NewMultiLineString
,NewPolygon
, andNewGeometryCollectiion
) no longer perform any geometry validation. They no longer accept constructor options or return an error, resulting in a function signature change. If users wish to validate the results, thenValidate()
can be called manually. -
Breaking change:
XY
'sAsPoint
method no longer checks the validity of the result and no longer returns an error. AnAsPoint
method is added to theCoordinates
type to shadowXY
'sAsPoint
method (sinceXY
is embedded inCoordinates
).
2023-06-23
Special thanks to Albert Teoh for contributing to this release.
-
Breaking change: Removes the
Insert
andDelete
methods from theRTree
type in thertree
package. Users relying on theInsert
andDelete
methods are advised to restructure their programs not to rely on them, or use alternative r-tree implementations, such as thegithub.com/tidwall/rtree
package. -
Performs a minor non-user-facing cleanup in the
rtree
package. -
R-tree performance improvements that moderately reduce the amount of memory and slightly reduce the amount of CPU that they use.
-
Exposes an
AsBox() rtree.Box
method on thegeom.Envelope
type, that converts the envelope to anrtree.Box
. -
Adds a
String() string
method to thegeom.Envelope
type.
2023-06-05
Special thanks to Albert Teoh for contributing to this release.
-
Adds wrappers in the
geos
package for theGEOSUnaryUnion_r
andGEOSCoverageUnion_r
functions (exposed asUnaryUnion
andCoverageUnion
). -
Runs CI against all non-EOL versions of GEOS (3.7 through to 3.11).
-
Replaces CI scripts with a Makefile.
2023-05-05
Special thanks to Albert Teoh for contributing to this release.
-
Updates reference implementation checks to use GEOS 3.11.
-
Fix a bug affecting only
aarch64
that caused wrong results to be given for line/line intersections. The bug did not effectx64_64
.
2023-04-02
Special thanks to Lachlan Patrick and Albert Teoh for contributing to this release.
-
Make
IgnoreOrder
a function rather than a global variable to prevent consumers from erroneously altering its behaviour. -
Add a
BoundingDiagonal
method to theEnvelope
type. -
Return an error rather than panicking when certain internal assumptions are violated during DCEL extraction.
2022-11-15
Special thanks to Albert Teoh for contributing to this release.
-
Use
Sequence
instead of[]XY
for DCEL edges. -
Reuse half edge records in DCEL algorithm to better support
GeometryCollection
inputs inUnion
,Intersection
,Difference
,SymmetricDifference
, andRelate
functions. -
Add
UnaryUnion
andUnionMany
functions. -
Fix a bug where calling
Union
,Difference
, orSymmetricDifference
with an empty geometry and aGeometryCollection
containing multiple children would return theGeometryCollection
unaltered (rather than unioning it together). -
Make DCEL operation output ordering deterministic.
2022-11-08
Special thanks to @missinglink for contributing to this release.
- Add benchmarks for WKB parsing.
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.
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
.
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.
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.
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.
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
).
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
.
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).
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.
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.
-
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 aSequence
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 thefmt.Stringer
interface. The method returns the same string as that returned by theSummary
method. -
Adds a new
NumRings
method to thePolygon
type. This method gives the total number of rings that make the polygon.
2021-07-18
-
Adds
Dump
methods toGeometry
,MultiPoint
,MultiLineString
,MultiPolygon
, andGeometryCollection
types. 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
BitSet
data structure. This data structure is used to specify which Points within a MultiPoint are empty during manual construction.
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 thegeos
package). 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.
2021-05-14
- Modifies the
Simplify
function to use an iterative rather than recursive approach. This prevents crashes for complex geometries.
2021-05-14
-
Reimplements the
ConvexHull
operation 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
Simplify
function that simplifies geometries using the Ramer Douglas Peucker algorithm.
2021-04-11
-
Changes the
Boundary
method to use GEOS style behaviour rather than PostGIS style behaviour for empty geometries. This means thatBoundary
now always returns a consistent geometry type. -
Adds back the RTree
Insert
andDelete
methods. These were previously removed in v0.25.1. -
Adds
Scan
methods to each concrete geometry type, so that that they implement thedatabase/sql.Scanner
interface.
2021-02-19
-
Adds a
Relate
top 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
.
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.
2020-12-31
-
Internal refactor for WKT unmarshalling to simplify error handling.
-
Performance improvements for Polygon validation (quicker 'ring in ring' check).
-
Performance improvements for the LineString IsSimple method.
-
Performance improvements for MultiPoint/MultiPoint intersection check.
-
Adds a
Nearest
method toRTree
, which finds the nearest entry to a given box. -
Performance improvements to the
Distance
andIntersection
functions, based on conditionally swapping the order of the inputs. -
Adds a
Count
method toRTree
, which gives the number of entries in the tree. -
Performance improvements to the MultiLineString IsSimple method.
-
Performance improvements to set operations (Union, Intersection, Difference, SymmetricDifference).
2020-12-07
-
More optimisations for DCEL operations (
Intersection
,Union
,Difference
, andSymmetricDifference
). The improvements result in a 25% speed improvement. -
Breaking change:
Intersects
is now a top level function rather than a method. This is to make it consistent with other operations that act on two geometries. -
Breaking change:
ExactEquals
is now a top level function rather than a method. This is to make it consistent with other operations that act on two geometries. It was also renamed fromEqualsExact
toExactEquals
. This is inconsistent with the corresponding function in GEOS, but reads more fluently.
2020-12-02
-
Improvements for DCEL operations (
Intersection
,Union
,Difference
, andSymmetricDifference
). Some improvements simplify data structures and algorithms, and other improvements increase performance (~2x speedup). -
Fixes a compiler warning in the
geos
package. -
Internal refactor of WKB error handling to mirror the error handling strategy used for WKT.
2020-10-30
- Add
Intersection
,Union
,Difference
, andSymmetricDifference
operations.
2020-10-30
- Add a
Distance
function that calculates the shortest Euclidean distance between two geometries.
2020-08-10
-
Add area calculation options (there are initially 2 options). The first option causes the area calculation to return the signed area. This replaces the
SignedArea
methods, and so is a breaking change. The second area allows the geometries to be transformed inline with the area calculation. -
Add
ForceCW
andForceCCW
methods. These methods force areal geometries to have consistent winding order (orientation). -
Fix a bug in the convex hull algorithm that causes a crash in some rare scenarios involving almost collinear points.
-
Add GEOS Buffer option wrappers. The following options are now wrapped:
-
The number of line segments used to represent curved parts of buffered geometries.
-
End-cap style (round, flat, square).
-
Join style (round, mitre, bevel).
-
-
Add a new constructor option
OmitInvalid
. This option causes invalid geometries to be replaced with empty geometries upon construction rather than giving an error.
2020-06-27
-
Fix a bug where constructor options were ignored in GeoJSON unmarshalling.
-
Performance improvements to geometry validations and the Intersects operation (due to improvements to point-in-ring operations and RTree bulk loading).
2020-05-30
-
Improve R-Tree delete operation performance.
-
Fix a bug in MultiPolygon validation.
2020-05-17
-
Improve the performance of R-Tree operations (with flow on improvements to many algorithms, including geometry validation).
-
Add a Delete method to the R-Tree implementation.
-
Improve the numerical stability of the centroid calculation algorithm.
-
Add a method to the R-Tree to find the boxes nearest to another box.
-
Add a wrapper for the GEOS Relate function (which returns a DE-9IM code).
2020-05-08
-
Add wrappers for the GEOS Difference and Symmetric Difference algorithms.
-
Implement the Point On Surface algorithm, which finds a point on the interior of a Polygon or Polygon. This algorithm is extended to also work with point and linear geometries.
-
Improve performance of WKB marshalling and unmarshalling.
-
Alters the
UnmarshalWKT
function to accept astring
rather than anio.Reader
. A new functionUnmarshalWKTFromReader
has been added that accepts a reader. This makes the WKT interface more consistent with the WKB interface.
2020-04-27
-
Allow geometry constructor options to be passed to GEOS operations that produce geometries.
-
Improve performance for MultiPolygon validation in cases where the child polygons touch at many points.
2020-04-20
-
Adds an R-Tree data structure (new package,
github.com/peterestace/simplefeatures/rtree
). The implementation follows the approach outlined in R-Trees - A Dynamic Index Structure For Spatial Searching. -
Improves some nasty worst-case performance behaviour for Polygon and MultiPolygon validation.
2020-04-13
-
Removes the
Line
type. This was done in order to better align simplefeatures with the OGC Simple Feature Access specification, and allows many edge cases in the code to be removed. Users previously using theLine
type should use theLineString
type instead. -
Adds an explicit
GeometryType
type, which represents one of the 7 types of geometry (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). TheType
method now returns aGeometryType
rather than astring
.
2020-04-11
-
Removes redundant PostGIS reference implementation tests, improving CI speed.
-
Overhauls WKB and WKT interfaces. These now return
[]byte
andstring
respectively, rather than writing to a suppliedio.Writer
. -
Removes the
IsValid
method. If users want to know if a geometry is valid or not, they should check for an error when geometries are constructed. -
Unexports the partially implemented
Intersection
method. It will be reexported once the feature is complete. -
Fixes a memory related bug in the
github.com/peterstace/simplefeatures/geos
package. -
Adds a wrapper for the GEOS simplify function.
-
Simplifies the
github.com/peterstace/simplefeatures/geos
package by not exporting the 'handle' concept. The package now just exposes standalone functions.
2020-04-05
- Adds a new package
github.com/peterstace/simplefeatures/geos
that wraps the GEOS library. The following functions are wrapped: Equals, Disjoint, Touches, Contains, Covers, Intersects, Within, CoveredBy, Crosses, Overlaps, Union, Intersection, and Buffer.
2020-03-24
- Adds documentation comments to all exported symbols.
2020-03-20
- Adds support to geometries for Z (3D) and M (Measure) values. This includes many breaking changes, primarily around geometry constructor functions.
2020-03-03
Special thanks to Frank Sun and Peter Jones for contributing to this release.
-
Fixes a bug in the intersects predicate between
MultiLineString
andMultiPolygon
. -
Removes the
EmptySet
type. ThePoint
,LineString
, andPolygon
types can now represent empty geometries. -
Adds the
GeometryType
method, which returns a string representation of the geometry type (e.g. returns"LineString"
for theLineString
geometries). -
Adds support to store empty
Point
geometries withinMultiPoint
geometries. -
Simplifies geometry constructor options by removing the
DisableExpensiveValidations
option. -
Removes the
Equals
predicate (which was only implemented for a small proportion of geometry type pairs). -
Modifies the
TransformXY
methods to return their own concrete geometry type.
2020-02-20
Special thanks to Lachlan Patrick for contributing to this release.
-
Adds a
Length
implementation for theGeometry
type. -
Modifies the
Boundary
for concrete geometry types to return a concrete geometry type (rather than the genericGeometry
type). -
Modifies the Fuzz Tests to use batching.
-
Fixes a bug in the
IsSimple
method forMultiLineString
. -
Adds
Centroid
implementations for all geometry types. -
Adds a new suite of reference implementation tests using
libgeos
.
2020-01-24
-
Fixes a deficiency where
LineString
would not retain coincident adjacent points. -
Adds two new methods to
LineString
.NumLines
gives the number ofLine
segments making up theLineString
, andLineN
allows access to thoseLine
segments. -
Reduces the memory required to store a
LineString
.
2020-01-21
Special thanks to Lachlan Patrick for contributing to this release.
-
Adds
Reverse
methods, which reverses the order of each geometry's control points. -
Adds
SignedArea
methods, which calculate the signed area of geometries. The signed area takes into consideration winding order, and produces either a negative or positive result for non-empty areal geometries.
2020-01-17
-
Fixes a bug where polygons with nested rings would erroneously be reported as valid.
-
Performance improvements have been made to
Polygon
andMultiPolygon
validation. The algorithms used now have sub-quadratic time complexity, and memory allocations have been significantly reduced.
2020-01-07
- The
Geometry
interface has been replaced with a concrete type also namedGeometry
. This new type holds exactly one geometry value (one ofEmptySet
,Point
,Line
,LineString
,Polygon
,MultiPoint
,MultiLineString
,MultiPolygon
,GeometryCollection
. TheAnyGeometry
type has been removed (Geometry
can be used instead).
2020-01-07
- A Linesweep algorithm is now used for the
Intersects() bool
implementation between line types (Line
,LineString
,MultiLineString
). This reduces the computational complexity from quadratic time to linearithmic time.
2019-12-24
- The
Intersects
method is now implemented for all geometry pairs. The method signature has been changed to no longer return an error (errors were only returned for unimplemented geometry pairs).
2019-12-02
Special thanks to Lachlan Patrick and Den Tsou for contributing to this release.
Initial tagged version.