WMS "Library Mode" request

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

WMS "Library Mode" request

D_Guidi
Hi users.
Sorry for the "doubled" post, the first one is in moderation so I'm
not sure that should be published or banned).

I'm trying to build a geoserver "library mode" request, using info
from this urls:
http://www.geo-solutions.it/blog/dynamic-wms-styling-with-geoserver-sld-and-library-mode/
and
http://docs.geoserver.org/latest/en/user/styling/sld-working.html#sld-library-mode

I've build an url like this:
http://localhost:8080/geoserver/URBINO/wms?layers=URBINO:VPARTICELLE,URBINO:GTCTFAB&styles=CATPARTICELLE,ruleCATBASEFABBRICATI&bbox=...&width=512&height=512&srs=EPSG:3004&format=image/png&service=wms&version=1.1.1&request=GetMap&SLD_BODY=
...
where SLD_BODY is something like
"<NamedLayer><Name>URBINO:GTCTFAB</Name>
<UserStyle><Name>ruleCATBASEFABBRICATI</Name>..." and it's perfectly
valid "per se" (i've made separate tests.

So basically what I've build is a request that define two layers and two styles.
The first style is defined as a geoserver style
The second style is NOT defined as a geoserver style, but is an
"UserStyle" inside SLD_BODY.
The result of the request is a Service
Exception:"Java.lang.ArrayIndexOutOfBoundsException: 1 1"

Note that I've tried to play with STYLES param, using as example the
string "styles=CATPARTICELLE," (note the last comma) with the same
results.
A request with "styles=CATPARTICELLE," and WITHOUT SLD_BODY works
well, but of course the second layer uses the default style.
A request without SLD_BODY and "styles=CATPARTICELLE" (no comma here)
fails, as I may expect.

Another thing: the same request works if I remove the 'CATPARTICELLE'
style from geoserver and add the same xml inside the request as
UserStyle in SLD_BODY.

Any suggestions?
Thanks for any kind of help.

Diego Guidi

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS "Library Mode" request

Stephen Crawford
I also couldn't get the library mode to work as described (or at least
how I understand it), but I did get it to work by putting all of the
layers/styles within the SLD_BODY.  Most of the layers use a named
style, but the layer "spr_ms_..." uses a UserStyle.

http://mybox/geoserver/cei/wms?SLD_BODY=<StyledLayerDescriptor><NamedLayer><Name>cei:mexicarib</Name><NamedStyle><Name>gray_polys_hvy_fill</Name><IsDefault>0</IsDefault></NamedStyle></NamedLayer><NamedLayer><Name>cei:canada</Name><NamedStyle><Name>gray_polys_hvy_fill</Name><IsDefault>0</IsDefault></NamedStyle></NamedLayer><NamedLayer><Name>cei:states</Name><NamedStyle><Name>gray_polys_hvy_fill</Name><IsDefault>0</IsDefault></NamedStyle></NamedLayer><NamedLayer><Name>spr_ms_0_20130731</Name><UserStyle><Name>ws_var4</Name><FeatureTypeStyle><Rule><RasterSymbolizer><ColorMap
type="intervals"><ColorMapEntry color="#FFFFFF" quantity="0.000001"
opacity="0"/><ColorMapEntry color="#99FF99"
quantity="0.5"/><ColorMapEntry color="#FFFF99"
quantity="0.7"/><ColorMapEntry color="#FF6666" quantity="1"
/></ColorMap></RasterSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer><NamedLayer><Name>cei:states</Name><NamedStyle><Name>gray_polys_hvy</Name><IsDefault>0</IsDefault></NamedStyle></NamedLayer></StyledLayerDescriptor>&BGCOLOR=0x99CCFF&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:105002&BBOX=-1248229.0136719,-1258485.8535156,2864599.0136719,1375213.8535156&WIDTH=773&HEIGHT=495

Good Luck,
Steve


On 3/27/2014 12:09 PM, Diego Guidi wrote:

> Hi users.
> Sorry for the "doubled" post, the first one is in moderation so I'm
> not sure that should be published or banned).
>
> I'm trying to build a geoserver "library mode" request, using info
> from this urls:
> http://www.geo-solutions.it/blog/dynamic-wms-styling-with-geoserver-sld-and-library-mode/
> and
> http://docs.geoserver.org/latest/en/user/styling/sld-working.html#sld-library-mode
>
> I've build an url like this:
> http://localhost:8080/geoserver/URBINO/wms?layers=URBINO:VPARTICELLE,URBINO:GTCTFAB&styles=CATPARTICELLE,ruleCATBASEFABBRICATI&bbox=...&width=512&height=512&srs=EPSG:3004&format=image/png&service=wms&version=1.1.1&request=GetMap&SLD_BODY=
> ...
> where SLD_BODY is something like
> "<NamedLayer><Name>URBINO:GTCTFAB</Name>
> <UserStyle><Name>ruleCATBASEFABBRICATI</Name>..." and it's perfectly
> valid "per se" (i've made separate tests.
>
> So basically what I've build is a request that define two layers and two styles.
> The first style is defined as a geoserver style
> The second style is NOT defined as a geoserver style, but is an
> "UserStyle" inside SLD_BODY.
> The result of the request is a Service
> Exception:"Java.lang.ArrayIndexOutOfBoundsException: 1 1"
>
> Note that I've tried to play with STYLES param, using as example the
> string "styles=CATPARTICELLE," (note the last comma) with the same
> results.
> A request with "styles=CATPARTICELLE," and WITHOUT SLD_BODY works
> well, but of course the second layer uses the default style.
> A request without SLD_BODY and "styles=CATPARTICELLE" (no comma here)
> fails, as I may expect.
>
> Another thing: the same request works if I remove the 'CATPARTICELLE'
> style from geoserver and add the same xml inside the request as
> UserStyle in SLD_BODY.
>
> Any suggestions?
> Thanks for any kind of help.
>
> Diego Guidi
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users


------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS "Library Mode" request

geowolf
In reply to this post by D_Guidi
On Thu, Mar 27, 2014 at 5:09 PM, Diego Guidi <[hidden email]> wrote:
Hi users.
Sorry for the "doubled" post, the first one is in moderation so I'm
not sure that should be published or banned).

I'm trying to build a geoserver "library mode" request, using info
from this urls:
http://www.geo-solutions.it/blog/dynamic-wms-styling-with-geoserver-sld-and-library-mode/
and
http://docs.geoserver.org/latest/en/user/styling/sld-working.html#sld-library-mode

I've build an url like this:
http://localhost:8080/geoserver/URBINO/wms?layers=URBINO:VPARTICELLE,URBINO:GTCTFAB&styles=CATPARTICELLE,ruleCATBASEFABBRICATI&bbox=...&width=512&height=512&srs=EPSG:3004&format=image/png&service=wms&version=1.1.1&request=GetMap&SLD_BODY=
...
where SLD_BODY is something like
"<NamedLayer><Name>URBINO:GTCTFAB</Name>
<UserStyle><Name>ruleCATBASEFABBRICATI</Name>..." and it's perfectly
valid "per se" (i've made separate tests.

So basically what I've build is a request that define two layers and two styles.
The first style is defined as a geoserver style
The second style is NOT defined as a geoserver style, but is an
"UserStyle" inside SLD_BODY.
The result of the request is a Service
Exception:"Java.lang.ArrayIndexOutOfBoundsException: 1 1"

Note that I've tried to play with STYLES param, using as example the
string "styles=CATPARTICELLE," (note the last comma) with the same
results.
A request with "styles=CATPARTICELLE," and WITHOUT SLD_BODY works
well, but of course the second layer uses the default style.
A request without SLD_BODY and "styles=CATPARTICELLE" (no comma here)
fails, as I may expect.

Another thing: the same request works if I remove the 'CATPARTICELLE'
style from geoserver and add the same xml inside the request as
UserStyle in SLD_BODY.

Any suggestions?

Looks like a bug to me, please open a ticket on jira with some sld and sample requests
to reproduce

Cheers
Andrea

--
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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


-------------------------------------------------------

------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS "Library Mode" request

D_Guidi
In reply to this post by Stephen Crawford
On Thu, Mar 27, 2014 at 6:02 PM, Stephen Crawford <[hidden email]> wrote:
> I also couldn't get the library mode to work as described (or at least
> how I understand it), but I did get it to work by putting all of the
> layers/styles within the SLD_BODY


It worked :)
Looks an acceptable solution to me, thanks.
Anyway, I hope to fill an issue with sample data soon.


Diego Guidi

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS "Library Mode" request

D_Guidi
In reply to this post by geowolf


On Friday, March 28, 2014, Andrea Aime <[hidden email]> wrote:
Looks like a bug to me, please open a ticket on jira with some sld and sample requests
to reproduce




--

Diego Guidi


------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users