[R-sig-Geo] Import nmea files?

Agustin Lobo alobolistas at gmail.com
Fri Jun 21 17:21:18 CEST 2013


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.

Agus

On Fri, Jun 21, 2013 at 4:50 PM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
> On Fri, Jun 21, 2013 at 2:02 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
>> I have nmea files with decimal seconds:
>> $GPRMC,100406.7,A,4132.98525,N,00039.14528,E,000.05,196.5,140613,000.2,W,D*2C
>> $GPGGA,100406.7,4132.98525,N,00039.14528,E,2,18,0.6,211.6,M,52.2,M,,*52
>> $GPVTG,196.5,T,196.8,M,000.05,N,0000.10,K,D*1F
>>
>> I use the following to convert to gpx:
>> gpsbabel -i nmea -f 2013-06-14_120409_Lleida.txt -o gpx -F
>> 2013-06-14_120409_LleidaNMEA.gpx
>> and the use readOGR() to import the gpx,
>> but the times in the gpx are rounded to nearest integer.
>
>  The times in the gpx file? I get the following if I convert those
> three lines using gpsbabel (1.3.6)
>
> <trkpt lat="41.549754167" lon="0.652421333">
>   <time>2013-06-14T10:04:06.699Z</time>
>   <course>196.500000</course>
>   <speed>0.025722</speed>
> </trkpt>
>
> which is a very non-integer time.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list