Initialization "record" causing bad extents/geometries in OGR for GPX files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Initialization "record" causing bad extents/geometries in OGR for GPX files

Vlad
I have a collection of GPX files that have something like this...

<trkpt lat="" lon="">
  <ele></ele>
  <time>2016-08-15T10:48:20Z</time>
</trkpt>

as the first element of a <trk><trkseg> section.  It's probably put in there on device initialization.  When OGR (Ogrinfo and the Dataset/Datasource Java classes) extract information, this trkpt is interpreted as having a lat/lon of 0,0.

This is causing bad geometries and extents to be generated...from ogrinfo -al

Layer name: tracks
Geometry: Multi Line String
Feature Count: 1
Extent: (0.000000, 0.000000) - (49.130867, 14.553272)
.
.
MULTILINESTRING ((0 0,49.122255 14.5532683,...

and

Layer name: track_points
Geometry: Point
Feature Count: 348
Extent: (0.000000, 0.000000) - (49.130867, 14.553272)
.
.
POINT (0 0)

Since this trkpt is "empty", should it not be ignored instead of given a default 0,0 lat/lon?


Reply | Threaded
Open this post in threaded view
|

Re: Initialization "record" causing bad extents/geometries in OGR for GPX files

Even Rouault-2

On mercredi 26 avril 2017 06:15:34 CEST Vlad wrote:

> I have a collection of GPX files that have something like this...

>

> <trkpt lat="" lon="">

> <ele></ele>

> <time>2016-08-15T10:48:20Z</time>

> </trkpt>

>

> as the first element of a <trk><trkseg> section. It's probably put in there

> on device initialization. When OGR (Ogrinfo and the Dataset/Datasource

> Java classes) extract information, this trkpt is interpreted as having a

> lat/lon of 0,0.

 

Vlad,

 

I've just committed a patch to ignore such lat/lon with empty content in trunk and 2.2 branch, but note that such a GPX file doesn't validate the GPX XML schema.

 

Even

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Initialization "record" causing bad extents/geometries in OGR for GPX files

Vlad
Thanks Even.
These things are coming from a cell phone app..

http://www.fulcrumapp.com

Reply | Threaded
Open this post in threaded view
|

Re: Initialization "record" causing bad extents/geometries in OGR for GPX files

jratike80
Vlad wrote
Thanks Even.
These things are coming from a cell phone app..

http://www.fulcrumapp.com
Hi Vlad,

They have nice web page but obviously not e-mail addresses so I wrote sort of a bug report into their chat box.

-Jukka Rahkonen-