[gdal-dev] Draft GDAL/OGR class hierarchy for GDAL 2.0

Even Rouault even.rouault at mines-paris.org
Tue Mar 25 03:44:50 PDT 2014


Selon Vincent Mora <vincent.mora at oslandia.com>:

> On 24/03/2014 21:46, Even Rouault wrote:
> > Hi,
> >
> > "Release soon, release early", so for people who like UML diagrams (there
> is
> > also a prototype of C++ classes for those who don't like UML very much),
> here's
> > a blog entry with the outcome of my thoughts for a possible re-organisation
> of
> > the GDAL/OGR class hierarchy
> >
> >
>
http://erouault.blogspot.ca/2014/03/draft-gdalogr-class-hierarchy-for-gdal.html
> I don't understand the need for HandleRasterData() and HandleVectorData().
>
> Isn't inheriting from GDALEmptyRasterDataset or GDALEmptyVectorDataset
> sufficient to convey the information that the class doesn't handle those
> kind of datasets.
>
> A call to GetLayerCount()/GetRasterCount() from the class user is
> sufficient to say "no vector/raster data here", and a dynamic _cast to
> GDALEmptyVectorDataset/GDALEmptyRasterDataset is even clearer to me, so
> HandleRasterData()/HandleVectorData() would be a third way to tell the
> same thing.

Actually, when thinking more about this, this kind of information should be at
the driver level, and not at the dataset level. The idea is that there are use
cases where you want to know if a driver can handle only vector, only raster, or
both. For example if you still want to have separate Open dialog boxes for
raster or vector.

>
> Also I'm not sure about the names GDALAbstract* since those are partial
> implementations.

I know I'm not very good at naming. Do you have an alternative proposal ? The
issue is that with my draft we end up with a lot of classes and interfaces, so
it is not obvious to find a good name to reflect their content.

Even


-- 
Geospatial professional services
http://even.rouault.free.fr/services.html




More information about the gdal-dev mailing list