[postgis-devel] ST_AsFlatGeobuf / ST_FromFlatGeobuf ?

Björn Harrtell bjorn.harrtell at gmail.com
Sun Sep 27 10:17:48 PDT 2020


Paul,

I have been trying to wrap my head around how an analogue to
jsonb_to_record would be useful for FlatGeobuf and can't figure it out. In
fact, I have trouble coming up with anything *really* useful as user
exposed PostGIS functions. The problem is that there is no way to work with
parts of a binary buffer except vis the generic file system aux functions
which does not feel right to use for stuff like this.

A plain ST_AsFlatGeobuf aggregate and a setof record returning
ST_FromFlatGeobuf could provide some usefulness perhaps but would be
limited by max tuple size and not really the desired "building blocks".

Optimally I would want to be able to process a FlatGeobuf binary from a
steam into rows and vice versa but the only way that I can think of to do
that is to make COPY accept and produce FlatGeobuf.

Did you have something in mind that I'm not seeing?

Den ons 23 sep. 2020 kl 17:22 skrev Paul Ramsey <pramsey at cleverelephant.ca>:

>
>
> > On Sep 23, 2020, at 12:34 AM, Björn Harrtell <bjorn.harrtell at gmail.com>
> wrote:
> >
> > Is flatgeobuf an alternative to shapefile, to MVT, or both? Do you
> > expect people to use it to extract full datasets or only parts of it
> > at a time?
>
> I think it's a worthy addition, and having the format in PostGIS will
> promote usage (orobouros) because that makes the format available to all
> connecting languages, systems, and it doesn't need to be reimplemented in
> 50 locations.
>
> > One thing I'm not sure about is `ST_FromFlatGeobuf`. I would expect
> > that to return a table/tuple, but AFAIK there is no way to change the
> > output format of a function based on the input, so I think I would
> > expect something like a fgb2pgsql cli and not a SQL function.
>
> See jsonb_to_record(jsonb), I think this is doable for geojson as well as
> [flat]geobuf.
>
> P.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20200927/cca60b24/attachment.html>


More information about the postgis-devel mailing list