[gdal-dev] How far can we resolve complex GeoJSON?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] How far can we resolve complex GeoJSON?

jratike80

Hi,

 

Have a look at data returned by request https://beta-paikkatieto.maanmittauslaitos.fi/geographic-names/wfs3/v1/collections/placenames/items?municipality=837&limit=100

There exists couple of features with “parallelName” and GDAL converts that part into a string type attribute

 

  parallelName (String) = [ { "placeNameId": 40581553, "placeNameVersionId": 2, "spelling": "Pirkkahalli", "language": "fin", "languageOfficiality": 1, "languageDominance": 1, "placeNameSource": 1, "placeNameStatus": 5, "placeNameCreationTime": "2008-12-05T22:00:00Z", "placeNameModificationTime": "2017-02-15T10:41:10Z", "placeNameDeletionTime": null } ]

 

Can we do anything else with GDAL and GeoJSON driver? I suppose it does not same kind of advanced features like GMLAS driver has.

Here is one placename as an example. A place can have zero to n parallel names.

 

{

      "type": "Feature",

      "id": "PN_40581553",

      "properties": {

        "placeNameId": 40581553,

        "placeNameVersionId": 2,

        "spelling": "Pirkkahalli",

        "language": "fin",

        "languageOfficiality": 1,

        "languageDominance": 1,

        "placeNameSource": 1,

        "placeNameStatus": 5,

        "placeNameCreationTime": "2008-12-05T22:00:00Z",

        "placeNameModificationTime": "2017-02-15T10:41:10Z",

        "placeNameDeletionTime": null,

        "placeId": 10581553,

        "placeVersionId": 2,

        "placeType": 8010105,

        "placeTypeDescription": 8010105,

        "placeTypeCategory": 8,

        "placeTypeGroup": 801,

        "placeTypeSubgroup": 80101,

        "placeElevation": 81,

        "tm35MapSheet": "M4211F3",

        "gslsMapSheet": "212308D",

        "rescueGridSquare": "21N4B3",

        "municipality": "837",

        "subregion": "064",

        "region": "06",

        "scaleRelevance": 50000,

        "placeCreationTime": "2008-12-05T22:00:00Z",

        "placeModificationTime": "2014-08-01T13:47:38Z",

        "placeDeletionTime": null,

        "parallelName": [

          {

            "placeNameId": 42003784,

            "placeNameVersionId": 3,

            "spelling": "Tampereen messu- ja urheilukeskus",

            "language": "fin",

            "languageOfficiality": 1,

            "languageDominance": 1,

            "placeNameSource": 1,

            "placeNameStatus": 3,

            "placeNameCreationTime": "2017-02-02T13:53:12Z",

            "placeNameModificationTime": "2017-02-15T14:34:47Z",

            "placeNameDeletionTime": null

          }

        ]

      },

      "geometry": {

        "type": "Point",

        "coordinates": [

          23.7323985,

          61.4640113

        ]

      }

    }

 

-Jukka Rahkonen-


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How far can we resolve complex GeoJSON?

Even Rouault-2
On jeudi 13 février 2020 21:06:57 CET Rahkonen Jukka (MML) wrote:
> Hi,
>
> Have a look at data returned by request
> https://beta-paikkatieto.maanmittauslaitos.fi/geographic-names/wfs3/v1/coll
> ections/placenames/items?municipality=837&limit=100 There exists couple of
> features with "parallelName" and GDAL converts that part into a string type
> attribute

-oo FLATTEN_NESTED_ATTRIBUTES=YES can improve things for a property that is a
JSon object/dictionary, but not here because parallelName content is an array.

>
>   parallelName (String) = [ { "placeNameId": 40581553, "placeNameVersionId":
> 2, "spelling": "Pirkkahalli", "language": "fin", "languageOfficiality": 1,
> "languageDominance": 1, "placeNameSource": 1, "placeNameStatus": 5,
> "placeNameCreationTime": "2008-12-05T22:00:00Z",
> "placeNameModificationTime": "2017-02-15T10:41:10Z",
> "placeNameDeletionTime": null } ]
>
> Can we do anything else with GDAL and GeoJSON driver? I suppose it does not
> same kind of advanced features like GMLAS driver has.

Indeed. The GeoJSON driver cannot create auxiliary layers for nested objects.
Thinking that a fun exercise would be to write a script that would convert the
GeoJSON content into XML (there are already utilities to do that) and generate
a XML schema. And then feed that into GMLAS. Sounds fun, doesn't it ;-) ?

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How far can we resolve complex GeoJSON?

Sean Gillies-3
Hi Jukka, Even,

On Thu, Feb 13, 2020 at 4:43 PM Even Rouault <[hidden email]> wrote:
On jeudi 13 février 2020 21:06:57 CET Rahkonen Jukka (MML) wrote:
> Hi,
>
> Have a look at data returned by request
> https://beta-paikkatieto.maanmittauslaitos.fi/geographic-names/wfs3/v1/coll
> ections/placenames/items?municipality=837&limit=100 There exists couple of
> features with "parallelName" and GDAL converts that part into a string type
> attribute

-oo FLATTEN_NESTED_ATTRIBUTES=YES can improve things for a property that is a
JSon object/dictionary, but not here because parallelName content is an array.
>
>   parallelName (String) = [ { "placeNameId": 40581553, "placeNameVersionId":
> 2, "spelling": "Pirkkahalli", "language": "fin", "languageOfficiality": 1,
> "languageDominance": 1, "placeNameSource": 1, "placeNameStatus": 5,
> "placeNameCreationTime": "2008-12-05T22:00:00Z",
> "placeNameModificationTime": "2017-02-15T10:41:10Z",
> "placeNameDeletionTime": null } ]
>
> Can we do anything else with GDAL and GeoJSON driver? I suppose it does not
> same kind of advanced features like GMLAS driver has.

Indeed. The GeoJSON driver cannot create auxiliary layers for nested objects.
Thinking that a fun exercise would be to write a script that would convert the
GeoJSON content into XML (there are already utilities to do that) and generate
a XML schema. And then feed that into GMLAS. Sounds fun, doesn't it ;-) ?

Even

If this JSON is coming from a WFS, won't there be a JSON schema of some kind provided by the server? Would using OGR's WFS3 driver instead of GeoJSON help?

--
Sean Gillies

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How far can we resolve complex GeoJSON?

Even Rouault-2
> If this JSON is coming from a WFS, won't there be a JSON schema of some
> kind provided by the server?

The WFS3 driver has some (primitive) support for JSON schema and XML schema,
but only for the "simple features" profile.

> Would using OGR's WFS3 driver instead of GeoJSON help?

No, it uses underneath the GeoJSON driver (and doesn't expose the open option
I mentionned).

Dealing with complex features + streaming mode that you typically expect from
reading from a WFS server would be a complicated (not to say impossible)
topic.
The GMLAS driver can deal with arbitrarily large datasets, but this requires
at least 2 reading passes for various technical reasons.

Eve

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev