Wrangling CityGML with GRASS ?

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

Wrangling CityGML with GRASS ?

"Peter Löwe"
Hello Markus, Stefan, all,

thanks for all your advice. New challenges have emerged, as the dataset is defined as a polyhedral surface:

I upgraded to GRASS 7.6.1 which comes with GDAL 2.3.1.

The data sources are official CityGML files provided by the German Federal Agency for Cartographyand Geodesy (Bundesamt für Kartographie), which have an ".xml"-extension.

v.in.ogr -2 -o --o input=TEST.xml output=TEST01
throws several warnings and creates an empty vector without an points/lines in it:

 Warning 1: Unrecognized geometry type : 1015                            [<=== note this!]
No projection information available for layer <Building>
Übersteuere die Überprüfung der Projektion.
Check if OGR layer <Building> contains polygons...
 100%
WARNUNG: Vektorkarte <SMALL01> existiert bereits und wird überschrieben.
Creating attribute table for layer <Building>...
Importing 1 features (OGR layer <Building>)...
WARNUNG: Skipping unsupported geometry type 'POLYHEDRALSURFACE'           [<=== note this!]
 100%
-----------------------------------------------------
Erstelle Topologie für die Vektorkarte <SMALL01@PERMANENT>...
Registriere Primitive...
WARNUNG: Input data contains 3D features. Created vector is 2D only,
         disable -2 flag to import 3D vector.


This problem seems to be ogr/gdal related:

ogrinfo -al TEST.xml
describes the geometry as a POLYHEDRALSURFACE Z (((412033.466 5812969.869 ...))).

ogr2ogr -f "GML" TEST.gml TEST.xml  fails (some effect when trying other target formats like CSV or ESRI shape:
Warning 1: Unrecognized geometry type : 1015
ERROR 6: Unsupported geometry type 3D PolyhedralSurface
ERROR 1: Export of geometry to GML failed
ERROR 1: Terminating translation prematurely after failed
translation of layer Building (use -skipfailures to skip errors)

There is GDAL documentation about surfaces (https://gdal.org/development/rfc/rfc64_triangle_polyhedralsurface_tin.html), but I couldn't find anything about transformations/pruning from 3D to 2D.

The CGAL library appears to be capable to handle such surfaces, but GIS-integration seems to be limited (https://www.cgal.org/).

Ideas on how to proceed, anyone ?

best,
Peter





<[hidden email]>


> Gesendet: Dienstag, 06. August 2019 um 14:46 Uhr
> Von: [hidden email]
> An: [hidden email]
> Betreff: grass-user Digest, Vol 160, Issue 5
>
> Send grass-user mailing list submissions to
> [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.osgeo.org/mailman/listinfo/grass-user
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of grass-user digest..."
>
>
> Today's Topics:
>
>    1. Re: Problems starting grass 7.4.1 in ubuntu (Markus Metz)
>    2. Re: wms google (Micha Silver)
>    3. Re: Wrangling CityGML with GRASS ? (Stefan Blumentrath)
>    4. Re: Wrangling CityGML with GRASS ? (Peter Löwe)
>    5. Re: Wrangling CityGML with GRASS ? (Markus Metz)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 5 Aug 2019 22:32:12 +0200
> From: Markus Metz <[hidden email]>
> To: Sebastián Dietrich <[hidden email]>
> Cc: grass-user <[hidden email]>
> Subject: Re: [GRASS-user] Problems starting grass 7.4.1 in ubuntu
> Message-ID:
> <CAG+h=[hidden email]>
> Content-Type: text/plain; charset="utf-8"
>
> On Mon, Aug 5, 2019 at 5:35 PM Sebastián Dietrich <[hidden email]>
> wrote:
> >
> > Hi everyone, when i try to launch g.gui i get the following message:
> >
> > GRASS 7.4.1 (EPSG5344):~/Documentos/grassdata > g.gui
> > Lanzando GUI <wxpython> en el fondo, por favor espere...
> > Traceback (most recent call last):
> >   File "/usr/lib/grass74/gui/wxpython/wxgui.py", line 25, in <module>
> >     from core import globalvar
> >   File "/usr/lib/grass74/gui/wxpython/core/globalvar.py", line 39, in
> <module>
> >     'locale')).ugettext
> > AttributeError: 'GNUTranslations' object has no attribute 'ugettext'
> > [MÁSCARA ráster presente]
> > GRASS 7.4.1 (EPSG5344):~/Documentos/grassdata >
> >
> > Can someone help with this issue?
>
> GNUTranslations has an attribute ugettext only in Python2, not in Python3.
> Make sure that the link "python" points to "python2", test with "python
> --version"
>
> Markus M
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190805/c9190edf/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 6 Aug 2019 09:19:31 +0300
> From: Micha Silver <[hidden email]>
> To: Sebastián Dietrich <[hidden email]>
> Cc: Ken Mankoff <[hidden email]>, [hidden email]
> Subject: Re: [GRASS-user] wms google
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="utf-8"
>
> An HTML attachment was scrubbed...
> URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190806/002e1069/attachment-0001.html>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 6 Aug 2019 09:13:57 +0000
> From: Stefan Blumentrath <[hidden email]>
> To: "Peter Löwe" <[hidden email]>, "[hidden email]"
> <[hidden email]>
> Subject: Re: [GRASS-user] Wrangling CityGML with GRASS ?
> Message-ID:
> <[hidden email]>
>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Peter,
>
> Not personally...
> I would guess you would import CityGML through GDAL:
> https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html
> There you can create subsets and the like...
>
> What are you planning to do with it, roughly?
>
> Cheers
> Stefan
>
>
> -----Original Message-----
> From: grass-user <[hidden email]> On Behalf Of "Peter Löwe"
> Sent: torsdag 1. august 2019 11:10
> To: [hidden email]
> Subject: [GRASS-user] Wrangling CityGML with GRASS ?
>
> Hi list,
>
> I'm looking for information/howtos/etc. about how to deal with large CityGML data sets using GRASS.
>
> Has anybody already explored this ?
>
> Best,
> Peter
>
> <[hidden email]>
>
> _______________________________________________
> grass-user mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
> ------------------------------
>
> Message: 4
> Date: Tue, 6 Aug 2019 12:23:29 +0200
> From: "Peter Löwe" <[hidden email]>
> To: "Stefan Blumentrath" <[hidden email]>
> Cc: "[hidden email]" <[hidden email]>
> Subject: Re: [GRASS-user] Wrangling CityGML with GRASS ?
> Message-ID:
> <trinity-c2c845f5-697c-4269-afaf-8be6360d44d9-1565087009741@3c-app-gmx-bs34>
>
> Content-Type: text/plain; charset=UTF-8
>
> Hi Stefan,
>
> thanks for the link: That's also the latest information we found so far, except for several OSGeo conference recordings (e.g. https://doi.org/10.5446/40913 https://doi.org/10.5446/40694).
> My colleagues have ingested CityGML datasets into R, which caused issues with the vector-topology for individual buildings. Also, we have to cope with significant amounts of CityGML datasets, which would require very large amounts of RAM, if the processing is done in R. Since GRASS locations are storage-effective AND GRASS handles vector topologies well, I had hoped that someone already explored this approach further :-)
>
> If this should be not the case (yet) we'll gladly report at one of next years FOSS4G events.
>
> Best,
> peter  
>
> <[hidden email]>
>
>
> > Gesendet: Dienstag, 06. August 2019 um 11:13 Uhr
> > Von: "Stefan Blumentrath" <[hidden email]>
> > An: "Peter Löwe" <[hidden email]>, "[hidden email]" <[hidden email]>
> > Betreff: RE: [GRASS-user] Wrangling CityGML with GRASS ?
> >
> > Hi Peter,
> >
> > Not personally...
> > I would guess you would import CityGML through GDAL:
> > https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html
> > There you can create subsets and the like...
> >
> > What are you planning to do with it, roughly?
> >
> > Cheers
> > Stefan
> >
> >
> > -----Original Message-----
> > From: grass-user <[hidden email]> On Behalf Of "Peter Löwe"
> > Sent: torsdag 1. august 2019 11:10
> > To: [hidden email]
> > Subject: [GRASS-user] Wrangling CityGML with GRASS ?
> >
> > Hi list,
> >
> > I'm looking for information/howtos/etc. about how to deal with large CityGML data sets using GRASS.
> >
> > Has anybody already explored this ?
> >
> > Best,
> > Peter
> >
> > <[hidden email]>
> >
> > _______________________________________________
> > grass-user mailing list
> > [hidden email]
> > https://lists.osgeo.org/mailman/listinfo/grass-user
> >
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 6 Aug 2019 14:45:50 +0200
> From: Markus Metz <[hidden email]>
> To: Peter Löwe <[hidden email]>
> Cc: Stefan Blumentrath <[hidden email]>,
> "[hidden email]" <[hidden email]>
> Subject: Re: [GRASS-user] Wrangling CityGML with GRASS ?
> Message-ID:
> <CAG+h=[hidden email]>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Peter,
>
> On Tue, Aug 6, 2019 at 12:23 PM "Peter Löwe" <[hidden email]> wrote:
> >
> > Hi Stefan,
> >
> > thanks for the link: That's also the latest information we found so far,
> except for several OSGeo conference recordings (e.g.
> https://doi.org/10.5446/40913 https://doi.org/10.5446/40694).
>
> GML and GMLAS are supported by GDAL 2.2+. However, in order to import GMLAS
> properly, some tricks are needed (interleaved reading for non-sequential
> layers, see
> https://gdal.org/drivers/vector/gmlas.html#performance-issues-with-large-multi-layer-gml-files)
> which are built into GRASS 7.6+.
>
> > My colleagues have ingested CityGML datasets into R, which caused issues
> with the vector-topology for individual buildings.
>
> That's not related to the data format, but to the content: 3D polygons.
> These are not supported in GRASS, when importing you need to convert the
> data to 2D with v.in.ogr -2, otherwise you get corrupt topology. Maybe this
> is also needed for R.
>
> Markus M
>
> > Also, we have to cope with significant amounts of CityGML datasets, which
> would require very large amounts of RAM, if the processing is done in R.
> Since GRASS locations are storage-effective AND GRASS handles vector
> topologies well, I had hoped that someone already explored this approach
> further :-)
> >
> > If this should be not the case (yet) we'll gladly report at one of next
> years FOSS4G events.
> >
> > Best,
> > peter
> >
> > <[hidden email]>
> >
> >
> > > Gesendet: Dienstag, 06. August 2019 um 11:13 Uhr
> > > Von: "Stefan Blumentrath" <[hidden email]>
> > > An: "Peter Löwe" <[hidden email]>, "[hidden email]" <
> [hidden email]>
> > > Betreff: RE: [GRASS-user] Wrangling CityGML with GRASS ?
> > >
> > > Hi Peter,
> > >
> > > Not personally...
> > > I would guess you would import CityGML through GDAL:
> > >
> https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html
> > > There you can create subsets and the like...
> > >
> > > What are you planning to do with it, roughly?
> > >
> > > Cheers
> > > Stefan
> > >
> > >
> > > -----Original Message-----
> > > From: grass-user <[hidden email]> On Behalf Of
> "Peter Löwe"
> > > Sent: torsdag 1. august 2019 11:10
> > > To: [hidden email]
> > > Subject: [GRASS-user] Wrangling CityGML with GRASS ?
> > >
> > > Hi list,
> > >
> > > I'm looking for information/howtos/etc. about how to deal with large
> CityGML data sets using GRASS.
> > >
> > > Has anybody already explored this ?
> > >
> > > Best,
> > > Peter
> > >
> > > <[hidden email]>
> > >
> > > _______________________________________________
> > > grass-user mailing list
> > > [hidden email]
> > > https://lists.osgeo.org/mailman/listinfo/grass-user
> > >
> > _______________________________________________
> > grass-user mailing list
> > [hidden email]
> > https://lists.osgeo.org/mailman/listinfo/grass-user
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190806/2dc10111/attachment.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> grass-user mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
> ------------------------------
>
> End of grass-user Digest, Vol 160, Issue 5
> ******************************************
>
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Wrangling CityGML with GRASS ?

Markus Metz-3


On Thu, Aug 8, 2019 at 2:59 PM "Peter Löwe" <[hidden email]> wrote:

>
> Hello Markus, Stefan, all,
>
> thanks for all your advice. New challenges have emerged, as the dataset is defined as a polyhedral surface:
>
> I upgraded to GRASS 7.6.1 which comes with GDAL 2.3.1.
>
> The data sources are official CityGML files provided by the German Federal Agency for Cartographyand Geodesy (Bundesamt für Kartographie), which have an ".xml"-extension.
>
> v.in.ogr -2 -o --o input=TEST.xml output=TEST01
> throws several warnings and creates an empty vector without an points/lines in it:
>
>  Warning 1: Unrecognized geometry type : 1015                            [<=== note this!]
> No projection information available for layer <Building>
> Übersteuere die Überprüfung der Projektion.
> Check if OGR layer <Building> contains polygons...
>  100%
> WARNUNG: Vektorkarte <SMALL01> existiert bereits und wird überschrieben.
> Creating attribute table for layer <Building>...
> Importing 1 features (OGR layer <Building>)...
> WARNUNG: Skipping unsupported geometry type 'POLYHEDRALSURFACE'           [<=== note this!]

v.in.ogr could force-convert these polyhedral surfaces to multipolygons, at the risk of getting garbage.

The required change to v.in.ogr would be small, but it would be safer to skip these unsupported feature types in order to avoid garbage output.

Markus M

>  100%
> -----------------------------------------------------

> Erstelle Topologie für die Vektorkarte <SMALL01@PERMANENT>...
> Registriere Primitive...
> WARNUNG: Input data contains 3D features. Created vector is 2D only,
>          disable -2 flag to import 3D vector.
>
>
> This problem seems to be ogr/gdal related:
>
> ogrinfo -al TEST.xml
> describes the geometry as a POLYHEDRALSURFACE Z (((412033.466 5812969.869 ...))).
>
> ogr2ogr -f "GML" TEST.gml TEST.xml  fails (some effect when trying other target formats like CSV or ESRI shape:
> Warning 1: Unrecognized geometry type : 1015
> ERROR 6: Unsupported geometry type 3D PolyhedralSurface
> ERROR 1: Export of geometry to GML failed
> ERROR 1: Terminating translation prematurely after failed
> translation of layer Building (use -skipfailures to skip errors)
>
> There is GDAL documentation about surfaces (https://gdal.org/development/rfc/rfc64_triangle_polyhedralsurface_tin.html), but I couldn't find anything about transformations/pruning from 3D to 2D.
>
> The CGAL library appears to be capable to handle such surfaces, but GIS-integration seems to be limited (https://www.cgal.org/).
>
> Ideas on how to proceed, anyone ?
>
> best,
> Peter
>
>
>
>
>
> <[hidden email]>
>
>
> > Gesendet: Dienstag, 06. August 2019 um 14:46 Uhr
> > Von: [hidden email]
> > An: [hidden email]
> > Betreff: grass-user Digest, Vol 160, Issue 5
> >
> > Send grass-user mailing list submissions to
> >       [hidden email]
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >       https://lists.osgeo.org/mailman/listinfo/grass-user
> > or, via email, send a message with subject or body 'help' to
> >       [hidden email]
> >
> > You can reach the person managing the list at
> >       [hidden email]
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of grass-user digest..."
> >
> >
> > Today's Topics:
> >
> >    1. Re: Problems starting grass 7.4.1 in ubuntu (Markus Metz)
> >    2. Re: wms google (Micha Silver)
> >    3. Re: Wrangling CityGML with GRASS ? (Stefan Blumentrath)
> >    4. Re: Wrangling CityGML with GRASS ? (Peter Löwe)
> >    5. Re: Wrangling CityGML with GRASS ? (Markus Metz)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Mon, 5 Aug 2019 22:32:12 +0200
> > From: Markus Metz <[hidden email]>
> > To: Sebastián Dietrich <[hidden email]>
> > Cc: grass-user <[hidden email]>
> > Subject: Re: [GRASS-user] Problems starting grass 7.4.1 in ubuntu
> > Message-ID:
> >       <CAG+h=[hidden email]>
> > Content-Type: text/plain; charset="utf-8"
> >
> > On Mon, Aug 5, 2019 at 5:35 PM Sebastián Dietrich <[hidden email]>
> > wrote:
> > >
> > > Hi everyone, when i try to launch g.gui i get the following message:
> > >
> > > GRASS 7.4.1 (EPSG5344):~/Documentos/grassdata > g.gui
> > > Lanzando GUI <wxpython> en el fondo, por favor espere...
> > > Traceback (most recent call last):
> > >   File "/usr/lib/grass74/gui/wxpython/wxgui.py", line 25, in <module>
> > >     from core import globalvar
> > >   File "/usr/lib/grass74/gui/wxpython/core/globalvar.py", line 39, in
> > <module>
> > >     'locale')).ugettext
> > > AttributeError: 'GNUTranslations' object has no attribute 'ugettext'
> > > [MÁSCARA ráster presente]
> > > GRASS 7.4.1 (EPSG5344):~/Documentos/grassdata >
> > >
> > > Can someone help with this issue?
> >
> > GNUTranslations has an attribute ugettext only in Python2, not in Python3.
> > Make sure that the link "python" points to "python2", test with "python
> > --version"
> >
> > Markus M
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190805/c9190edf/attachment-0001.html>
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Tue, 6 Aug 2019 09:19:31 +0300
> > From: Micha Silver <[hidden email]>
> > To: Sebastián Dietrich <[hidden email]>
> > Cc: Ken Mankoff <[hidden email]>, [hidden email]
> > Subject: Re: [GRASS-user] wms google
> > Message-ID: <[hidden email]>
> > Content-Type: text/plain; charset="utf-8"
> >
> > An HTML attachment was scrubbed...
> > URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190806/002e1069/attachment-0001.html>
> >
> > ------------------------------
> >
> > Message: 3
> > Date: Tue, 6 Aug 2019 09:13:57 +0000
> > From: Stefan Blumentrath <[hidden email]>
> > To: "Peter Löwe" <[hidden email]>, "[hidden email]"
> >       <[hidden email]>
> > Subject: Re: [GRASS-user] Wrangling CityGML with GRASS ?
> > Message-ID:
> >       <[hidden email]>
> >      
> > Content-Type: text/plain; charset="utf-8"
> >
> > Hi Peter,
> >
> > Not personally...
> > I would guess you would import CityGML through GDAL:
> > https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html
> > There you can create subsets and the like...
> >
> > What are you planning to do with it, roughly?
> >
> > Cheers
> > Stefan
> >
> >
> > -----Original Message-----
> > From: grass-user <[hidden email]> On Behalf Of "Peter Löwe"
> > Sent: torsdag 1. august 2019 11:10
> > To: [hidden email]
> > Subject: [GRASS-user] Wrangling CityGML with GRASS ?
> >
> > Hi list,
> >
> > I'm looking for information/howtos/etc. about how to deal with large CityGML data sets using GRASS.
> >
> > Has anybody already explored this ?
> >
> > Best,
> > Peter
> >
> > <[hidden email]>
> >
> > _______________________________________________
> > grass-user mailing list
> > [hidden email]
> > https://lists.osgeo.org/mailman/listinfo/grass-user
> >
> > ------------------------------
> >
> > Message: 4
> > Date: Tue, 6 Aug 2019 12:23:29 +0200
> > From: "Peter Löwe" <[hidden email]>
> > To: "Stefan Blumentrath" <[hidden email]>
> > Cc: "[hidden email]" <[hidden email]>
> > Subject: Re: [GRASS-user] Wrangling CityGML with GRASS ?
> > Message-ID:
> >       <trinity-c2c845f5-697c-4269-afaf-8be6360d44d9-1565087009741@3c-app-gmx-bs34>
> >      
> > Content-Type: text/plain; charset=UTF-8
> >
> > Hi Stefan,
> >
> > thanks for the link: That's also the latest information we found so far, except for several OSGeo conference recordings (e.g. https://doi.org/10.5446/40913 https://doi.org/10.5446/40694).
> > My colleagues have ingested CityGML datasets into R, which caused issues with the vector-topology for individual buildings. Also, we have to cope with significant amounts of CityGML datasets, which would require very large amounts of RAM, if the processing is done in R. Since GRASS locations are storage-effective AND GRASS handles vector topologies well, I had hoped that someone already explored this approach further :-)
> >
> > If this should be not the case (yet) we'll gladly report at one of next years FOSS4G events.
> >
> > Best,
> > peter  
> >
> > <[hidden email]>
> >
> >
> > > Gesendet: Dienstag, 06. August 2019 um 11:13 Uhr
> > > Von: "Stefan Blumentrath" <[hidden email]>
> > > An: "Peter Löwe" <[hidden email]>, "[hidden email]" <[hidden email]>
> > > Betreff: RE: [GRASS-user] Wrangling CityGML with GRASS ?
> > >
> > > Hi Peter,
> > >
> > > Not personally...
> > > I would guess you would import CityGML through GDAL:
> > > https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html
> > > There you can create subsets and the like...
> > >
> > > What are you planning to do with it, roughly?
> > >
> > > Cheers
> > > Stefan
> > >
> > >
> > > -----Original Message-----
> > > From: grass-user <[hidden email]> On Behalf Of "Peter Löwe"
> > > Sent: torsdag 1. august 2019 11:10
> > > To: [hidden email]
> > > Subject: [GRASS-user] Wrangling CityGML with GRASS ?
> > >
> > > Hi list,
> > >
> > > I'm looking for information/howtos/etc. about how to deal with large CityGML data sets using GRASS.
> > >
> > > Has anybody already explored this ?
> > >
> > > Best,
> > > Peter
> > >
> > > <[hidden email]>
> > >
> > > _______________________________________________
> > > grass-user mailing list
> > > [hidden email]
> > > https://lists.osgeo.org/mailman/listinfo/grass-user
> > >
> >
> >
> > ------------------------------
> >
> > Message: 5
> > Date: Tue, 6 Aug 2019 14:45:50 +0200
> > From: Markus Metz <[hidden email]>
> > To: Peter Löwe <[hidden email]>
> > Cc: Stefan Blumentrath <[hidden email]>,
> >       "[hidden email]" <[hidden email]>
> > Subject: Re: [GRASS-user] Wrangling CityGML with GRASS ?
> > Message-ID:
> >       <CAG+h=[hidden email]>
> > Content-Type: text/plain; charset="utf-8"
> >
> > Hi Peter,
> >
> > On Tue, Aug 6, 2019 at 12:23 PM "Peter Löwe" <[hidden email]> wrote:
> > >
> > > Hi Stefan,
> > >
> > > thanks for the link: That's also the latest information we found so far,
> > except for several OSGeo conference recordings (e.g.
> > https://doi.org/10.5446/40913 https://doi.org/10.5446/40694).
> >
> > GML and GMLAS are supported by GDAL 2.2+. However, in order to import GMLAS
> > properly, some tricks are needed (interleaved reading for non-sequential
> > layers, see
> > https://gdal.org/drivers/vector/gmlas.html#performance-issues-with-large-multi-layer-gml-files)
> > which are built into GRASS 7.6+.
> >
> > > My colleagues have ingested CityGML datasets into R, which caused issues
> > with the vector-topology for individual buildings.
> >
> > That's not related to the data format, but to the content: 3D polygons.
> > These are not supported in GRASS, when importing you need to convert the
> > data to 2D with v.in.ogr -2, otherwise you get corrupt topology. Maybe this
> > is also needed for R.
> >
> > Markus M
> >
> > > Also, we have to cope with significant amounts of CityGML datasets, which
> > would require very large amounts of RAM, if the processing is done in R.
> > Since GRASS locations are storage-effective AND GRASS handles vector
> > topologies well, I had hoped that someone already explored this approach
> > further :-)
> > >
> > > If this should be not the case (yet) we'll gladly report at one of next
> > years FOSS4G events.
> > >
> > > Best,
> > > peter
> > >
> > > <[hidden email]>
> > >
> > >
> > > > Gesendet: Dienstag, 06. August 2019 um 11:13 Uhr
> > > > Von: "Stefan Blumentrath" <[hidden email]>
> > > > An: "Peter Löwe" <[hidden email]>, "[hidden email]" <
> > [hidden email]>
> > > > Betreff: RE: [GRASS-user] Wrangling CityGML with GRASS ?
> > > >
> > > > Hi Peter,
> > > >
> > > > Not personally...
> > > > I would guess you would import CityGML through GDAL:
> > > >
> > https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html
> > > > There you can create subsets and the like...
> > > >
> > > > What are you planning to do with it, roughly?
> > > >
> > > > Cheers
> > > > Stefan
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: grass-user <[hidden email]> On Behalf Of
> > "Peter Löwe"
> > > > Sent: torsdag 1. august 2019 11:10
> > > > To: [hidden email]
> > > > Subject: [GRASS-user] Wrangling CityGML with GRASS ?
> > > >
> > > > Hi list,
> > > >
> > > > I'm looking for information/howtos/etc. about how to deal with large
> > CityGML data sets using GRASS.
> > > >
> > > > Has anybody already explored this ?
> > > >
> > > > Best,
> > > > Peter
> > > >
> > > > <[hidden email]>
> > > >
> > > > _______________________________________________
> > > > grass-user mailing list
> > > > [hidden email]
> > > > https://lists.osgeo.org/mailman/listinfo/grass-user
> > > >
> > > _______________________________________________
> > > grass-user mailing list
> > > [hidden email]
> > > https://lists.osgeo.org/mailman/listinfo/grass-user
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190806/2dc10111/attachment.html>
> >
> > ------------------------------
> >
> > Subject: Digest Footer
> >
> > _______________________________________________
> > grass-user mailing list
> > [hidden email]
> > https://lists.osgeo.org/mailman/listinfo/grass-user
> >
> > ------------------------------
> >
> > End of grass-user Digest, Vol 160, Issue 5
> > ******************************************
> >
> _______________________________________________
> grass-user mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Wrangling CityGML with GRASS ?

"Peter Löwe"
Hi Markus, all,
 
one option to deal with this is in a structured way could be to use the GMLAS-driver of GDAL, prior to the import into GRASS via v.in.ogr, as 
Stelios Vitalis described it here: https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html (last code example) 
 
For me, GDAL2.3.1 in GRASS refuses to accept the "GMLAS:" override for the import-driver:
 
ogr2ogr -f GeoJSON SMALL.json GMLAS:SMALL.gml -oo REMOVE_UNUSED_LAYERS=YES -oo REMOVE_UNUSED_FIELDS=YES -sql "SELECT * FROM groundsurface"
 
--> if GDAL-4-GRASS is currently built without GMLAS-support, it would be wortwhile to include it soonish (-> benefits: https://inspire.ec.europa.eu/sites/default/files/presentations/gml_application_schema_made_easy_in_gdal_ogr_and_qgis_-_gmlas_driver_0.pdf
 
Otherwise, the standard GML-driver doesn't feature the REMOVE_xxx options:
ogr2ogr -f GeoJSON SMALL.json SMALL.gml -oo REMOVE_UNUSED_LAYERS=YES -oo REMOVE_UNUSED_FIELDS=YES -sql "SELECT * FROM groundsurface"
 
Warning 6: driver GML does not support open option REMOVE_UNUSED_LAYERS
Warning 6: driver GML does not support open option REMOVE_UNUSED_FIELDS
ERROR 6: The GeoJSON driver does not overwrite existing files.
ERROR 1: GeoJSON driver failed to create SMALL.json
 
Best,
peter
 

 
 
 
Gesendet: Donnerstag, 08. August 2019 um 15:15 Uhr
Von: "Markus Metz" <[hidden email]>
An: "Peter Löwe" <[hidden email]>
Cc: grass-user <[hidden email]>
Betreff: Re: [GRASS-user] Wrangling CityGML with GRASS ?


On Thu, Aug 8, 2019 at 2:59 PM "Peter Löwe" <[hidden email]> wrote:
>
> Hello Markus, Stefan, all,
>
> thanks for all your advice. New challenges have emerged, as the dataset is defined as a polyhedral surface:
>
> I upgraded to GRASS 7.6.1 which comes with GDAL 2.3.1.
>
> The data sources are official CityGML files provided by the German Federal Agency for Cartographyand Geodesy (Bundesamt für Kartographie), which have an ".xml"-extension.
>
> v.in.ogr -2 -o --o input=TEST.xml output=TEST01
> throws several warnings and creates an empty vector without an points/lines in it:
>
>  Warning 1: Unrecognized geometry type : 1015                            [<=== note this!]
> No projection information available for layer <Building>
> Übersteuere die Überprüfung der Projektion.
> Check if OGR layer <Building> contains polygons...
>  100%
> WARNUNG: Vektorkarte <SMALL01> existiert bereits und wird überschrieben.
> Creating attribute table for layer <Building>...
> Importing 1 features (OGR layer <Building>)...
> WARNUNG: Skipping unsupported geometry type 'POLYHEDRALSURFACE'           [<=== note this!]
 
v.in.ogr could force-convert these polyhedral surfaces to multipolygons, at the risk of getting garbage.
 
The required change to v.in.ogr would be small, but it would be safer to skip these unsupported feature types in order to avoid garbage output.
 
Markus M
 
 

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

Re: Wrangling CityGML with GRASS ?

Markus Metz-3
Hi Peter,

On Thu, Aug 8, 2019 at 3:56 PM "Peter Löwe" <[hidden email]> wrote:
>
> Hi Markus, all,
[...]
>  
> For me, GDAL2.3.1 in GRASS refuses to accept the "GMLAS:"
from https://gdal.org/drivers/vector/gmlas.html: The driver requires Xerces-C >= 3.1

You need to rebuild GDAL accordingly, but

> override for the import-driver:
>  
> ogr2ogr -f GeoJSON SMALL.json GMLAS:SMALL.gml -oo REMOVE_UNUSED_LAYERS=YES -oo REMOVE_UNUSED_FIELDS=YES -sql "SELECT * FROM groundsurface"

apparently GMLAS is supported. What is the exact error message for " GDAL2.3.1 in GRASS refuses to accept the "GMLAS:""?

Markus M
>  

> --> if GDAL-4-GRASS is currently built without GMLAS-support, it would be wortwhile to include it soonish (-> benefits: https://inspire.ec.europa.eu/sites/default/files/presentations/gml_application_schema_made_easy_in_gdal_ogr_and_qgis_-_gmlas_driver_0.pdf)
>  
> Otherwise, the standard GML-driver doesn't feature the REMOVE_xxx options:
> ogr2ogr -f GeoJSON SMALL.json SMALL.gml -oo REMOVE_UNUSED_LAYERS=YES -oo REMOVE_UNUSED_FIELDS=YES -sql "SELECT * FROM groundsurface"
>  
> Warning 6: driver GML does not support open option REMOVE_UNUSED_LAYERS
> Warning 6: driver GML does not support open option REMOVE_UNUSED_FIELDS
> ERROR 6: The GeoJSON driver does not overwrite existing files.
> ERROR 1: GeoJSON driver failed to create SMALL.json
>  
> Best,
> peter
>  
>
>  
> <[hidden email]>
>  
>  
> Gesendet: Donnerstag, 08. August 2019 um 15:15 Uhr
> Von: "Markus Metz" <[hidden email]>
> An: "Peter Löwe" <[hidden email]>
> Cc: grass-user <[hidden email]>
> Betreff: Re: [GRASS-user] Wrangling CityGML with GRASS ?
>
>
> On Thu, Aug 8, 2019 at 2:59 PM "Peter Löwe" <[hidden email]> wrote:
> >
> > Hello Markus, Stefan, all,
> >
> > thanks for all your advice. New challenges have emerged, as the dataset is defined as a polyhedral surface:
> >
> > I upgraded to GRASS 7.6.1 which comes with GDAL 2.3.1.
> >
> > The data sources are official CityGML files provided by the German Federal Agency for Cartographyand Geodesy (Bundesamt für Kartographie), which have an ".xml"-extension.
> >
> > v.in.ogr -2 -o --o input=TEST.xml output=TEST01
> > throws several warnings and creates an empty vector without an points/lines in it:
> >
> >  Warning 1: Unrecognized geometry type : 1015                            [<=== note this!]
> > No projection information available for layer <Building>
> > Übersteuere die Überprüfung der Projektion.
> > Check if OGR layer <Building> contains polygons...
> >  100%
> > WARNUNG: Vektorkarte <SMALL01> existiert bereits und wird überschrieben.
> > Creating attribute table for layer <Building>...
> > Importing 1 features (OGR layer <Building>)...
> > WARNUNG: Skipping unsupported geometry type 'POLYHEDRALSURFACE'           [<=== note this!]
>  
> v.in.ogr could force-convert these polyhedral surfaces to multipolygons, at the risk of getting garbage.
>  
> The required change to v.in.ogr would be small, but it would be safer to skip these unsupported feature types in order to avoid garbage output.
>  
> Markus M
>  
>  
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Wrangling CityGML with GRASS ?

"Peter Löwe"
Hi Markus,
 
I am not sure whether GMLAS is currently supported:
ogr2ogr -f GeoJSON SMALL.json GMLAS:SMALL.gml -oo REMOVE_UNUSED_LAYERS=YES -oo REMOVE_UNUSED_FIELDS=YES -sql "SELECT * FROM groundsurface"
throws 
"FAILURE:
Unable to open datasource `GMLAS:SMALL.gml' with the following drivers.
  -> `OGR_GRASS'
  -> `PCIDSK'
  -> `PDF'
 [...]
"
-> with no mentioning of GMLAS as a driver option.
 
Best,
Peter
 
You need to rebuild GDAL accordingly, but
 
> override for the import-driver:
>  
> ogr2ogr -f GeoJSON SMALL.json GMLAS:SMALL.gml -oo REMOVE_UNUSED_LAYERS=YES -oo REMOVE_UNUSED_FIELDS=YES -sql "SELECT * FROM groundsurface"
 
apparently GMLAS is supported. What is the exact error message for " GDAL2.3.1 in GRASS refuses to accept the "GMLAS:""?
 
Markus M

_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user