Manhattan shapes error

Apr 8, 2013 at 10:25 AM
Dear all,

I am experiencing a little problem in converting an integer raster to polygon shapefile using manhattanshapes.

here is the code
       Dim a As New DotSpatial.Plugins.Taudem.Port.ManhattanShapes(fname)

        Dim g As New FeatureSet(FeatureType.Polygon)
        g.Filename = TextBox1.Text

        g = a.GridToShapeManhattan()
the instructions above works fine, the problem I am encountering is that the create shapefile often has errors such as the one in this issue TEXT

basically instead of finding just vertical and horizontal borders on the newly created shapefile, I find sometimes triangulated lines. I think this is a bug in manhattan shapes.


anybody experienced that?
thank you
Oscar
Coordinator
Apr 10, 2013 at 8:46 PM
Edited Apr 10, 2013 at 8:47 PM
Oscar, try using

DotSpatial.Tools.RasterToPolygon
IFeatureSet fs = new FeatureSet(DotSpatial.Topology.FeatureType.Polygon);
IRaster r = Raster.Open("myraster.bgd");
DotSpatial.Tools.RasterToPolygon d = new DotSpatial.Tools.RasterToPolygon();
d.Execute(r, fs, null);
Apr 11, 2013 at 2:39 PM
Hi Dan

I tried, but if I place null (nothing, since I am working in vb.net) for the cancel progress handler it throws an error.

This happens at line 269 of RasterToPolygon.cs

I have never worked with progress handler, can you please tell me what to put instead of null?

Thank you
Oscar
Apr 12, 2013 at 10:11 AM
Ok, I saw that there are some changes done by mogikanin on rasterToPolygon, I am working with an old version, I will check the new version

Thanks
Oscar
Apr 12, 2013 at 12:15 PM
No, changeset 71844 but still the same problem, throws a null reference exception if I pass nothing to cancelprogressHandler

Is it a bug?
Any Idea?

thank you
Oscar
Coordinator
Apr 12, 2013 at 4:12 PM
Well the cancelprogresshandler is a useful object anyway. So maybe just create a cancelprogresshandler object and pass it in.