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

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


Le samedi 14 août 2010 19:57:52, Frank Warmerdam a écrit :
> On Sat, Aug 14, 2010 at 11:18 AM, Even Rouault
> 
> Even,
> 
> I'm generally ok with this change.  I would like to see it made explicit
> that the name returned by OGRLayer::GetName() must always match the name
> returned by the OGRFeatureDefn::GetName().

Yes 100% agreed : here's what is currently stated in the doc of the method : 
"This returns the same result as GetLayerDefn()->GetName()"

Is that clear enough ?

> 
> I am also wondering if there are any other aspects that should be handled
> this way.  Many applications want to show a list of laye names, and the
> geometry type of the layer (ie. ogrinfo, QGIS, etc).  Should we also be
> making the geometry type a virtual method fetch on the layer?

Yes, that makes sense although this is an information that is sometimes a bit 
harder to get than the name, however I can add easily it  :

OGRGeometryType OGRLayer::GetGeomType()

which should return the same as GetLayerDefn()->GetGeomType()

> 
> I can see the change you propose being of benefit to essentially all the
> RDBMS  drivers.

Yes, a quick look at the MYSQL driver shows that it could benefit from that 
too.

> 
> Best regards,


More information about the gdal-dev mailing list