ST_filterLessThan

更新时间:
复制 MD 格式

Filters all pcpoint objects in a pcpatch and returns a new pcpatch containing only the points whose value for the specified attribute dimension is less than a given threshold.

Syntax

pcpatch ST_filterLessThan(pcpatch pc, text dimname, float8 value);

Returns: pcpatch

Parameters

ParameterDescription
pcThe input pcpatch object.
dimnameThe name of the attribute dimension to filter on.
valueThe threshold value. Only points whose dimension value is strictly less than this value are included in the result.

Example

Filter all points in patch 7 where the y dimension is less than 45.60:

SELECT ST_AsText(ST_FilterLessThan(pa, 'y', 45.60)) FROM patches WHERE id = 7;

Output:

{"pcid":1,"pts":[[-126.42,45.58,58,5],[-126.41,45.59,59,5]]}

Both returned points have y values of 45.58 and 45.59, which are less than the threshold 45.60.