peterstace / simplefeatures

Simple Features is a pure Go Implementation of the OpenGIS Simple Feature Access Specification
MIT License
131 stars 19 forks source link

Implement TransformXY method for Envelope type #460

Closed peterstace closed 2 years ago

peterstace commented 2 years ago

Description

commit dae405ccad01d406322dfeaf5574fad7be75a6c6 Author: Peter Stace peterstace@gmail.com Date: Sun Sep 25 18:02:35 2022 +1000

Implement TransformXY method for Envelope type

All regular other geometry types have a TransformXY method, so it's
reasonable for Envelope to have one as well.

The benchmark test is to confirm sure that the implementation of
TransformXY doesn't allocate memory, even though it uses a slice of XYs
internally.

Check List

Have you:

Related Issue

Benchmark Results

$ go test ./geom -run=^\$ -bench=EnvelopeTrans -benchmem
goos: linux
goarch: arm64
pkg: github.com/peterstace/simplefeatures/geom
BenchmarkEnvelopeTransformXY-2           8729284               137.2 ns/op             0 B/op          0 allocs/op
PASS
ok      github.com/peterstace/simplefeatures/geom       1.341s
peterstace commented 2 years ago

There are some lint errors, but curiously they don't appear to be introduced by this PR. I'll fix those in a separate PR.

EDIT: PR to fix lint issues at https://github.com/peterstace/simplefeatures/pull/461

peterstace commented 2 years ago

Thanks for reviewing!