[gdal-dev] ogr2ogr ignoring tracks, only converting paths

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Sat Feb 8 10:02:33 PST 2020


Hi,

Please answer with “reply-all” so your mails go also back to the list.

GDAL has two drivers for KML
https://gdal.org/drivers/vector/kml.html
https://gdal.org/drivers/vector/libkml.html#vector-libkml

KML driver finds only one layer from your data
ogrinfo --config gdal_skip libkml testcase.kml
INFO: Open of `testcase.kml'
      using driver `KML' successful.
1: Stuttgart-Schweiz (3D Line String)

LIBKML driver finds 4 layers

ogrinfo testcase.kml
INFO: Open of `testcase.kml'
      using driver `LIBKML' successful.
1: Temporäre Orte
2: Stuttgart-Schweiz
3: GPS device
4: Tracks

Layers 1 and 3 do not contain data but layers 2 and 4 do.

It seems that you are using GDAL which either does not have LIBKML driver or it appears in the list of formats after KML. Check the drivers with command ogrinfo --formats. If you don’t have LIBKML you must get such GDAL build that has the driver. If you have both KML and LIBKML in that order, you must skip the KML driver with config option --config GDAL_SKIP KML.

-Jukka Rahkonen-


Lähettäjä: Manuel H. <manuelhewitt at gmail.com>
Lähetetty: lauantai 8. helmikuuta 2020 14.50
Vastaanottaja: Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi>
Aihe: Re: [gdal-dev] ogr2ogr ignoring tracks, only converting paths

Test data with a track and a path. After simplification only the path is left:  https://filebin.net/xp0qi0cfm4bs08cw

The newer tracks I should have as GPX tracks, but likely not the old ones. I surely could simplify new ones before adding them to Google Earth, but I was looking for a way to simplify all the old data as easily as possible. I wanted to prevent having to export each track manually and then run it through a program before piecing it back together. My KML is over 80MB.

Am Sa., 8. Feb. 2020 um 13:34 Uhr schrieb jratike80 <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>>:
Hi,

Could you provide some test data? If data area GPS logs, do you happen to
have they also in GPX format that might have better support in GDAL and for
example gpsbabel program?

-Jukka Rahkonen-


Manuel H. wrote
> Hi,
>
> I was attempting to simplify my Google Earth KML file and found ogr2ogr
> mentioned on the internet.
> When I run it through the program, ogr2ogr seems to ignore everything that
> is a "Track" according to Google Earth. Only entries that are a "Path" are
> converted. They are all GPS logs I collected over many years with
> different
> devices. Most modern tracks have been collected with smartphones and they
> are all ignored.
>
> Is there an easy way to prevent or circumvent this?
>
> Also, ogr2ogr flattens my KML by removing all folders and the general
> hierarchy. This is annoying, but I could deal with it if I convert folders
> separately.
>
> BG,
>
> Manuel
>
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo<mailto:gdal-dev at .osgeo>

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200208/cc4372db/attachment.html>


More information about the gdal-dev mailing list