Quantcast
Channel: DotSpatial
Viewing all articles
Browse latest Browse all 3973

New Post: Convert shapefile to raster

$
0
0
hi,

this is weird. I tried to test the instructions. Here is my code:
            Extent extent = new Extent(new double[] {xMin, yMin, xMax,yMax});

            int w = (int)Math.Ceiling(extent.Width / cellsize);
            int h = (int)Math.Ceiling(extent.Height / cellsize);

            IRaster raster = VectorToRaster.ToRaster(fs, cellsize, "unUsed", "output.bgd", "", new string[] { }, null);

            int rw = raster.NumColumns;
            int rh = raster.NumRows;
            int crw = (int)Math.Ceiling(extent.Width / raster.CellWidth);
            int crh = (int)Math.Ceiling(extent.Height / raster.CellHeight);
And I get :

w = 112, h =11, rw = 135, rh = 8, crw = 112, crh = 11

the output.bdg has the sanme size of my input polygon, not the extent I specified. :(

Viewing all articles
Browse latest Browse all 3973

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>