<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi Markus, all,</div>

<div> </div>

<div>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 <br/>
Stelios Vitalis described it here: <a href="https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html">https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html</a> (last code example) </div>

<div> </div>

<div>For me, GDAL2.3.1 in GRASS refuses to accept the "GMLAS:" override for the import-driver:</div>

<div> </div>

<div>ogr2ogr -f GeoJSON SMALL.json GMLAS:SMALL.gml -oo REMOVE_UNUSED_LAYERS=YES -oo REMOVE_UNUSED_FIELDS=YES -sql "SELECT * FROM groundsurface"</div>

<div> </div>

<div>--> if GDAL-4-GRASS is currently built without GMLAS-support, it would be wortwhile to include it soonish (-> benefits: <a href="https://inspire.ec.europa.eu/sites/default/files/presentations/gml_application_schema_made_easy_in_gdal_ogr_and_qgis_-_gmlas_driver_0.pdf">https://inspire.ec.europa.eu/sites/default/files/presentations/gml_application_schema_made_easy_in_gdal_ogr_and_qgis_-_gmlas_driver_0.pdf</a>) </div>

<div> </div>

<div>Otherwise, the standard GML-driver doesn't feature the REMOVE_xxx options:</div>

<div>ogr2ogr -f GeoJSON SMALL.json SMALL.gml -oo REMOVE_UNUSED_LAYERS=YES -oo REMOVE_UNUSED_FIELDS=YES -sql "SELECT * FROM groundsurface"</div>

<div> </div>

<div>Warning 6: driver GML does not support open option REMOVE_UNUSED_LAYERS<br/>
Warning 6: driver GML does not support open option REMOVE_UNUSED_FIELDS<br/>
ERROR 6: The GeoJSON driver does not overwrite existing files.<br/>
ERROR 1: GeoJSON driver failed to create SMALL.json<br/>
 </div>

<div>Best,</div>

<div>peter</div>

<div> </div>

<div><br/>
 </div>

<div class="signature"><peter.loewe@gmx.de></div>

<div> 
<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Donnerstag, 08. August 2019 um 15:15 Uhr<br/>
<b>Von:</b> "Markus Metz" <markus.metz.giswork@gmail.com><br/>
<b>An:</b> "Peter Löwe" <peter.loewe@gmx.de><br/>
<b>Cc:</b> grass-user <grass-user@lists.osgeo.org><br/>
<b>Betreff:</b> Re: [GRASS-user] Wrangling CityGML with GRASS ?</div>

<div name="quoted-content"><br/>
<br/>
On Thu, Aug 8, 2019 at 2:59 PM "Peter Löwe" <<a href="mailto:peter.loewe@gmx.de" onclick="parent.window.location.href='mailto:peter.loewe@gmx.de'; return false;" target="_blank">peter.loewe@gmx.de</a>> wrote:<br/>
><br/>
> Hello Markus, Stefan, all,<br/>
><br/>
> thanks for all your advice. New challenges have emerged, as the dataset is defined as a polyhedral surface:<br/>
><br/>
> I upgraded to GRASS 7.6.1 which comes with GDAL 2.3.1.<br/>
><br/>
> 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.<br/>
><br/>
> v.in.ogr -2 -o --o input=TEST.xml output=TEST01<br/>
> throws several warnings and creates an empty vector without an points/lines in it:<br/>
><br/>
>  Warning 1: Unrecognized geometry type : 1015                            [<=== note this!]<br/>
> No projection information available for layer <Building><br/>
> Übersteuere die Überprüfung der Projektion.<br/>
> Check if OGR layer <Building> contains polygons...<br/>
>  100%<br/>
> WARNUNG: Vektorkarte <SMALL01> existiert bereits und wird überschrieben.<br/>
> Creating attribute table for layer <Building>...<br/>
> Importing 1 features (OGR layer <Building>)...<br/>
> WARNUNG: Skipping unsupported geometry type 'POLYHEDRALSURFACE'           [<=== note this!]
<div> </div>

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

<div> </div>

<div>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.</div>

<div> </div>

<div>Markus M</div>

<div> </div>

<div> </div>
</div>
</div>
</div>
</div></div></body></html>