[gdal-dev] VMAP Issues.

Courtney Schitka c.schitka at gmail.com
Wed Apr 30 14:42:29 EDT 2008


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).

Then after a bunch of else ifs

We call this method

IAddLayer( pszLyrName, eFamily );

in ogrogdidatasource.cpp

where we create a new OGRLayer and add it to an array of layers. Now I would
think that if we were opening the data source for read we should be fetching
the layer as opposed to creating a new one. Creating this new layer would
also explain to me why my layer has no features in it.

Thoughts comments Help ?



Courtney




On Wed, Apr 30, 2008 at 10:53 AM, Frank Warmerdam <warmerdam at pobox.com>
wrote:

> Courtney Schitka wrote:
>
> > Hi All,
> >  As you probably know. I am trying to read. Features from a VMAP data
> > source via code I am developing using GDAL 1.5.1 with OGDI built in.
> >
> ...
>
> > This lead me to the assumption that the code was right and the data was
> > bad. HOWVER when I open the data source + layer via ogrinfo. Everything
> > works like a charm.
> >
>
> Courtney,
>
> Honestly, I cannot think of any reason this might be happening other than
> perhaps that you are using different versions of OGR+OGDI in ogrinfo vs.
> in your program.  I assume that is not the case?
>
> Are you confident it is the same layer you are getting no features from
> programmatically as you are getting features from with ogrinfo?
>
> I'm sorry to ask rather basic questions, but I don't know where else to
> start given the problems you are seeing.
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080430/53517883/attachment.html


More information about the gdal-dev mailing list