And here is the context of the transformation function I posted earlier:
if (buffer[0:6]=="$GPRMC"):
gpsData = buffer.split(",")
if (gpsData[2] == "A") and (gpsData[12][0] != "N") and
checkOK(buffer): # No Warning and not invalid, checksum OK
position["lat"] = format_coords(gpsData[3], gpsData[4])
position["lon"] = format_coords(gpsData[5], gpsData[6])
#print "%s %s" % (position["lat"],
position["lon"])
kriko schrieb:
> Looking into the api, it reads NMEA sentence and parse coordinate like
> this:
> 01338.7008,E
>
> ...
> String deg = str.substring(0, 2); // 013
> String min = str.substring(2); // 38.7008
> return this.parseCoordinate(deg, min, due, 'E', 'W'); // 013, 38.7008,
> E
> ...
>
> protected float parseCoordinate(String deg, String min, String due,
> char posDue, char negDue) throws GpsException {
> float ret = this.parseInt(deg) + (this.parseFloat(min) / 60);
> due = due.trim();
> if(due.length() != 1) throw new GpsException("Only one-character dues
> allowed (" + due + ")");
> char charDue = Character.toUpperCase(due.charAt(0));
> if(charDue == posDue){
> return ret;
> } else if(charDue == negDue){
> return -ret;
> } else {
> throw new GpsException("Only " + posDue + " or " + negDue + "
> dues
> allowed (" + due + ")");
> }
> }
>
> But I have to convert from NMEA to WGS84 - which is also called UTM?.
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---