Hello Azbina,
The code for determining centroid is very clearly provided in the GIS example within the models library. I have used the same code and modified it a bit as given below:
to draw-basin-labels
foreach gis:feature-list-of subbasin-zekiah [ this-basin-vector-feature ->
let centroid1 gis:location-of gis:centroid-of this-basin-vector-feature
; centroid will be an empty list if it lies outside the bounds
; of the current NetLogo world, as defined by our current GIS
; coordinate transformation
if not empty? centroid1 [
create-turtles 1
[ set xcor item 0 centroid1
set ycor item 1 centroid1
set size 0.8
set color yellow
set shape "circle"
;set label gis:property-value this-basin-vector-feature "CNTRY_NAME"
]
]
]
end
The above code will identify the centroids of each subbasin and show it with a yellow-colored turtle.
For finding distance between the points, you can create turtles on these points and then ask the turtles to measure distance between each other. I have modified your code as follows:
to draw-wwtp
gis:set-drawing-color yellow
gis:create-turtles-from-points wwtp-data wwtps [ set shape "circle" set color blue]
;gis:draw wwtp-data 3.0
end
wwtps is a breed that I created. The points will be marked with turtles in blue color.
Hope this helps.
Best,
Pradeesh