[R-sig-Geo] Import nmea files?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Jun 21 17:44:57 CEST 2013


On Fri, Jun 21, 2013 at 4:21 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
> You are right, my guess was hasty: I also have
> <trkpt lat="41.549754167" lon="0.652421333">
>   <time>2013-06-14T10:04:06.699Z</time>
>   <course>196.500000</course>
>   <speed>0.025722</speed>
>
> in the gpx, but then after readOGR():
> gpstracknmea <-
> readOGR(dsn=file.path(dirgpsin,"2013-06-14_120409_LleidaNMEA.gpx"),layer="track_points",stringsAsFactors=FALSE)
> I get:
>> gpstracknmea at data$time[1]
> [1] "2013/06/14 10:04:07+00"
>> class(gpstracknmea at data$time)
> [1] "character"
>
> so it seems that readOGR() is the one rounding to the nearest integer.
> http://www.gdal.org/ogr/drv_gpx.html  does not mention any rounding.

There's a five-year-old gdal/ogr bug report that might be relevant:

http://trac.osgeo.org/gdal/ticket/2680

perhaps you might try bumping that? I suspect the precision is lost
when ogr reads in the gpx file, so no amount of fiddling with the
output format as string will help.

Barry



More information about the R-sig-Geo mailing list