βοΈ Draw shapes on the mapο
Starting with EOmaps v5.0 it is possible to draw simple shapes on the map using Maps.draw
.
- The shapes can be saved to disk as geo-coded shapefiles using
m.draw.save_shapes(filepath)
.(Saving shapes requires thegeopandas
module!) To remove the most recently drawn shape use
m.draw.remove_last_shape()
.
m = Maps()
m.add_feature.preset.coastline()
m.draw.polygon()
|
![]() |
Note
Drawing capabilities are fully integrated in the π§° Companion Widget. In most cases it is much more convenient to draw shapes with the widget instead of executing the commands in a console!
In case you still stick to using the commands for drawing shape, it is important to know that the calls for drawing shapes are non-blocking and starting a new draw will silently cancel active draws!
Initialize a new ShapeDrawer. |
|
Draw a rectangle. |
|
Draw a circle. |
|
Draw arbitarary polygons |
|
Save the drawn shapes to a file. |
|
Remove the most recently plotted polygon from the map. |