osmtogeojson 0.1.1 copy "osmtogeojson: ^0.1.1" to clipboard
osmtogeojson: ^0.1.1 copied to clipboard

Converts OSM data (XML or Overpass JSON) to GeoJSON FeatureCollections.

example/main.dart

import 'dart:convert';

import 'package:osmtogeojson/osmtogeojson.dart';

void main() {
  // JSON as output by Overpass API (using `[out:json];`)
  final overpassJson = {
    'elements': [
      {
        'type': 'node',
        'id': 1,
        'lat': 48.2082,
        'lon': 16.3738,
        'tags': {'name': 'Vienna', 'place': 'city'},
      },
    ],
  };

  // Convert to GeoJSON and pretty-print it
  final geoJson = osmToGeoJson(overpassJson);
  print(const JsonEncoder.withIndent('  ').convert(geoJson));
}
0
likes
150
points
12
downloads

Documentation

API reference

Publisher

verified publisherdomy.dev

Weekly Downloads

Converts OSM data (XML or Overpass JSON) to GeoJSON FeatureCollections.

Repository (GitHub)
View/report issues

Topics

#geojson #openstreetmap #map

License

BSD-3-Clause (license)

Dependencies

xml

More

Packages that depend on osmtogeojson