✏️ 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 the geopandas module!)
  • To remove the most recently drawn shape use m.draw.remove_last_shape().

m = Maps()
m.add_feature.preset.coastline()
m.draw.polygon()
_images/draw_shapes.gif

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!

new_drawer

Initialize a new ShapeDrawer.

rectangle

Draw a rectangle.

circle

Draw a circle.

polygon

Draw arbitrary polygons

save_shapes

Save the drawn shapes to a file.

remove_last_shape

Remove the most recently plotted polygon from the map.