Wednesday, August 23, 2017

Using Microsoft Access to Track Tasks

Earlier this year I experienced an increase in workload, as I took on a more central roll in developing GIS solutions and project support within my company.

To deal with the increasing number of requests for GIS support I was receiving, I wanted to set up a GIS Task Tracker database/spreadsheet that I could use to easily input and track requests.  In addition, I would have a number of other GIS staff assisting with the project, so I felt task management would need to take center stage if the project was going to continue running smoothly.

I began with a template in Excel, but it quickly became clear that this approach wouldn't work....our spreadsheet became riddled with errors and many staff were forgetting to enter tasks.  I decided to scrap my original Excel document and use an Access database, in part because of a number of benefits I saw:

     1.  Access could be easily linked to our Outlook accounts.
     2.  Tasks could be directly e-mailed to GIS staff through this Outlook connection.
     3.  A task form could be utilized, for easily entering accurate task information.
     4.  GIS staff could quickly and easily communicate with project staff with regard to time frames and workload issues.
     5.  Attachments could be added to each individual request.
     6.  Finally, Excel is ultimately a tool for small scale data analysis.  It became clear that Access was the right tool for this complex data management/storage task.....perfect for this exercise.

In my research, I was fortunate to find an (almost) perfect template developed by Microsoft here:

https://support.office.com/en-us/article/Use-the-Task-Management-Access-Database-template-50376839-8cc6-4d29-ac1b-b9fce69605f8


The original template wouldn't need much editing on my end, just a few extra fields and changes to the primary form used for adding new tasks:
View of the task tracker in Access


Adding tasks in the table view was simplified with the creation of an entry form:
View of the Entry Form


With the Task Tracker in place, my workload became much more manageable and allowed me to generate queries and reports detailing the influx of recent requests.  I would highly recommend this database template for anyone looking to manage GIS requests within a medium or even large GIS work group.

Friday, August 18, 2017

GIS Corps - Mapping Malakal, Nsanje District


Mapping of Malakal, Nsanje District (Partnered with Humanitarian OpenStreetMap Team)

From January 2014 - Novemeber 2014 I was involved with a project to remotely map areas of Malawi as a Volunteer Coordinator with the GIS Corps.  Below is a detailed description of this effort.

In September 2014, GIS Corps partnered with Severin Menard of the Humanitarian OpenStreetMap Team to begin mapping the Southern region of Malawi along the Lower Shire River.  The area along the Lower Shire (the Nsanje District) connects Lake Malawi and the Zambezi River in Mozambique and is prone to frequent flooding that can be devastating to local communities.

The national Department of Disaster Management Affairs in Malawi (DoDMA) and the Global Facility for Disaster Reduction and Recovery (GFDRR) agreed about the necessity to have detailed data of the region.  Through community mapping in the field, the collected data could be used to build hazard impact scenarios with tools like InaSafe to improve planning, preparedness and response activities.  Flood prone areas were identified through local experience and knowledge from DoDMA headquarters, DoDMA districts officers, village leaders, and local residents.


Since October 2014, GIS Corps volunteers have made significant progress toward mapping roads, buildings, footpaths, and waterways in an effort to add valuable spatial data to OpenStreetMap.  Areas of high priority were identified, and as of late January 2015 approximately 150 square miles have been mapped in these flood prone areas (see Figure 1, Figure 2, Figure 3).


The project used the iD and JOSM editors developed for OSM, and the Tasking Manager developed by HOT. GISCorps managed the project, provided online documentation of project methods, and created a Q&A document where volunteers could find answers to their questions. Skype, Google Chat, and Google Drive collaboration documents have been utilized for real-time communication between volunteers.


Recent Developments


In mid-January, devastating flooding in Southern Malawi and Mozambique left tens-of-thousands displaced from their homes, thus reaffirming this project’s importance and the necessity of GIS Corps’ involvement with the Humantarian OpenStreetMap Team(http://www.theguardian.com/global-development/2015/jan/14/malawi-flooding-torrential-rain-mozambique).  Heavy rains have damaged crops, washed away livestock, damaged infrastructure, and have left many stranded in low-lying areas.


GIS Corps volunteers have continued their hard work, mapping in designated “priority areas” where disaster planning efforts are most crucial.  The job aims primarily at adding building footprints and infrastructure data, which will serve to estimate the number of affected people for each settlement.  Since the mid-January flooding, Severin Menard (HOT Coordinator) has re-established areas of high priority and identified several other areas within Southern Malawi in which mapping efforts are needed.

Link to article on GIS Corps Website:
Link to related article:

Malawi_Capture.JPG
Figure 1 - Project Area, Nsanje District, Malawi

Figure 2 - HOT/OSM Project Overview Page, completed tiles
Figure 3 - Detailed view of mapping progress in OSM



Thursday, August 17, 2017

Exporting Maps to PDF with Python

Recently, I had the need for a python script that would export a series of maps to PDF.

I wanted to set up a task using Python and Task Scheduler, that would access a workspace location and export every .mxd at that location to PDF at a specific time during the evening.

I began with a script I found here:  http://support.esri.com/en/technical-article/000012420

I ended up with a slightly modified script, as shown below:

_________________________________________________________
#Import modules here
import arcpy, os

print ('Hello, finding workspace now...')

#Set workspace location here
arcpy.env.workspace = ws = r"C:\Test"

print ('Finding .mxd files now...')

#Create list of .mxd files within the workspace.
mxd_list = arcpy.ListFiles("*.mxd")

print ('Exporting to PDF now...')

for mxd in mxd_list:
   
    current_mxd = arcpy.mapping.MapDocument(os.path.join(ws, mxd))
    pdf_name = mxd[:-4] + ".pdf"
    arcpy.mapping.ExportToPDF(current_mxd, pdf_name)

print ('Complete, thank you for using Map Exporter!')
__________________________________________________________


Next, I needed to set the script to run at a specific time. 

To accomplish this, I started by opening Task Scheduler from the Windows Start Menu.

Next, I ran through the following steps:

1. Create a Basic Task
2. Start Daily
3. Run time 10 p.m., recurring daily
4. Action = Start a program
5. Select location of script


Now, I have a nice, tidy, fairly simple map exporter that will run every night at 10 p.m. 

Additional information on utilizing the Task Scheduler is here:    https://blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/




Wednesday, August 16, 2017

Using ModelBuilder to Streamline Editing in ArcMap

Recently I was tasked with creating section lines (from township dimensions and attributes contained in legal descriptions) for several counties in Minnesota.

Existing data was deemed insufficient for our project's purposes, so the lines would need to be manually created, on a case by case basis, in order to accurately plot data.

Maintaining the integrity of the section line feature class was very important, and would dictate the accuracy of other steps in the process.  Thus, creating section lines that were both accurate and topologically sound became my primary concern.  Creating sections without overshoots, dangles, or extraneous points was the primary goal here, and I wanted to ensure I streamlined the process to remove human error during the editing process.  The section lines themselves didn't need to be perfect, but we needed to be consistent in our approach.

The first step in the process involved close examination of aerial imagery, and unfortunately could not be modeled.  The mapper would need to carefully draw a centerline along a road, fence, or other visible use-line in order to establish the boundary of each section.  Next, the Copy Parallel tool was utilized to offset each line by 1320 feet.  The result of this manual operation is a grid, as depicted in the image below.


Image 1 - Section lines before running custom tool


As you can see, the grid contains a number of errors including line overshoots, dangles, and extraneous vertices.


The tool below, is aimed at correcting these issues without manual edits.


Image 2 - "Finalize Section Lines" tool developed in ModelBuilder




Image 3 - "Finalize Section Lines" tool


The end result of the model, should look something like the image below.  Nice, clean lines, with 2 vertices per edge.


Image 4 - End Result









Work in Progress - Disputed Areas Map

I started this project as a fun change of pace from my normal GIS day-to-day, and as a way of brushing up on my cartography skills. For me,...