I have an architectural issue and not sure how to proceed, any suggestions
will be helpful.
I have a geoserver rending static layers for my web app client that uses
OpenLayers. Each layer has a table associated with it. I define user defined
styles for each layer for Line color, fill color in a different table based
on the user who logs in.
I am basically trying to implement dynamic styling for the geoserver layer.
Here are some options I have tried and some reasons they did not work
1. Added the UserStyle as part of SLD_BODY - unfortunately GET request
limits for IE messed this plan
2. Generate a UserStyle as text/xml in an action and set the SLD = action -
unfortunately it looks like the SLD parameter need a physical SLD file, so I
might have to publish an SLD file everytime user changes the style values
which might be something I dont want to consider right now.
3. Using POST - does not work out of the box since OpenLayers does not
support this out of the box.
So my question is is there any other alternative way of handling this issue?
I have an architectural issue and not sure how to proceed, any suggestions
will be helpful.
I have a geoserver rending static layers for my web app client that uses
OpenLayers. Each layer has a table associated with it. I define user defined
styles for each layer for Line color, fill color in a different table based
on the user who logs in.
I am basically trying to implement dynamic styling for the geoserver layer.
Here are some options I have tried and some reasons they did not work
1. Added the UserStyle as part of SLD_BODY - unfortunately GET request
limits for IE messed this plan
2. Generate a UserStyle as text/xml in an action and set the SLD = action -
unfortunately it looks like the SLD parameter need a physical SLD file, so I
might have to publish an SLD file everytime user changes the style values
which might be something I dont want to consider right now.
I could be wrong, but I thought that the remote SLD could be a dynamic script, as long as the appropriate content type headers are set in the response. Others will correct me if I am wrong. What happens when you try to use the script? Do you see any exceptions in the geoserver log? The remote URL also must be visible from the server, not from the client.
3. Using POST - does not work out of the box since OpenLayers does not
support this out of the box.
So my question is is there any other alternative way of handling this issue?
Thanks & Regards
Ajay Ravichandran
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
Well I have a URL with an action within which the response header is set to
"text/xml" and I use PrintWriter to write the StyledLayerDescriptor string
to the response.
But for some reason I get a "SAXParseException: white spaces are required
between systemId and publicId ".
If I take the same XML string write it to an sld file placed on the server
and add the URL to the sld file to the GetMap request's SLD argument, it
works beautifully.
So you see, it works if the StyledLayerDescriptor tag is in an sld file and
the SLD parameter of the geoserver's Getmap request points to an sld file,
but doesnt work if I am writing the StyledLayerDescriptor contents directly
to the response
Any ideas??
Thanks
Ajay
Justin Deoliveira-6 wrote:
Hi Ajay,
ajayr wrote:
Hey All
I have an architectural issue and not sure how to proceed, any
suggestions
will be helpful.
I have a geoserver rending static layers for my web app client that uses
OpenLayers. Each layer has a table associated with it. I define user
defined
styles for each layer for Line color, fill color in a different table
based
on the user who logs in.
I am basically trying to implement dynamic styling for the geoserver
layer.
Here are some options I have tried and some reasons they did not work
1. Added the UserStyle as part of SLD_BODY - unfortunately GET request
limits for IE messed this plan
2. Generate a UserStyle as text/xml in an action and set the SLD = action
-
unfortunately it looks like the SLD parameter need a physical SLD file,
so I
might have to publish an SLD file everytime user changes the style values
which might be something I dont want to consider right now.
I could be wrong, but I thought that the remote SLD could be a dynamic
script, as long as the appropriate content type headers are set in the
response. Others will correct me if I am wrong. What happens when you
try to use the script? Do you see any exceptions in the geoserver log?
The remote URL also must be visible from the server, not from the client.
3. Using POST - does not work out of the box since OpenLayers does not
support this out of the box.
So my question is is there any other alternative way of handling this
issue?
Thanks & Regards
Ajay Ravichandran
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference:
$250.
Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users
Well I have a URL with an action within which the response header is set to
"text/xml" and I use PrintWriter to write the StyledLayerDescriptor string
to the response.
But for some reason I get a "SAXParseException: white spaces are required
between systemId and publicId ".
It would seem the SLD you're generating has an error in the very first
lines of it (header). Can you attach a sample?
If I take the same XML string write it to an sld file placed on the server
and add the URL to the sld file to the GetMap request's SLD argument, it
works beautifully.
Maybe storing on the file system changes the content encoding of the file? Not sure. Is your sld generator publicly available so that we can hit it directly?
So you see, it works if the StyledLayerDescriptor tag is in an sld file and
the SLD parameter of the geoserver's Getmap request points to an sld file,
but doesnt work if I am writing the StyledLayerDescriptor contents directly
to the response
Directly to the response... if you want to use dynamic styles your GetMap request should look something like:
Well I have a URL with an action within which the response header is set
to
"text/xml" and I use PrintWriter to write the StyledLayerDescriptor
string
to the response.
But for some reason I get a "SAXParseException: white spaces are required
between systemId and publicId ".
It would seem the SLD you're generating has an error in the very first
lines of it (header). Can you attach a sample?
If I take the same XML string write it to an sld file placed on the
server
and add the URL to the sld file to the GetMap request's SLD argument, it
works beautifully.
Maybe storing on the file system changes the content encoding of the
file? Not sure. Is your sld generator publicly available so that we can
hit it directly?
So you see, it works if the StyledLayerDescriptor tag is in an sld file
and
the SLD parameter of the geoserver's Getmap request points to an sld
file,
but doesnt work if I am writing the StyledLayerDescriptor contents
directly
to the response
Directly to the response... if you want to use dynamic styles your
GetMap request should look something like:
Where http://host/generator is your dynamic sld generator (a servlet, a
php script).
Cheers
Andrea
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference:
$250.
Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users