[Gdal-dev] Re: Minor changes to gdal_java.i

Tamas Szekeres szekerest at gmail.com
Fri Apr 6 16:04:22 EDT 2007


Folks,

I'm quite sure in that the Dataset.ReadRaster and Dataset.WriteRaster
is currently supported for some of the bindings. However the common
implementation in Dataset.i is not suitable for every language and
possibly need to be customized in many cases.
In this regard if this option currently does not work for java, it
would be necessary to apply a fix for it without waiting for the other
languages to proceed.

Best regards,

Tamas


2007/4/6, Andrea Aime <aaime at openplans.org>:
> Simone Gannecchini ha scritto:
> > Hi all,
> > I am attaching a very minor patch for the gdal_java.i swig  file that me and
> > Daniele would really like to have accepted.
> > If you look at it here below, you'll see that it simply allows to write and
> > read without going through each single raster band.
> >
> > It should provide a nice optimization in case you work tile by tile since it
> > reduces the number JNI calls to read/write data by the number of #bands.
> >
> > Index: C:/work/VC++/gdal/swig/include/java/gdal_java.i
> > ===================================================================
> > --- C:/work/VC++/gdal/swig/include/java/gdal_java.i   (revision 11187)
> > +++ C:/work/VC++/gdal/swig/include/java/gdal_java.i   (working copy)
> > +%extend GDALDatasetShadow {
> > +  CPLErr ReadRaster_Direct( int xoff, int yoff, int xsize, int ysize,
> > +                            int buf_xsize, int buf_ysize,
> > +                            GDALDataType buf_type, int bands, void *buf)
> > +{
> > +
> > +
> > +   return GDALDatasetRasterIO( self, GF_Read, xoff, yoff, xsize, ysize,
> > +                                 buf, buf_xsize, buf_ysize,
> > +                                 buf_type, bands, 0,0,0,0);
> > +
> > +}
> > +
> > +
> > + CPLErr WriteRaster_Direct( int xoff, int yoff, int xsize, int ysize,
> > +                            int buf_xsize, int buf_ysize,
> > +                            GDALDataType buf_type, int bands, void *buf)
> > +{
> > +
> > +  return GDALDatasetRasterIO( self, GF_Write, xoff, yoff, xsize, ysize,
> > +                                 buf, buf_xsize, buf_ysize,
> > +                                 buf_type, bands, 0,0,0,0);
> > +
> > +}
> > +
> > +} /* extend */
> > +
> > +
> >  %include typemaps_java.i
>
> Change looks good, I see the advantage, I'm just wondering if this is
> general enough to push it one level up, where every language can use it.
> I mean, I don't see anything java specific there?
>
> > We have other optimizations that we are working on for accessing large
> > raster in java on Tile base but for the moment they are not stable enough
> > (wonder if we'll have have time to make them stable though :-) )
>
> Well, it may be nice to discuss their design, aim, and implementation.
> There are lots of skilled people here, someone may have ideas on how to
> stabilize them, whatever that means :-)
>
> Cheers
> Andrea
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>



More information about the Gdal-dev mailing list