Saturday, June 28, 2014

Manipulating Spatial Data (GIS Programming Module 6)

This assignment involved using the arcpy module in Python to access spatial datasets in order to find and manipulate the data within. The script whose output is shown below creates a new file geodatabase, populates it with shapefiles from an extant data directory and then creates a dictionary that holds population values using city names as keys, specifically cities that possess the 'County Seat' attribute from the FEATURE column in the attribute table for the 'cities' feature class.

script output 01

script output 2

Wednesday, June 25, 2014

Digitizing Archaeological Datasets

This project spanned two weeks and was rather intensive. Scans of survey grids from the Oaxaca Valley Settlement Survey Project were georeferenced and the spatial data from the surveys were digitized into attribute tables of shapefiles. The task of georeferencing was made difficult by the poor quality of the scan of the survey grid and also by difficulty in finding a suitable basemap of the Oaxaca Valley onto which to rectify the grid. Eventually a solution was found, though, and the grid was tied in. Afterwards, the separate grids for land cover and collection surveys were tied into the grid and then their data was digitized. Finally, each grid was laid out with land cover and survey results and a map was created, or three in the case of Grid N2E3, which had 3 grids of survey collection data due to the density of occupation.

Grid Locations

N2E3a

N2E3b

N2E3c

N2E4

Friday, June 20, 2014

Geoprocessing in Python

This week's script called up functions from the Python arcpy module for geoprocessing tools from ArcGIS. The scripting was straightforward. A point vector shapefile had had processed to add XY coordinates to features, then each feature was given a 1000 meter buffer, then the buffered features were dissolved to form a single feature.

From the completed process summary:

1. Added the import call and environment settings (workspace & overwrite = true)

2. Confirmed parameters and syntax for the three geoprocessing functions in the ArcMap python window

3. Created variables for shapefile inputs and outputs

4. Wrote up the calls for the three geoprocessing functions one at a time, printing the results via the GetMessages() function each time. Ran code after each function call was written.

5. Added comments as I went.

Geoprocessing messages were directed to stdout:

Thursday, June 12, 2014

Python Fundamentals II

This week's assignment involved debugging some code provided and then extending it with some directives designed to provide practice with using conditionals and loops. The first part of the output below (names listed as winning and losing) was provided with some bugs in the code to prevent it from running. These were found and fixed. The second part of the assignment involved generating a list of 20 random integers that ranged from 0 to 10, printing the result and then pruning a single integer from the generated list. The list was generated from a simple while loop (as per instructions) that appended a new random number to the list for each iteration. The break state for the loop was when a variable incremented each time reached the value of 20. Python's list functionality made manipulating the list quite easy and only took two lines of code to remove all instances of a particular integer.

Code output

Wednesday, June 11, 2014

Georeferencing 1785 Map of Macao

This week the assignment involved georeferencing (as best as possible) an historic map. While the map couldn't be georeferenced with utter precision, using a spline algorithm, it could be placed well enough to provide a recognizable regression from the current state of the area.

Macao, 1785

Friday, June 6, 2014

Python Fundamentals I

This week's assignment involved writing a simple script that assigned my full name to a string and then manipulated it in various ways. The output from the script was to be my last name and the number of letters in my last name, tripled. This was a basic introduction to various data types, data structures, functions and methods.

The screenshot below shows the script output from running the script four times, including two times with a different name assigned as the initial string.

Script Output

Wednesday, June 4, 2014

Dress Rehersal for Presenting Historic Maps

This week's assignment was simple. We were given a raster of an historic, late 19th Century topographical map of coastal Massachusetts that was already mosaicked and geo-referenced. From this, a basic map was created that showed the Boston area, located Paul Revere's home and presented Revere's portrait and a census record from his household recorded in 1790.

Paul Revere's Home