3

When making a GetCapabilities request from ArcGis Desktop, how does it get the information needed for making the GetMap request and how is the GetMap request handled by their "sample server"?

For example (taken from their own resource center http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005300000046000000):

If I use their own sample server and make the following GetCapabilities request: http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer?version=1.3.0&request=GetCapabilities&service=WMS

But how does it get the information needed for making the following GetMap request?: http:/sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer?version=1.3.0&request=GetMap&CRS=CRS:84&bbox=-178.217598,18.924782,-66.969271,71.406235&width=760&height=360&layers=0&styles=default&format=image/png

Is it only taken from the GetCapabilities response XML or am I missing something here? It's difficult for me to understand how ArcGis Desktop creates the GetMap request and receives the images when I'm only inputting the GetCapabilities request. Is there some documentation I'm missing somewhere? And is there some kind of guideline as to how their "sample server" might be handling the incoming requests?

2

GetMap URL is automatically built using the response of GetCapabilities.

Here you see, where do GetMap parameteres come from in the GetCapabilities Xml Document:

  • CRS=CRS:84 => This is the coordinate system of all layers. Just try to search the xml file for CRS:84.
  • bbox=-178.217598,18.924782,-66.969271,71.406235 => Search for EX_GeographicBoundingBox in xml and you will see the bounding box of all layers and bounding box of each layer separately.
  • width=760&height=360 = > just search for MaxWidth or MaxHeight and you will see two numbers. You can specify any number less than or equal to these numbers
  • layers=0 => Look for the tags Layer. In your sample GetCapabilities xml, there a group layer at top, with 3 layers underneath that layer. You can query each layer with their numbers. valid values are 0,1,2
  • styles=default => look for style in the GetCapabilities xml

  • format=image/png => look for format in the GetCapabilities xml

All WMS (web mapping service) services support GetMap request by default, if you haven't disabled it, you can use the same server url but with different request parameter. Pay attention to your both URLs. They are exactly the same until the request part:

http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer?version=1.3.0

From here you can set the request parameter to either GetCapabilities or GetMap. For example:

http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer?version=1.3.0&request=GetMap

  • 1
    Thank you for your response. Are you also able to explain to me how the client finds out which server to send the GetMap request for? If we take the sample server XML as an example again, how does the client know where to send the GetMap request? This might sound strange, but I ask because I have my own server, which I've loaded the GetCapabilities XML into, and I can see the GetCapabilities request ArcGIS makes, so I also assumed that it would send the GetMap request for the same server, but it doesn't. What I'm wondering is where it gets the server from, that it has send GetMap to. – Left4Cookies Mar 2 '15 at 17:18
  • see the updated answer. – Farid Cheraghi Mar 2 '15 at 17:40
  • Please consider marking the answer as accepted, it you think this is your answer. For details, check GIS SE Tour. – Farid Cheraghi Mar 2 '15 at 18:31
  • Thanks your answer is definitely 'accepted'. If I'm running a server locally which is able to load and respond with an XML like sampleserver I could make ArcGIS request something like: localhost/wms?request=getcapabilities and then my server responds with the XML. Now, ArcGIS makes a GetMap request with the parameters of the GetCapabilities but instead of simply requesting localhost/wms?request=getmap, it changes it to sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/… Can you explain how? – Left4Cookies Mar 2 '15 at 19:02
  • 1
    GetMap request has some required parameters. If you click this link with no parameter of GetMap, server will complain about the neccessary params like style,format, srs,bbox,width,height. all of which I descibed in my answer. To fill these parameters ArcGIS, first issues a GetCapabilities request and then parses the response XML and look for those parameters to fill in GetMap request. All of these are done programmatically. – Farid Cheraghi Mar 2 '15 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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