CE 697V, Project 41 Project 4: Geoprocessing Script November 10, 2006 Kwangbae Kim.

Slides:



Advertisements
Similar presentations
NSF DUE ; Module 4.3. NSF DUE ; GeoTEd Partners Module name and number.
Advertisements

Geoprocessing; Useful Tools You Should Know in ArcToolbox Unlock the hidden secrets of ArcToolbox to discover tools that make your work easier and analysis.
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
GIS Overlay Getting to the “where is?”. Distance buffering Creates a distance from a feature Creates a distance from a feature Works with points.
GIS Level 2 MIT GIS Services
Border around project area Everything else is hardly noticeable… but it’s there Big circles… and semi- transparent Color distinction is clear.
Spatial Analyst Raster vs. Vector. Spatial Analyst Extension.
Geography 465 Working with ArcGIS Tools and Environment Settings.
Python & ModelBuilder. Overview Python/ModelBuilder Concepts – The Geoprocessor – Checking some environment variables – Providing feedback from your model/script.
Spatial Analyst Raster vs. Vector. Spatial Analyst Extension.
ModelBuilder In ArcGIS 9.x By Tim Weigel GEOG 407/607 April 3 rd, 2006.
What Geoprocessing? Geoprocessing is the processing of geographic information. Commonly used to describe a process when geographic objects are manipulated.
Geography 465 Analytic Cartography: Getting Started with Python Scripting.
Geography 465 GIS Database Programming Getting Started with GIS Database Programming.
Let’s pretty it up!. Border around project area Everything else is hardly noticeable… but it’s there Big circles… and semi- transparent Color distinction.
Introduction to ArcGIS for Environmental Scientists Module 3 – GIS Analysis ArcGIS Toolbox.
Kurt Menke, GISP GRASS GIS Geographic Resources Analysis Support System.
GIS Tools Workflow of GIS Tools to Determine Properties Suitable for Migratory Bird Foraging Sites.
Habitat Analysis in ArcGIS Use of Spatial Analysis to characterize used resources Thomas Bonnot
Preparing a Climate Data Time Series from PRISM Rasters This is the cover art for the album The Dark Side of the Moon by the artist Pink Floyd. The cover.
Python & ModelBuilder. Continuing Education Python and ModelBuilder Overview Python/ModelBuilder Concepts –The Geoprocessor –Checking some environment.
Lecture 9 Managing a GIS project. GIS analysis Collect and process data to aid in decision making  Use the data to make decisions  Identify alternatives.
2006 GIS Jam: ArcGIS Python Scripting
Writing Geoprocessing Scripts With ArcGIS Lecture 9.
Introduction to Spatial Analysis and Spatial Modeling
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.
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 concepts, skills and tools
Exploring ArcToolbox Presented by: Isaac Johnson.
Site Selection with ModelBuilder CE697V Chiung-Shiuan Fu October, 16, 2006 Civil Engineering, Purdue University.
Technical Workshops | Esri International User Conference San Diego, California Creating Geoprocessing Services Kevin Hibma, Scott Murray July 25, 2012.
Module 6: Geoprocessing Scripts. Processing loops and decisions.
Site Suitability for Lake Overholser Cassi Poor CRP 551.
Geo-processing tools Tools: Buffer Geo-processing tools allow you to work with your data bases on spatial relations.... at a specified distance... with.
Building Site Selection Tool using Python
Advanced ArcGIS Yafang Su Academic Technology Services Geocoding Geoprocessing.
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 -
Geographic Data in GIS. Components of geographic data Three general components to geographic information Three general components to geographic information.
CE 525 January 31, HW#4 Were the modules helpful in learning how to do this exercise? Were any steps unclear? Questions? Good examples…
Juanita Cano City of Sacramento Spring 2014 Geography 375.
Geoprocessing Geoprocessing is a fancy name for Spatial Operations So what is Geoprocessing? Processing or manipulating of geographic/spatial data to.
Introduction to Geographic Information Systems Fall 2013 (INF 385T-28620) Dr. David Arctur Research Fellow, Adjunct Faculty University of Texas at Austin.
DEM TRAINING (DIGITAL ELEVATION MODEL). STEP 1 OPEN GIS.
Natura 2000 System Alberto Telletxea Bilbomática under EEA Contractor.
Morgan Neal GEOG 385 Fall 2011 Objective – Identify a driving route through locations within a user-specified distance of the lower American River using.
Google Map API The Google Maps API lets you embed Google Maps in your own web pages with JavaScript The API provides a number of utilities for manipulating.
Pesticide Use Web Mapping Application Joanna Nishimura Fall 2014.
GIS Project1 Physical Structure of GDB Geodatabase Feature datasets Object classes, subtypes Features classes, subtypes Relationship classes Geometric.
Introduction to GIS Programming Final Project Submitted by Todd Lenkin Geography 375 Spring of 2011 American River College.
Lecture 18: Spatial Analysis Using Rasters Jeffery S. Horsburgh CEE 5190/6190 Geographic Information Systems for Civil Engineers Spring 2016.
Key Terms Attribute join Target table Join table Spatial join.
Graduate Students, CEE-6190
GIS Institute Center for Geographic Analysis
Geography 385 Introduction to ArcGIS Web Application Design
Presented by Shaynee Gulliford
Site Selection Tool Development with ModelBuilder
ArcToolbox A collection of commands In 11 toolboxes
Attribute Extraction.
Lecture 9 Using Python for Geoprocessing
Creating Geoprocessing Services
Lecture 10 Accessing tools and environment setting in Scripts
GEOCODING Creates map features from addresses or place-names.
GIS Lecture: Geoprocessing
GIS Institute Center for Geographic Analysis
Geography 465 GIS Database Programming
Module 4 - Analysis Module 4: Basic Analysis Tools
GIS Institute Center for Geographic Analysis
Midwest-bound A Site Suitability Analysis of South Bend, Indiana for Relocation by Joi Misenti Geog 375--Spring 2016.
Clip & Convert to ASCII Program Kelly Knapp Spring 2010
Presentation transcript:

CE 697V, Project 41 Project 4: Geoprocessing Script November 10, 2006 Kwangbae Kim

CE 697V, Project 42 Descriptions of this project ArcGIS geoprocessing to select suitable locations by tool development with geoprocessing script The object of this project: to make a tool with geoprocessing script to find the best site selection for his family at the city of West Lafayette of a new Purdue student

CE 697V, Project 43 Procedure 1. Create a personal geodatabase to save or load all the involved data 2. Load all vector and raster data in geodatabase 3. Project all vector data and raster data (DEM in Lafayette) 4. Perform spatial analysis tools by selection criteria to find the best location

CE 697V, Project 44 Contents of Geoprocessing Scripts Script Project 4a: Create a personal geodatabase to save or load all the involved data Script Project 4b: Load all vector and raster data in geodatabase and project all vector data and raster data (DEM in Lafayette) Script Project 4c: Perform spatial analysis tools by selection criteria to find the best location

CE 697V, Project 45 Selection criteria Input all feature data (all streets, restaurants, CE building, schoolmap, and houses shape files) into geodatabase Project all feature data on UTM zone 16N, NAD83 Project the elevation_lafayette raster data on UTM zone 16N, NAD83 Select US Highway 52 from all streets Buffer US Highway 52 within 1 mile from selected US Highway 52 Buffer restaurants within 2 miles from restaurants Buffer 6 driving distance miles to the Civil Engineering building Buffer 3 driving distance miles to school Select houses with 3 bedrooms and a price less than $150,000 from geocoding house addresses

CE 697V, Project 46 Selection criteria (features) Clip all_streets_buffer and restaurants_buffer → clip1_out Intersect civil_engineering_buffer and school_buffer → intersect_out Clip clip1_out and intersect_out → clip2_out Intersect clip2_out and houses_select → final_out

CE 697V, Project 47 Final Map

CE 697V, Project 48 Geoprocessing Scrpit # # Created on: Kwangbae Kim # CE697V, Project 4: Geoprocessing Script # # Import system modules import sys, os, win32com.client, string # Create the Geoprocessor object gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") # Load required toolboxes... gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx") gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx") # Create workspace and geodatabase gp.workspace = gp.GetParameterAsText(0) Script project4a

CE 697V, Project 49 Geoprocessing Scrpit p4_mdb = gp.GetParameterAsText(1) geodb=gp.CreatePersonalGDB_management("H:/project4", p4_mdb) # Load the features, raster data, and table # Load features: all streets, restaurants, Civil Engineering, school, and houses features = gp.GetParameterAsText(2) gp.FeatureClassToGeodatabase_Conversion(features,geodb) rasters = gp.GetParameterAsText(3) gp.RasterToGeodatabase(rasters,geodb)

CE 697V, Project 410 Geoprocessing Scrpit # # Created on: Kwangbae Kim # CE697V, Project 4_b: Geoprocessing Script # # Import system modules import sys, os, win32com.client, string # Create the Geoprocessor object gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") # Load required toolboxes... gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx") gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx") # Create workspace and geodatabase gp.workspace = gp.GetParameterAsText(0) Script project4b

CE 697V, Project 411 Geoprocessing Scrpit (cont ’ d) # Load the features, raster data, and table # Load features: all streets, restaurants, Civil Engineering, school, and houses all_streets = gp.GetParameterAsText(1) restaurants = gp.GetParameterAsText(2) civil_engineering = gp.GetParameterAsText(3) school = gp.GetParameterAsText(4) houses = gp.GetParameterAsText(5) # Load raster data: elevation data elevation_west_lafayette = gp.GetParameterAsText(6) elevation_east_lafayette = gp.GetParameterAsText(7) # Read the parameter value for projection projection = gp.GetParameterAsText(8)

CE 697V, Project 412 Geoprocessing Scrpit (cont ’ d) # Project the features class on UTM Zone 16N gp.BatchProject_management(all_streets, gp.workspace, projection) gp.BatchProject_management(restaurants, gp.workspace, projection) gp.BatchProject_management(civil_engineering, gp.workspace, projection) gp.BatchProject_management(school, gp.workspace, projection) gp.BatchProject_management(houses, gp.workspace, projection) # Project raster data on UTM Zone 16N gp.ProjectRaster_management(elevation_west_lafayette, "elevation_west_lafayette_project", projection, "BILINEAR", "", "","" ) gp.ProjectRaster_management(elevation_east_lafayette, "elevation_east_lafayette_project", projection, "BILINEAR", "", "","" ) Project all features and rasters on UTM Zone 16N

CE 697V, Project 413 Geoprocessing Scrpit (cont ’ d) # create new geodatabase gdb=gp.GetParameterAsText(9) geodb=gp.CreatePersonalGDB("H:/project4", gdb) # Input all features and raster data into geodatabase gp.FeatureClassToGeodatabase_Conversion(all_streets+"_1", geodb) gp.FeatureClassToGeodatabase_Conversion(restaurants+"_1", geodb) gp.FeatureClassToGeodatabase_Conversion(civil_engineering+"_1", geodb) gp.FeatureClassToGeodatabase_Conversion(school+"_1", geodb) gp.FeatureClassToGeodatabase_Conversion(houses+"_1", geodb) gp.RasterToGeodatabase_Conversion(elevation_west_lafayette+"_project", geodb) gp.RasterToGeodatabase_Conversion(elevation_east_lafayette+"_project", geodb)

CE 697V, Project 414 Geoprocessing Scrpit (cont ’ d) # # Created on: Kwangbae Kim # CE697V, Project 4_c: Geoprocessing Script # # Import system modules import sys, os, win32com.client, string # Create the Geoprocessor object gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") # Load required toolboxes... gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx") gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx") Script project4c

CE 697V, Project 415 Geoprocessing Scrpit (cont ’ d) # Create workspace and geodatabase gp.workspace = gp.GetParameterAsText(0) # Load the projected features: all streets, restaurants, Civil Engineering, school, and houses all_streets = gp.GetParameterAsText(1) restaurants = gp.GetParameterAsText(2) civil_engineering = gp.GetParameterAsText(3) school = gp.GetParameterAsText(4) houses = gp.GetParameterAsText(2) # Read the parameter values distance_US52 = gp.GetParameterAsText(3) distance_restaurants = gp.GetParameterAsText(7) distance_civil_engineering = gp.GetParameterAsText(8) distance_school = gp.GetParameterAsText(9)

CE 697V, Project 416 Geoprocessing Scrpit (cont ’ d) # Select US Highway 52 from all streets and distance buffer (1 mile) s1 = all_streets+'_select' gp.Select_analysis(all_streets, s1, "( [NAME] = 'SAGAMORE') OR( [NAME] = 'US HIGHWAY 52') OR( [NAME] = 'US HWY 52' )") # Buffer 2 miles distance to restaurants b2 = restaurants+'_buffer' gp.Buffer_analysis(restaurants, b2, distance_restaurants, "FULL", "ROUND", "ALL", "") # Buffer 6 miles driving distance to Civil Engineering building b3 = civil_engineering+'_buffer' gp.Buffer_analysis(civil_engineering, b3, distance_civil_engineering, "FULL", "ROUND", "ALL", "")

CE 697V, Project 417 Geoprocessing Scrpit (cont ’ d) # Buffer 3 miles driving distance to all schools b4 = school+'_buffer' gp.Buffer_analysis(school, b4, distance_school, "FULL", "ROUND", "ALL", "") # Select houses with 3 bedrooms and a price less than $ s2 = houses+'_select' gp.Select_analysis(houses, s2, "( [BED] = 3 ) AND ( [PRICE] <= )" # Clip US52_buffer and restaurants_buffer -> clip1_out feature gp.Clip_analysis(US52_buffer, restaurants_buffer, clip1_out) # Intersect civil_engineering_buffer and school_buffer -> intersect_out gp.Intersect_analysis(civil_engineering_buffer, school_buffer, intersect_out) # Clip clip1_out and intersect_out -> clip2_out gp.Clip_analysis(clip1_out, intersect_out, clip2_out)

CE 697V, Project 418 Geoprocessing Scrpit # Intersect clip2_out and houses_select -> final_out feature gp.Intersect_analysis(clip2_out, houses_select, final_out) # create new geodatabase gdb=gp.GetParameterAsText(3) geodb=gp.CreatePersonalGDB("H:/project4", gdb) # Input all features and raster data into geodatabase gp.FeatureClassToGeodatabase_Conversion(s1, geodb) gp.FeatureClassToGeodatabase_Conversion(b2, geodb) gp.FeatureClassToGeodatabase_Conversion(b3, geodb) gp.FeatureClassToGeodatabase_Conversion(b4, geodb) gp.FeatureClassToGeodatabase_Conversion(s2, geodb) gp.FeatureClassToGeodatabase_Conversion(clip1_out, geodb) gp.FeatureClassToGeodatabase_Conversion(intersect_out, geodb) gp.FeatureClassToGeodatabase_Conversion(clip2_out, geodb) gp.FeatureClassToGeodatabase_Conversion(final_out, geodb)