mikeio icon indicating copy to clipboard operation
mikeio copied to clipboard

Fix GeometryFM.contains (optional use of shapely)

Open ecomodeller opened this issue 1 year ago • 2 comments

ecomodeller avatar Jun 05 '24 08:06 ecomodeller

I guess it is not possible to use _point_in_polygon() ?

jsmariegaard avatar Jun 05 '24 15:06 jsmariegaard

I guess it is not possible to use _point_in_polygon() ?

I suppose we can, but that is only part of the solution, we still need to construct a proper polygon with holes for the entire domain, unless we loop over all elements, which we could do in a clever way similar to how find_index works (when #685 has been fixed) .

ecomodeller avatar Jun 06 '24 08:06 ecomodeller

@jsmariegaard ...plot.outline() is used to plot the outline of the model domain. Very useful! image

We have the ability to extract elements into a new file, e.g. image

But the subset has lost the reference to the original model domain.

Does the concept of outline of the model domain still apply for a subset?

ecomodeller avatar Jan 30 '25 07:01 ecomodeller

But the subset has lost the reference to the original model domain.

Does the concept of outline of the model domain still apply for a subset?

I guess it does not in many cases. But the user would probably know that and could accept that the plot.outline() would be empty or raise an error 🤔

jsmariegaard avatar Jan 30 '25 08:01 jsmariegaard