Closed ear7h closed 5 years ago
Agh also looks like I neglected to run package-wide tests
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
encoding/mvt/feature.go | 0 | 1 | 0.0% | ||
planar/triangulate/gdey/quadedge/subdivision/subdivision.go | 0 | 4 | 0.0% | ||
encoding/wkt/wkt.go | 9 | 15 | 60.0% | ||
encoding/wkt/wkt_encode.go | 312 | 429 | 72.73% | ||
<!-- | Total: | 322 | 450 | 71.56% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
encoding/wkt/wkt.go | 3 | 57.14% | ||
planar/triangulate/constraineddelaunay/triangulator.go | 6 | 57.78% | ||
<!-- | Total: | 9 | --> |
Totals | |
---|---|
Change from base Build 287: | 0.3% |
Covered Lines: | 11834 |
Relevant Lines: | 20300 |
@gdey yep and ci should pass. I removed the commit which implements build tags for tile test files. I will implement the solution we discussed in a different pr (#72)
update: it failed when running the vet
command.
performance
This pr has a pretty good performance improvement over the previous encoder, both in cpu time and allocations. The most important function in all of this is
formatFloat
for an even greater performance improvement it could be written in assembly or maybe use the 'e' formatter.A simple change that came to mind is also:
benchmarks
I'm using the following command for running benchmarks:
before
after
latest
latest with 'e' parameter
usability
My implementation is a bit longer because it has to deal with a choice of removing or keeping empty geometries. It also returns a proper error message when lines and geometries with not enough valid points are sent for a polygon or linestring.
I just noticed there is also a bug, where empty points can be sent on a line string, this should not be allowed.
extra
I also took the liberty of changing all "Verticies" to "Vertices", I can remove this commit.
todo
Encoder
struct forformatFloat