[gdal-dev] Accessing OGRStyleTable
Geo Aspects Development
dev at geoaspects.com
Thu Sep 11 17:02:48 EDT 2008
Sorry, but I have to agree with Alberto - there is actually no way
(that I have found) of listing the currently loaded styles (for a UI
dropdown for example), either with the OGRStyleTable or with the
You have to maintain this list yourself.
Plus the OGRStyleTable is not at all private - you actually need one
before you can use the OGRStyleMgr, and the style strings are passed
in and out of both classes quite liberally. An OGRStyleMgr-
>getAllStyles() method would actually be quite useful, although I'm
not sure what it should return (a const char ** ?)
On Sep 11, 2008, at 10:33 PM, Mateusz Łoskot wrote:
> Alberto Pérez Cassinelli pisze:
>> Hi, I'm getting an OGRStyleTable from an OGRDataSource.
>> My problem is that I need to access all members of this
>> OGRStyleTable (that
>> is all style definitions and names) to store them in a data
>> structure of
>> type string vector,
> Why you need to access private elements of class.
> You should not even know they exist.
>> but I don't find any method to do it sequentially (I
>> can't read one by one because I don't know their names).
> See section 3 for usage example
> It explains how to read styles sequentially.
>> In short I need access to OGRStyleTable::m_papszStyleTable.
> > Anyone know how to do this?
> I suppose rationale of your concept is bad. You should not neet to
> access it.
> Best regards,
> Mateusz Loskot, http://mateusz.loskot.net
> Charter Member of OSGeo, http://osgeo.org
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
More information about the gdal-dev