Skip to main content

Polygon geometry

Define a shape using connected points

This geometry type defines multiple points that form a single closed shape. Use it to describe assets that occupy a significant area, e.g. buildings, playgrounds, zones.

An item with polygon geometry displayed on the map

How to draw

When editing item geometry (or any other geometry field in Alloy), the Geometry Editor appears. The row of draw tools indicates which geometry types are allowed by the item's design (or the source of the field).

The draw tools are dimmed out if the relevant geometry type isn't allowed

Select the Polygon tool and then select a starting point on the map. Continue selecting points along your desired shape. If you need to track a fine curve, select as many points as possible along it! To finish drawing, double-select the last point (or select the starting point again).

Alternatively, you can use the Box tool to draw a rectangle between two diagonal points.

Demonstrating the Polygon tool in the Geometry Editor

Once a polygon is finished, the Polygon tool becomes dimmed to indicate that no further polygons can be added.

To edit the polygon, select an existing point (your mouse will snap to it) and drag it to a different position. To add a new point, select and hold anywhere along an edge, and then drag the new point into position! Use the Erase tool to remove points as needed.

Select Done to save your changes.

Editing the points of a polygon in the Geometry Editor

Example GeoJSON

To access the underlying code of the current geometry, select Menu in the Geometry Editor and choose GeoJson view.

{
"type": "Polygon",
"coordinates": [
[
[-1.529004, 52.290984],
[-1.52882, 52.291009],
[-1.528782, 52.290908],
[-1.529016, 52.290874],
[-1.529038, 52.290932],
[-1.528987, 52.290939],
[-1.529004, 52.290984]
]
]
}