OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.67k stars 2.46k forks source link

ogr2ogr fails to convert alkis data (from wfs gml) #7732

Closed pcace closed 1 year ago

pcace commented 1 year ago

Hi there, what am i doing wrong when ogr2ogr does not want to convert this gml file to json:

  <wfs:boundedBy>
    <gml:Envelope srsName="urn:ogc:def:crs:EPSG::25832">
      <gml:lowerCorner>656539.249 5649416.474</gml:lowerCorner>
      <gml:upperCorner>657678.556 5650011.002</gml:upperCorner>
    </gml:Envelope>
  </wfs:boundedBy>
  <wfs:member>
    <ave:Flurstueck xmlns:ave="http://repository.gdi-de.org/schemas/adv/produkt/alkis-vereinfacht/1.0" gml:id="Flurstueck_DETHL51P0000qqDlFL">
      <gml:identifier codeSpace="urn:adv:oid:">DETHL51P0000qqDlFL</gml:identifier>
      <ave:oid>DETHL51P0000qqDlFL</ave:oid>
      <ave:aktualit>2023-02-17</ave:aktualit>
      <ave:geometrie>
        <!--Inlined geometry 'Flurstueck_DETHL51P0000qqDlFL_AVE_GEOMETRIE'-->
        <gml:MultiSurface gml:id="Flurstueck_DETHL51P0000qqDlFL_AVE_GEOMETRIE" srsName="urn:ogc:def:crs:EPSG::25832">
          <gml:surfaceMember>
            <gml:Polygon gml:id="GEOMETRY_c975b0eb-71c8-4912-b8d3-70326a310e50" srsName="urn:ogc:def:crs:EPSG::25832">
              <gml:exterior>
                <gml:LinearRing>
                  <gml:posList>657060.405 5649762.885 657058.084 5649782.148 657054.542 5649811.537 657050.996 5649840.968 657043.813 5649900.579 657042.488 5649911.579 657037.149 5649955.883 657030.508 5650011.002 657028.690 5650010.779 657017.129 5650009.362 657022.778 5650005.384 657023.481 5649999.533 657024.704 5649989.347 657025.973 5649978.780 657026.579 5649973.734 657027.191 5649968.636 657028.181 5649958.262 657031.993 5649918.315 657033.039 5649910.196 657034.331 5649900.164 657040.495 5649852.290 657045.859 5649810.628 657050.392 5649775.419 657058.113 5649711.123 657060.875 5649688.122 657067.580 5649632.294 657068.196 5649627.162 657069.077 5649619.832 657070.066 5649611.599 657071.254 5649601.706 657074.821 5649572.000 657077.367 5649550.799 657077.428 5649550.291 657082.093 5649511.451 657084.463 5649491.710 657091.153 5649436.755 657093.034 5649421.304 657093.167 5649418.244 657095.698 5649418.225 657101.974 5649418.180 657101.485 5649422.239 657101.181 5649424.757 657100.704 5649428.716 657099.527 5649438.477 657097.540 5649454.945 657095.804 5649469.315 657093.938 5649484.777 657092.418 5649497.355 657091.496 5649505.001 657090.726 5649511.377 657087.895 5649534.827 657084.358 5649564.141 657083.360 5649572.410 657078.570 5649612.123 657077.115 5649624.198 657076.334 5649630.685 657075.479 5649637.783 657072.748 5649660.445 657070.054 5649682.809 657067.248 5649706.097 657066.508 5649712.235 657064.975 5649724.955 657062.650 5649744.253 657060.405 5649762.885</gml:posList>
                </gml:LinearRing>
              </gml:exterior>
            </gml:Polygon>
          </gml:surfaceMember>
        </gml:MultiSurface>
      </ave:geometrie>
      <ave:idflurst>DETHL51P0000qqDl</ave:idflurst>
      <ave:flaeche>5378</ave:flaeche>
      <ave:flstkennz>16533600900995______</ave:flstkennz>
      <ave:land>Thüringen</ave:land>
      <ave:gemarkung>Hopfgarten</ave:gemarkung>
      <ave:flur>Flur 9</ave:flur>
      <ave:flurstnr>995</ave:flurstnr>
      <ave:gmdschl>16071103</ave:gmdschl>
      <ave:regbezirk>unbesetzt</ave:regbezirk>
      <ave:kreis>Weimarer Land</ave:kreis>
      <ave:gemeinde>Grammetal</ave:gemeinde>
      <ave:lagebeztxt>An der Sundleite und am Holzwege</ave:lagebeztxt>
      <ave:tntxt>Landwirtschaft; 1734|Weg; 1357|Weg; 61|Weg; 40|Landwirtschaft; 30|Landwirtschaft; 2156</ave:tntxt>
    </ave:Flurstueck>
  </wfs:member>
</wfs:FeatureCollection>

the error i am getting is this:

{"error":true,"message":"Command failed: ogr2ogr -f GeoJSON -skipfailures /vsistdout/ /tmp/4a3c0b5107b287e8057266755bf3e24ctmp.gml\nFAILURE:\nUnable to open datasource/tmp/4a3c0b5107b287e8057266755bf3e24ctmp.gml' with the following drivers.\n -> FITS'\n ->PCIDSK'\n -> netCDF'\n ->PDS4'\n -> VICAR'\n ->JP2OpenJPEG'\n -> PDF'\n ->MBTiles'\n -> BAG'\n ->EEDA'\n -> OGCAPI'\n ->ESRI Shapefile'\n -> MapInfo File'\n ->UK .NTF'\n -> LVBAG'\n ->OGR_SDTS'\n -> S57'\n ->DGN'\n -> OGR_VRT'\n ->Memory'\n -> CSV'\n ->NAS'\n -> GML'\n ->GPX'\n -> LIBKML'\n ->KML'\n -> GeoJSON'\n ->GeoJSONSeq'\n -> ESRIJSON'\n ->TopoJSON'\n -> Interlis 1'\n ->Interlis 2'\n -> OGR_GMT'\n ->GPKG'\n -> SQLite'\n ->ODBC'\n -> WAsP'\n ->PGeo'\n -> MSSQLSpatial'\n ->PostgreSQL'\n -> MySQL'\n ->OpenFileGDB'\n -> DXF'\n ->CAD'\n -> FlatGeobuf'\n ->Geoconcept'\n -> GeoRSS'\n ->VFK'\n -> PGDUMP'\n ->OSM'\n -> GPSBabel'\n ->OGR_PDS'\n -> WFS'\n ->OAPIF'\n -> EDIGEO'\n ->SVG'\n -> Idrisi'\n ->XLS'\n -> ODS'\n ->XLSX'\n -> Elasticsearch'\n ->Carto'\n -> AmigoCloud'\n ->SXF'\n -> Selafin'\n ->JML'\n -> PLSCENES'\n ->CSW'\n -> VDV'\n ->GMLAS'\n -> MVT'\n ->NGW'\n -> MapML'\n ->Parquet'\n -> Arrow'\n ->GTFS'\n -> TIGER'\n ->AVCBin'\n -> AVCE00'\n ->HTTP'\n"}`

but why? is there anything strange with the gml file?

Thanks a lot for hints what is going on here and how i would solve this!

Cheers

jratike80 commented 1 year ago

It seems that the GML file is truncated and it is missing some data from the beginning.

Didn't you notice the hint?

Questions should go to the gdal-dev mailing list at https://lists.osgeo.org/mailman/listinfo/gdal-dev or other support forums. GitHub issues are for bug reports and suggestions for new features.

pcace commented 1 year ago

ok, i will try it there. thanks!