Pages

Wednesday, 30 October 2013

GeoServer GetMap with HTTP POST

Straight up "how2map" post today - after noticing that the GeoServer Demo Requests (and User Guide) do not include a GetMap Request document.

HTTP GET

Here is the HTTP GET example from the Demo Requests page:

http://localhost:8080/geoserver/wms?
  bbox=-130,24,-66,50&
  styles=population&
  Format=image/png&
  request=GetMap&
  layers=topp:states&
  width=550&height=250&
  srs=EPSG:4326

HTTP POST

Here is the example translated into HTTP Post:

http://localhost:8080/geoserver/ows

<?xml version="1.0" encoding="UTF-8"?>
<ogc:GetMap xmlns:ogc="http://www.opengis.net/ows"
            xmlns:gml="http://www.opengis.net/gml"
            version="1.1.1" service="WMS">
   <StyledLayerDescriptor version="1.0.0">
      <NamedLayer>
        <Name>topp:states</Name>
        <NamedStyle><Name>population</Name></NamedStyle> 
      </NamedLayer> 
   </StyledLayerDescriptor>
   <BoundingBox srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
      <gml:coord><gml:X>-130</gml:X><gml:Y>24</gml:Y></gml:coord>
      <gml:coord><gml:X>-55</gml:X><gml:Y>50</gml:Y></gml:coord>
   </BoundingBox>
   <Output>
      <Format>image/png</Format>
      <Size><Width>550</Width><Height>250</Height></Size>
   </Output>
</ogc:GetMap>

I will commit the above example so subsequent releases provide a good starting point. Thanks to Mike Pumphrey for helping me sort out a working example.

Documentation harmed in the making of this post:


References:

Post a Comment