[gdal-dev] VRTDataset in Java

Ivan Lucena lucena_ivan at hotmail.com
Tue Jun 10 10:32:33 PDT 2014


Hi Even,

> Date: Tue, 10 Jun 2014 17:43:50 +0200
> From: even.rouault at mines-paris.org
> To: lucena_ivan at hotmail.com
> CC: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] VRTDataset in Java
> 
> Ivan,
> 
> gdal_vrt.h is an already installed header file and the symbols are exported
> (CPL_DLL), so this is a public C API (although a bit confidential probably)
> As far as SWIG bindings is concerned, some work would be needed. New shadow

I once added some methods to the GDAL SWIG Java interface but I can't remember how I did it. The only thing I remember is the pain in the neck. 

> types should be introduced to model VRTDataset and VRTSourcedRasterBand (and
> some care too since all bands returned by a VRTDataset are not necessarily
> VRTSourcedRasterBand ). As far as VRTAddSource(), there's no C API to bind the
> corresponding C++ VRTSource classes, but probably that the helpers
> VRTAddSimpleSource() and VRTAddComplexSource() are sufficient.

Yes, it seems like it is possible to create the VRT Dataset using the generic API up to the point where we you cannot enter the band "SimpleSource" or "ComplexSource", so maybe those two functions would be enough. Let me see what I can do with SWIG.

The VRT driver is the usual solution to a lot of problem but we cannot automatize the solution on environment other than C/C++ or command scripts. But unfortunately, even if we add those two function much of the VRT magic is still not on the VRT code but in gdal_translate.cpp [0].

Best regards,

Ivan


ref.: [0] http://osgeo-org.1560.x6.nabble.com/gdal-dev-gdal-translate-as-a-VRTDataset-factory-td3750410.html

> 
> Even
> 
> >
> >
> > Do we have plans to add those entries to the GDAL API (C, Java, etc.)?
> >
> > ---------- \...\GDAL\TRUNK\FRMTS\VRT\GDAL_VRT.H
> > VRTDatasetH CPL_DLL CPL_STDCALL VRTCreate( int, int );
> > CPLXMLNode CPL_DLL * CPL_STDCALL VRTSerializeToXML( VRTDatasetH, const char *
> > );
> > CPLErr CPL_STDCALL VRTAddSource( VRTSourcedRasterBandH, VRTSourceH );
> > CPLErr CPL_DLL CPL_STDCALL VRTAddSimpleSource( VRTSourcedRasterBandH,
> > CPLErr CPL_DLL CPL_STDCALL VRTAddComplexSource( VRTSourcedRasterBandH,
> >
> > From: lucena_ivan at hotmail.com
> > To: gdal-dev at lists.osgeo.org
> > Date: Mon, 9 Jun 2014 16:58:12 -0400
> > Subject: [gdal-dev] VRTDataset in Java
> >
> >
> >
> >
> > Hi there,
> >
> > What is the best option to create in memory VRT Dataset with the GDAL Java
> > API?
> >
> > I would like to do thing like gdal_translate does [0], band selection and
> > window cropping for example.
> >
> > It seems like the VRTDataset class is not wrapped in Java, so I would need to
> > write the XML myself or use a regular GDAL Dataset clas, ex.:
> >
> > Dataset ds = dal.getDriverByName("VRT").Create("/vsimem/xxx.vrt", 255, 255);
> >
> > But there are some methods in VRTDataset that GDALDataset doesn't have, so I
> > think I am going with the raw XML option.
> >
> > Any better idea?
> >
> > Best regards,
> >
> > Ivan
> >
> > ref. :
> >
> > [0]
> > http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdal_translate.cpp#L1095
> >
> >
> >
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >
> 
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140610/64702d31/attachment.html>


More information about the gdal-dev mailing list