geodata 0.8.0-a.8 icon indicating copy to clipboard operation
geodata: ^0.8.0-a.8 copied to clipboard

A geospatial client to read GeoJSON and OGC API Features data sources.

GeoJSON and OGC API clients for Dart

pub package License style: very good analysis

Features #

  • Client-side data source abstractions
    • common geospatial Web APIs
    • geospatial feature services
  • Data source implementations to read geospatial features
  • Also (partially) conforming to following standards

Package #

This package is at BETA stage, interfaces not fully final yet.

This is a Dart package named geodata under the geospatial code repository.

To use, add the dependency in your pubspec.yaml:

  geodata: ^0.8.0-a.8

The package contains also following mini-libraries, that can be used to import only a certain subset instead of the whole geodata library:

LibraryExports alsoDescription
commonCommon data structures and helpers (for links, metadata, paged responses).
coreMetadata and data source abstractions of geospatial Web APIs (ie. features).
geojson_clientcommon, coreA client-side data source to read GeoJSON data from web and file resources.
ogcapi_features_clientcommon, coreA client-side data source to read features from OGC API Features services.

All the mini-libraries have dependencies to equatable and geocore packages. The geojson_client and ogcapi_features_client libraries depends also on the http package. The geojson_client package uses dart:io functions for file access too.

Usage #

This sample shows to read GeoJSON features from a web resource using a HTTP fetcher, and from a local file using a file fetcher.

Please see other examples too.

import 'package:geodata/geojson_client.dart';

Future<void> main(List<String> args) async {
  // read GeoJSON for earthquakes from web using HTTP(S)
  print('GeoJSON features from HTTP');
  await _readFeatures(
      location: Uri.parse(

Future<void> _readFeatures(FeatureSource source) async {
  // read features with error handling
  try {
    // get items or features from a source, maximum 5 features returned
    final items = await source.items(
      const FeatureItemsQuery(limit: 5),

    // do something with features, in this sample just print them out
    for (final f in items.collection.features) {
      print('Feature with id: ${}');
      print('  geometry: ${f.geometry}');
      print('  properties:');
      for (final key in {
        print('    $key: ${[key]}');
  } on FeatureException catch (e) {
    print('Reading GeoJSON resource failed: ${}');
    if (e.cause != null) {
      print('Cause: ${e.cause}');
    if (e.trace != null) {
  } catch (e, st) {
    print('Reading GeoJSON resource failed: $e');

Authors #

This project is authored by Navibyte.

More information and other links are available at the geospatial repository from GitHub.

License #

This project is licensed under the "BSD-3-Clause"-style license.

Please see the LICENSE.

pub points


shield icon for verified

A geospatial client to read GeoJSON and OGC API Features data sources.

Repository (GitHub)
View/report issues


API reference


BSD-3-Clause (LICENSE)


equatable, geocore, http, meta


Packages that depend on geodata