[OpenLayers-Users] mergeNewParams not working
David Alda Fernandez de Lezea
dalda at ikt.es
Fri Nov 13 04:26:38 EST 2009
I'm using MapServer and I made some time ago a map viewer using only MapServer and an HTML page with PHP in which I was able to apply SLD's and I'm just copying them and try to make it work, so I'm almost 100% sure that MapServer can work with these SLD's. I've tried what you said, remove XSL tags and add SLD parameter to my layer:
wms.mergeNewParams({SLD: "sld2.xml"});
But I get a lot of errors from MapServer.
[Fri Nov 13 10:02:37 2009].770000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:37 2009].770000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20ab_1624_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:36 2009].20000 CGI Request 1 on process 6124
[Fri Nov 13 10:02:38 2009].474000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:38 2009].474000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20ac_17ec_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:36 2009].20000 CGI Request 1 on process 5144
[Fri Nov 13 10:02:38 2009].474000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:38 2009].474000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20ac_1418_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:37 2009].786000 CGI Request 1 on process 4904
[Fri Nov 13 10:02:40 2009].505000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:40 2009].505000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20ad_1328_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:38 2009].989000 CGI Request 1 on process 1444
[Fri Nov 13 10:02:41 2009].739000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:41 2009].739000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20ae_5a4_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:40 2009].536000 CGI Request 1 on process 5968
[Fri Nov 13 10:02:43 2009].67000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:43 2009].67000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20b0_1750_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:40 2009].520000 CGI Request 1 on process 3216
[Fri Nov 13 10:02:43 2009].83000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:43 2009].83000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20b0_c90_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:41 2009].755000 CGI Request 1 on process 4736
[Fri Nov 13 10:02:44 2009].364000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:44 2009].364000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20b1_1280_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:43 2009].98000 CGI Request 1 on process 5816
[Fri Nov 13 10:02:45 2009].645000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:45 2009].645000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20b3_16b8_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:44 2009].380000 CGI Request 1 on process 2636
[Fri Nov 13 10:02:46 2009].942000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:46 2009].942000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20b4_a4c_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:45 2009].661000 CGI Request 1 on process 4892
[Fri Nov 13 10:02:48 2009].20000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:48 2009].20000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20b5_131c_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:46 2009].958000 CGI Request 1 on process 6092
[Fri Nov 13 10:02:49 2009].458000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:49 2009].458000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20b6_17cc_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
[Fri Nov 13 10:02:48 2009].36000 CGI Request 1 on process 4768
[Fri Nov 13 10:02:50 2009].489000 msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 6 () for sld2.xml
[Fri Nov 13 10:02:50 2009].489000 msSLDApplySLDURL: WMS server error. Could not open SLD sld2.xml and save it in temporary file C:/ms4w/Apache/htdocs/MFD/tmp/4afd20b8_12a0_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file
This is the first time I see this error.
What I want to really do is to get some data from an external service in a predefined structure and parse it using XSL and my predefined SLD, to get a final SLD xml file and apply it to the layer, that's the reason because I had those tags.
You should apply it to the polygon layer.
What WMS are you using? Mapserver? Try to put your SLD XML on a webserver and reference it with the SLD parameter without the use of OpenLayers in between. If this does not work, you might have better luck asking on the mailing list of your server product.
Have you tried without the xsl stuff embedded in your XML?
Also, things like PropertyIsEqualTo etc need to be in the ogc prefix, not sure if this is the problem though (some WMS-s are quite permissive).
Best regards,
Bart
>
> Sure, here it is:
>
> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output omit-xml-declaration="yes" method="xml"/>
> <xsl:param name="objetoPila" select="null"/>
> <xsl:template match="/">
> <StyledLayerDescriptor version="1.0.0"
> xsi:schemaLocation="http://www.opengis.net/sld
> StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld"
> xmlns:ogc="http://www.opengis.net/ogc"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <NamedLayer>
> <Name>RecintosSigpac</Name>
> <UserStyle>
> <Name>Selección de Recintos</Name>
> <Title>Título</Title>
> <Abstract>Comentarios</Abstract>
> <FeatureTypeStyle>
> <Rule>
> <ogc:Filter xmlns:gml="http://www.opengis.net/gml">
> <ogc:And>
> <PropertyIsEqualTo>
> <PropertyName>PROVINCIA</PropertyName>
> <Literal>1</Literal>
> </PropertyIsEqualTo>
> <PropertyIsEqualTo>
> <PropertyName>MUNICIPIO</PropertyName>
> <Literal>1</Literal>
> </PropertyIsEqualTo>
> <PropertyIsEqualTo>
> <PropertyName>POLIGONO</PropertyName>
> <Literal>1</Literal>
> </PropertyIsEqualTo>
> <PropertyIsEqualTo>
> <PropertyName>PARCELA</PropertyName>
> <Literal>1</Literal>
> </PropertyIsEqualTo>
> <PropertyIsEqualTo>
> <PropertyName>RECINTO</PropertyName>
> <Literal>1</Literal>
> </PropertyIsEqualTo>
> </ogc:And>
> </ogc:Filter>
> <PolygonSymbolizer>
> <Fill>
> <CssParameter name="fill">#FFCC66</CssParameter>
> <CssParameter name="fill-opacity">0.5</CssParameter>
> </Fill>
> <Stroke>
> <CssParameter name="stroke">#00FF00</CssParameter>
> <CssParameter name="stroke-width">3</CssParameter>
> </Stroke>
> </PolygonSymbolizer>
> </Rule>
> </FeatureTypeStyle>
> </UserStyle>
> </NamedLayer>
> </StyledLayerDescriptor>
> </xsl:template>
> </xsl:stylesheet>
>
>
> One more question, I have 2 layers, both are taken from my WMS but one is
> a raster file, that acts as base layer, and the other one is polygon
> layer. In which of them do I have to apply the new params??. I've tried
> appliying them in my polygon layer.
>
> Thanks.
>
>
> Un saludo,
>
> ··················································································
>
> David Alda Fernández de Lezea
> Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad
>
> IKT
> Granja Modelo s/n · 01192 · Arkaute (Araba)
>
> ··················································································
> Tlfnos.: 945-00-32-95 Fax: 945-00.32.90
> ··················································································
> email: dalda at ikt.es web: www.ikt.es
> ··················································································
>
> -----Mensaje original-----
> De: bartvde at osgis.nl [mailto:bartvde at osgis.nl]
> Enviado el: viernes, 13 de noviembre de 2009 9:18
> Para: David Alda Fernandez de Lezea
> CC: users at openlayers.org
> Asunto: Re: [OpenLayers-Users] mergeNewParams not working
>
> Can you post the contents of your SLD XML?
>
> Best regards,
> Bart
>
>> Hello,
>>
>> I want to apply some SLD generated on the fly through SLD_BODY
>> parameter using the following code:
>>
>> var sld = getSLD("sld1.xsl","pilaXML.xml"); var wms =
>> map.getLayersByName("myLayerName")[0];
>> wms.mergeNewParams({SLD_BODY: sld});
>>
>> but I don't get any result. The image is refreshed in the browser but
>> there's no selection at all. I've got a debug file for my WMS server
>> and I don't seem to get any error:
>>
>> [Fri Nov 13 09:00:18 2009].346000 CGI Request 1 on process 5940
>>
>> My SLD contains 2084 characters, it could be that the problem? Or
>> maybe I'm doing something wrong. Has anybody any idea of what's
>> happening??
>>
>> Thanks.
>>
>>
>>
>>
>>
>>
>> Un saludo,
>>
>>
>>
>> ······································································
>> ············
>>
>>
>> David Alda Fernández de Lezea
>>
>> Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y
>> Biodiversidad
>>
>>
>>
>> IKT
>>
>> Granja Modelo s/n · 01192 · Arkaute (Araba)
>>
>>
>> ··················································································
>> Tlfnos.: 945-00-32-95 Fax: 945-00.32.90
>> ··················································································
>> email: dalda at ikt.es web: www.ikt.es
>> <http://www.ikt.es/>
>> ······································································
>> ············
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
More information about the Users
mailing list