Open bloritsch opened 8 years ago
Tiling is simple image splitting. Bitmap save as indexed PNG w/alpha: use PngBitmapDecoder/Encoder
var sourceDataset = Gdal.Open(...) var destDataset = GDal.AutoCreateWarpedVRT(sourceDataset, sourceWkt, destWkt, ResampleAlg, precision)
Dump data to Image IntPtr using destDataset.ReadRaster()
NOTE: reading a raster may require an intermediate step to change the destination bits before saving, but that is regular image data translation. destDataset transforms the origin bits to the new bits for the new projection.
Ex.
BitmapData data = bitmap.LockBits(destImageRect, ImageLockMode.ReadWrite, pixelFormat) int stride = bitmapData.Stride IntPtr buf = bitmapData.Scan0
readRaster to buf
bitmap.UnlockBits(data)
Good article here on reading the map files https://trac.osgeo.org/gdal/wiki/GdalOgrCsharpRaster
Main functions:
NOTE: this may simply build on the shape file loader.