Dfs2 to dfs0 (zonal statistics) #410
Replies: 1 comment 1 reply
-
Hi @nielsriegels take a look at this notebook https://github.com/DHI/mikeio/blob/zonal_stats_notebook/notebooks/Dfs2%20-%20Zonal%20statistics.ipynb which is a work in progress. Is this in line with what you are asking for? This is of course an idealized example, but it seems feasible to adapt it multiple named polygons from a Shapefile. One caveat might be that with a high-resolution raster, it might be a bit slow to perform the check which points are in each polygon. But first step is to create something that works, and then optimize. P.S. Contributions to the code or example data, or comments to the discussion is always welcome! |
Beta Was this translation helpful? Give feedback.
-
Has anyone developed a script to convert a dfs2 (or dfsu) files to one or more dfs0 files based on a polygon shapefile? I would like to be able to create dfs0 files with values equal to the weighted average of grid values in each polygon in the shapefile. MIKE OPERATIONS has a tool like this.
Beta Was this translation helpful? Give feedback.
All reactions