[OpenLayers-Users] Class based fill of polygons

Andreas Forø Tollefsen andreasft at gmail.com
Thu Aug 7 07:12:08 PDT 2014


Thank you Arnd,

Using SLD worked perfectly. I created my SLD file in QGIS and then used
that for each attribute in the polygon object in GeoServer.
Next, I need to figure out how to show this legend in OpenLayers.

Andreas


2014-08-05 20:22 GMT+02:00 Arnd Wippermann <arnd.wippermann at web.de>:

>  you could use SLD for WMS to accomplish this task.
>
> most likely you have to create a sld file for every attribute you wish to
> visualize.
>
> An example, that shows different styling for the same layer based on
> different rules (not always by attribute)
>
> http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/MapServer_SLD_World/MapServer_SLD_World.asp
>
> Regards,
> Arnd
>
>  ------------------------------
> *Von:* openlayers-users-bounces at lists.osgeo.org [mailto:
> openlayers-users-bounces at lists.osgeo.org] *Im Auftrag von *Andreas Forø
> Tollefsen
> *Gesendet:* Dienstag, 5. August 2014 14:51
> *An:* openlayers-users at lists.osgeo.org
> *Betreff:* [OpenLayers-Users] Class based fill of polygons
>
>  Hi all,
>
> I am new to OpenLayers (so forgive me in advance).
>
> I have a polygon layer in GeoServer (from a shapefile) consisting of 487
> features and 15 statistical attributes of socio-economic variables.
> What I want to accomplish is to visualize these 15 variables in a web map
> service, where the user can select the variable he/she wants to visualize
> and that the color fill represents low to high on the selected variable
> (white to dark grey i.e.).
>
> So far I have managed to set up an OpenLayers page that reads the
> GeoServer layer, and outputs the attribute table below the map when I click
> one of the features.
>
> However, I am still lost as to how I should proceed to create the
> visualization.
> One example of an end-result could look similar to this:
> http://sedac.ciesin..columbia.edu/maps/client
> <http://sedac.ciesin.columbia.edu/maps/client>
>
> So my question is. What styling code am I looking for, and could this type
> of solution be created out of the one layer, or do I need one layer for
> each attribute?
> And if I need to create a rule based class interval, do I have to do this
> manually for each class, for each attribute?
>
> Any example code that points to the suggested direction would be great!
>
> thanks!
>
> Best,
> Andreas
>
>
>
> ------------------------------
>    <http://www.avast.com/>
>
> Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus
> <http://www.avast.com/> Schutz ist aktiv.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20140807/747839b7/attachment.html>


More information about the Users mailing list