[gdal-dev] WAsP map output for ogr
Even Rouault
even.rouault at mines-paris.org
Tue Mar 11 02:39:00 PDT 2014
Hi Vincent,
> The driver is now R/W.
ok I now realize that oErrorRegion.Intersect( oEnvelope ) is on the OGREnvelope
class and not OGRGeometry (in later case it is a boolean operation, hence my
erroneous note).
If you want to test the compliance of your driver (the read part) with the
assumptions of the OGR API, you can go to the apps subdirectory of GDAL and
"make test_ogrsf", and then "test_ogrsf a_wasp_file".
I can see a few things that should be corrected :
- reset iFeatureCount in ResetReading()
- take attribute and spatial filter into account in GetNextFeature(). Actually
you could rename your GetNextFeature() into GetNextRawFeature() and copy and
paste the GetNextFeature() implementation of
ogr/ogrsf_frmts/cartodb/ogrcartodblayer.cpp
- OGRWAsPDriver::Open() : it should be much more restrictive and only return a
non NULL pointer in case a WASP file is found (test typical extension if it
exists, otherwise look at first bytes). Otherwise every file not handled by
other drivers will be reported as a WASP datasource.
- you probably want to have a flag at the layer level to indicate if it is
opened in read-only or write-only mode, and use it in the various operations
(CreateFeature(), GetNextFeature(), TestCapability())
Even
More information about the gdal-dev
mailing list