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:

2 comments:

Sankar said...

The explanation of HTTP requests, XML payloads, and web service communication provides valuable insight into backend application integration and API-driven development. Exploring Web Development Projects helps students build practical knowledge of web services, RESTful communication, and enterprise application development using modern web technologies.

Sankar said...

Learning how web services integrate with mapping platforms like GeoServer also strengthens the foundation for building scalable web applications. Exploring NextJS Projects enables developers to create modern frontend applications that efficiently consume APIs, visualize geospatial data, and deliver interactive user experiences.