Changeset 10900

Show
Ignore:
Timestamp:
03/08/07 16:20:40 (2 years ago)
Author:
tamas
Message:

Using the enumerated types in the sample apps.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/swig/csharp/apps/GDALColorTable.cs

    r10368 r10900  
    11using System; 
    22 
    3 using GDAL; 
     3using OSGeo.GDAL; 
    44 
    55 
     
    3838            /*      Register driver(s).                                             */ 
    3939            /* -------------------------------------------------------------------- */ 
    40             gdal.AllRegister(); 
     40            Gdal.AllRegister(); 
    4141             
    4242            Driver dv = null; 
     
    4949            /*      Open dataset.                                                   */ 
    5050            /* -------------------------------------------------------------------- */ 
    51             ds = gdal.Open(file, gdalconst.GA_ReadOnly); 
     51            ds = Gdal.Open(file, Access.GA_ReadOnly); 
    5252            ba = ds.GetRasterBand(1); 
    5353            ct = ba.GetRasterColorTable(); 
     
    6363            /*      Get driver                                                      */ 
    6464            /* -------------------------------------------------------------------- */   
    65             dv = gdal.GetDriverByName("GTiff"); 
     65            dv = Gdal.GetDriverByName("GTiff"); 
    6666 
    6767            ds_out = dv.Create(file_out, ds.RasterXSize, ds.RasterYSize, 
    6868                ds.RasterCount, ba.DataType, new string [] {}); 
    6969            ba_out = ds_out.GetRasterBand(1); 
    70             ct_out = new ColorTable(gdalconst.GPI_RGB); 
     70            ct_out = new ColorTable(PaletteInterp.GPI_RGB); 
    7171 
    7272            ba_out.WriteRaster(0, 0, ds.RasterXSize, ds.RasterYSize, buffer, 
  • trunk/gdal/swig/csharp/apps/GDALInfo.cs

    r10763 r10900  
    11using System; 
    22 
    3 using GDAL; 
     3using OSGeo.GDAL; 
    44 
    55 
     
    3939            /*      Register driver(s).                                             */ 
    4040            /* -------------------------------------------------------------------- */ 
    41             gdal.AllRegister(); 
     41            Gdal.AllRegister(); 
    4242 
    4343            /* -------------------------------------------------------------------- */ 
    4444            /*      Open dataset.                                                   */ 
    4545            /* -------------------------------------------------------------------- */ 
    46             Dataset ds = gdal.Open( args[0], 0 ); 
     46            Dataset ds = Gdal.Open( args[0], 0 ); 
    4747                 
    4848            if (ds == null)  
     
    133133                Band band = ds.GetRasterBand(iBand); 
    134134                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())); 
    137137                Console.WriteLine("   Description: " + band.GetDescription()); 
    138138                Console.WriteLine("   Size (" + band.XSize + "," + band.YSize + ")"); 
  • trunk/gdal/swig/csharp/apps/GDALRead.cs

    r10337 r10900  
    33using System.Drawing.Imaging; 
    44 
    5 using GDAL; 
     5using OSGeo.GDAL; 
    66 
    77 
     
    4242            /*      Register driver(s).                                             */ 
    4343            /* -------------------------------------------------------------------- */ 
    44             gdal.AllRegister(); 
     44            Gdal.AllRegister(); 
    4545 
    4646            /* -------------------------------------------------------------------- */ 
    4747            /*      Open dataset.                                                   */ 
    4848            /* -------------------------------------------------------------------- */ 
    49             Dataset ds = gdal.Open( args[0], 0 ); 
     49            Dataset ds = Gdal.Open( args[0], 0 ); 
    5050                 
    5151            if (ds == null)  
  • trunk/gdal/swig/csharp/apps/GDALReadDirect.cs

    r10337 r10900  
    33using System.Drawing.Imaging; 
    44 
    5 using GDAL; 
     5using OSGeo.GDAL; 
    66 
    77 
     
    4242            /*      Register driver(s).                                             */ 
    4343            /* -------------------------------------------------------------------- */ 
    44             gdal.AllRegister(); 
     44            Gdal.AllRegister(); 
    4545 
    4646            /* -------------------------------------------------------------------- */ 
    4747            /*      Open dataset.                                                   */ 
    4848            /* -------------------------------------------------------------------- */ 
    49             Dataset ds = gdal.Open( args[0], 0 ); 
     49            Dataset ds = Gdal.Open( args[0], 0 ); 
    5050                 
    5151            if (ds == null)  
     
    127127            IntPtr buf = bitmapData.Scan0; 
    128128 
    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); 
    132132            TimeSpan renderTime = DateTime.Now - start; 
    133133            Console.WriteLine("SaveBitmapDirect fetch time: " + renderTime.TotalMilliseconds + " ms"); 
  • trunk/gdal/swig/csharp/apps/GDALWrite.cs

    r10334 r10900  
    11using System; 
    22 
    3 using GDAL; 
     3using OSGeo.GDAL; 
    44 
    55 
     
    4848            /*      Register driver(s).                                             */ 
    4949            /* -------------------------------------------------------------------- */ 
    50             gdal.AllRegister(); 
     50            Gdal.AllRegister(); 
    5151             
    5252            /* -------------------------------------------------------------------- */ 
    5353            /*      Get driver                                                      */ 
    5454            /* -------------------------------------------------------------------- */   
    55             Driver drv = gdal.GetDriverByName("GTiff"); 
     55            Driver drv = Gdal.GetDriverByName("GTiff"); 
    5656 
    5757            if (drv == null)  
     
    6767            /* -------------------------------------------------------------------- */ 
    6868            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); 
    7070                 
    7171            if (ds == null)  
  • trunk/gdal/swig/csharp/apps/OSRTransform.cs

    r10015 r10900  
    11using System; 
    2 using OSR; 
     2using OSGeo.OSR; 
    33 
    44/** 
  • trunk/gdal/swig/csharp/apps/ReadXML.cs

    r10384 r10900  
    11using System; 
    22 
    3 using GDAL; 
     3using OSGeo.GDAL; 
    44/** 
    55 
  • trunk/gdal/swig/csharp/apps/WKT2WKB.cs

    r10371 r10900  
    11using System; 
    22 
    3 using OGR; 
     3using OSGeo.OGR; 
    44 
    55 
     
    3434                /*      Register format(s).                                             */ 
    3535                /* -------------------------------------------------------------------- */ 
    36         ogr.RegisterAll(); 
     36        Ogr.RegisterAll(); 
    3737 
    38         Geometry geom = new Geometry(ogr.wkbUnknown, args[0], 0, null, null); 
     38        Geometry geom = new Geometry(wkbGeometryType.wkbUnknown, args[0], 0, null, null); 
    3939         
    4040        int wkbSize = geom.WkbSize(); 
  • trunk/gdal/swig/csharp/apps/createdata.cs

    r10336 r10900  
    11using System; 
    22 
    3 using OGR; 
     3using OSGeo.OGR; 
    44 
    55 
     
    3737                /*      Register format(s).                                             */ 
    3838                /* -------------------------------------------------------------------- */ 
    39         ogr.RegisterAll(); 
     39        Ogr.RegisterAll(); 
    4040 
    4141                /* -------------------------------------------------------------------- */ 
    4242                /*      Get driver                                                      */ 
    4343                /* -------------------------------------------------------------------- */       
    44         Driver drv = ogr.GetDriverByName("ESRI Shapefile"); 
     44        Driver drv = Ogr.GetDriverByName("ESRI Shapefile"); 
    4545 
    4646                if (drv == null)  
     
    7070        Layer layer; 
    7171 
    72         layer = ds.CreateLayer( args[1], null, ogr.wkbPoint, new string[] {} ); 
     72        layer = ds.CreateLayer( args[1], null, wkbGeometryType.wkbPoint, new string[] {} ); 
    7373        if( layer == null ) 
    7474        { 
     
    8181        /* -------------------------------------------------------------------- */ 
    8282 
    83         FieldDefn fdefn = new FieldDefn( "Name", ogr.OFTString ); 
     83        FieldDefn fdefn = new FieldDefn( "Name", FieldType.OFTString ); 
    8484 
    8585        fdefn.SetWidth(32); 
     
    9898        feature.SetField( "Name", "value" ); 
    9999 
    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); 
    101101         
    102102        if( feature.SetGeometry( geom ) != 0 ) 
  • trunk/gdal/swig/csharp/apps/ogrinfo.cs

    r10179 r10900  
    11using System; 
    22 
    3 using OGR; 
     3using OSGeo.OGR; 
    44 
    55 
     
    3737                /*      Register format(s).                                             */ 
    3838                /* -------------------------------------------------------------------- */ 
    39                 ogr.RegisterAll(); 
     39                Ogr.RegisterAll(); 
    4040 
    4141                /* -------------------------------------------------------------------- */ 
    4242                /*      Open data source.                                               */ 
    4343                /* -------------------------------------------------------------------- */ 
    44                 DataSource ds = ogr.Open( args[0], 0 ); 
     44                DataSource ds = Ogr.Open( args[0], 0 ); 
    4545                 
    4646                if (ds == null) {