Thursday, September 19, 2019

QGIS Calculate the Mid Coordinates of Polygons

In QGIS field calculator, you can calculate the center point of all polygons within a polygon layer.

Formula 1:
x($geometry), y($geometry)

Formula 2:
xmin(centroid($geometry)), ymin(centroid($geometry))

Formula 3:
x(centroid($geometry)), y(centroid($geometry))

Note that: 'x' standards for Longitude while 'y' standards for Latitude. $geometry represent the variable polygon geometry.

As you can see the preview result for the three formulas are the same.

No comments:

Post a Comment