Raster operations in DotSpatial

203 Views Asked by At

Searching for advice: We are rewriting (in c#) the graphical user interface for the Watershed Risk Analysis Management Framework model, and are using the DotSpatial libraries for our map operations. We need to perform some simple tabulations on raster data, and I'm having trouble finding examples. We need to calculate land use (using national land cover dataset) percentages within polygons, calculate average slope and aspect within polygons. Pretty standard stuff for hydrologic analysis. Does anyone know of tutorials or available code sources for DotSpatial raster analysis? Thanks for your time.

1

There are 1 best solutions below

0
On

did you find a way to do it? I am in the same position. For the moment, my current workaround is this. I have converted my raster into a List<GeoAPI.Geometries.IPoint> listPts using the center coordinates of the pixels, with the Z value as the corresponding raster pixel value. Then, with my PolygonShapefile, I loop over each feature, and use the feature.Geometry.Covers(listPts[i]) methode to build a list of the points failing in each polygons. After that, I simply cross the two lists together to calculates the corresponding statistics that I need.

I would like a better suggestion, but for the moment, it fits my needs.