[R-sig-Geo] Import nmea files?
Barry Rowlingson
b.rowlingson at lancaster.ac.uk
Fri Jun 21 18:03:43 CEST 2013
On Fri, Jun 21, 2013 at 4:21 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
> 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.
If you convert from nmea to KML, then you can read this with readOGR
and then get the exact time from the Description data:
gpsbabel -i nmea -f test.nmea -o kml -F out.kml
> t=readOGR("out.kml","Points")
OGR data source with driver: KML
Source: "out.kml", layer: "Points"
with 1 features and 2 fields
Feature type: wkbPoint with 3 dimensions
> t
coordinates Name
1 (0.652421, 41.5498, 0) -0
Description
1 <table> <tr><td>Longitude: 0.652421 </td></tr> <tr><td>Latitude:
41.549754 </td></tr> <tr><td>Speed: 0.0 mph </td></tr>
<tr><td>Heading: 0.7 </td></tr> <tr><td>Time: 2013-06-14T10:04:06.699Z
</td></tr> </table>
> t$Description
[1] <table> <tr><td>Longitude: 0.652421 </td></tr> <tr><td>Latitude:
41.549754 </td></tr> <tr><td>Speed: 0.0 mph </td></tr>
<tr><td>Heading: 0.7 </td></tr> <tr><td>Time: 2013-06-14T10:04:06.699Z
</td></tr> </table>
Levels: <table> <tr><td>Longitude: 0.652421 </td></tr>
<tr><td>Latitude: 41.549754 </td></tr> <tr><td>Speed: 0.0 mph
</td></tr> <tr><td>Heading: 0.7 </td></tr> <tr><td>Time:
2013-06-14T10:04:06.699Z </td></tr> </table>
You will have to do a bit of string gymnastics with the Description though....
Its possible other gpsbabel output formats might make this easier - I
couldn't get the csv output to do more than the spatial coordinates.
Barry
More information about the R-sig-Geo
mailing list