[gdal-dev] how to test the creation and deletion capability of
ogr?
Even Rouault
even.rouault at mines-paris.org
Fri Oct 16 12:54:21 EDT 2009
Selon atubar <atubar at 126.com>:
> Thanks for your help, I modify those params and get right return values now.
>
> As I want to write a function, which can automatically return a rusult, that
> whether the input raster file has a set of subdataset.
> I use a metadata item of "subdataset", and this value is known from another
> program but not api doc.
I'm not sure what your question is. You can find documentation about subdatasets
here : http://gdal.org/gdal_datamodel.html . and here to extract metadata :
http://gdal.org/classGDALMajorObject.html#8ce3bf5795bbebfe9bc643e2152bb360
>
> By generally reading the api doc, and as a freshman, I find it hard to get
> exact value of those const char params and options.
>
> Do you have a good idea?
Could you be more explicit about what is not clear and quote the actual function
names ? Otherwise nobody can really help you or improve the doc. Studying the
source code of GDAL/OGR utilities is also often a great source of knowledge
about how to use the API : http://trac.osgeo.org/gdal/browser/trunk/gdal/apps
>
>
>
>
> å¨2009-10-16 01:50:33ï¼"Even Rouault" <even.rouault at mines-paris.org>Â
åéï¼
> >Selon Chaitanya kumar CH <chaitanya.ch at gmail.com>:
> >
> >Atubar
> >
> >As Chaintanya says and the doc recommands it, you must use theÂ
macro and not
> >string values directly. For one good reason : #defineÂ
ODrCCreateDataSource
> >expands to "CreateDataSource"... So "ODrCCreateDataSource" is anÂ
invalid input
> >for OGRSFDriver::TestCapability().
> >
> >You're also mentionning functions that take strings as argumentsÂ
but you don't
> >know which values are valid. Could you be more explicit aboutÂ
which functions ?
> >Generally the doc should make it clear about the expected meaningÂ
/Â accepted
> >values. But things can always be improved ;-)
> >
> >Even
> >
> >>Â atubar,
> >>
> >> Here is a sample.
> >>Â http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/ogr2ogr.cpp#L401
> >> The preferred #define macro forms are used here. (
> >>Â
http://www.gdal.org/ogr/classOGRSFDriver.html#6c37cb7552902cd27cd6d4b904d7c744
> >>Â )
> >>
> >> As per your problem, perhaps the drivers you tested did indeedÂ
not support
> >> creation and deletion. Which drivers were they?
> >>
> >> 2009/10/15 atubar <atubar at 126.com>
> >>
> >>Â >Â Hi,
> >>Â >
> >> > I want to take a test about the capability of creation andÂ
deletion for
> >> > all supported formats of ogr .
> >>Â >
> >> > The code like below,  The parameter "const char" are copiedÂ
from api doc.
> >> > But all flag return a value of 0, why ?
> >>Â >
> >> >   int flag;
> >>Â >
> >>Â >Â Â Â flag=poDriver->TestCapability("ODrCCreateDataSource");
> >>Â >Â Â Â if(flag==TRUE)
> >> >    cout<<endl<<"  --Supported Creation. "<<endl;
> >>Â >Â Â Â flag=poDriver->TestCapability("ODrCDeleteDataSource");
> >>Â >Â Â Â if(flag==TRUE)
> >> >    cout<<endl<<"  --Supported Deletion. "<<endl;
> >>Â >
> >> > Many funcions need const char * params, is there a list ofÂ
these values ?
> >>Â >
> >>Â >
> >>Â >
> >>Â >
> >>Â >Â ------------------------------
> >>Â >
> >> ç½ÂæÂÂÃ¥ÂÂÃ¥Â
Âå¹´èÂÂ亿èµÂæÂÂéÂ
>
>ï¼Â3Då½éÂ懫Â游ãÂÂ天ä¸Âè´°ãÂÂï¼ÂÃ¥Â
Âè´¹é¢ÂÃ¥Â
ÂçÂÂ<http://allyes.nie.163.com/main/adfclick?db=afanie&bid=1256,612,23&cid=146,4,1&sid=1353&show=ignore&url=http://tx2.163.com/fab.html>
> >>Â >Â _______________________________________________
> >> > gdal-dev mailing list
> >>Â >Â gdal-dev at lists.osgeo.org
> >>Â >Â http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >>Â >
> >>
> >>
> >>
> >>Â --
> >> Best regards,
> >> Chaitanya kumar CH.
> >>
> >
> >
>
More information about the gdal-dev
mailing list