orb icon indicating copy to clipboard operation
orb copied to clipboard

flatgeobuf support

Open gertcuykens opened this issue 6 years ago • 6 comments
trafficstars

Because in my opinion you are the king of osm and geojson in golang :P would appreciate your take on flatgeobuf as a replacement of geojson

see: https://github.com/bjornharrtell/flatgeobuf/issues/7 see: https://github.com/mapbox/tippecanoe/issues/777

gertcuykens avatar Jul 27 '19 02:07 gertcuykens

more specifically, do you mean geojson <-> flatgeobuf?

paulmach avatar Sep 17 '19 15:09 paulmach

Maybe have a look at the format, if you can spot improvements. I think the geo community need desperately a format for heavy lifting and streaming geo data. Geojson and xml are just to verbose. Just trying to convince as many people as possible to agree on a design so we have global tool support for a more performant intermediate format. Others will probably implement it for you and and do a pull request for it in orb/encoding But everybody needs to agree on some format first. For example topojson is other candidate I already did a pull request for https://github.com/paulmach/orb/pull/33 Thanks

gertcuykens avatar Sep 17 '19 16:09 gertcuykens

I looked at flatgeobuf but don't see much documentation. I see a few lines for Specification in the readme and some flatbuffer files. I don't really understand how to pack geometry into them. It seems like you'd need byte compatible implementations of geobuf and flatbush in golang too.

As for topojson. Thank you, I'll take a look.

paulmach avatar Sep 17 '19 19:09 paulmach

@paulmach flatgeobuf is now more mature than last year and integrated in several well known GIS software. golang support is still lacking but note that geobuf is not a dependency it's just inspired by it and flatbush is not a strict requirement. If you are interested I will take a second look at providing a reference golang implementation (even though I've very rarely touched golang).

bjornharrtell avatar Nov 21 '20 14:11 bjornharrtell

FlatGeoBuf support in Go would be amazing.

In the meantime, Shapefile and GeoPackage seem like the only binary formats which are supported both by Golang and by GDAL

Geobuf format, as provided in this package as well as by the "spatial-go" package, was a nice binary format (and considerably more compact than FlatGeoBuf in my experience), but Geobuf seems to be no longer actively maintained by Mapbox, and the format is not supported by GDAL, so that seems to be a dead end.

morandd avatar Oct 18 '22 12:10 morandd

For folks who are interested, I've implemented what I think is a very good low-to-medium level native Go library for FlatGeobuf: https://github.com/gogama/flatgeobuf. I'd love to hear feedback if anyone has some!

The difficulty I've observed with FGB at least in Go is that although it is wonderful to be able to read and write the lower-level FlatBuffer data types and search the index (all of which my library does quite cleanly, I think), there is still a lot of tricky manual boilerplate required to unpack the FlatBuffer tables and feature properties into high-level structured types that people are used to coding against, for example org.Geometry.

I'm working on a higher-level library to solve this problem: https://github.com/gogama/flatgeobuf-convert. It's in a pretty early stage, but I imagine within 30-60 days I'll have an alpha version available that lets you pack/unpack between Orb types and FlatGeobuf low-level types and handle features properties more cleanly also.

vcschapp avatar Jan 05 '24 23:01 vcschapp