Assignment: Accessing Data on the Internet
1. Extracting Data from an XML File
In ArcGIS, create a metadata file for a shapefile or use an existing file (the existing one may be more challenging because of it's size). Write a script that finds the Title and one of the date tags in the metadata and writes them to an HTML file. The HTML file can have a simple format like the following:
<html> <body> Title: [Your title goes here] [Two other tags] </body> </html>
Create your own "DateUtil" module (i.e. a file called "DateUtil.py") that includes a function to convert ESRI's date format to something more readable. Make sure you can run the script and then open the file in an HTML browser such as FileFox or Safari.
Turn-in:
- The metadata file (XML file)
- The DateUtil module (Python file)
- The Python script that reads the metadata file and writes the HTML file (Python file)
2. Extracting GIS Data from a Web Service
Write a Python script that downloads data from a web service. This can be any GIS web service and the data extracted can be points or rasters (we have not yet covered how to work with polylines and polygons in web services). You'll need to download at least 4 data elements (points or rasters) and save them to a file so they can be loaded into a GIS application. The application can be ArcGIS (TIFF, JPG, etc.) or GoogleEarth (KML).
Turn-in:
- A Python script that requests data from a web service and writes it to a file or files, either points or rasters.
- Extra credit: Turn in two scripts instead of one where one script writes a series of rasters from a web service and the other writes points to a KML file.