navibyte / geospatial_demos Goto Github PK
View Code? Open in Web Editor NEWGeospatial demo and sample apps for Dart and Flutter.
License: Other
Geospatial demo and sample apps for Dart and Flutter.
License: Other
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°W
print(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′W
const dm = Dms(type: DmsType.degMin, decimals: 3);
print(p.latLonDms(format: dm));
// prints degrees, minutes and seconds: 51° 28′ 40″ N, 0° 00′ 05″ W
const 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 W
const 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′N
const 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.
Earthquake Map sample app has a GeoJSON client / feature layer on the GeoJSON service provided by USGS.
BGS (British Geological Survey) also has an earthquake service - that is conforming to OGC API Features standard. It would be nice to use it on a demo along with "plain" GeoJSON data source from USGS.
Docs:
https://www.api.gov.uk/bgs/bgs-ogcapi-server/#bgs-ogcapi-server
API endpoint:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.