topojson 0.2.0 copy "topojson: ^0.2.0" to clipboard
topojson: ^0.2.0 copied to clipboard

A Dart port of topojson.

topojson #

A Dart port of topojson/topojson-client.

It only implements feature function that can be used to convert TopoJSON to GeoJSON.

/// topojson to geojson conversion
final resp = await http.get(
    Uri.parse('https://geoshape.ex.nii.ac.jp/jma/resource/AreaInformationCity_landslide/20210518/4220201.topojson'));
final topoJson = jsonDecode(utf8.decode(resp.bodyBytes));

final f = toGeoJson(topoJson);
final geoJson = jsonEncode(f);

await io.File('4220201.geojson').writeAsString(geoJson);