Create Polygons from Lines¶
Polygon and Topology¶
Lines that connect and form a closed area define a surface (polygon in Gemini Terrain). In the topological model, each surface consists of a list of lines and neighboring polygons that share lines between them. It is therefore sufficient that the coordinates for each line are stored in only one place, not together with each polygon it is a part of.
When you have lines in topological form, you can create polygons directly from these in Gemini Terrain under certain conditions. You can find this function in the context menu.
Icon for Create/update polygon from lines**
The figure below shows how the program creates a polygon. You point to the side of a line, and the polygon is created automatically. The rule is simple: if multiple lines meet at the node point, a right turn is chosen. The polygon is formed when the starting line is reached again. At the node points, a proximity check is performed, typically about 3 mm.

Illustration of how the polygon is automatically created from lines
Note
If the lines are not in topological form, you will not be able to create correct polygons. In these cases, you must edit the data either manually or using the Automatic Topology Cleanup function.
How Polygons are Stored in Application Layer and SOSI¶
After polygonization, both lines and polygons will exist in the application layer. The polygons have copied the coordinates from the lines.
SOSI describes a topological model. In this model, each surface consists of a list of lines and neighboring polygons that share lines between them. It is therefore sufficient that the coordinates for each line are stored in only one place, not together with each polygon it is a part of.
Application layers in Gemini Terrain do not have a complete topological data structure – both lines and polygons are stored with coordinates. The program creates the topological structure during export to SOSI, provided that there is a connection between polygons and lines.
Warning
If you edit lines without updating the polygons afterward, the connection between lines and polygons will be lost.
Tip
Geometry for existing polygons can be updated while already defined properties are preserved using the Create/update polygon from lines function.
Uses for the Polygonization Tool¶
Boundary Contour for Triangulation¶
An example of using the polygonization tool is when you have measured terrain points and terrain lines along with a boundary contour that should limit the model. You can then quickly create a polygon with this function and set it to boundary contour type. This will be used in later triangulation.
Construction of Plans¶
Another example is in the construction of plans. In this case, you have many lines and many polygons that are adjacent to each other. This data should also be delivered in the correct SOSI file.
The prerequisite for creating polygons in this case is that the lines are in topological form. The Automatic Topology Cleanup function is described in a separate section. When you have lines in topological form, you can create polygons directly from these using Create polygon from lines in application layer on the toolbar.
Update Polygon After Editing Lines¶
When you edit lines via the property dialog or by using point grips ("grips"), and e.g., insert a new or delete a point, you must manually update the associated polygon afterward.
Procedure
- Select the polygon
- Choose Create/update polygon from lines from the context menu
This will update the geometry of the polygon while preserving the properties that already existed.
Move Point with Preserved Topology¶
Gemini Terrain also has a special function for moving points and maintaining the connection between lines and polygons:
Icon for Move point in application layer**
In the figure below, you see a parcel where lines and polygon have identical coordinates. The surface is derived from the line, and consequently, the polygon's outline is identical to the line. If you use the Move point in application layer function on the toolbar, both the line and polygon will move the same way, and the topology is maintained.

Moving a point while preserving the connection between line and polygon
Export Polygons to SOSI¶
Polygons in Gemini Terrain correspond to surfaces in SOSI. The program forms surfaces according to the SOSI standard during data export. If you have created polygons as described above, exporting to SOSI should be straightforward. All polygons will find connections to line objects so that surfaces are formed correctly.
Warning
If a connection to line objects cannot be found, the program automatically creates the missing line objects. The problem is that you then get duplicate lines in the exported SOSI file.
Note
The option Find connections between lines and polygons must be checked in the property dialog for the application layer. Application layers that have this option active get a polygon symbol in the list.

Application layer with Find connections between lines and polygons activated
When the surfaces are formed, the program creates representation points and other properties for each surface.