[OpenLayers-Users] SLD different rules in a layer according to dynamic information

Martin Davis mtnclimb at gmail.com
Mon Nov 18 11:02:10 PST 2013


This is really a question for the GeoServer Users list, so you may wish to
post there.  But here's a rough reply:

1) I believe that in GeoServer shapefiles are somewhat faster, but if you
already have the data in PostGIS  for data management reasons it's probably
better to access it there directly

2) Yes, this kind of thematic (chloropleth) styling is done in SLD. There
are a couple of ways of doing this:
a) use SLD rules, as in this example:
http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/polygons.html#attribute-based-polygon
b) use the Categorize function in SLD, as shown here:
http://docs.geoserver.org/stable/en/user/styling/sld-tipstricks/transformation-func.html#categorize

An advantage of (a) is that you can then generate an appropriate legend too.


On Mon, Nov 18, 2013 at 6:05 AM, Diego Roberto
<diegorrborges at yahoo.com.br>wrote:

> Hello ,
> I am working on a project that shows statistical information about the
> state . Among these statistics need to show for instance the cities that
> stand out in an industry with percentage ranges . Example :
> Agricultural sector in the state of Goiás in Brazil will have to show
> painted the municipalities of colors according to the percentage .
>
>    - 100-81 % - Dark Blue
>    - 80-51 % - Light Blue
>    - 50-21 % - Gray
>    - 20-0 % - white
>
> Below is a picture showing more or less this:
> http://www.4shared.com/download/Slpq6Wbr/mapa.jpg
>
> I have a shapefile from around the state with geographic information , as
> well as the same information in the database PostgreSQL + PostGIS .
> I'm working with files with Geoserver SLD to paint municipalities .
>
> I have two questions to work with this information :
> 1 ) What is the best way to work in a matter of processing. A shapefile is
> imported into GeoServer or pointing a table from the database in GeoServer ?
> 2 ) This way of working to create the style SLD in GeoServer and assign eg
> dark blue if the municipality is within the range 100-81 % believe the
> correct way to work ?
>
> I thank you for your attention.
> Diego.
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20131118/300d3eeb/attachment.html>


More information about the Users mailing list