-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Summary
Add a gis:min-distance-of reporter that returns the minimum geometric distance between a target geometry (a VectorFeature or NetLogo agent with a GIS geometry) and any member of a collection (a VectorDataset or an agentset). Distance follows the units of the active GIS projection (e.g., meters if projected, degrees if unprojected lat/lon). Returns 0 when geometries touch or intersect.
This feature request builds on the work started in PR #46, and #17, #18 and #19, originally written by @josephzhao.
Proposed API
gis:min-distance-of <collection> <target> ;; -> numberParameters
<collection>:VectorDataset| agentset<target>:VectorFeature| agent (turtle/link/patch) that has a GIS geometry
Return value
- Minimum JTS geometry distance between
<target>and any geometry in<collection>.
Example usage
extensions [ gis ]
to setup
ca
set roads-ds gis:load-dataset "roads.shp"
; ensure appropriate projection/transform is set for meaningful units
end
to-report dist-to-roads [car]
report gis:min-distance-of roads-ds car
end
to-report nearest-obstacle-dist [peds]
; peds is an agentset of pedestrian turtles
let d gis:min-distance-of peds one-of cars
report d
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels