-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding/mvt fails on nil features #135
Comments
Can these features just be skipped on encoding? |
How would you propose skipping them in |
Nil features are "skipped" during encoding. Features clipped to empty/nil are remove from the features array during clipping #141 |
I merged the above change, it is in v0.11.0 |
Perfect, that's a great solution. Thanks @paulmach! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a layer has an empty feature, often due to clipping, it causes
MarshalGzipped
(and probablyMarshal
too) to fail with a null pointer panic. The panic is on accessingf.Geometry
in the marshaller. On further investigation, this happens when the geometry or feature isnil
.My workflow looks a bit like this:
mvt.MarshalGzipped(layers)
fails with a panic.If I add a
Prune
function, something along the lines of:then the tiles marshal and render correctly.
Can I suggest or open a PR to provide a
Prune
function for bothmvt.Layer
andmvt.Layers
?The text was updated successfully, but these errors were encountered: