🧪 Version 0.3.1 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for parse_geojson

Utility to parse GeoJSON into a series of GeoPolygons. This is part of the reference section.

Purpose

Utility to parse GeoJSON into a series of GeoPolygons which currently only supports MultiPolygon and Polygon.

Snippet

Load a GeoJSON file at example.geojson and make a closed shape.
source = sketch.get_data_layer().get_json('example.geojson')
geo_polygons = sketch.parse_geojson(source)
geo_polygon = geo_polygons[0]
shape = geo_polygon.to_shape()

Parameters

  • source: The loaded GeoJSON source to parse.

Examples

Availability

Available for all platforms.

See also