🧪 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 to_shape

Convert a GeoPolygon to a closed shape in pixel-space. This is part of the reference section.

Purpose

Convert this GeoPolygon to a closed shape in pixel-space using the current map view / geospatial transformation configuration.

Snippet

Make a geospatial region in the shape of a triangle into a closed shape
geo_polygon = sketch.start_geo_polygon(1, 2)
geo_polygon.add_coordinate(0, 2)
geo_polygon.add_coordinate(1, 0)
shape = geo_polygon.to_shape()

Examples

Availability

Available for all platforms.

See also