[Gpsbabel-misc] Zero altitude causes problem with KML output
Brought to you by:
robertl
From: Isaac W. <is...@wi...> - 2011-08-25 17:22:30
|
While trying to write a shell script to delete one of each pair of duplicated coordinates in a KML file (a problem I mentioned in a previous message), I discovered another problem. When the altitude entry in a gpx file is zero: <?xml version='1.0' encoding='UTF-8'?> <gpx version='1.1' creator='GPSMID' xmlns='http://www.topografix.com/GPX/1/1'> <trk> <trkseg> <trkpt lat='37.26142' lon='-121.89242'> <ele>38</ele> <time>2011-08-24T21:13:33Z</time> </trkpt> <trkpt lat='37.261414' lon='-121.89239'> <ele>0</ele> <time>2011-08-24T21:13:45Z</time> </trkpt> <trkpt lat='37.26142' lon='-121.89241'> <ele>0</ele> <time>2011-08-24T21:13:51Z</time> </trkpt> <trkpt lat='37.261475' lon='-121.89246'> <ele>0</ele> <time>2011-08-24T21:13:59Z</time> </trkpt> ... Then the corresponding entries in the resulting KML file are entirely omitted: <Placemark> <name>Path</name> <styleUrl>#lineStyle</styleUrl> <LineString> <tessellate>1</tessellate> <coordinates> -121.892420,37.261420,38.00 -121.892420,37.261420,38.000000 -121.892390,37.261414 -121.892390,37.261414 -121.892410,37.261420 -121.892410,37.261420 -121.892460,37.261475 -121.892460,37.261475 -121.892430,37.261510 -121.892430,37.261510 -121.892420,37.261530,59.00 -121.892420,37.261530,59.000000 -121.892420,37.261536 -121.892420,37.261536 -121.892370,37.261547,56.00 -121.892370,37.261547,56.000000 ... This not only frustrated my intention of deleting all lines containing ".000000" as a way of eliminating the duplicates, but also is probably not good practice for data which may be used in a structured database. Zero values for latitude and longitude seem to be handled properly. Isaac |