Thanks for the patch Joerg. However, I had to modify it to add the "|RMC" in the second if. <br><br>Now it works with 11 fields RMC sentences (although it does nothing with the "Mode indicator" field, whatever it was):
<br><br>Index: NMEA.pm<br>===================================================================<br>--- NMEA.pm     (revisión: 1886)<br>+++ NMEA.pm     (copia de trabajo)<br>@@ -107,9 +107,13 @@<br>            GLL => 5,<br>
            ZDA => 5,<br>            };<br>-       if ( $type !~ m/GSV|GSA/ && $elem_count != $elem_soll->{$type} ){<br>+<br>+       if ( $type =~ m/RMC/ && ( $elem_count != 10 ) && ( $elem_count != 11 ) ){
<br>            print "!!!!!!! ERROR $elem_count is wrong Number of elements(should be $elem_soll->{$type}): $full_line\n";<br>            next;<br>+       } elsif ( $type !~ m/GSV|GSA|RMC/ && $elem_count != $elem_soll->{$type} ){
<br>+           print "!!!!!!! ERROR $elem_count is wrong Number of elements(should be $elem_soll->{$type}): $full_line\n";<br>+           next;<br>        }<br> <br> <br><br><div><span class="gmail_quote">On 1/11/07, 
<b class="gmail_sendername">Joerg Ostertag (OSM Munich/Germany)</b> <<a href="mailto:openstreetmap@ostertag.name">openstreetmap@ostertag.name</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thursday 11 January 2007 18:18, Francisco R. Santos wrote:<br>> I'm testing the osmfilter.pl script with some NMEA files, but I get a bunch<br>> of errors with:<br>><br>> ...<br>> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,
<br>> 143857.000,A,4025.5097,N,00336.6222,W,16.97,95.72 ,071206,,,A*78<br>> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,<br>> 143858.000,A,4025.5094,N,00336.6162,W,15.47,94.74,071206,,,A*7A
<br>> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,<br>> 143859.000 ,A,4025.5092,N,00336.6107,W,14.88,95.60,071206,,,A*78<br>> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,
<br>> 143900.000,A,4025.5093,N,00336.6051,W,15.24,93.58,071206,,,A*7C<br>> !!!!!!! ERROR 11 is wrong Number of elements(should be 10): $GPRMC,<br>> 143901.000,A,4025.5094,N,00336.5992,W,16.07,90.44,071206,,,A*73<br>
> ...<br>><br>> Although I get the .gpx and .osm files with right data, it seems (according<br>> to <a href="http://www.werple.net.au/~gnb/gps/nmea.html#gprmc">http://www.werple.net.au/~gnb/gps/nmea.html#gprmc
</a><br>> <<a href="http://www.werple.net.au/%7Egnb/gps/nmea.html#gprmc">http://www.werple.net.au/%7Egnb/gps/nmea.html#gprmc</a>>) that the new "Mode<br>> indicator" field is not handled by the script.
<br>><br>> Can I still use the generated .gpx and .osm files? Are RMC sentences used?<br><br>In this Version all your RMC lines will be ignored.<br>But all othere lines are still read.<br><br>If you want to patch it:
<br><br>Index: NMEA.pm<br>===================================================================<br>--- NMEA.pm     (Revision 1863)<br>+++ NMEA.pm     (Arbeitskopie)<br>@@ -107,9 +107,13 @@<br>            GLL => 5,<br>            ZDA => 5,
<br>            };<br>-       if ( $type !~ m/GSV|GSA/ && $elem_count != $elem_soll->{$type} ){<br>+<br>+       if ( $type =~ m/RMC/ && ( $elem_count != 10 ) && ( $elem_count !=<br>11 ) ){<br>            print "!!!!!!! ERROR $elem_count is wrong Number of
<br>elements(should be $elem_soll->{$type}): $full_line\n";<br>            next;<br>+       } elsif ( $type !~ m/GSV|GSA/ && $elem_count != $elem_soll->{$type} ){<br>+           print "!!!!!!! ERROR $elem_count is wrong Number of
<br>elements(should be $elem_soll->{$type}): $full_line\n";<br>+           next;<br>        }<br><br><br>_______________________________________________<br>dev mailing list<br><a href="mailto:dev@openstreetmap.org">
dev@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev</a><br></blockquote></div><br>