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
 

 
<peter.lo...@gmx.de>
 
 
Gesendet: Donnerstag, 08. August 2019 um 15:15 Uhr
Von: "Markus Metz" <markus.metz.gisw...@gmail.com>
An: "Peter Löwe" <peter.lo...@gmx.de>
Cc: grass-user <grass-user@lists.osgeo.org>
Betreff: Re: [GRASS-user] Wrangling CityGML with GRASS ?


On Thu, Aug 8, 2019 at 2:59 PM "Peter Löwe" <peter.lo...@gmx.de> 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
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to