On Tue, Aug 20, 2013 at 12:18 PM, Nuno Oliveira <
nuno-miguel-olive...@ptinovacao.pt> wrote:

> Hi,
>
> I have the necessity of storing several styling properties for different
> types of entities. That entities are identified by a type and a subtype.
> The first approach was using a different column for every styling
> property (color, stroke, label, etc ...). Some entities needs all the
> styling
> properties and others just some of them (the number of styling
> properties needed is related with the entity type and subtype).
>
> With this approach I have a lot of "noise" in my data model introduced
> by the styling properties. Beside, if a new type or subtype of entity
> needs another styling property a new column must be added. Some
> workarounds exists,
> but they don't really solve the original problem (and sometimes they
> introduce other problems).
>
> After spend some time thinking about this problem I come to this solution.
> I store all the styling properties as a JSON map, i.e. in String that
> match this pattern '{"Color":"#FF0000", "Size":10.0}'. With this
> approach I can store all the styling properties in a single column in a
> flexible way. To make this properties available in SLDs I implement a
> new filter function to access the JSON map values. For example to access
> the 'Size' value:
>
> (...)
> <ogc:Function name='mapper'>
> <ogc:PropertyName>json_map_properties</ogc:PropertyName>
>      <ogc:Literal>Size</ogc:Literal>
>      <ogc:Literal>5.0</ogc:Literal>
> </ogc:Function>
> (...)
>
> The first parameter points to the JSON map. The second parameter is the
> name
> of the property we want access (the map key). The third parameter is
> optional and contains the default value.
>
> Does someone have a better approach to this problem ?
>

Hmm... I can think of other approaches, but they would all be more
complicated
and require changes to GeoServer.
This one seems fine to me.


>
> (If someone is interested I can contribute the code I write to GeoServer.)
>

I guess it could be a useful addition. Since you'd be contributing new
files, you'd
have to sign either the GeoServer or the GeoTools contribution agreement
for us to accept the contribution.

Jody, is the new contributor agreement available anywhere?

Cheers
Andrea

-- 
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to