-
Hello! It's me again. I'm trying to get a mesa-geo model up and running but I'm having trouble adding the raster in. A simplified version of the project and data is in a repo here. My goal is to produce a raster with the same dimensions of the input raster where each cell has a 0 if it doesn't have oysters, a 1 if the cell has shells, and a 2 if it has oysters. This raster will be passed to a landlab function similar to this example (but with a raster instead of a grid). The model has 3 types of agents: reefs (which are polygons), oysters (which can only be placed inside of reefs), and shells (which are dead oysters, they get the same geometry as the living oyster). Here is the agent code.
the model also has a
And here is the model code
And here is the server code
When I launch the server there is a big black square over Florida, slightly south of where data is supposed to be. Could it be a CRS issue? I have no idea. any help would be appreciated!!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Sorry about the issue. Working with raster and vector data at the same time could be difficult. A few issues I noticed in the code -
Let me know whether this helps : ) |
Beta Was this translation helpful? Give feedback.
Sorry about the issue. Working with raster and vector data at the same time could be difficult.
A few issues I noticed in the code -
space.raster_layer.transform
is used to get geometry location (x, y) from (row, col) raster indices. In thepoint_in_reef
function inmodel.py
,pnt
already has the correct geometry (x, y), so it doesn't need to be transformed further.Hence, returning
pnt
directly should be fine. On a side note, I would suggest to definepoint_in_reef
as a member method ofOysterModel
class, so that you could useself.point_in_reef(random_reef)
instead.In
space.py
whenraster_layer
is created, it was added as zeros: