Geog 518 - Internet Mapping and GIS

EXERCISE - RETRIEVING ATTRIBUTE AND GEOMETRIC INFORMATION WITH XML

Copy the Ex06 folder from n:\int_gis_map\labs into your c:\arcims\website folder.  From the previous lab, delete the NorthAmerica service and recreate it as a Feature Service rather than an Image Service.

 Open the sendArcXML application in a browser (http://localhost/website/Ex06.).  Also open the

Check the Query box; it must always be checked on for this exercise.

Click Get Features.

This is the XML for a query minus the layer id and the actual query

<?xml version="1.0" encoding="UTF-8" ?>
<ARCXML version="1.1">
<REQUEST>
<GET_FEATURES outputmode="xml" geometry="false" envelope="true" >
<LAYER id="" />
<SPATIALQUERY subfields="#ALL#" where="" />
</GET_FEATURES>
</REQUEST>
</ARCXML>

The layer id goes in line 5 and the query string after the "where" in line 6.  The layer is Cities and the field to query is NAME. Edit the XML to retrieve the population for Sacramento.  Click on the Send Request button when you have completed the XML.  Use SPATIALQUERY entry in the ArcXML Programmer's Reference if you are having some trouble.

What is the population of Sacramento? __________________________

How would you modify the request to obtain only this information? ____________________________________

Now we are going to combine an attribute query with a spatial query by using an envelope on the spatial query.  Modify the request you used before to return only the number of cities with a population greater than 2,000,000.  Hint:  check the attributes of the GET_FEATURES element and look for the one that will return only the count and not the information about the selected features.

How may cities are there that meet this criterion? _____________

A child element of <SPATIALQUERY> is <SPATIALFILTER>.  Look up that element, correctly specify the relation attribute. Now add an ENVELOPE element to the SPATIALFILTER element with the following attributes:

minx = 85.67
miny = -27.75
maxx = 151.12
maxy = 20.55

Make sure you close all tags.

How many cities meet the criteria now?  (Population > 2,000,000 and inside the provided envelope?) ______

Now you are going to select all the cities in the world with a population < 10,000,000 but your  request  will limit the number of features that can be returned to six.  Edit the request to remove the SPATIALFILTER and ENVELOPE elements. We are searching the entire world, not just Southeast Asia.    You will need to add attributes to the GET_FEATURES request  - check the beginrecord and featurelimit attributes.

How many cities did the request return? ____________

What are the names of these cities? ______________________________

Are there more features to select? _______

How do you know?________________________-

There should be more features to select.  Edit the request to select the missing features.  Hint: you will need to edit the beginrecord attribute.

How many features did the request return? _____

What are the names of the cities? ____________

Are there any more to return?______

How do you know? _____

Now you are going to retrieve the geometry information for selected features.

Use a GET_FEATURES request to retrieve the geometry information for the country of Denmark from the Countries layer in the World service (you will have to delete this service and recreate it as a Feature Service first)

What type of feature is it? ___________________

Use a GET_FEATURES request to find the cities in Southeast Asia (in the NorthAmerica service)  with a population greater than 2,000,000.  You made this request earlier.  Edit the request to return the geometry in compact XML format.  Hint:  use the geometry and compact attrbibutes, remove the skipfeatures attribute, and include the SHAPE file in the subfields attribute.  Click Send Request.

What type of geometric shape is returned? _____________

If you are requesting attribute data, which fields should you include in the subfields attribute? ____________