ST_LocateBetween — 返回与测量范围匹配的几何图形部分。
geometry ST_LocateBetween(geometry geom, float8 measure_start, float8 measure_end, float8 offset = 0);
返回一个几何图形(集合),其中包含与指定测量范围(包含)匹配的输入测量几何图形部分。
如果提供了偏移量,则结果将向输入行的左侧或右侧偏移指定的距离。 正偏移量将向左偏移,负偏移量将向右偏移。
裁剪非凸多边形可能会产生无效的几何图形。
语义由 ISO/IEC 13249-3 SQL/MM 空间标准指定。
可用性:1.1.0(旧名称 ST_Locate_Between_Measures)。
更改:2.0.0 - 在之前的版本中,这曾经被称为 ST_Locate_Between_Measures。
增强:3.0.0 - 添加了对多边形、TIN、三角形的支持。
该功能支持M坐标。
该方法实现了SQL/MM规范。 SQL-MM IEC 13249-3: 5.1
SELECT ST_LocateBetween( 'MULTILINESTRING M ((1 2 3,3 4 2,9 4 3),(1 2 3,5 4 5))'::geometry, 1.5, 3);
GEOMETRYCOLLECTION M (LINESTRING M (1 2 3,3 4 2,9 4 3),POINT M (1 2 3))
Extract the section between measures 2 and 8, offset to the left. Because the clipped line and the offset result share the same coordinate space, this example is intended for a single overlay panel rather than separate side-by-side figures.
SELECT ST_LocateBetween(
ST_AddMeasure(
'LINESTRING (20 180,50 20,100 120,180 20)',
0,
10),
2,
8,
20);
MULTILINESTRING((54.49835 104.53427,58.700561 82.122481,82.111456 128.944272,84.248937 132.324934,87.01637 135.21267,90.303073 137.491987,93.977598 139.071724,97.892984 139.888702,101.892639 139.910247,105.816599 139.135495,109.507928 137.595434,112.818995 135.351657,115.617376 132.493901,145.310173 95.377905))