[FWTools] Re: Style usage?

Daniel Morissette dmorissette at mapgears.com
Fri Dec 28 08:50:28 EST 2007


Stefan Keller wrote:
>  
> 1. Is there also a concept and a way to change style output in an 
> ogr2ogr call, e.g. for KML?
>  

I don't think ogr2ogr supports "changing" the style assigned to a given 
feature or assigning new styles to features, but when translating 
between formats that support styles (e.g. TAB, MIF and DGN) then the 
styles are maintained as much as possible.

With respect to KML, last time I checked I don't think the KML driver 
supported styles, so the answer is no, at the moment it is not possible 
to control the style of the features written to KML output (but 
technically that's feasible and could be implemented someday).

> 2. Regarding the style concept perhaps it would be helpful to mention 
> similarities to SLD and eventually also to Mapfile symbols (if there are 
> any)?
>  

The concept of assigning rendering rules to geometries is shared in both 
cases but that's about it. The terminology (pen/brush/etc vs 
symbolizers) and encoding (compact text strings vs verbose XML) are 
completely different.

SLD also supports building up classifications using filter encoding 
which is not part of the OGR style concept.

Why did OGR invent its own encoding instead of reusing SLD? Mostly 
because the OGR style encoding predates the days when SLD became well 
known (to me anyway) and widely used. But even if we were to do this 
again today I'm not sure if we would opt for a verbose XML encoding... 
we'd probably spend a lot of time debating the performance issues vs the 
benefits of interoperability with SLD.

BTW, this question would really belong on the gdal-dev list, so I have 
cross-posted my reply to gdal-dev (and ask that further replies be sent 
only to gdal-dev).

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/


More information about the FWTools mailing list