You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
geobase 0.5.1 has support for spherical geodesy functions and also DMS formatting utilities.
See sample from geobase:
Format geographic coordinates as string representations (DD, DM, DMS):
```dart
const p =Geographic(lat:51.4778, lon:-0.0014);
// all three samples print decimal degrees: 51.4778°N 0.0014°Wprint(p.latLonDms(separator:' '));
print('${p.latDms()} ${p.lonDms()}');
print('${Dms().lat(51.4778)} ${Dms().lon(-0.0014)}');
// prints degrees and minutes: 51°28.668′N, 0°00.084′Wconst dm =Dms(type:DmsType.degMin, decimals:3);
print(p.latLonDms(format: dm));
// prints degrees, minutes and seconds: 51° 28′ 40″ N, 0° 00′ 05″ Wconst dms =Dms.narrowSpace(type:DmsType.degMinSec);
print(p.latLonDms(format: dms));
// 51 degrees 28 minutes 40 seconds to N, 0 degrees 0 minutes 5 seconds to Wconst dmsTextual =Dms(
type:DmsType.degMinSec,
separator:' ',
decimals:0,
zeroPadMinSec:false,
degree:' degrees',
prime:' minutes',
doublePrime:' seconds to',
);
print(p.latLonDms(format: dmsTextual));
Parsing and formatting is supported also for geographic bounding boxes:
// Parses box from decimal degrees (DD) with cardinal direction symbols.final box =GeoBox.parseDms(west:'20°W', south:'50°N', east:'20°E', north:'60°N');
// prints degrees and minutes: 20°0′W 50°0′N, 20°0′E 60°0′Nconst dm0 =Dms(type:DmsType.degMin, decimals:0, zeroPadMinSec:false);
print('${box.westDms(dm0)} ${box.southDms(dm0)}'' ${box.eastDms(dm0)} ${box.northDms(dm0)}');
In the previous example dm, dm0, dms and dmsTextual are instances of the Dms class that implements DmsFormat. This defines multiple methods for
parsing and formatting decimal degrees and sexagesimal degrees
(degrees/minutes/seconds) on latitude, longitude and bearing values.
The default format used by Geographic and GeoBox classes formats values as
decimal degrees with cardinal direction symbols. To use other formats
(degrees/minutes or degrees/minutes/seconds), or to set other parameters (like
separators, symbol characters, the number of decimals, zero padding or value
signing) you should create a custom Dms instance.
Utilizing these utilities when representing geographic coordinates in UI.
The text was updated successfully, but these errors were encountered:
geobase 0.5.1 has support for spherical geodesy functions and also DMS formatting utilities.
See sample from geobase:
Parsing and formatting is supported also for geographic bounding boxes:
In the previous example
dm
,dm0
,dms
anddmsTextual
are instances of theDms
class that implementsDmsFormat
. This defines multiple methods forparsing and formatting decimal degrees and sexagesimal degrees
(degrees/minutes/seconds) on latitude, longitude and bearing values.
The default format used by
Geographic
andGeoBox
classes formats values asdecimal degrees with cardinal direction symbols. To use other formats
(degrees/minutes or degrees/minutes/seconds), or to set other parameters (like
separators, symbol characters, the number of decimals, zero padding or value
signing) you should create a custom
Dms
instance.The text was updated successfully, but these errors were encountered: