[Qgis-user] GoeJSON with nested JSON (advise please)

Andrew Hughes ahhughes at gmail.com
Thu Mar 3 18:24:13 PST 2022


Hi All,

Seeking advice here...

The GeoJSON spec supports nested json within properties, see example #2 @
https://www.rfc-editor.org/rfc/rfc7946#section-1.5

It would appear that QGIS 3.16 is unable to load this as layers. I'm highly
skeptical about how much support there is for nested JSON not just in QGIS
but from all GIS technologies.

I'd really appreciate any words of wisdom on how best to deal with this.

Maybe things like:

   - Do it, it has enough support
   - Don't do this, nobody likes it ( gdal/ogr2ogr, postgres, esri e.t.c...)
   - Flatten the json (i.e. stringify) only when needed so no data is
   destroyed


Thank you

p.s. Here's an example if you wish to reproduce it, save locally as
*.geojson and drop it in qgis and it will not load. Remove the red nested
object and all will be fine.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            153,
            -27
          ],
          [
            152.9,
            -27.1
          ]
        ]
      },
      "properties": {
        "flatProperty": "works fine",


*        "nestedObject : {          "withinQGIS316" : "FAIL TO LOAD AS A
LAYER in v 3.16"        }*
      }
    }
  ]
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220304/8f040209/attachment.html>


More information about the Qgis-user mailing list