I’d like to use an xmlhttprequest to generate an image on the server, return the url of the image to update the UI and then after requesting the image remove it from the server. Is anyone else following a similar process that would care to explain the details of how they do it?
Jeff Faulkner ha scritto:
I'd like to use an xmlhttprequest to generate an image on the server, return the url of the image to update the UI and then after requesting the image remove it from the server. Is anyone else following a similar process that would care to explain the details of how they do it?
We do not support this out of the box, yet, may I ask what the use
case is? GetMap is GET request that allows you do directly ask for
an image. Usually the trouble is about needing to generate a map
with a long SLD that cannot fit the GET limits... unfortunately we still
not provide a solution for that.
There was some discussion here:
http://www.nabble.com/a-question-about-Ajax%2Bgeoserver-tf2474180.html#a6929394
Yet, I guess we would better store the set of parameters for generating the image, instead of the image itself, and clear them after a certain timeout, or first time the image is actually requested. This way we could still generate the image on the fly, and we would avoid hitting the file system (that is, it would be a little less error prone and faster, thought... it may have issues with a round robin load balanced cluster...).
But I digress... what was your specific use case?
Cheers
Andrea
Thanks for the link to the other post. I want to accomplish about the same.
The UI allows multiple filtering criteria to be specified which is sent to the server as an ajax request. On the server a sld is generated and a post request sent to the geoserver app. The map image is generated and returned in the response, the image is stored on the server and the url for the image is returned to the UI which is then updated. I want to remove the image some time after the request is made so the images don’t continually build up on the server.
Overall is this a reasonable process?
The sld has the possibility to get large enough that I don’t want to use a GET request and put it in the url and would like to put it in the body of a POST request. I could generate the sld on the client but would rather do so on the server. I guess either way I would still need a way to periodically remove the old images from the server. I’m wondering if others are doing this?
As a side question does anyone know how Mapbuilder and openlayers update the UI with the image? I plan on digging into these tools also.
Thanks
On 4/2/07, Andrea Aime <aaime@anonymised.com> wrote:
Jeff Faulkner ha scritto:
I’d like to use an xmlhttprequest to generate an image on the server,
return the url of the image to update the UI and then after requesting
the image remove it from the server. Is anyone else following a similar
process that would care to explain the details of how they do it?We do not support this out of the box, yet, may I ask what the use
case is? GetMap is GET request that allows you do directly ask for
an image. Usually the trouble is about needing to generate a map
with a long SLD that cannot fit the GET limits… unfortunately we still
not provide a solution for that.There was some discussion here:
http://www.nabble.com/a-question-about-Ajax%2Bgeoserver-tf2474180.html#a6929394Yet, I guess we would better store the set of parameters for generating
the image, instead of the image itself, and clear them after a certain
timeout, or first time the image is actually requested. This way we
could still generate the image on the fly, and we would avoid hitting
the file system (that is, it would be a little less error prone and
faster, thought… it may have issues with a round robin load balanced
cluster…).But I digress… what was your specific use case?
Cheers
Andrea
Jeff Faulkner ha scritto:
Thanks for the link to the other post. I want to accomplish about the same.
The UI allows multiple filtering criteria to be specified which is sent to the server as an ajax request. On the server a sld is generated and a post request sent to the geoserver app. The map image is generated and returned in the response, the image is stored on the server and the url for the image is returned to the UI which is then updated. I want to remove the image some time after the request is made so the images don't continually build up on the server.
Overall is this a reasonable process?
Seems ok for a custom app, but I'm not sure you can get away with
that process using MapBuilder or OpenLayers for the navigation.
It would be easier to deal with this kind of requests if Geoserver accepted putStyles requests, eventually with a timeout for styles,
so that you could store styles only temporarily (an expire timeout
to be accounted from last request using the style, just like a cache),
and have geoserver return a style id that you can use in GetMap requests. This way you just would have to update the layer definition
in the client you chose, and the WMS protocol would not be broken.
Anyways, this requires a patch and some discussion on the devel
list on how to do this, and with which priority. (for sure it won't
hit 1.5.0, but it may be something to be included in 1.5.1).
If we're playing just with filters, you could leverage the new GetMap
filter parameters, CQL being a lot more compact than OGC filters, but
with the limitation that you cannot write fid filters...
and you may just accumulate enough filters to make it go beyond a GET size. Anyways, I suggest to have a look at it:
http://docs.codehaus.org/display/GEOSDOC/WMS+vendor+parameters
The sld has the possibility to get large enough that I don't want to use a GET request and put it in the url and would like to put it in the body of a POST request. I could generate the sld on the client but would rather do so on the server. I guess either way I would still need a way to periodically remove the old images from the server. I'm wondering if others are doing this?
I think other people did that using a custom server side app, but
they were not using OpenLayer or MapBuilder
As a side question does anyone know how Mapbuilder and openlayers update the UI with the image? I plan on digging into these tools also.
This you have to ask on the mapbuilder and openlayer user mailing lists.
Cheers
Andrea