[gdal-dev] OGR Feature Styles

Frank Warmerdam warmerdam at pobox.com
Thu Jan 24 13:57:40 EST 2008


Geo Aspects Development wrote:
> hi,
> 
> I have a couple of questions regarding feature styles in OGR.
> 
> Firstly, it appears that there is no way to count or list the names of 
> styles stored in a StyleTable - the list is private and there are no 
> methods to access it. So, for example, in a UI, I can't list the 
> available styles by name for the user to choose from. Is this correct?

Tim,

That is correct.  I wouldn't mind adding a few extra accessors
for this though - at least in trunk.

> Secondly, the section in the documentation marked  "Feature Styles can 
> be stored at 2 levels" suggests that a style can be defined at the 
> dataset or feature level. In fact, there is a  StyleTable property for 
> OGRDataSource, for OGRLayer and for OGRFeature, however, none of the 
> drivers appear to use these tables (they simply store the style string 
> directly in the feature without using a table), plus the StyleMgr only 
> uses the one style table it has been initialized with (so you have to 
> preload it from the dataset, layer or feature) - which means that "all 
> that stuff should be transparent to the OGR client " is not exactly the 
> case ie If I want to look up a style name (as denoted by an @name in the 
> style string) I need to search the style tables stored in the feature, 
> then the layer and  then the dataset myself?

You are correct.  In practice styling is only actually implemented at the
feature level.  A number of the things envisaged in the style document
were not put into practice.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list