Coordinates of Vertices in a Polygon using QGIS

Описание к видео Coordinates of Vertices in a Polygon using QGIS

QGIS can help you list the coordinates of a polygon and export them for use in reports or other documents. Here's how you can do it:
Steps to list and export polygon coordinates in QGIS:
1. Load the Polygon Layer: Ensure that your polygon layer is added to the QGIS project.
2. Open the Attribute Table: Right-click on the polygon layer and select Open Attribute Table.
3. Enable Field Calculator: Open the Field Calculator (click on the calculator icon in the Attribute Table toolbar).
4. Create a New Field for Coordinates:
o In the Field Calculator, check the box Create a new field.
o Set a name for the new field (e.g., coordinates).
When creating a field to store polygon coordinates (which involve multiple vertices), the data type of the field must be capable of handling long strings, not just a single value. Since polygons can have many coordinate points, the issue might be that the default field type was set to something too restrictive, like an integer or a short text field, which can only hold a single point or value.
5. Open the Field Calculator:
• Open the attribute table, and then click the Field Calculator.
6. Select the Correct Field Type:
• In the Field Calculator dialog, when creating a new field, make sure to choose a data type that can handle multiple coordinate points:
o Text (String): Select this option for the field type.
o Set the Field Length: Choose a sufficiently large field length (e.g., 255 or more) to store the entire Well-Known Text (WKT) string. For polygons with many vertices, you'll need a long enough string length to hold all coordinates.
7. Expression:
• Use the geom_to_wkt($geometry) expression to store the WKT representation of the polygon geometry in the newly created text field.
8. Check the Output:
• After applying this, the new field should contain the full WKT representation of each polygon, including all the vertices.

Комментарии

Информация по комментариям в разработке