Wednesday, June 25, 2014

GIS 5265 Module 6: Digitizing and Editing Large Datasets





Module 6, spread out over two weeks, was quite a challenging and time-consuming task.  As in the previous module, we began by georeferencing a map image to an ArcMap basemap.  In this case, the image as a topographic map with a survey grid of the Oaxaca Valley, Mexico.  This was a frustratingly difficult task, as common points of reference between the image and basemap were difficult to locate.  By finding a couple of possible control points and updating the image's position as I went along, I was able to get a reasonably well-positioned image.  I then digitized by assigned three grid squares (first image above) and georeferenced the corresponding collection and land type maps to them.

The next task was to create new shapefiles for the collection units and land type.  While the land type shapefile was easy to complete (especially since I only have Type III land in my squares), digitizing the collection units was more tedious.  Square N9E8 in particular took some time to digitize properly.  The task was made more difficult by the presence of multiple units with separate components and the asymmetrical overlapping of units from difference periods.  As an example, in the northern portion of square N9E8 there is unit V-58, composed of four separate sections.  I thus created a multipart polygon to represent the unit as a single feature.  However, the westernmost circular component of V-58 also represents unit IIIA-47.  Therefore, I needed to create a new feature exactly corresponding to this component of V-58 (using the 'trace' editing tool) to represent unit IIIA-47.  I also had to interpret the labeling scheme for the dense cluster of units in the center of square N9E8.

Labeling the collection units of N9E8 was also problematic.  The complex combination of different time periods for the same components or portions of components effectively ruled out a color symbology.  Replicating the original labeling scheme was a possibility, but I decided to attempt a simpler scheme of indicator lines and arrows when necessary.  I used Illustrator to create the lines and arrows as well as to fine-tune label placement.

The map below represents an extra task graduate student completed.  We were given an Excel table with data on sites in the Oaxaca Valley.  By using the grid square column, we could isolate the sites located in our squares.  We were also to only use the sites dating to the IIIB Period.  I created a new table containing only the sites dating to the IIIB Period that were in my grids; this resulted in only two sites.  I then joined the table to my collection units layer in ArcMap based on unit name.  My initial join failed due to column names that were incompatible with ArcMap (mostly the presence of periods).  After editing the column names accordingly, the join went smoothly.  I then symbolized the two sites based on the conservative population estimate.  Unfortunately, having only two sites makes the map a bit uninteresting.  It also doesn't allow me to say much in way of interpretation.  Both the sites are relatively small and are located in the same land type (10% arable, not symbolized here).



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.