Skip to content

How to get mesa-geo to work with a raster #146

Answered by wang-boyu
ifoxfoot asked this question in Q&A
Discussion options

You must be logged in to vote

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 -

  1. space.raster_layer.transform is used to get geometry location (x, y) from (row, col) raster indices. In the point_in_reef function in model.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 define point_in_reef as a member method of OysterModel class, so that you could use self.point_in_reef(random_reef) instead.

  2. In space.py when raster_layer is created, it was added as zeros:

    raster_layer.apply_raster(
             data = np.zeros(shape

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@wang-boyu
Comment options

@ifoxfoot
Comment options

@ifoxfoot
Comment options

@ifoxfoot
Comment options

@wang-boyu
Comment options

Answer selected by ifoxfoot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants