Changeset 10900
- Timestamp:
- 03/08/07 16:20:40 (2 years ago)
- Files:
-
- trunk/gdal/swig/csharp/apps/GDALColorTable.cs (modified) (4 diffs)
- trunk/gdal/swig/csharp/apps/GDALInfo.cs (modified) (3 diffs)
- trunk/gdal/swig/csharp/apps/GDALRead.cs (modified) (2 diffs)
- trunk/gdal/swig/csharp/apps/GDALReadDirect.cs (modified) (3 diffs)
- trunk/gdal/swig/csharp/apps/GDALWrite.cs (modified) (3 diffs)
- trunk/gdal/swig/csharp/apps/OSRTransform.cs (modified) (1 diff)
- trunk/gdal/swig/csharp/apps/ReadXML.cs (modified) (1 diff)
- trunk/gdal/swig/csharp/apps/WKT2WKB.cs (modified) (2 diffs)
- trunk/gdal/swig/csharp/apps/createdata.cs (modified) (5 diffs)
- trunk/gdal/swig/csharp/apps/ogrinfo.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/swig/csharp/apps/GDALColorTable.cs
r10368 r10900 1 1 using System; 2 2 3 using GDAL;3 using OSGeo.GDAL; 4 4 5 5 … … 38 38 /* Register driver(s). */ 39 39 /* -------------------------------------------------------------------- */ 40 gdal.AllRegister();40 Gdal.AllRegister(); 41 41 42 42 Driver dv = null; … … 49 49 /* Open dataset. */ 50 50 /* -------------------------------------------------------------------- */ 51 ds = gdal.Open(file, gdalconst.GA_ReadOnly);51 ds = Gdal.Open(file, Access.GA_ReadOnly); 52 52 ba = ds.GetRasterBand(1); 53 53 ct = ba.GetRasterColorTable(); … … 63 63 /* Get driver */ 64 64 /* -------------------------------------------------------------------- */ 65 dv = gdal.GetDriverByName("GTiff");65 dv = Gdal.GetDriverByName("GTiff"); 66 66 67 67 ds_out = dv.Create(file_out, ds.RasterXSize, ds.RasterYSize, 68 68 ds.RasterCount, ba.DataType, new string [] {}); 69 69 ba_out = ds_out.GetRasterBand(1); 70 ct_out = new ColorTable( gdalconst.GPI_RGB);70 ct_out = new ColorTable(PaletteInterp.GPI_RGB); 71 71 72 72 ba_out.WriteRaster(0, 0, ds.RasterXSize, ds.RasterYSize, buffer, trunk/gdal/swig/csharp/apps/GDALInfo.cs
r10763 r10900 1 1 using System; 2 2 3 using GDAL;3 using OSGeo.GDAL; 4 4 5 5 … … 39 39 /* Register driver(s). */ 40 40 /* -------------------------------------------------------------------- */ 41 gdal.AllRegister();41 Gdal.AllRegister(); 42 42 43 43 /* -------------------------------------------------------------------- */ 44 44 /* Open dataset. */ 45 45 /* -------------------------------------------------------------------- */ 46 Dataset ds = gdal.Open( args[0], 0 );46 Dataset ds = Gdal.Open( args[0], 0 ); 47 47 48 48 if (ds == null) … … 133 133 Band band = ds.GetRasterBand(iBand); 134 134 Console.WriteLine("Band " + iBand + " :"); 135 Console.WriteLine(" DataType: " + gdal.GetDataTypeName(band.DataType));136 Console.WriteLine(" ColorInterpretation: " + gdal.GetColorInterpretationName(band.GetRasterColorInterpretation()));135 Console.WriteLine(" DataType: " + Gdal.GetDataTypeName(band.DataType)); 136 Console.WriteLine(" ColorInterpretation: " + Gdal.GetColorInterpretationName(band.GetRasterColorInterpretation())); 137 137 Console.WriteLine(" Description: " + band.GetDescription()); 138 138 Console.WriteLine(" Size (" + band.XSize + "," + band.YSize + ")"); trunk/gdal/swig/csharp/apps/GDALRead.cs
r10337 r10900 3 3 using System.Drawing.Imaging; 4 4 5 using GDAL;5 using OSGeo.GDAL; 6 6 7 7 … … 42 42 /* Register driver(s). */ 43 43 /* -------------------------------------------------------------------- */ 44 gdal.AllRegister();44 Gdal.AllRegister(); 45 45 46 46 /* -------------------------------------------------------------------- */ 47 47 /* Open dataset. */ 48 48 /* -------------------------------------------------------------------- */ 49 Dataset ds = gdal.Open( args[0], 0 );49 Dataset ds = Gdal.Open( args[0], 0 ); 50 50 51 51 if (ds == null) trunk/gdal/swig/csharp/apps/GDALReadDirect.cs
r10337 r10900 3 3 using System.Drawing.Imaging; 4 4 5 using GDAL;5 using OSGeo.GDAL; 6 6 7 7 … … 42 42 /* Register driver(s). */ 43 43 /* -------------------------------------------------------------------- */ 44 gdal.AllRegister();44 Gdal.AllRegister(); 45 45 46 46 /* -------------------------------------------------------------------- */ 47 47 /* Open dataset. */ 48 48 /* -------------------------------------------------------------------- */ 49 Dataset ds = gdal.Open( args[0], 0 );49 Dataset ds = Gdal.Open( args[0], 0 ); 50 50 51 51 if (ds == null) … … 127 127 IntPtr buf = bitmapData.Scan0; 128 128 129 blueBand.ReadRaster(0, 0, width, height, buf, width, height, 1, 4, stride);130 greenBand.ReadRaster(0, 0, width, height, new IntPtr(buf.ToInt32()+1), width, height, 1, 4, stride);131 redBand.ReadRaster(0, 0, width, height, new IntPtr(buf.ToInt32()+2), width, height, 1, 4, stride);129 blueBand.ReadRaster(0, 0, width, height, buf, width, height, DataType.GDT_Byte, 4, stride); 130 greenBand.ReadRaster(0, 0, width, height, new IntPtr(buf.ToInt32()+1), width, height, DataType.GDT_Byte, 4, stride); 131 redBand.ReadRaster(0, 0, width, height, new IntPtr(buf.ToInt32()+2), width, height, DataType.GDT_Byte, 4, stride); 132 132 TimeSpan renderTime = DateTime.Now - start; 133 133 Console.WriteLine("SaveBitmapDirect fetch time: " + renderTime.TotalMilliseconds + " ms"); trunk/gdal/swig/csharp/apps/GDALWrite.cs
r10334 r10900 1 1 using System; 2 2 3 using GDAL;3 using OSGeo.GDAL; 4 4 5 5 … … 48 48 /* Register driver(s). */ 49 49 /* -------------------------------------------------------------------- */ 50 gdal.AllRegister();50 Gdal.AllRegister(); 51 51 52 52 /* -------------------------------------------------------------------- */ 53 53 /* Get driver */ 54 54 /* -------------------------------------------------------------------- */ 55 Driver drv = gdal.GetDriverByName("GTiff");55 Driver drv = Gdal.GetDriverByName("GTiff"); 56 56 57 57 if (drv == null) … … 67 67 /* -------------------------------------------------------------------- */ 68 68 string[] options = new string [] {"BLOCKXSIZE=" + bXSize, "BLOCKYSIZE=" + bYSize}; 69 Dataset ds = drv.Create(args[0], w, h, 1, gdalconst.GDT_Byte, options);69 Dataset ds = drv.Create(args[0], w, h, 1, DataType.GDT_Byte, options); 70 70 71 71 if (ds == null) trunk/gdal/swig/csharp/apps/OSRTransform.cs
r10015 r10900 1 1 using System; 2 using OS R;2 using OSGeo.OSR; 3 3 4 4 /** trunk/gdal/swig/csharp/apps/ReadXML.cs
r10384 r10900 1 1 using System; 2 2 3 using GDAL;3 using OSGeo.GDAL; 4 4 /** 5 5 trunk/gdal/swig/csharp/apps/WKT2WKB.cs
r10371 r10900 1 1 using System; 2 2 3 using O GR;3 using OSGeo.OGR; 4 4 5 5 … … 34 34 /* Register format(s). */ 35 35 /* -------------------------------------------------------------------- */ 36 ogr.RegisterAll();36 Ogr.RegisterAll(); 37 37 38 Geometry geom = new Geometry( ogr.wkbUnknown, args[0], 0, null, null);38 Geometry geom = new Geometry(wkbGeometryType.wkbUnknown, args[0], 0, null, null); 39 39 40 40 int wkbSize = geom.WkbSize(); trunk/gdal/swig/csharp/apps/createdata.cs
r10336 r10900 1 1 using System; 2 2 3 using O GR;3 using OSGeo.OGR; 4 4 5 5 … … 37 37 /* Register format(s). */ 38 38 /* -------------------------------------------------------------------- */ 39 ogr.RegisterAll();39 Ogr.RegisterAll(); 40 40 41 41 /* -------------------------------------------------------------------- */ 42 42 /* Get driver */ 43 43 /* -------------------------------------------------------------------- */ 44 Driver drv = ogr.GetDriverByName("ESRI Shapefile");44 Driver drv = Ogr.GetDriverByName("ESRI Shapefile"); 45 45 46 46 if (drv == null) … … 70 70 Layer layer; 71 71 72 layer = ds.CreateLayer( args[1], null, ogr.wkbPoint, new string[] {} );72 layer = ds.CreateLayer( args[1], null, wkbGeometryType.wkbPoint, new string[] {} ); 73 73 if( layer == null ) 74 74 { … … 81 81 /* -------------------------------------------------------------------- */ 82 82 83 FieldDefn fdefn = new FieldDefn( "Name", ogr.OFTString );83 FieldDefn fdefn = new FieldDefn( "Name", FieldType.OFTString ); 84 84 85 85 fdefn.SetWidth(32); … … 98 98 feature.SetField( "Name", "value" ); 99 99 100 Geometry geom = new Geometry( ogr.wkbUnknown, "POINT(47.0 19.2)", 0, null, null);100 Geometry geom = new Geometry(wkbGeometryType.wkbUnknown, "POINT(47.0 19.2)", 0, null, null); 101 101 102 102 if( feature.SetGeometry( geom ) != 0 ) trunk/gdal/swig/csharp/apps/ogrinfo.cs
r10179 r10900 1 1 using System; 2 2 3 using O GR;3 using OSGeo.OGR; 4 4 5 5 … … 37 37 /* Register format(s). */ 38 38 /* -------------------------------------------------------------------- */ 39 ogr.RegisterAll();39 Ogr.RegisterAll(); 40 40 41 41 /* -------------------------------------------------------------------- */ 42 42 /* Open data source. */ 43 43 /* -------------------------------------------------------------------- */ 44 DataSource ds = ogr.Open( args[0], 0 );44 DataSource ds = Ogr.Open( args[0], 0 ); 45 45 46 46 if (ds == null) {
