LAS for Topographic Analysis Using Python

Slides:



Advertisements
Similar presentations
RGS-IBG Online CPD course in GIS Analysing Data in ArcGIS Session 6.
Advertisements

Using Track Changes in Microsoft Word Navigating Directions Click on the arrows or the home button located in the bottom right-hand corner of each.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Environmental GIS Nicholas A. Procopio, Ph.D, GISP Some slides from Lyna Wiggins (Rutgers University)
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Purchasing Goods and Services. Overview In this session you will learn how to utilize the eProcurement Module to create requisitions for purchasing goods.
Annotation & Nomenclature By Corey Fortezzo for PG&G GIS Workshop, 2010.
ESRM 250 & CFR 520: Introduction to GIS © Phil Hurvitz, KEEP THIS TEXT BOX this slide includes some ESRI fonts. when you save this presentation,
Python & ModelBuilder. Overview Python/ModelBuilder Concepts – The Geoprocessor – Checking some environment variables – Providing feedback from your model/script.
Introduction to ArcGIS Add-Ins Exercises GIS/LIS Conference, 2014 Rochester, MN.
Project 3: Finding, Retrieving, and Viewing National Data Map Rick Hartlieb Ben Miller Alexis Phillips Jessica Plummer.
Python & ModelBuilder. Continuing Education Python and ModelBuilder Overview Python/ModelBuilder Concepts –The Geoprocessor –Checking some environment.
Network Analysis with Python
Introduction to ArcPy. Topics What is ArcPy? Accessing geoprocessing tools using ArcPy Writing scripts using ArcPy.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
MagicInfo Pro Scheduler Now that a template has been created from content imported into the Library, the user is ready to begin scheduling content to.
Internet and Distributed Representation of Agent Based Model by- Manish Sharma.
Hosted Virtualization Lab Last Update Copyright Kenneth M. Chipps Ph.D.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Caching Imagery Using.
Exploring an Open Source Automation Framework Implementation.
Advance Map Automation With Python
Technical Workshops | Esri International User Conference San Diego, California Creating Geoprocessing Services Kevin Hibma, Scott Murray July 25, 2012.
Esri UC 2014 | Technical Workshop | Python Map Automation – Beyond the Basics of arcpy.mapping Jeff Barrette Jeff Moulds.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Chapter 13: AutoCAD DesignCenter. After completing this Chapter, you will be able to use the following: Overview of DesignCenter Container, Content Type.
Tutorial 3 Adding and Formatting Text with CSS Styles.
NotetakR.ppt A template to assist students with note taking for school research projects Designed by Kevin Jarrett Original idea © Mike Eisenberg.
Publishing GIS Services to ArcGIS Server
Claritas 3D REFSTAT: Refraction statics calculations.
Python: Building Geoprocessing Tools David Wynne, Ghislain Prince.
Python: File Directories What is a directory? A hierarchical file system that contains folders and files. Directory (root folder) Sub-directory (folder.
Introduction to GIS Programming Final Project Submitted by Todd Lenkin Geography 375 Spring of 2011 American River College.
Best Practices for Managing and Serving Lidar and Elevation Data Cody Benkelman.
Jeff Barrette Jeff Moulds
Installation and Training
Introduction to Programming
Desktop Mapping: Building Map Books
PYTHON: AN INTRODUCTION
Introduction to ArcGIS Add-Ins
Adding and editing students and student test settings
Introduction to Programming
Geography 375 Introduction to Python May 15, 2015
Introduction to ArcGIS 9
Fill the screen challenge!
Topics Introduction to File Input and Output
Qualtrics Survey Kenyon
Managing Rosters Screener Training Module Module 5
Test Information Distribution Engine (TIDE) Training
Using Photoshop for IED
Data Upload & Management
ECE 3567 Microcontroller Lab
This lecture Introduction to arcpy Debugging Using arcpy.
Claritas 3D REFSTAT: Refraction statics calculations
Spatial Data Entry via Digitizing
NotetakR.ppt A template to assist students with note taking for school research projects Designed by Kevin Jarrett Original idea © Mike Eisenberg.
Scripts In Matlab.
Please Note These definition power points may not cover every artistic term or Photoshop term discussed in class. These are just the terms we really.
Network Analysis using Python
Geoprocessing Sample Tools for Lidar Data Management
Publishing image services in ArcGIS
WinSLAMM Batch Editor Module 23
Topics Introduction to File Input and Output
Virginia Lenvik Geography 375 Spring 2013
Clip, Merge, Cluster, and Repeat
Clip & Convert to ASCII Program Kelly Knapp Spring 2010
RecipePlus and Recipe 2 Enhanced ActiveX control
Geog 375 Individual Final Programming Project: Automated Thematic Maps
Adding signatures to outgoing in Webmail and Microsoft Outlook
Desktop Mapping: Building Map Books
Presentation transcript:

LAS for Topographic Analysis Using Python Theodore Smith May 22, 2013

Goals Demonstrate learning of Python programming methods. Produce a program that produces specified outputs needed for analysis of debris flow susceptibility ala Smith (1988). Grapple with and solve programming problems, learning in the process.

Overview The program consists of three modules: Module 1 creates initial files, imports lidar data, and produces a point summary. Module 2 creates a raster ground surface. Module 3 creates a series of surfaces (hillshade, slope, curvature, etc.) needed for the analysis. Modules 2 and 3 could be easily combined once the code is fully tested.

Typical Starting Code Sample print "Final Project - LAS for Topographic Analysis Using Python\n" print "by Theodore C. Smith, May 2, 2013\n" print "Sub-program Module 1\n" import arcpy, sys, os, traceback # set the current workspace (in the case a folder) arcpy.env.workspace = 'J:\\LiDAR_Proj\\workspace\\' # Create variable definitions for file paths, file names, and projection. # The next two lines will need to be changed for each study area. quadDesig = "MM" # Variable designates a study area (in this case, a quadrangle) that coincides with a folder name. quadTif = "o37122e4.tif" # File name of topographic map image outpath = "J:\\LiDAR_Proj\\Quads\\" + quadDesig + "\\output\\" outmxd = outpath + quadDesig + "_dfa.mxd" topo = "J:\\LiDAR_Proj\\Quads\\" + quadDesig + "\\topobase\\" + quadTif topoLyrOut = outpath + quadDesig + "topo.lyr" inLas = "J:\\LiDAR_Proj\\Quads\\" + quadDesig + "\\ldata\\" lasDatasetOut = outpath + quadDesig + "lidar.lasd" outgdb = quadDesig + "lidar.gdb" lasMP = outgdb + os.sep + quadDesig + "test.lyr" ptSumFC = outpath + quadDesig + "PtSumFC" coordSys = "J:\\ArcFave\NAD 1983 UTM Zone 10N.prj" Modules typically all define variables, call on ArcGIS and operating system processes, and define workspace.

Typical Exception Routine # http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000000q000000 tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n " + str(sys.exc_type) + ": " + str(sys.exc_value) + "\n" msgs = "ARCPY ERRORS:\n" + arcpy.GetMessages(2) + "\n" arcpy.AddError(msgs) arcpy.AddError(pymsg) print msgs print pymsg arcpy.AddMessage(arcpy.GetMessages(1)) print arcpy.GetMessages(1)

Part of Module 1 Try Subroutine # Copy the existing mxd template to the project output directory. mxd = arcpy.mapping.MapDocument("J:\\LiDAR_Proj\\_templateUTM10N.mxd") mxd.saveACopy(outmxd) print "New mxd created at " + outmxd + "\n" # Make a dataset using las files in the quadDesig las data directory. # The next four lines may be commented out if the dataset is not desired. # Check to see if the las dataset already exists, if so, delete it if arcpy.Exists(lasDatasetOut): arcpy.Delete_management(lasDatasetOut) arcpy.CreateLasDataset_management(inLas, lasDatasetOut) print "New las dataset created at " + lasDatasetOut + "\n" # Make a raster layer using the georeferenced topographic map image; save as new layer. # The next four lines may be commented out if the topo map layer is not desired. # Check to see if the topographic map layer already exists, if so, delete it if arcpy.Exists(topoLyrOut): arcpy.Delete_management(topoLyrOut) arcpy.MakeRasterLayer_management(topo, "topoLyr") arcpy.SaveToLayerFile_management("topoLyr", topoLyrOut, "ABSOLUTE") print "New topographic map layer created at " + topoLyrOut + "\n"

Screen OutPut from Module 1 Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> Final Project - LAS for Topographic Analysis Using Python by Theodore C. Smith, May 2, 2013 Sub-program Module 1 New mxd created at J:\LiDAR_Proj\Quads\MM\output\MM_dfa.mxd New las dataset created at J:\LiDAR_Proj\Quads\MM\output\MMlidar.lasd New topographic map layer created at J:\LiDAR_Proj\Quads\MM\output\MMtopo.lyr Pointfile summary created at J:\LiDAR_Proj\Quads\MM\output\MMPtSumFC.dbf Please review the point file summary to determine the average point spacing. Then put the value in the code of the second sub-program.

Point File Summary from Module 1 File Name Pt_Count Pt_Spacing Z_Min Z_Max ARRA-CA_GoldenGate_2010_42505700.las 10450178 0.46401221681 -69.65100000000 751.50600000000 ARRA-CA_GoldenGate_2010_42505850.las 13043726 0.41532724894 -43.02100000000 765.94600000000 ARRA-CA_GoldenGate_2010_42506000.las 11500616 0.44231402230 -87.71700000000 774.20300000000 ARRA-CA_GoldenGate_2010_44005700.las 11643314 0.43959521266 83.57300000000 652.35500000000 ARRA-CA_GoldenGate_2010_44005850.las 9933729 0.47592125932 4.19900000000 772.86800000000 ARRA-CA_GoldenGate_2010_44006000.las 8237973 0.52261404493 -89.43100000000 772.60200000000 ARRA-CA_GoldenGate_2010_45505700.las 8028488 0.52938834758 101.32500000000 642.75900000000 ARRA-CA_GoldenGate_2010_45505850.las 8142413 0.52567181932 -30.66200000000 724.43800000000 ARRA-CA_GoldenGate_2010_45506000.las 7966833 0.53143285716 39.35700000000 763.57700000000 ARRA-CA_GoldenGate_2010_47005700.las 7087137 0.56345059911 110.06200000000 749.09800000000 ARRA-CA_GoldenGate_2010_47005850.las 7121150 0.56210337400 59.03900000000 712.87500000000 ARRA-CA_GoldenGate_2010_47006000.las 8219604 0.52319768254 46.09400000000 741.75200000000 Average Point Spacing 0.49958572372 The bottom line is manually added.

Module 3 Output Final Project - LAS for Topographic Analysis Using Python by Theodore C. Smith, May 22, 2013 Sub-program Module 3 Uses existing surface raster at J:\LiDAR_Proj\Quads\MM\output\MM_DF_Proj.gdb\MM_Terr_Raster_20 Creating hillshade . . . New hillshade raster at J:\LiDAR_Proj\Quads\MM\output\MMhillshade1 New slope raster at J:\LiDAR_Proj\Quads\MM\output\MMslope1.tif New flow direction raster at J:\LiDAR_Proj\Quads\MM\output\MMflowdir1 New flow accumulation raster at J:\LiDAR_Proj\Quads\MM\output\MMflowacc1 New curvature raster at J:\LiDAR_Proj\Quads\MM\output\MMcurvature1 >>>

Hillshade Output

Slope Output

Flow Direction Output

Flow Accumulation Output

Curvature plus Hillshade

Curvature, Flow Accumulation, & Hillshade Compare this slide with the upper left corner of the image on the following slide. What appears as yellow-green here equates to red on the next slide.

Smith (1988) Prototype

Programming Problems Encountered Typical difficulty catching typographical errors and incorrect case. Some ArcGIS online helps are outdated; the 10.1 tool help content was better but was not always clear. The program needed to be broken into modules to expedite testing and to assure that required parameters were available. ESRI no longer distributes the various projection data files with ArcGIS 10.1, so projection file needed to be saved to disk.

Outcomes Demonstrated ability to produce some reasonable programs using several ArcGIS tools and extensions. Identified some methods that will automate testing to identify optimal parameters for the spline tool. I recognize that I need to clean up the code more, improving standardization of file locations and variables.