If your using ogr2ogr try using the switch -emptyStrAsNull if you're not.
On 3/6/25 15:39, Patrick Young via gdal-dev wrote:
Hello,
I translated some geojson to flatgeobuf where the geojson features have
a variable number of properties (e.g. some features have a bunch of
translations for the name of a place pulled from OSM).
I noticed in the ogrinfo output that while the summary info has all the
fields possible,
name: String (0.0)
name:ar: String (0.0)
name:bn: String (0.0)
...etc...
each feature prints out just its actual fields associated with it:
OGRFeature(layer):1
name (String) = Huselva
LINESTRING (-36.7425039 -54.1973051 ...etc..)
I had expected a bunch of NULL values for all the fields not set, much
like what QGIS shows or what happens if I translate to e.g. geoparquet.
In the flatgeobuf spec, I noticed it supports a per feature schema
https://github.com/flatgeobuf/flatgeobuf/
blob/3d488b384a911b3a18d8b28ee730fb8f3831a39b/src/fbs/header.fbs#L75
<https://github.com/flatgeobuf/flatgeobuf/
blob/3d488b384a911b3a18d8b28ee730fb8f3831a39b/src/fbs/header.fbs#L75>
Is ogr taking advantage of this? Or is it just aware that those fields
were never set for that feature?
I am asking because if I was to create the flatgeobuf directly with OGR,
I am not sure if I need to call CreateField on the layer itself for all
possible fields, or can I do something per feature?
Thanks!
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev