Marine and Coastal Biodiversity Management in Pacific Island Countries

Slides:



Advertisements
Similar presentations
Environmental GIS Nicholas A. Procopio, Ph.D, GISP Some slides from Lyna Wiggins (Rutgers University)
Advertisements

Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Introduction to ArcPython Dan Mahr ‘11 10/28/2014 GEOL1320.
ModelBuilder In ArcGIS 9.x By Tim Weigel GEOG 407/607 April 3 rd, 2006.
Spatial Analysis, Geoprocessing,
What Geoprocessing? Geoprocessing is the processing of geographic information. Commonly used to describe a process when geographic objects are manipulated.
@ 2007 Austin Troy. Geoprocessing Introduction to GIS Geoprocessing is the processing of geographic information. Perform spatial analysis and modeling.
InSTALL InVEST Rich Sharp. InVEST Installation process InVEST: The Application Get InVEST Install the core InVEST application – InVEST statistics while.
Habitat Analysis in ArcGIS Use of Spatial Analysis to characterize used resources Thomas Bonnot
Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions.
Arc: Programming Options Dr Andy Evans. Programming ArcGIS ArcGIS: Most popular commercial GIS. Out of the box functionality good, but occasionally: You.
Esri International User Conference | San Diego, CA Technical Workshops | Python – Getting Started Drew Flater, Ghislain Prince July 12 - July 14, 2011.
Working with cursors in Python GISDE Python Workshop Qiao Li.
1/29 Former leader of the “free” world … “I know what I believe. I will continue to articulate what I believe and what I believe.
2006 GIS Jam: ArcGIS Python Scripting
Introduction to InVEST ArcGIS Tool Nasser Olwero GMP, Bangkok April
Network Analysis with Python
Overview Cursors arcpy.da module Geometrys Arrays SpatialReferences
Introduction to ArcPy. Topics What is ArcPy? Accessing geoprocessing tools using ArcPy Writing scripts using ArcPy.
Python: An Introduction
ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Python, Toolboxes, Tools & Script Tools
Introduction to Model Builder Mike Sweeney ESRI-Charlotte.
ArcGIS Pro: A Quick Tour of Python David Wynne.
GDAL/OGR. GDAL/OGR GDAL/OGR : Frank Warmerdam Tools for reading, writing, and processing GDAL - Geospatial Data Abstraction Library GDAL - Geospatial.
A.Batchimeg GDAL Geospatial Data Abstraction Library GDAL Geospatial Data Abstraction Library
Introduction to ArcGIS for Environmental Scientists Module 3 – GIS Analysis Model Builder.
Geoprocessing Geoprocessing is a fancy name for Spatial Operations So what is Geoprocessing? Processing or manipulating of geographic/spatial data to.
Kurt Menke, GISP Quantum GIS (QGIS) Plugins. Extending QGIS Plugins Think ArcGIS extensions and script tools Core Plugins Core Plugins Contributed Plugins.
William Perry U.S. Geological Survey Western Ecological Research Center Geography 375 Final Project May 22, 2013.
Lecture 10: Geoprocessing with Python (II) Dr. Taysir Hassan Abdel Hamid Associate Professor, Information Systems Dept., Faculty of Computers and Information.
Lecture 18: Spatial Analysis Using Rasters Jeffery S. Horsburgh CEE 5190/6190 Geographic Information Systems for Civil Engineers Spring 2016.
Geospatial Data Abstraction Library(GDAL) Sabya Sachi.
Graduate Students, CEE-6190
Lecture 9: Geoprocessing with Python
Introduction to InVEST ArcGIS Tool
Introduction Presenter: James Zollweg, Ph.D.
ArcGIS Workflow Manager: Advanced Workflows and Concepts
Features that make a map
Automating parflow preprocessing steps for DEMs
PYTHON: AN INTRODUCTION
Environmental GIS Nicholas A. Procopio, Ph.D, GISP
IPYTHON AND MATPLOTLIB Python for computational science
Lecture 22: Using ArcToolbox Tools in Python
ArcMap: Geoprocessing
Spatial Analysis and Functions
Tan Hoang GEOG 362 – Final Project
Emma Gildesgame, Katie Lebling and Ian McCullough
Data Analysis using Python-I
Programming and Automation
Using Model Builder in ArcGIS
Spatial Data Processing
Writing Geoprocessing Scripts With ArcGIS
Lecture 10 Accessing tools and environment setting in Scripts
ModelBuilder for Beginners
Writing Geoprocessing Scripts With ArcGIS
Marine Protected Areas
Preparing raster files for Condatis
Matplotlib.
Vector Geoprocessing.
Module 4 - Analysis Module 4: Basic Analysis Tools
Building Map Books in ArcGIS
Network Analyst – Automating Workflows with Geoprocessing
Input and Output Python3 Beginner #3.
Extending ArcGIS using programming
Programming Arc.
Virginia Lenvik Geography 375 Spring 2013
Clip & Convert to ASCII Program Kelly Knapp Spring 2010
Ideal Parcels Locator Script
Presentation transcript:

Marine and Coastal Biodiversity Management in Pacific Island Countries MACBIO Marine and Coastal Biodiversity Management in Pacific Island Countries

Python Geoprocessing Modules arcpy raster/vector/crs processing module ArcGIS (closed source software) gdal/ogr/osr raster/vector/crs processing modules QGIS (free open source software) Marine and Coastal Biodiversity Management in Pacific Island Countries and Atolls 07.11.2018 MACBIO

Task: Clip Raster with Polygon EEZ: http://www.marineregions.org/ SST: http://www.oracle.ugent.be/ 07.11.2018 MACBIO

Task: Clip Raster with Polygon [ArcMap GUI] 07.11.2018 MACBIO

Output from ArcMap GUI 07.11.2018 MACBIO

ArcGIS Model Builder: design process 07.11.2018 MACBIO

Output from ArcGIS Model Builder 07.11.2018 MACBIO

ArcGIS Model Builder: export python script 07.11.2018 MACBIO

ArcGIS Model Builder: export python script 07.11.2018 MACBIO

Python script from ArcGIS Model Builder Import Module # Import arcpy module import arcpy # Local variables: inFiji_EEZ = r"C:\temp\FIJI_EEZ.shp“ inSST = r"C:\temp\SST.tif" outFiji_SST = r"C:\temp\FIJI_SST.tif" # Process: Clip arcpy.Clip_management(SST, “#", Fiji_SST, Fiji_EEZ, #", "ClippingGeometry") Import module Assign input/output Import module Process Data 07.11.2018 MACBIO

Output from python script 07.11.2018 MACBIO

Task: Clip Raster with Polygon [QGIS GUI] 07.11.2018 MACBIO

Output from QGIS GUI 07.11.2018 MACBIO

Clip Raster with Polygon [QGIS] Console command generated by QGIS 07.11.2018 MACBIO

Clip Raster with Polygon [GDAL] gdalwarp.exe -dstnodata 0 -q -cutline C:/temp/EEZs/FJI.shp -crop_to_cutline -of GTiff C:/temp/SST.tif C:/temp/EEZs/FJI_SST.tif Call executable program Assign nodata value Quiet (no progress reports) Assign clip geometry Write nodata outside clip Assign output format Assign input file Assign output file

Python script from GDAL Command Import Module # Import arcpy module import os # Local variables: inFiji_EEZ = r"C:\temp\FIJI_EEZ.shp“ inSST = r"C:\temp\SST.tif" outFiji_SST = r"C:\temp\FIJI_SST.tif" # Process: Clip command = ['gdalwarp', '-dstnodata 0', '-cutline', inFiji_EEZ '-crop_to_cutline', '-of GTiff', inSST, outFiji_SST] os.system(' '.join(command)) Import module Assign input/output Import module Process Data 07.11.2018 MACBIO

Output from command line 07.11.2018 MACBIO

Process list of datasets Automation of arcpy using python script Import Module # Import modules import os # Local variables: shapeFolder = r"C:\temp\EEZs" sstRaster = r"C:\temp\SST.tif“ # Set workspace arcpy.env.workspace = shapeFolder # Process: Clip for ds in arcpy.ListFeatureClasses(): outRaster = ds.split(‘.')[0] + "_SST.tif" arcpy.Clip_management(sstRaster, "#", outRaster, ds, "#", "ClippingGeometry") Assign input Import module Process list of datasets Assign output Process Data Execution time: 115.5 seconds 07.11.2018 MACBIO

Output from automated arcpy python script 07.11.2018 MACBIO

Process list of datasets Automation of GDAL using python script Import Module # Import modules import os # Local variables: shapeFolder = r"C:\temp\EEZs" sstRaster = r"C:\temp\SST.tif“ # Process: Clip for ds in os.listdir(shapeFolder): if ds.endswith(‘.shp’): outRaster = ds.split(‘.')[0] + "_SST.tif“ command = ['gdalwarp', '-dstnodata 0', '-cutline', inFiji_EEZ '-crop_to_cutline', '-of GTiff', inSST, outFiji_SST] os.system(' '.join(command)) Assign input Import module Process list of datasets Assign output Process Data Execution time: 20.4 seconds 07.11.2018 MACBIO

Output from automated gdal python script 07.11.2018 MACBIO

Further visualization of spatial data # import modules import arcpy import matplotlib.pyplot as plt import numpy as np # set local variables shapeFolder = r"C:\temp\EEZs" sstRaster = r"C:\temp\SST.tif" rasterList = [] countryList = [] # process each shapefile arcpy.env.workspace = shapeFolder for ds in arcpy.ListFeatureClasses(): outRaster = ds.split('.')[0] + "_SST.tif" arcpy.Clip_management(sstRaster, "#", raster, ds, "#", "ClippingGeometry") array = arcpy.RasterToNumPyArray(outRaster) rasterList.append(np.ma.compressed(np.ma.masked_less_equal(array, 0))) countryList.append(ds.split('.')[0]) # create boxplots fig, ax = plt.subplots() ax.set_ylabel("degrees C", ) bp = plt.boxplot(rasterList) plt.xticks(np.arange(1, len(countryList)+1), countryList, rotation='vertical') plt.title('SST values for each country') plt.show() Import Modules Import Modules Import Modules Import module Assign input Create storage in memory Hold data in memory Process list of datasets Create output rasters Write data to memory Hold data in memory Create boxplot object Create y-axis label Add data to boxplots Add x-axis label 07.11.2018 MACBIO Add title

Output of python script

Questions or Comments? Jonah Sullivan  Marine and Coastal Biodiversity Management in Pacific Island Countries (MACBIO) Senior GIS Officer Oceania Regional Office (ORO) | The International Union for Conservation of Nature (IUCN) 5 Ma’afu Street, Private Mail Bag, Suva, Fiji Islands. http://www.iucn.org/oceania Jonah.Sullivan@iucn.org