Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Does anybody know if I can retrieve by REST service in GeoServer an raster representation of layer?
Just like in for ex. ArcGIS REST Api:
When I send:

MapServer/export?dpi=96&transparent=true&format=png8&bbox=338477.336%2C360036.34849999996%2C619993.648%2C548154.8615&bboxSR=2180&imageSR=2180&size=1064%2C711&f=image

In response, I get png image of layer in defined bbox.

share|improve this question
2  
I think you need ArcServer for that to work - GeoServer's REST is for configuration changes. –  iant Jul 17 '13 at 13:50
    
yes I agree I get same response from Geoserver-mailing list. –  Krystian Jul 17 '13 at 13:53
add comment

3 Answers 3

What @Iant said. As the GeoServer RESTful interface docs says:

GeoServer provides a RESTful interface through which clients can retrieve information about an instance and make configuration changes. Using the REST interface’s simple HTTP calls, clients can configure GeoServer without needing to use the Web Administration Interface.

So unfortunately, you can't really use it to get representations of a layer. However, you can use GeoServer's web map service for that. What you can do is issue a GetMap request like so:

http://yourdomain.com/geoserver/wms?
&service=WMS&version=1.1.1
&request=GetMap
&layers=jantrik:Storm_Mains
&styles=&format=image/png
&TRANSPARENT=TRUE
&srs=EPSG:2000
&bbox=11879566.92588,7000626.9713143,11880134.841974,7001041.8162735
&width=512
&height=374

I hope that helps. Good luck!

share|improve this answer
add comment

you have to go through geoserver's wms service:

    http://GEOSERVERBASE/geoserver/wms?
    service=WMS&
    version=1.1.1&
    request=GetMap&
    layers=jantrik:Storm_Mains&
    styles=&format=image/png&
    TRANSPARENT=TRUE&
    srs=EPSG:2000&
    bbox=11879566.92588,7000626.9713143,11880134.841974,7001041.8162735&
    width=512&
    height=374

You can change the parameters like two layers altogether, bbox, style or others:

layers=jantrik:Storm_Mains,jantrik:Storm_Nodes,.....

In multiple layers you have to keep in mind that all layers should be in same bbox.

If you don't want to set all the parameters, you can send a request like this:

http://localhost:8888/geoserver/wms/reflect?layers=jantrik:Storm_Mains

In this request all parameters will be set as default values. You can give a look at Geoserver rest api documentation.

share|improve this answer
add comment

I guess that you've been mislead by naming here.

REST is mostly thought of as a way to interact with resources over HTTP, by using HTTP verbs (GET, PUT, POST, DELETE).

The WMS-standard is described as RESTful (but if it's actually RESTful is another question).

Thus, your question can be interpreted as "is it possible to get a map image from Geoserver using REST?" In that case the answer is a loud YES: Using the WMS standard as described by R.K.

But, then, as our friends in ESRI decided to create their own "standard", the "ArcGIS REST API", which I think of as a "kind-of-wms" and then the confusion sets in.

Because, as you've apparently found out, GeoServer also has a REST api (in addition to the "WMS api"). But this Geoserver-specific API operates on Geoserver itself (not the Web Map Service it offers). So, using the "Geoserver REST API" it's not possible to get a map image, but that was never the intention eiter, as Geoserver serves map images using WMS.

Hope this clears things up!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.