[gdal-dev] KML recognized as GML by ogr2ogr

Even Rouault even.rouault at spatialys.com
Fri Sep 29 04:44:24 PDT 2017


On vendredi 29 septembre 2017 12:59:04 CEST Even Rouault wrote:
> On vendredi 29 septembre 2017 07:34:27 CEST Rahkonen Jukka (MML) wrote:
> > Hi,
> > 
> > See
> > https://gis.stackexchange.com/questions/256861/kml-to-shapefile-problems-o
> > g
> > r2ogr
> > 
> > I have verified with todays GDAL 2.3.0dev  from gisinternals that ogrinfos
> > open the KML file form that question with LIBKML driver while ogr2ogr
> > opens
> > it with GML driver and fails.
> 
> Fixed per https://trac.osgeo.org/gdal/ticket/7061
> 
> The reason of the difference of behaviour is that if you do "ogrinfo a.kml",
> ogrinfo tries to open in read-update mode, and only the LIBKML supports it,
> so the GML driver (which is registered, and thus tried, before the LIBML)
> will be skipped
> 
> When you do "ogr2ogr out in.kml", the input file is opened in read-only
> mode, so the GML driver tried to open it and seeing a
> xmlns:gml="http://www.opengis.net/gml" (useless in that context) declaration
> thought that it should open it.

By the way, I've just changed this odd behaviour of ogrinfo in trunk. It really does not make 
sense to try opening in update mode in most cases, unless -sql is used. So by default, now, 
unless -sql without -ro is used, ogrinfo will open in read-only mode.


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170929/2d7a9195/attachment.html>


More information about the gdal-dev mailing list