최인접 위치 계산
다른 위치에 대한 최인접 위치를 찾은 후에 이 두 위치 간의 거리를 계산합니다.
다음 연산자를 사용하여 최인접 도형 또는 최인접 도형의 최대 수를 발견할 수 있습니다.
- the nearest polygon among <polygons> to <a geometry>
- the <a number> nearest polygons among <polygons> to <a geometry>
유사한 연산자를 점, 선 스트링 및 일반 도형에 사용할 수 있습니다.
다음 연산자를 사용하여 두 도형 간의 거리를 계산할 수 있습니다.
- the distance between <a geometry> and <a geometry> in <a length unit>
- all <geometries> within distance of <a number> <a length unit> to <a geometry>
다음 예에서 주차장은 비즈니스 모델에서 다각형으로 정의됩니다. 규칙은 자동차위 위치에 대해 최인접 주차장을 찾은 후에 거리(Km 단위)를 계산합니다.
when a car issue event occurs
definitions
set 'parking lots' to the parking lots of 'the organization';
set 'nearest parking lot' to the nearest polygon among the parking areas of 'parking lots' to the location of this car issue event;
then print "the nearest parking lot is within " + the distance between 'nearest parking lot' and the location of this car issue event in kilometers + "kilometers";