Centroid - ObjectVision/GeoDMS GitHub Wiki
Geometric functions centroid

- centroid(polygon_data_item)
centroid(polygon_data_item) results in a point data item with the centroid of the polygon_data_item argument.
The centroid of a polygon does not have to be located within the polygon. Use the centroid_or_mid function to find a point always located within or at the border of that polygon such that point_in_polygon would return true.
- data item polygon_data_item with fpoint or dpoint value type and composition polygon
attribute<point_rd> centroid (district) := centroid(district/geometry);
| district/geometry | centroid |
|---|---|
| {21: xy(113810; 403025) ... | xy(113049; 402955) |
| {17: xy(113269; 400990) ... | xy(112704; 401159) |
| {19: xy(115099; 401238) ... | xy(114017; 401268) |
domain district, nr of rows = 3
see code from: https://github.com/ObjectVision/GeoDMS/blob/v13/rtc/dll/src/geo/Centroid.h
