On Mon, Aug 8, 2011 at 11:14 PM, Davi Custódio [via OSGeo.org] <
ml-node+6666737-586813224-338...@n2.nabble.com> wrote:
> Hello,
>
> The Geoserver version 2.1 onwards, provides support to so called Layers SQL
> View, where you can create SQL statements with parameters pointing to a
> PostGIS (for example). Using OpenLayers, wms can create dynamic layers from
> a sql command using the parameter viewparams. Example:
>
> var wms = new OpenLayers.Layer.WMS.Post ("Test View", "/ GeoServer / wms",
> {layers: 'censoibge: test', format: 'image / gif', transparent: "true",
> style: style }, options);
>
> var str = "(culture = 'Soja' and year = 2009 and area_plantada>
> area_plantada 100 and <= 1000 and area_plantada <> 0) or";
> str + = "(culture = 'Soja' and year = 2009 and area_plantada>
> area_plantada 1000 and <= 2000) or";
> str + = "(culture = 'Soja' and year = 2009 and area_plantada>
> area_plantada 2000 and <= 3000) or";
> str + = "(culture = 'Soja' and year = 2009 and area_plantada>
> area_plantada 3000 and <= 4000) or";
> str + = "(culture = 'Soja' and year = 2009 and area_plantada>
> area_plantada 4000 and <= 5000) or";
> str + = "(culture = 'Soja' and year = 2009 and area_plantada>
> area_plantada 5000 and <= 10000) or";
> str + = "(culture = 'Soja' and year = 2009 and area_plantada> 10000)";
>
> wms.mergeNewParams ({
> viewparams "sql: select * from where vw_pam_all_shapes" + str
> });
>
> The problem is when I try to set a sld_body to implement different styles
> for each condition. Testing sld_body in a normal layer (not SQL type VIEW)
> everything works ok, but if I do:
>
> wms.mergeNewParams ({
> sld_body: sld
> });
>
> the layer styles and does not respect the rules defined in SLD.
>
> Can anyone help? There is the possibility of applying layers sld_body in
> the sql view Geoserver? If not, there is another alternative that allows the
> flexibility to open the setting styles for the user?
>
> Thank you.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://osgeo-org.1803224.n2.nabble.com/Geoserver-SQL-View-Layers-SLD-BODY-tp6666737p6666737.html
> To start a new topic under GeoServer - Dev, email
> ml-node+6128263-305059426-338...@n2.nabble.com
> To unsubscribe from GeoServer - Dev, click
> here<http://osgeo-org.1803224.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6128263&code=RGF2aWN1c3RvZGlvQGdtYWlsLmNvbXw2MTI4MjYzfDEyOTA2MDA1ODk=>.
>
>
--
Davi de O. Custódio
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Geoserver-SQL-View-Layers-SLD-BODY-tp6666737p6666746.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel