osm_overpass 0.0.6 copy "osm_overpass: ^0.0.6" to clipboard
osm_overpass: ^0.0.6 copied to clipboard

A dio compatible dart package to query the OpenStreetMap Overpass API.

osm_overpass #

A dio compatible dart package to query the OpenStreetMap Overpass API.

Getting started #

To get started add the following to your pubspec.yaml file:

dependencies:
  osm_overpass: ^0.0.6

Then you can import the package in your Dart code:

import 'package:osm_overpass/osm_overpass.dart';

Usage #

To query the OpenStreetMap Overpass API you can use the Overpass class. The query method takes a script parameter which is the Overpass QL script to run and a bbox parameter which is the bounding box to query within. The query method returns a list of Element objects which represent the results of the query.

import 'package:osm_overpass/osm_overpass.dart';

void main() async {
  final overpass = Overpass();
  final elements = await overpass.query(
    script: 'node[amenity=bar]({{bbox}});\nout;', 
    bbox: (-27.460467537569297,153.03190097931952,-27.454260316536676,153.03804860238165)
  );
  
  for (final element in elements!) {
    print(element.toMap());
  }
}
0
likes
140
points
17
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A dio compatible dart package to query the OpenStreetMap Overpass API.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

dio, flutter_map, latlong2

More

Packages that depend on osm_overpass