[OSM-dev] Problem with osmfilter.pl: NMEA RMC sentences not correctly handled

Joerg Ostertag (OSM Munich/Germany) openstreetmap at ostertag.name
Thu Jan 11 17:27:13 GMT 2007


On Thursday 11 January 2007 18:18, Francisco R. Santos wrote:
> I'm testing the osmfilter.pl script with some NMEA files, but I get a bunch
> of errors with:
>
> ...
> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,
> 143857.000,A,4025.5097,N,00336.6222,W,16.97,95.72 ,071206,,,A*78
> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,
> 143858.000,A,4025.5094,N,00336.6162,W,15.47,94.74,071206,,,A*7A
> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,
> 143859.000 ,A,4025.5092,N,00336.6107,W,14.88,95.60,071206,,,A*78
> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,
> 143900.000,A,4025.5093,N,00336.6051,W,15.24,93.58,071206,,,A*7C
> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,
> 143901.000,A,4025.5094,N,00336.5992,W,16.07,90.44,071206,,,A*73
> ...
>
> Although I get the .gpx and .osm files with right data, it seems (according
> to http://www.werple.net.au/~gnb/gps/nmea.html#gprmc
> <http://www.werple.net.au/%7Egnb/gps/nmea.html#gprmc>) that the new "Mode
> indicator" field is not handled by the script.
>
> Can I still use the generated .gpx and .osm files? Are RMC sentences used?

In this Version all your RMC lines will be ignored.
But all othere lines are still read.

If you want to patch it:

Index: NMEA.pm
===================================================================
--- NMEA.pm     (Revision 1863)
+++ NMEA.pm     (Arbeitskopie)
@@ -107,9 +107,13 @@
            GLL => 5,
            ZDA => 5,
            };
-       if ( $type !~ m/GSV|GSA/ && $elem_count != $elem_soll->{$type} ){
+
+       if ( $type =~ m/RMC/ && ( $elem_count != 10 ) && ( $elem_count != 
11 ) ){
            print "!!!!!!! ERROR $elem_count is wrong Number of 
elements(should be $elem_soll->{$type}): $full_line\n";
            next;
+       } elsif ( $type !~ m/GSV|GSA/ && $elem_count != $elem_soll->{$type} ){
+           print "!!!!!!! ERROR $elem_count is wrong Number of 
elements(should be $elem_soll->{$type}): $full_line\n";
+           next;
        }





More information about the dev mailing list