Skip to content

Geospatial tools for Dart

🧭 Geospatial tools for Dart is a set of code packages for Dart 🎯 and Flutter πŸ’™ written in the Dart language providing data structures and tools for coordinates, geometries, feature objects, metadata, ellipsoidal and spherical geodesy, projections, tiling schemes, vector data models and formats, and geospatial Web APIs.

These tools are available as two Dart code packages as described in the article Geospatial tools for Dartβ€Š-β€Šversion 1.0 published (October 2023).

πŸ“¦ Code packages

The code packages are published at pub.dev:

CodePackageDescription
🌐 geobasepub packageGeospatial data structures (coordinates, geometries, features, metadata), ellipsoidal and spherical geodesy, projections and tiling schemes. Vector data format support for GeoJSON, WKT and WKB.
🌎 geodatapub packageGeospatial feature service Web APIs with support for GeoJSON and OGC API Features clients.

Packages help Dart and Flutter developers to model positions, bounding boxes, geometries (point, line string, polygon etc.), feature objects (that is geospatial entities with identifiers, geometries and properties) and geospatial metadata (temporal data like instants and intervals, spatial extents etc.) in their own application specific domain models.

Geometry and feature objects can be read and decoded (and also encoded) from common geospatial vector data formats like GeoJSON, WKT and WKB. A Web API client for geospatial feature services based on the OGC API Features standard is also included.

Basic support for geometry functions is available too. Line lengths, area perimeters, centroids, polylabels and distances can be computed in cartesian coordinates.

For geographic coordinates it’s possible to calculate distances, bearings, destinations points and intermediate points along the Earth surface based on ellipsoidal and spherical earth models.

Latitude and Longitude of the Earth

Web Mercator Quad and Global Geodetic Quad are two WGS 84 based tiling schemes representing the world as tiles and pixels in hierarchical tile matrix sets. Calculations for these schemes as well as the basic support for geospatial projections between geographic and projected coordinate reference systems is also provided.

πŸ› οΈ Install

Code packages are published at pub.dev as stable versions.

Dart 2 and 3 language versions both are supported with Dart SDK 2.17 as a minimum requirement.

You can add dependencies in your pubspec.yaml file (you should check pub.dev for the latest versions):

dependencies:
geobase: ^1.4.0
geodata: ^1.4.0

Now it’s possible to import packages and start using these rich geospatial tools in your Dart or Flutter application:

import `package:geobase/geobase.dart`;
import `package:geodata/geodata.dart`;

If you don’t need Web API support for OGC API Features and GeoJSON resources, then you can just omit geodata and use only geobase as a dependency.

πŸš€ Shortcuts to docs

Overview

Package: geobase

Package: geodata

▢️ Next steps

Next follow the reading path to the introduction, use shortcut links above or read usage guides on geobase and geodata packages.