Replies: 2 comments 3 replies
-
I can think of two ways of doing it at the moment:
|
Beta Was this translation helpful? Give feedback.
-
Hi @wang-boyu thanks for the hint. I decided to go with option 1 (kind of) and I feel like I am soooooo close. Instead of masking the raster by the polygon-agent I chose to rasterize the shape of the polygon agent so that it has the values I want inside the polygon and zeros everywhere else. Outside of mesa, my workflow is as follows:
within my model, the code looks like this: but when I run it I get the error
which makes sense because the the reef agent is created from a shapefile with multiple polygons, and each polygon becomes a reef agent. Is there a way for the agent to select the geometry of only the polygon it is in? |
Beta Was this translation helpful? Give feedback.
-
Hello!
My goal is to add elevation to a raster layer in every cell that intersects with an agent. The agent is a large polygon so it intersects with lots of cells.
Here is an non-functioning code example within the step function of my polygon-agent
I'm stuck on the last line, but basically I just need to get every cell that intersects with the agent. The
get_intersecting_cells(self)
part was wishful thinking...but there must be a way to do this?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions