[gdal-dev] VMAP Issues.

Frank Warmerdam warmerdam at pobox.com
Wed Apr 30 14:59:51 EDT 2008


Courtney Schitka wrote:
> Hi Frank,
>  
> I suspect that what is happening is that the VMAP data source is being 
> opened for writing instead of for reading. After debugging here is why 
> I've come to this conclusion.
>  
> 
> OGRDataSource* pOGRDataSource = OGRSFDriverRegistrar::Open(char 
> *ptrDataSrc);
> 
> This in turn goes through all the drivers until it comes to.
> 
> int
> 
> OGROGDIDataSource::Open
> 
> So as I step through this code, with the debugger everything works like 
> I would expect it to work.
> 
> Then I come to this
> 
> /* -------------------------------------------------------------------- */
> 
> /* If an explicit layer was selected, just create that layer. */
> 
> /* -------------------------------------------------------------------- */
> 
> m_poCurrentLayer = NULL;
> 
> I am selecting an explicit layer so I am bewildered at why this is set 
> to NULL (On a side note I suspect this being null is the root of my 
> problems).

Courtney,

Are you are specifying a layer name in the datasource name in
your program, and not doing the same when using ogrinfo?  That
is certainly a significant difference!  I didn't even know that
this layer name selection in the datasource name logic existed,
though I must have written it some 8-9 years ago.

Is there a reason you are doing this?  Why not just open the same
datasource name you use with ogrinfo, and then use GetLayer() or
GetLayerByName() to fetch the layer handle?

I see the explicitly named layer logic does not use cln_GetLayerCapabilities().
Perhaps there is a side effect of this difference.  The
cln_GetLayerCapabilities() in the OGDI API is actually a relatively recent
addition to the API.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list