NMEA sentences do contain WGS84 coordinates, probably just not in the
appropriate format you need. Just convert the text to floats. Here is a
python snipplet:
"quad" is either N,S,E or W
def format_coords(coord, quad):
sign = 1
if quad == "S" or quad == "W":
sign = -1
if coord[4] == ".":
return (float(coord[0:2])+ float(coord[2:]) / 60.) * sign
elif coord[5] == ".":
return (float(coord[0:3]) + float(coord[3:]) / 60.) * sign
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
-~----------~----~----~----~------~----~------~--~---