Thursday, June 19, 2014
GIS 5103 Module 5: Geoprocessing with Python
The whole point of this course is to learn how to use Python to geoprocess data using the tools of ArcGIS. With module 5 we are now getting familiar enough with the syntax of Python to use it to accomplish geoprocessing tasks. These tasks may be simple, but they will be the building blocks for more complex tasks in future modules.
Our assignment for the week was simple yet required some thought and planning to complete correctly. Our script was required to add XY coordinates to a layer, create a 1000 meter buffer around the features of that layer, then create a new buffer layer dissolved into a single feature. The standalone script also needed to print the messages of the tools in the Interactive Window (see screenshot above). To run more than once, we also needed to include code to allow the overwriting of previous data.
To add XY coordinates to the hospitals layer, I consulted ArcGIS help on the proper syntax for the AddXY_management tool. As described in the help file, I also used the Copy_management tool to first create a new copy of the hospitals shapefile to which was then appended XY coordinates with the AddXY tool. I also used this tool to experiment with creating variables for the input parameters as described in the exercise.
The rest of the script was relatively simple to write. The only issue I ran into was the failure of the script to overwrite previous data. After some time fiddling with the script, I realized ArcMap was open in the background. Closing ArcMap allowed the script to run and overwrite without error.
Friday, June 6, 2014
GIS 5103 Module 4: Python Fundamentals Part II
Module 4 continued our journey into the basic syntax of Python script. The assignment this week was a little more complicated than last week. This time we were given a piece of code composed of a for loop and an if-elif-else conditional that took the form of a dice game. This code, however, contained two errors. We had to debug the script by finding and correcting the errors. Once the script ran without error, we then had to add new script that accomplished a couple of tasks. First, the script needed to use a while loop to add 20 numbers to a list and then print that list. The numbers had to be random and between 0 and 10. The next, multi-step task was to remove a chosen number from the list and print a message detailing the number of times that number was removed. This I accomplished using the count method (to find how many times the chosen number occurred in the list), an if-elif-else conditional (to determine which message to print) and a while loop (to remove each instance of that number). The final task for the script was to print the updated list.
This was a challenging but very enjoyable assignment. At one point (at least), I was confused on how to proceed. Rather than dig through the text, I searched for relevant Python forums and tutorials for guidance. As we have already learned, there appears to be a large community of helpful Python coders that have provided much useful information online.
GIS 5265 Module 5: Georeferencing Historic Maps
This week's assignment continued our investigation and incorporation of historic data into GIS, but this time the data are maps. We began by exploring the David Rumsey map collection (http://www.davidrumsey.com) and downloading a historic map of Macao based on surveys conducted by Cook and Bligh in the late 18th century. We then georeferenced this historic map based on imagery and topographic baselayers downloaded from ESRI. This was done by connecting control points from the historic map to corresponding locations on the baselayers. This was difficult for a couple of reasons. First, the historic map is of an unknown projection and clearly has errors. Second, the modern geography of Macao has changed much as a result of urbanization and land reclamation. It is thus difficult to know where best to place control points.
After placing thirteen control points and switching the transformation from first order polynomial to spline, I began to see a closer correspondence between the historic map and the modern baselayers. I was tempted to place more control points in the western portion of the historic map after seeing how the spline transformation altered it, but I believe Macao itself, the area of primary interest, is reasonably well-aligned.
This was an enjoyable exercise that made me more comfortable with georeferencing. I look forward to using these skills in the future.
Tuesday, June 3, 2014
GIS 5103 Module 3: Python Fundamentals Part 1
The screenshot above might not seem that impressive, yet it is the output of our Module 3 assignment for GIS Programming. I am happy to get to this module, as it begins to introduce the building blocks of Python scripting. The previous two modules saw us using scripts with syntax we did not understand. Now, however, we are learning the details of Python scripting. The structure of the module, providing examples in the exercise then requiring us to write a script with very little instruction in the assignment, works well to force us to think of the logic of the syntax and how to structure our script.
The assignment required us to write a script that created a string of our name, then to perform various actions on that string. We had to split our full name into a list, then print our last name using indexing, then create a variable for the length of our last name, then multiply that value by three, and finally to print that value. The only output of the script should be our last name and the final value. It was a fun assignment that forced us to pay attention to the details of our syntax to avoid errors. I look forward to learning more Python basics in module 4.
GIS 5265 Module 4: Historic Records and Documents
Module 4 of GIS Applications in Archaeology introduced us to searching for and incorporating historic documents in ArcMap for research and layout design. Of course, this includes historic maps and aerial imagery, but it also includes other types of data (such as the census document in the map above). One source we explored was Ancestry.com, from which the image of the 1790 census was acquired. While searching for Paul Revere and acquiring the census were the only requirements for using Ancestry.com, I have begun a sample family tree using the site and am amazed at the wealth of data available. I may not continue with a paid subscription at this time, but I will keep it in mind for the future.
The lab assignment also explored the use of the Swipe, Hyperlink, and HTML pop-up tools. The Swipe tool in particular is useful for comparing maps of the same area from different times, as we did here with our Boston maps. The Hyperlink tool is used to link documents (such as the census and portrait images above) to features in a map. The HTML pop-up tool can be used to display attribute data for features as well as link to a website in a pop-up window. Unfortunately, I experienced some issues with this tool. Although the browser pop-up window did appear when I used the tool, the target of the link (a Google Map Streetview of the Revere House) never loaded. Instead, I was consistently given a script error warning and a pop-up window of a Google Search for the Revere House. The provided link worked correctly when input in a browser, so I imagine there is a setting in my ArcMap somewhere that is preventing the link from working properly.
To finalize the above map, I exported it from ArcMap into Adobe Illustrator for fine-tuning. I was skeptical at first in last semester's Cartography class that I would use Illustrator much, but I have been converted on its superior image editing capability. In particular, the drop-shadows created in Illustrator look much better than those created in ArcMap.
This was a fun lab that expanded our idea of historic data beyond maps and aerial imagery.
Wednesday, May 28, 2014
GIS 5103 Participation Assignment 1: GIS, Archaeology, and Human Movement Modeling
The article I read as an example of GIS used in the real
world was “Multiple pathways across past landscapes: circuit theory as a
complementary geospatial method to least cost path for modeling past movement”
by Meghan C. L. Howey (Journal of Archaeological Science, 38 (2011),
2523-2535). Howey uses the topic of
population movement among the peoples of northern Michigan between 1200 and
1600 AD to test least cost path modeling and circuit modeling of this
movement. Specifically, she looks at the
movement to and from the Missaukee Earthworks site, an important trade and
ritual center. Howey’s circuit model is
run by an ArcGIS tool called Circuitscape.
The simplest version of least cost path modeling would
consider only distance and topography, which, according to Howey, some
researchers still do. However, Howey
also included water routes and land cover in her original least cost path
analysis. The output of a least cost
path model is a single route that, based on the input parameters, represents
the route of least resistance between two points. A circuit model, on the other hand, considers
the presence of multiple routes between two points in its analysis of the
relative ease or difficulty of travel.
In other words, if site A and site B have a single route of medium
resistance connecting them while site A and site C have five possible
connecting routes of the same resistance, travel between sites A and C will be
rated as easier than travel between sites A and B. While distance is a factor, this may hold
true even if site C is significantly further away than site B.
The article’s tables and figures show an interesting
comparison between the results of the two modelling strategies, but Howey
concludes by emphasizing each tool has its strengths and weaknesses. Circuit modelling is clearly useful in
considering a larger portion of the landscape as potential routes of travel;
humans are not perfect optimizers of their energies and surroundings, after
all. However, circuit modelling can
overlook cases in which a single route is overwhelmingly preferred (such as
water routes). In the latter case, least
cost path modelling would provide a more useful picture.
The article may be a bit dry, I suppose, but I followed the
suggestion to explore UWF’s library databases and went with a topic aligning
with the archaeology track. The article
can be accessed at: http://dx.doi.org.ezproxy.lib.uwf.edu/10.1016/j.jas.2011.03.024.
GIS 5265 Module 3: Ethics in Archaeological GIS
This week's assignment aimed to place GIS data and research within a discussion of ethics in archaeological research. How do we conduct research that includes (or is primarily) spatial data when site location is a sensitive issue? The assignment began with an exploration of the Middle Eastern Geodatabase for Antiquities (MEGA, http://www.megajordan.org/Map), an online geodatabase of archaeological sites in Jordan. With different levels of access depending on user category, the project aims to facilitate academic research as well as provide information for conservationists and the public to aid in protecting the sites.
The actual lab portion of this week's assignment was largely a review of how to create and use a geodatabase in ArcMap, but it added a discussion of the security benefits of geodatabases over isolated shapefiles in multiple folders. By collecting all data files in a single database, one has more control over who has access to the data therein. It is much more difficult to control and protect data spread over multiple locations.
This module also explored methods of creating new point feature classes in our geodatabase. In the map above, Petra was added as its own layer by directly entering its latitude and longitude coordinates in an ArcMap edit session. The other sites were imported from an Excel spreadsheet containing each site's name, description, and coordinates. In completing the above map, my main creative contribution was converting all site labels to annotations stored in the map (after setting the font and halo) for better placement. I also created a definition query to remove the Petra location that was included in the Excel spreadsheet.
The ethics of sharing archaeological data is a big topic without clear answers. On the one hand, we would like to educate the public as much as possible, hoping that through education we can minimize the desire to engage in activities that will damage sites. Unfortunately, there will likely always be a small number of people willing to irreparably damage sites for potential financial gain (or simply to damage sites through inconsiderate land use). That is why I think the route taken by the State Historic Preservation Offices (at least the ones I am familiar with) in restricting access to detailed location data is prudent.
Subscribe to:
Posts (Atom)






