Introduction to GIS Programming Final Project Submitted by Todd Lenkin Geography 375 Spring of 2011 American River College.

Slides:



Advertisements
Similar presentations
Week 1: Introduction to GIS
Advertisements

Web-Based Planning Tools for Missouri Show-Me Ag Classic February 1, 2006 Columbia, MO Chris Barnett Center for Agricultural, Resource and Environmental.
School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.
NSF DUE ; Module 4.3. NSF DUE ; GeoTEd Partners Module name and number.
TileMill Quickly and Easily Design Maps for the Web Shaky Sherpa Matt Berg Modi Research Group The Earth Institute. Columbia University.
Creating Map Books ArcMap 10 Data Driven Pages
MEPO Training MEPO Database Access Training Presentation Copyright 2011 Rodger B. Fluke, MPA.
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
GIS Level 2 MIT GIS Services
Set up for Spatial Components ► Open an existing ArcMap project file (.mxd) for your survey area ► Open ArcToolbox ► Unzip the Digital Soil Survey – Pedon.
Geodatabase basic. The geodatabase The geodatabase is a collection of geographic datasets of various types used in ArcGIS and managed in either a file.
West Hills College Farm of the Future. West Hills College Farm of the Future Where are you NOW?! Precision Agriculture – Lesson 3.
Technical Support: (989) GIS and Mapping Procedures in ArcMap 9.x Creating an ArcMap Project Editing an ArcMap Project Printing an ArcMap Project.
ArcView Documents Francisco Olivera, Ph.D., P.E. Department of Civil Engineering Texas A&M University.
Intro. To GIS Lecture 6 Spatial Analysis April 8th, 2013
@ 2007 Austin Troy. Geoprocessing Introduction to GIS Geoprocessing is the processing of geographic information. Perform spatial analysis and modeling.
Introduction to ArcGIS for Environmental Scientists Module 3 – GIS Analysis ArcGIS Toolbox.
Rebecca Boger Earth and Environmental Sciences Brooklyn College.
Introduction to ArcGIS for Environmental Scientists Module 2 – GIS Fundamentals Lecture 5 – Coordinate Systems and Map Projections.
Lecture 4 Geodatabases. Geodatabases Outline  Data types  Geodatabases  Data table joins  Spatial joins  Field calculator  Calculate geometry 
Esri International User Conference | San Diego, CA Technical Workshops | Loading CAD data into the Geodatabase Alex LeReaux Thursday, July 14, 2011 – 10:15.
Attribute Data in GIS Data in GIS are stored as features AND tabular info Tabular information can be associated with features OR Tabular data may NOT be.
CE 525. Grading GIS Proficiency Exam 10% Attendance 10% 90–100 = A Pop Quiz Questions 10% 80 – 89 = B Homework/Certifications 20% 70 – 79 = C Midterm.
Matching school attendance boundaries with schools from CCD dataset.
Importing your Own Data To display in GIS Lab 4a: (Table Join) Mapping By State, County, or Nation.
Overview Cursors arcpy.da module Geometrys Arrays SpatialReferences
Introduction to ArcPy. Topics What is ArcPy? Accessing geoprocessing tools using ArcPy Writing scripts using ArcPy.
Introduction to ArcGIS for Environmental Scientists Module 2 – Fundamentals Chapter 7 – Queries.
GIS Tutorial 1 Lecture 4 Geodatabases. Outline  Data types  Geodatabases  Data table joins  Spatial joins  Field calculator  Calculate geometry.
Data Queries Selecting features in ArcMap Data queries  Important part of a GIS project Can be a part of your data preparation or final analysis  Data.
Geo-processing tools Tools: Buffer Geo-processing tools allow you to work with your data bases on spatial relations.... at a specified distance... with.
Return to Outline Copyright © 2011 by Maribeth H. Price 3-1 Labeling and annotation.
1 Introduction To Geographical Data and TEISS Maps Angelique Luedeker, ITEP/TAMS Center.
Using the AccuGlobe Software with the IndianaMap Using the AccuGlobe Software.
URBDP 422 URBAN AND REGIONAL GEO-SPATIAL ANALYSIS Lecture 3: Building a GeoDatabase; Projections Lab Session: Exercise 3: vector analysis Jan 14, 2014.
LBR & WS LAB 1: INTRODUCTION TO GIS.
GIS & Health ESPM 9: W 5-8 April 7, 2010 Instructors: Maggi Kelly Kevin Koy Mark O’Connor Geospatial Innovation Facility College of Natural Resources -
ArcGIS: ArcCatalog. Agenda The ArcCatalog Interface General ArcCatalog ▫Navigating directories ▫Preview data ▫View metadata Advanced ArcCatalog ▫Modifying.
Geographic Data in GIS. Components of geographic data Three general components to geographic information Three general components to geographic information.
Geographic Information Systems Using ESRI ArcGIS 9.3 Arc Catalog File Management.
NSF DUE ; Wen M. Andrews J. Sargeant Reynolds Community College Richmond, Virginia.
Selecting features in ArcMap
Introduction to Geographic Information Systems Fall 2013 (INF 385T-28620) Dr. David Arctur Research Fellow, Adjunct Faculty University of Texas at Austin.
1 Introduction To Geographical Data and TEISS Maps Angelique Luedeker, ITEP/TAMS Center.
CE 525. REGRESSION VIDEO Return Quiz Why regression? Re-watch video as it will be on the midterm! 1. This is the difference between actual observed values.
Intro. To GIS Pre-Lab Spatial Analysis April 1 st, 2013.
William Perry U.S. Geological Survey Western Ecological Research Center Geography 375 Final Project May 22, 2013.
CENTENNIAL COLLEGE SCHOOL OF ENGINEERING & APPLIED SCIENCE VS 361 Introduction to GIS SPATIAL OPERATIONS COURSE NOTES 1.
Lecture 10: Geoprocessing with Python (II) Dr. Taysir Hassan Abdel Hamid Associate Professor, Information Systems Dept., Faculty of Computers and Information.
Outline of Script Import Modules Setup Workspace Environment and Assign Data Path Variables Summary of Script Title and Author Info.
Lecture 3 Interacting with Data.
Improving Georeferencing Workflow with Python
Geography 385 Introduction to ArcGIS Web Application Design
A PYTHON SCRIPT TO PAN-SHARPEN IMAGERY
Final Project: Read from a csv file and write to a database table
Attribute Extraction.
DOWNTOWN RESTAURANTS AND CRIME RELATIONSHIPS
Hazards Planning and Risk Management
Preliminaries: -- vector, raster, shapefiles, feature classes.
Hazards Planning and Risk Management
Hazards Planning and Risk Management
The Use of Looping Code in Map Production
Virginia Lenvik Geography 375 Spring 2013
ESRM 250/CFR 520 Autumn 2009 Phil Hurvitz
Midwest-bound A Site Suitability Analysis of South Bend, Indiana for Relocation by Joi Misenti Geog 375--Spring 2016.
Processing of NOAA Precipitation Data and Thematic Map Generation
Clip & Convert to ASCII Program Kelly Knapp Spring 2010
Geog 375 Individual Final Programming Project: Automated Thematic Maps
Presentation transcript:

Introduction to GIS Programming Final Project Submitted by Todd Lenkin Geography 375 Spring of 2011 American River College

Introduction & Set up Script This Python script has been created to compare the location of two sets of points that are supposed to represent the same thing. Specifically, underground fuel storage tanks within the County of El Dorado. The two sources of data are the county database and the state waterboard's website known as Geotracker.Geotracker The script begins with a brief description. The modules are imported: arcpy, sys & traceback. The workspace environment is identified as a file geodatabase that has already been created. It contains the two tables with the data that were imported from Excel spreadsheets. The variables are set for the tables, layers and files.

Script Description Import Modules Set Current Workspace Set Variables Introduction & Set up Script

Make Data Into Features The first process is to create layers with the data using the latitude and longitude fields from each table. The script checks if the layer(s) exists and if so, performs a delete of the file. Then the spatial reference is set to the geographic coordinate system being used (NAD 83). Then the Make XY Event Layer tool is used. Get Count is used to print the results. The second process is to make features from the layers. The script checks if the feature class(es) exist and if so, performs a delete of the file. Copy Features tool is used to make feature classes. A string is used to print that the features have been copied.

If Exists, Delete Set Spatial Reference for Geographic Coordinate System Make XY Event Layer Print Result using Get Count If Exists, Delete Copy Features Print Finished String Make Data into Features

Project, Near Analysis & Join Fields The third process is to convert the features into a projected coordinate system so that the units are in feet. The script checks if the feature(s) exists and if so, performs a delete of the file. Then the spatial reference is set to the projected coordinate system being used (State Plane). Then the Project tool is used. A string is used to print that the projected feature classes have been created. The forth process performs the Near analysis with the county features being the target. The distance parameter is 1,000 feet. The fifth process is to determine if the closest point represents the same facility. The Join Field tool is used to add the Global ID field from the state features to the county features.

If Exists, Delete Set Spatial Reference for Projected Coordinate System Print Finished String Near Analysis Print Finished String Join Field (Global ID) Project, Near Analysis & Join Field

Select Analysis The sixth process is create three feature classes that represent the different scenarios of matching the county point to the state point. If the Global ID fields are equal, then the closest state point to the county point is a match. If the Global ID fields have a null value, then either the state or county record does not exist. And if the Global ID fields do not match, then the closest point is not a match and further analysis is required. The script checks if the feature(s) exists and if so, performs a delete of the file. The Select tool is used to create the feature class. Get Count is used to print the results.

If Exists, Delete Select where Global ID Matches Select where Global ID has NULL Value Select where Global ID is not a Match Print Result using Get Count Select Analysis

Buffer, Spatial Join & Select The seventh process is to create buffer polygons around the three county points where the closest state point is not a match. The script checks if the feature class exists and if so, performs a delete of the file. The Buffer tool is used to create the polygons with a distance of 500 feet. A string is used to print that the polygons have been created. The eighth process is a Spatial Join which adds the fields from the no match county buffer to the state points that are within the polygons, using the keep common parameter. The ninth process is to select the records where the Global ID field of the state points equal the Global ID field of the added buffer polygon. The result contains only the three records from the state feature class that didn't match in the first near analysis.

If Exists, Delete Buffer Analysis Print Completed String If Exists, Delete Spatial Join Analysis Print Result using Get Count If Exists, Delete Select where Global ID Matches Buffer, Spatial Join & Select

Near Analysis & Merge Management The tenth process is to perform a second Near analysis - this time between the no match county points as the target and the three state points just isolated from the buffer, spatial join and select. The eleventh and final process is the preparation of the feature class containing the remaining three records and merging it to the other records that matched in the first near analysis. The Delete Field tool removes the Global ID added from the first Join Field management. And the Join Field tool adds the Global ID of the Near FID from the second Near analysis. The script checks if the merged feature exists and if so, performs a delete of the file. The Merge tool creates the County Final feature class. Print string indicates merge is complete and the script is finished.

Near Analysis Print Completed String Delete Field Join Field If Exists, Delete Merge Management Print Completed & Finished String Near Analysis & Merge

Python Shell Print Strings

Introduction & Set up of Map Script A map was created using three layers of points plus Bing Maps Hybrid as the base map. The layers are the feature class that resulted from the merge named County Final that contains the distance calculation, the state points and the no data points. The modules are imported: arcpy, sys & traceback. From arcpy.mapping import * is used to eliminate the need to write it each time. Paths are set for the datapath, mappath and the map document. The data frame is specified and the layers in the table of contents are retrieved with a loop. A print string is used to list the layers. An if, else is used to assign a variable to the county data layer and a print string is used to indicate which layers were or were not assigned (a variable) for search. A search cursor is created with the county data variable.

Import Modules Set Paths & Get Map Document Get Data Frame Get List of Layers in Table of Contents Loop through Layers Assign Layer to Variable Create Search Cursor Introduction & Set up Map Script

Set up (cont.) & PDF Export A for loop is used to loop through the individual rows. A variable is set to the facility name field. A query variable is set and assigned to the layer definition query property. Using the get extent method, the data frame's extent property is set to the layer's extent. Pans and centers the data frame extent using a new extent object. The data frame scale is set at 1:2,000. Check to see if the PDF file exists, and if so, deletes it. The export to PDF routine exports the maps, using the mappath variable plus the facility variable to name the files. Print string showing PDF created and completed for each facility.

Create For Loop Set Name Field Variable Create Query Variable Assign Layer Definition Set Data Frame Extent Pan to Extent Set Scale If Exists, Delete Export to PDF Set up (cont.) & PDF Export