Repository navigation
mid
- mid(polygon_data_item)
mid(polygon_data_item) results in a point data item with the middle of the polygon_data_item argument.
The middle of a polygon is determined by selecting a horizontal scan-line that separates 50% of the area of that polygon above and below that scan-line, and on that scan-line, the 50% percentile of a set of evenly distributed points on that scan-line that are within that polygon.
If the scan-line does not contain any points within the polygon (for example on an hourglass-shaped polygon with a zero-sided waist), other scan-lines are tried until a point is found for which point_in_polygon would result in true.
Since GeoDMS 20.25.0 a polygon with a null vertex results in a null point, as it does for area, centroid and centroid_or_mid: it has no area to divide. Such vertices arise, for instance, when a dpoint polygon with a coordinate outside the int32 range is converted to an ipoint unit in millimetres. Before, mid ended the process with an access violation (0xC0000005) when every vertex of a polygon was null, and resulted in the first vertex of the polygon when only some were.
- data item polygon_data_item with fpoint or dpoint value type and composition polygon

For more info on SelectRow and GetScanPoint, see:
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.