tippecanoe icon indicating copy to clipboard operation
tippecanoe copied to clipboard

Feature request: FlatGeobuf input

Open bdon opened this issue 3 years ago • 7 comments

https://github.com/flatgeobuf/flatgeobuf is an alternative to both Geobuf and GeoJSON.

Advantage over Geobuf:

  • supported directly by GDAL 3.1+
  • less work (no deserialization step)

Advantage over GeoJSON:

  • less work, possibly faster, but may not ultimately be a bottleneck

Other advantages:

  • Can read an indexed FlatGeobuf to only grab a subset of data, but this would need an API.

Tippecanoe should be able to read a stream of flatgeobuf either from disk or from a pipe. It should support schema less (per-feature) input to have parity with geojson/geobuf. Possibly deprecate geobuf input to simplify overall.

bdon avatar Feb 10 '22 04:02 bdon

I think deprecating geobuf makes sense. It doesn't seem to work for larger files--at least on my machine, json2geobuf runs out of memory with a 4.5 GB input.

Based on a comment from the developer, memory issues may be inevitable with geobuf.

jjhembd avatar Feb 12 '22 00:02 jjhembd

Relevant issue re: FlatGeobuf here: https://github.com/flatgeobuf/flatgeobuf/issues/125

bdon avatar Feb 13 '22 07:02 bdon

In order to keep parity with the "GeoJSON Extension" described here: https://github.com/protomaps/tippecanoe#geojson-extension we need to think of a different strategy, since FlatGeobuf does not support arbitrary extensions like Geobuf does. The readme describes a way of modifying a ndjson by moving the relevant properties from the normal GeoJSON feature properties. For the FlatGeobuf case we can define a set of prefixes for properties like tippecanoe:maxzoom instead of needing the extension.

bdon avatar Feb 14 '22 03:02 bdon

@bdon nice to see this initiative! Does this still mean a Go (reference?) implementation is needed?

bjornharrtell avatar Feb 14 '22 10:02 bjornharrtell

@bjornharrtell while I'd like it for my other projects, a Go implementation isn't needed for tippecanoe - I have vendored in the C++ headers here https://github.com/protomaps/tippecanoe/tree/flatgeobuf which should be all that is necessary.

bdon avatar Feb 14 '22 11:02 bdon

Checklist:

  • [ ] streaming: #9
  • [ ] extensions: #7
  • [x] support for embedding FGB primary keys (sequence numbers) in output tiles
  • [ ] heterogenous collections: #8

bdon avatar Mar 25 '22 06:03 bdon

  • [ ] verify all columns are translated correctly to MVT, other than binary (not representable)

bdon avatar Apr 23 '22 05:04 bdon

Migrated to https://github.com/felt/tippecanoe/issues/21

bdon avatar Oct 12 '22 05:10 bdon