[gdal-dev] GetFeatureCount() bForce set to FALSE

Even Rouault even.rouault at spatialys.com
Mon Sep 8 07:22:27 PDT 2014


Martin,

I'm far from being a C++ expert, but I don't think it makes sense to change the
default value of an optional parameter of a virtual method in a child class of
the base class.

http://svn.osgeo.org/gdal/trunk/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h :
virtual int         GetFeatureCount( int bForce = TRUE );

My suggestion would be that you remove the (|| bForce) test in your
implementation, if the poDataBlock->GetFeatureCount() is reliable.

Even

> Hi all,
>
> I was trying to change a default value of bForce in
> OGRVFKLayer::GetFeatureCount() to FALSE [1], but when I debug eg.
> ogrinfo, it still reports bForce as TRUE (1)
>
> Breakpoint 1, OGRVFKLayer::GetFeatureCount (this=0x71a7d0, bForce=1)
> at ogrvfklayer.cpp:162
>
> Any idea what could be wrong?
>
> Thanks in advance, Martin
>
> [1]
>
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/vfk/ogr_vfk.h#L83
>
> --
> Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list