Closed polastre closed 7 months ago
Can these features just be skipped on encoding?
How would you propose skipping them in MarshalGzipped
, which encodes the entire set?
Nil features are "skipped" during encoding. Features clipped to empty/nil are remove from the features array during clipping https://github.com/paulmach/orb/pull/141
Perfect, that's a great solution. Thanks @paulmach!
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
?