Arc_length
Geometric functions arc_length
syntax
- arc_length(arc_poly_dataitem, valuesunit of coordinate system)
- arc_length(arc_poly_dataitem)
definition
arc_length(arc_poly_dataitem, valuesunit) calculates the length of an Arc or the outline of a Polygon Data item arc_poly_dataitem.
The resulting Values unit is configured as second Argument. Since GeoDMS 20.3.0 it also converts: coordinates in metres read out as arc_length(road/geometry, km) give kilometres, where before 20.3.0 the second argument only relabelled the metres and you had to divide by 1000 yourself. A values unit whose Metric does not match the metric of the coordinates at all is reported as a warning and still accepted as a label, which is deprecated behaviour.
Since GeoDMS 20.3.0 the second argument may also be left out. arc_length(arc_poly_dataitem) derives the resulting Values unit from the coordinates themselves, so m for a Coordinate system in metres.
Since GeoDMS 20.19.2 that single-argument form also works on coordinates that have a metric, which is the normal case for a projected SpatialReference. Before 20.19.2 it crashed the GeoDMS GUI on exactly those coordinates; see Area, where the same derivation is described.
Furthermore, note that multi-linestrings are sequences of points that contain
description
The definition of the outline of a polygon is only equal to the perimeter if the polygon has no islands and lakes.
In case a polygon consists of multiple rings, the outline also contains the artificial lines needed to relate the rings, see Polygon data model.
If you want to calculate the perimeter, use a Split_polygon function first to make different polygons for all exterior rings (the outline of the lakes are still a part of the calculated arc_length).
applies to
- arc or polygon data item arc_poly_dataitem with fpoint or dpoint Value type and composition type arc or polygon.
example
attribute<meter> road_length (Road) := arc_length(road/geometry, meter);
attribute<meter> road_length_v2 (Road) := arc_length(road/geometry); // same values, meter derived from the coordinates
| road/geometry | road_length |
|---|---|
| {2: xy(112631; 399246) xy(111866; 398599)} | 1001.92 |
| {3: xy(111866; 398599) xy(111924; 399495) xy(111524; 401801)} | 3238.31 |
| {2: xy(114921; 401529) xy(114823; 398584)} | 2946.63 |
domain Road, nr of rows = 3