jamal
jamal

Reputation: 229

Some time geoserver return wms file instead of image

I have setup a geoserver with openlayers, and I found some errors getting some tiles from wms in geoserver; for some tiles I get response as application/octet-stream (and the browser show a save dialog) instead of png image specified in getmap parameters. Here is image captured for more details.

Thanks lot for your help

enter image description here

Upvotes: 0

Views: 546

Answers (1)

iblasi
iblasi

Reputation: 1307

Maybe I am half-year late, but maybe could help with my answer.

Usually, when you make a request to Geoserver, as @simogeo said, you have to define some parameters which usually geoserver requests as minimum parameters. These parameters could be: service, version, srs, request, layers, boundingbox, width, height and/or format.

So the URL request is something like the following one (<> tags depend on each one):

http://<IPaddress>/geoserver/<workspace>/wms?service=WMS&version=1.1.0&request=GetMap&layers=<workspace>:<layername>&styles=&bbox=23.975,68.018,24.126,68.074&width=512&height=512&srs=CRS:84&format=image%2Fjpeg

In your case, looking for what you said, it seems that format parameter by default is octet-stream. If you change that parameter to other format such as the one in my example (image JPEG) you will receive a JPEG image back from the server. If still there are errors, as @simogeo said, your server is returning errors (which will show them in a XML) and you will need to define better your request!

Hope not to be enough late my answer ;)

Upvotes: 1

Related Questions