[gdal-dev] about reading OGR feature style file *.ofs

Tamas Szekeres szekerest at gmail.com
Fri Jul 4 06:34:24 EDT 2008


As far as I remember the OGR style table concept hasn't been
implemented yet. At the moment you can store the styles only at
feature level. If a driver doesn't support the feature level styles
internally then you can place the style strings into a field named
'OGR_STYLE' that can be handled by OGR automatically.

Best regards,


2008/7/4 wow <27949218 at qq.com>:
> Hi,
>   I have created a style file  border.ofs for a polygon shape file
> border.shp.  Here's the ofs file content:
> OFS-Version: 1.0
> StyleField: ""
> DefaultStyle: PEN(C:#000000)
> road:         PEN(c:#FF0000,w:5px)
> lake:         BRUSH(fc:#0000FF);LINE(c:#000000)
> billboard:    SYMBOL(c:#00FF00,id:"ogr-sym-9")
> label:        LABEL(f:"Times New Roman",s:12pt,t:{"China"})
> When i try to get the style, i have the following two questions:
> 1. Did ogr provide mathod to get style from *.ofs file, or we shall read it
> line by line  by users and then convert the style strings to Style Table to
> be accessed by OGRStyle referenced classes ?
>    If it did, when call shape driver to read shp file, dose the driver
> automatically read the style into OGRLayer? if so, then how can i get style
> with OGRLayer?
> 2. Is OGRLayer::GetStyleTable only available for getting style table from
> *.tlb file? I try to use it to read the above  file border.ofs   with  these
> codes:
>   OGRStyleTable* pStyleTable;
>   pStyleTable = pLayer->GetStyleTable();
>  but failed.
> Please help me. By the way, if someone has examples about styles, would you
> mail me some?
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

More information about the gdal-dev mailing list