[gdal-dev] Proposed addition of OGR_L_GetName() / OGRLayer::GetName()

Even Rouault even.rouault at mines-paris.org
Sat Aug 14 11:18:50 EDT 2010


Hi gdal-devs,

Here's a proposal for adding OGR_L_GetName() / OGRLayer::GetName().

The proposed patch in http://trac.osgeo.org/gdal/ticket/3719 introduces a new 
virtual method GetName?() at the OGRLayer level.

The semantics of this method is to return the same result as GetLayerDefn()-
>GetName(). This is indeed the default implementation of the OGRLayer class 
itself.

So, what is it usefull for ? A few drivers, like PG since 
http://trac.osgeo.org/gdal/changeset/20277 , can benefit from GetName() by 
overloading it, without needing to fetch the layer definition, which is an 
operation that cost a few SQL requests per layer.

So the new method can be usefull to present the list of layer names of a PG 
database.

This would also be very handy for a OGR WFS driver I'm writing. It would save 
a DescribeFeatureType request for each layer. Just the GetCapabilities request 
would be needed.

Apart from the PG driver, there's only another driver (LIBKML) in trunk that 
overrides GetName(), and its semantics matches the one explained above. So 
there's no backward compatibility issue.

IMHO, this change seems to be a bit light to deserve a whole RFC, but I wanted 
to hear from your feedback before applying it.

Best regards,

Even


More information about the gdal-dev mailing list