- Timestamp:
- 2008-08-21T00:47:19+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r738 r814 60 60 TIME(1), 61 61 /** Warning from the receiver (A = data ok, V = warning) */ 62 RECEIVER_WARNING(2), WIDTH_NORTH(3), WIDTH_NORTH_NAME(4), LENGTH_EAST(5), LENGTH_EAST_NAME( 63 6), 62 RECEIVER_WARNING(2), 63 WIDTH_NORTH(3), WIDTH_NORTH_NAME(4), 64 LENGTH_EAST(5), LENGTH_EAST_NAME(6), 64 65 /** Speed in knots */ 65 66 SPEED(7), COURSE(8), DATE(9), … … 168 169 169 170 int latdeg = Integer.parseInt(widthNorth.substring(0, 2)); 171 double latmin = Double.parseDouble(widthNorth.substring(2)); 172 double lat = latdeg + latmin / 60; 170 173 if ("S".equals(e[GPRMC.WIDTH_NORTH_NAME.position])) { 171 latdeg = -latdeg; 172 } 173 double latmin = Double.parseDouble(widthNorth.substring(2)); 174 lat = -lat; 175 } 174 176 175 177 int londeg = Integer.parseInt(lengthEast.substring(0, 3)); 178 double lonmin = Double.parseDouble(lengthEast.substring(3)); 179 double lon = londeg + lonmin / 60; 176 180 if ("W".equals(e[GPRMC.LENGTH_EAST_NAME.position])) { 177 lon deg = -londeg;181 lon = -lon; 178 182 } 179 double lonmin = Double.parseDouble(lengthEast.substring(3)); 180 181 return new LatLon(latdeg + latmin / 60, londeg + lonmin / 60); 183 184 return new LatLon(lat, lon); 182 185 } 183 186 }
Note:
See TracChangeset
for help on using the changeset viewer.