-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Proposed by @StefanBrand in fiboa/specification#24 and fiboa/specification#32.
All the following has been written by @StefanBrand and more can be found in fiboa/specification#24:
Some related resources:
- https://guide.cloudnativegeo.org/flatgeobuf/intro.html and linked therein:
- https://worace.works/2022/03/12/flatgeobuf-implementers-guide/
Here are some experiments based on the Austrian GSA dataset.
Tools
- GDAL/OGR 3.9
flatcbinary from https://github.com/google/flatbuffers/releases/tag/v24.3.25header.fbsfile from https://github.com/flatgeobuf/flatgeobuf
Steps
- Convert to FlatGeobuf:
ogr2ogr GSA_Austria_2023-2_sample.fgb INSPIRE_SCHLAEGE_2023-2_POLYGON.gpkg \ -limit 2 \ -mo 'fiboa={"fiboa_version": "0.2.0", "fiboa_extensions": []}' \ -nomd \ -nln parcels - Find length of Header:
hexdump --skip 8 -n 4 -d GSA_Austria_2023-2_sample.fgb-> 2084 - Dump header into file:
dd skip=12 count=2084 bs=1 if=GSA_Austria_2023-2_sample.fgb > header.bin - Deserialize into JSON:
flatc --json --strict-json --raw-binary src/fbs/header.fbs -- header.bin
Result
This is the resulting JSON:
{
"name": "parcels",
"envelope": [
672737.349999999977,
476317.109999999986,
675804.430000000051,
477193.350000000035
],
"geometry_type": "Polygon",
"columns": [
{
"name": "FS_KENNUNG",
"type": "Double",
"precision": 0
},
{
"name": "SNAR_BEZEICHNUNG",
"type": "String",
"width": 240
},
{
"name": "SL_FLAECHE_BRUTTO_HA",
"type": "Double",
"precision": 0
},
{
"name": "GEO_ID",
"type": "Double",
"precision": 0
},
{
"name": "INSPIRE_ID",
"type": "String",
"width": 500
},
{
"name": "GML_ID",
"type": "String",
"width": 500
},
{
"name": "GML_IDENTIFIER",
"type": "String",
"width": 500
},
{
"name": "SNAR_CODE",
"type": "String",
"width": 30
},
{
"name": "GEO_PART_KEY",
"type": "Double",
"precision": 0
},
{
"name": "LOG_PKEY",
"type": "Double",
"precision": 0
},
{
"name": "GEOM_DATE_CREATED",
"type": "DateTime",
"width": 0
},
{
"name": "FART_ID",
"type": "Double",
"precision": 0
},
{
"name": "GEO_TYPE",
"type": "String",
"width": 50
},
{
"name": "GML_GEOM",
"type": "Binary",
"width": 0
},
{
"name": "GML_LENGTH",
"type": "Double",
"precision": 0
},
{
"name": "KZ_BIO_OEPUL_JN",
"type": "String",
"width": 1
}
],
"features_count": 2,
"crs": {
"org": "EPSG",
"code": 31287,
"name": "MGI / Austria Lambert",
"wkt": "PROJCRS[\"MGI / Austria Lambert\",BASEGEOGCRS[\"MGI\",DATUM[\"Militar-Geographische Institut\",ELLIPSOID[\"Bessel 1841\",6377397.155,299.1528128,LENGTHUNIT[\"metre\",1]]],PRIMEM[\"Greenwich\",0,ANGLEUNIT[\"degree\",0.0174532925199433]],ID[\"EPSG\",4312]],CONVERSION[\"Austria Lambert\",METHOD[\"Lambert Conic Conformal (2SP)\",ID[\"EPSG\",9802]],PARAMETER[\"Latitude of false origin\",47.5,ANGLEUNIT[\"degree\",0.0174532925199433],ID[\"EPSG\",8821]],PARAMETER[\"Longitude of false origin\",13.3333333333333,ANGLEUNIT[\"degree\",0.0174532925199433],ID[\"EPSG\",8822]],PARAMETER[\"Latitude of 1st standard parallel\",49,ANGLEUNIT[\"degree\",0.0174532925199433],ID[\"EPSG\",8823]],PARAMETER[\"Latitude of 2nd standard parallel\",46,ANGLEUNIT[\"degree\",0.0174532925199433],ID[\"EPSG\",8824]],PARAMETER[\"Easting at false origin\",400000,LENGTHUNIT[\"metre\",1],ID[\"EPSG\",8826]],PARAMETER[\"Northing at false origin\",400000,LENGTHUNIT[\"metre\",1],ID[\"EPSG\",8827]]],CS[Cartesian,2],AXIS[\"northing (X)\",north,ORDER[1],LENGTHUNIT[\"metre\",1]],AXIS[\"easting (Y)\",east,ORDER[2],LENGTHUNIT[\"metre\",1]],USAGE[SCOPE[\"Topographic mapping (medium and small scale).\"],AREA[\"Austria.\"],BBOX[46.4,9.53,49.02,17.17]],ID[\"EPSG\",31287]]"
},
"metadata": "{\"fiboa\":\"{\\\"fiboa_version\\\": \\\"0.2.0\\\", \\\"fiboa_extensions\\\": []}\"}"
}
Note that OGR already seems to quote the JSON, which results in too many quoted characters.
Metadata
Metadata
Assignees
Labels
No labels