SlideShare a Scribd company logo
Python Raster Function:
Custom On-the-fly Analysis
Feroz Abdul Kadar Jamie Drisdelle
Raster Functions
What’s a Raster Function?
• Mapping of one raster to another.
• Loosely
• Transient: on the fly.
• Different from a geoprocessing tool.
… a transformation of one raster into another.
The Fundamentals
What’s a Raster Function Chain?
The Basic Model
Function Raster Dataset
Mosaic Dataset Item
Image Service
Mosaic Dataset
A raster function “chain” encapsulate your algorithm as a tree of functions.
What’s a Raster Function Chain?
The Basic Model
Python Raster Functions
What’s a Python Raster Function?
• Natural evolution of the raster function’s COM API—usually implemented in
.NET
• Implement a raster function from the comfort of your Python module.
• Architecture: Module loaded by an adapter—Python-aware and a first-class
participant in the function chain.
Your Python module—assisted by ArcGIS—is a raster function.
The Extended Model
What’s a Python Raster Function?
The Extended Model
Function Raster Dataset
Mosaic Dataset Item
Image Service
Mosaic Dataset
Motivation
• Extend ArcGIS—participate in a raster function chain.
• Primary pipeline for image data in ArcGIS—processing, analyzing, and
visualizing… on the fly.
• Portable. Reusable. Dynamic. Fast. Scalable.
• Why Python?
- Friendly & easy to learn. “readability first”. “batteries included”.
- Huge collection of libraries. Vibrant community of Pythonistas and Pythoneers.
- “…de facto superglue language for modern scientific computing.”
- “…tools for almost every aspect of scientific computing are readily available in Python.”
Why Raster Functions in Python?
An Example
Raster Function in Python: Linear Spectral Unmixing
Courtesy: Jacob Wasilkowski. @jwasil
Linear Spectral Unmixing
• Determines abundance of certain material in a particular pixel.
• Typically performed on lower resolution imagery (like Landsat)
• Input training endmember spectra required for each class
Introducing a Sample Use Case
Linear Spectral Unmixing
The Process
Soil
Vegetation
Non-photosynthetic vegetation
Shadows
Shadow: [70.05629, 27.24081, 25.31275, 24.17432, 31.77904, 17.82422]
Veg: [65.46086, 30.09995, 26.27376, 117.45741, 76.96012, 26.25062]
NPV: [74.74029, 32.06931, 35.57350, 32.66032, 73.63062, 60.51104]
Soil: [143.65580, 79.30271, 102.82176, 93.60246, 176.57705, 117.49280]
Linear
Unmixing
Demo
A Python Raster Function in Action: Linear Spectral Unmixing
Courtesy: Jacob Wasilkowski. @jwasil
The API
• How does ArcGIS Desktop or Server interact with my raster function?
• Get started—step-by-step guide
• Real-world or reference implementations—excellent springboard
• Well-documented API reference
• What additional libraries are needed? How complicated is it?
• Lightweight design—no external dependencies outside of NumPy to begin with.
• ArcGIS’ adapter provides assistance—opt out to take control of specific aspects.
Create a new raster function using simple and familiar Pythonesque constructs.
How do I create Raster Function in Python?
Hello, World!
The API
• customize our function object—a specific
instance of our class—as soon as it's created.
• Define raster function name & description.
__init__
The API
• Define all input parameters to the function.
• For each parameter, define:
- Name (Identifier)
- Display Name
- Long Description
- Data Type
- Default Value
- Required vs Optional
- …
getParameterInfo()
The API
• How are input rasters read—Padding, Mask, …?
• How’s the output raster constructed—inherit NoData, Metadata, …?
• Given: Nothing.
• Returns: dictionary containing configuration attribute values.
getConfiguration()
The API
• Define a subset of input rasters.
• Pixels read from selected rasters.
• Given: properties of the requested pixel block,
all scalar parameter values.
• Returns: names of selected rasters.
selectRasters()
The API
• Defines the output raster.
• Invoked each time a dataset containing the Python raster function is
initialized.
• Given: Raster info associated with all input rasters.
• Returns: Raster Info of the output raster.
updateRasterInfo()
The API
• Workhorse of the raster function. Process Pixels.
• Given:
• Expected pixel-block size+location
• output raster properties (map space)
• pixels+mask of selected input rasters
• Returns: Pixels+mask of requested pixel block.
updatePixels()
The API
• Create or update dataset- or band-level metadata.
• Given:
• property names
• band index
• current key metadata values
• Returns: updated values of given properties
updateKeyMetadata()
The API
• Given:
• info on parent product,
• context of execution.
• Returns:
• OK to Run (Boolean)—Licensed to execute or not?
• Expected product level and extension.
isLicensed()
Demo
Code Walkthrough
Raster Function Templates
What’s a Raster Function Template?
A raster function template anonymizes select raster and scalar inputs as Variables.
The Basic Model
Template
Input
Raster
Variables
Input
Scalar
Variables
Output
Raster
Raster Function Templates
• Create new function templates
- Via Raster Function Template Editor
- Layer > Symbology > Export As Raster Function Template
- Function Raster Dataset > Functions > Save as
• Function Raster Layer in a Map
• Image Analysis Window
• Raster Functions Pane in Pro
• Layer > Properties > Functions tab
A raster function template makes your processing or analysis portable.
Basic Workflows
Raster Function Templates
• On a Mosaic Dataset
- Populating a mosaic using the Add Rasters tool
- Mosaic dataset items
- Batch Edit Raster Functions or
- Edit Raster Function Geoprocessing Tool.
- As Processing Templates
• On an Image Service—for server-side processing
Learn more at https://github.com/Esri/raster-functions#raster-function-templates.
Advanced Workflows
Raster Function Templates
• Name & Description
• Type: Item, Group, or Mosaic.
• Definition Query
• Fields that control grouping.
Properties
Demo
Processing Templates on a Mosaic Dataset
Demo
Publishing Processing Templates
Additional Considerations
Performance
• Vectorize.
• Use NumPy and SciPy.
• Use Cython: For production-grade performance.
• Bridge to C/C++ implementations via ctypes or Boost.Python.
Leverage well-known options to optimize time-critical parts of your raster function.
Publishing & Deployment
• Python version
• Desktop vs. Pro: Python 2.7 vs. 3.4
• Desktop vs. Server: 32- vs. 64-bit Python 2.7
• Package dependencies
• Binary deployment
• CPython bytecode. Cython compiled binary.
• isLicensed method to restrict usage.
GitHub
• https://github.com/Esri/raster-functions
• Curated collection of raster functions and templates.
• Go ahead:
- Browse samples to learn more.
- Fork the repo. Experiment.
- Log defects or enhancement requests as issues.
- Send pull requests to contribute code.
GitHub enables collaboration.
Where do functions and templates live?
Wiki
• https://github.com/Esri/raster-functions/wiki
• Details of interaction between ArcGIS and your
Python raster function.
• Recommendations and techniques for writing
effective raster functions
Where do I find the story?
The Road Ahead
• Tools for testing your raster functions—profiling or debugging.
• Streamline usability of Python raster functions in ArcGIS Pro.
• Integration with Portal workflows.
• Expand and maintain the wiki: API, recommendations, resources.
…for Pythonistas and Pythoneers with a passion for scientific computing.
In Closing
• Powerful pipeline for processing, analysis, and visualization.
- Raster Functions. Chains. Templates.
• Using simple constructs in Python: participate and exploit.
• Code and docs are on GitHub.
• We’ll help you along the way—@jdrisdelle and @akferoz.
Wake up! We are done.
Rate This Session
www.esri.com/RateMyDevSummitSession
Sessions on related topics:
Python: Working with Raster Data—Wednesday at 4:00
Python: Working with Scientific Data—Wednesday at 5:30
http://www.esri.com/events/devsummit/agenda

More Related Content

What's hot

Anomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NETAnomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NET
Marco Parenzan
 
Akka Actors
Akka ActorsAkka Actors
Akka Actors
Dylan Forciea
 
Validating Big Data Jobs—Stopping Failures Before Production on Apache Spark...
 Validating Big Data Jobs—Stopping Failures Before Production on Apache Spark... Validating Big Data Jobs—Stopping Failures Before Production on Apache Spark...
Validating Big Data Jobs—Stopping Failures Before Production on Apache Spark...
Databricks
 
"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров
Fwdays
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8
Heartin Jacob
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
Roy Russo
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughput
Paolo Negri
 
Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...
Azul Systems Inc.
 
Scaling software with akka
Scaling software with akkaScaling software with akka
Scaling software with akka
scalaconfjp
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
Jonas Brømsø
 
Scala profiling
Scala profilingScala profiling
Scala profiling
Filippo Pacifici
 
Ruby Under The Hood
Ruby Under The HoodRuby Under The Hood
Ruby Under The Hood
craig lehmann
 
Storm presentation
Storm presentationStorm presentation
Storm presentation
Shyam Raj
 
Actor model in .NET - Akka.NET
Actor model in .NET - Akka.NETActor model in .NET - Akka.NET
Actor model in .NET - Akka.NET
Konrad Dusza
 
Parallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysisParallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysis
Manojit Nandi
 
Perl-Critic
Perl-CriticPerl-Critic
Perl-Critic
Jonas Brømsø
 
Apache Storm
Apache StormApache Storm
Apache Storm
masifqadri
 

What's hot (17)

Anomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NETAnomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NET
 
Akka Actors
Akka ActorsAkka Actors
Akka Actors
 
Validating Big Data Jobs—Stopping Failures Before Production on Apache Spark...
 Validating Big Data Jobs—Stopping Failures Before Production on Apache Spark... Validating Big Data Jobs—Stopping Failures Before Production on Apache Spark...
Validating Big Data Jobs—Stopping Failures Before Production on Apache Spark...
 
"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughput
 
Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...
 
Scaling software with akka
Scaling software with akkaScaling software with akka
Scaling software with akka
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Scala profiling
Scala profilingScala profiling
Scala profiling
 
Ruby Under The Hood
Ruby Under The HoodRuby Under The Hood
Ruby Under The Hood
 
Storm presentation
Storm presentationStorm presentation
Storm presentation
 
Actor model in .NET - Akka.NET
Actor model in .NET - Akka.NETActor model in .NET - Akka.NET
Actor model in .NET - Akka.NET
 
Parallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysisParallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysis
 
Perl-Critic
Perl-CriticPerl-Critic
Perl-Critic
 
Apache Storm
Apache StormApache Storm
Apache Storm
 

Viewers also liked

chanussot.pdf
chanussot.pdfchanussot.pdf
chanussot.pdfgrssieee
 
ROBUST UNMIXING OF HYPERSPECTRAL IMAGES: APPLICATION TO MARS
ROBUST UNMIXING OF HYPERSPECTRAL IMAGES: APPLICATION TO MARSROBUST UNMIXING OF HYPERSPECTRAL IMAGES: APPLICATION TO MARS
ROBUST UNMIXING OF HYPERSPECTRAL IMAGES: APPLICATION TO MARSgrssieee
 
SIMPLEX VOLUME ANALYSIS BASED ON TRIANGULAR FACTORIZATION: A FRAMEWORK FOR HY...
SIMPLEX VOLUME ANALYSIS BASED ON TRIANGULAR FACTORIZATION: A FRAMEWORK FOR HY...SIMPLEX VOLUME ANALYSIS BASED ON TRIANGULAR FACTORIZATION: A FRAMEWORK FOR HY...
SIMPLEX VOLUME ANALYSIS BASED ON TRIANGULAR FACTORIZATION: A FRAMEWORK FOR HY...grssieee
 
MINIMUM ENDMEMBER-WISE DISTANCE CONSTRAINED NONNEGATIVE MATRIX FACTORIZATION ...
MINIMUM ENDMEMBER-WISE DISTANCE CONSTRAINED NONNEGATIVE MATRIX FACTORIZATION ...MINIMUM ENDMEMBER-WISE DISTANCE CONSTRAINED NONNEGATIVE MATRIX FACTORIZATION ...
MINIMUM ENDMEMBER-WISE DISTANCE CONSTRAINED NONNEGATIVE MATRIX FACTORIZATION ...grssieee
 
Yang-IGARSS2011-1082.pptx
Yang-IGARSS2011-1082.pptxYang-IGARSS2011-1082.pptx
Yang-IGARSS2011-1082.pptxgrssieee
 
IEEE 2014 MATLAB IMAGE PROCESSING PROJECTS Does deblurring improve geometrica...
IEEE 2014 MATLAB IMAGE PROCESSING PROJECTS Does deblurring improve geometrica...IEEE 2014 MATLAB IMAGE PROCESSING PROJECTS Does deblurring improve geometrica...
IEEE 2014 MATLAB IMAGE PROCESSING PROJECTS Does deblurring improve geometrica...
IEEEBEBTECHSTUDENTPROJECTS
 
Luo-IGARSS2011-2385.ppt
Luo-IGARSS2011-2385.pptLuo-IGARSS2011-2385.ppt
Luo-IGARSS2011-2385.pptgrssieee
 
Jose_TH1_T09_5.ppt
Jose_TH1_T09_5.pptJose_TH1_T09_5.ppt
Jose_TH1_T09_5.pptgrssieee
 
Hyperspectral unmixing using novel conversion model.ppt
Hyperspectral unmixing using novel conversion model.pptHyperspectral unmixing using novel conversion model.ppt
Hyperspectral unmixing using novel conversion model.pptgrssieee
 

Viewers also liked (10)

chanussot.pdf
chanussot.pdfchanussot.pdf
chanussot.pdf
 
ROBUST UNMIXING OF HYPERSPECTRAL IMAGES: APPLICATION TO MARS
ROBUST UNMIXING OF HYPERSPECTRAL IMAGES: APPLICATION TO MARSROBUST UNMIXING OF HYPERSPECTRAL IMAGES: APPLICATION TO MARS
ROBUST UNMIXING OF HYPERSPECTRAL IMAGES: APPLICATION TO MARS
 
SIMPLEX VOLUME ANALYSIS BASED ON TRIANGULAR FACTORIZATION: A FRAMEWORK FOR HY...
SIMPLEX VOLUME ANALYSIS BASED ON TRIANGULAR FACTORIZATION: A FRAMEWORK FOR HY...SIMPLEX VOLUME ANALYSIS BASED ON TRIANGULAR FACTORIZATION: A FRAMEWORK FOR HY...
SIMPLEX VOLUME ANALYSIS BASED ON TRIANGULAR FACTORIZATION: A FRAMEWORK FOR HY...
 
MINIMUM ENDMEMBER-WISE DISTANCE CONSTRAINED NONNEGATIVE MATRIX FACTORIZATION ...
MINIMUM ENDMEMBER-WISE DISTANCE CONSTRAINED NONNEGATIVE MATRIX FACTORIZATION ...MINIMUM ENDMEMBER-WISE DISTANCE CONSTRAINED NONNEGATIVE MATRIX FACTORIZATION ...
MINIMUM ENDMEMBER-WISE DISTANCE CONSTRAINED NONNEGATIVE MATRIX FACTORIZATION ...
 
Yang-IGARSS2011-1082.pptx
Yang-IGARSS2011-1082.pptxYang-IGARSS2011-1082.pptx
Yang-IGARSS2011-1082.pptx
 
IEEE 2014 MATLAB IMAGE PROCESSING PROJECTS Does deblurring improve geometrica...
IEEE 2014 MATLAB IMAGE PROCESSING PROJECTS Does deblurring improve geometrica...IEEE 2014 MATLAB IMAGE PROCESSING PROJECTS Does deblurring improve geometrica...
IEEE 2014 MATLAB IMAGE PROCESSING PROJECTS Does deblurring improve geometrica...
 
Luo-IGARSS2011-2385.ppt
Luo-IGARSS2011-2385.pptLuo-IGARSS2011-2385.ppt
Luo-IGARSS2011-2385.ppt
 
Jose_TH1_T09_5.ppt
Jose_TH1_T09_5.pptJose_TH1_T09_5.ppt
Jose_TH1_T09_5.ppt
 
Hyperspectral unmixing using novel conversion model.ppt
Hyperspectral unmixing using novel conversion model.pptHyperspectral unmixing using novel conversion model.ppt
Hyperspectral unmixing using novel conversion model.ppt
 
MCC_PhDDefense
MCC_PhDDefenseMCC_PhDDefense
MCC_PhDDefense
 

Similar to Python Raster Function - Esri Developer Conference - 2015

VIATRA 2.0 Webinar
VIATRA 2.0 WebinarVIATRA 2.0 Webinar
VIATRA 2.0 Webinar
Istvan Rath
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nlbartzon
 
Serverless on OpenStack with Docker Swarm, Mistral, and StackStorm
Serverless on OpenStack with Docker Swarm, Mistral, and StackStormServerless on OpenStack with Docker Swarm, Mistral, and StackStorm
Serverless on OpenStack with Docker Swarm, Mistral, and StackStorm
Dmitri Zimine
 
Labview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRLLabview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRL
Mohammad Sabouri
 
Building a Better BaaS
Building a Better BaaSBuilding a Better BaaS
Building a Better BaaS
Apigee | Google Cloud
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
tieleman
 
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
The Grid the Brad and the Ugly: Using Grids to Improve Your ApplicationsThe Grid the Brad and the Ugly: Using Grids to Improve Your Applications
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
balassaitis
 
Operationalizing Machine Learning Using GPU-accelerated, In-database Analytics
Operationalizing Machine Learning Using GPU-accelerated, In-database AnalyticsOperationalizing Machine Learning Using GPU-accelerated, In-database Analytics
Operationalizing Machine Learning Using GPU-accelerated, In-database Analytics
Kinetica
 
Spark Summit EU talk by Nick Pentreath
Spark Summit EU talk by Nick PentreathSpark Summit EU talk by Nick Pentreath
Spark Summit EU talk by Nick Pentreath
Spark Summit
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
David M. Johnson
 
On-boarding with JanusGraph Performance
On-boarding with JanusGraph PerformanceOn-boarding with JanusGraph Performance
On-boarding with JanusGraph Performance
Chin Huang
 
Leveraging Apache Spark to Develop AI-Enabled Products and Services at Bosch
Leveraging Apache Spark to Develop AI-Enabled Products and Services at BoschLeveraging Apache Spark to Develop AI-Enabled Products and Services at Bosch
Leveraging Apache Spark to Develop AI-Enabled Products and Services at Bosch
Databricks
 
Reveal's Advanced Analytics: Using R & Python
Reveal's Advanced Analytics: Using R & PythonReveal's Advanced Analytics: Using R & Python
Reveal's Advanced Analytics: Using R & Python
Poojitha B
 
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
Deep learning and streaming in Apache Spark 2.2 by Matei ZahariaDeep learning and streaming in Apache Spark 2.2 by Matei Zaharia
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
GoDataDriven
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
zeeg
 
Cytoscape CI Chapter 2
Cytoscape CI Chapter 2Cytoscape CI Chapter 2
Cytoscape CI Chapter 2
bdemchak
 
[DLHacks]Introduction to ChainerCV
[DLHacks]Introduction to ChainerCV[DLHacks]Introduction to ChainerCV
[DLHacks]Introduction to ChainerCV
Deep Learning JP
 
Application of the Actor Model to Large Scale NDE Data Analysis
Application of the Actor Model to Large Scale NDE Data AnalysisApplication of the Actor Model to Large Scale NDE Data Analysis
Application of the Actor Model to Large Scale NDE Data Analysis
ChrisCoughlin9
 
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
Jason Dai
 

Similar to Python Raster Function - Esri Developer Conference - 2015 (20)

dev_int_96
dev_int_96dev_int_96
dev_int_96
 
VIATRA 2.0 Webinar
VIATRA 2.0 WebinarVIATRA 2.0 Webinar
VIATRA 2.0 Webinar
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
Serverless on OpenStack with Docker Swarm, Mistral, and StackStorm
Serverless on OpenStack with Docker Swarm, Mistral, and StackStormServerless on OpenStack with Docker Swarm, Mistral, and StackStorm
Serverless on OpenStack with Docker Swarm, Mistral, and StackStorm
 
Labview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRLLabview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRL
 
Building a Better BaaS
Building a Better BaaSBuilding a Better BaaS
Building a Better BaaS
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
The Grid the Brad and the Ugly: Using Grids to Improve Your ApplicationsThe Grid the Brad and the Ugly: Using Grids to Improve Your Applications
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
 
Operationalizing Machine Learning Using GPU-accelerated, In-database Analytics
Operationalizing Machine Learning Using GPU-accelerated, In-database AnalyticsOperationalizing Machine Learning Using GPU-accelerated, In-database Analytics
Operationalizing Machine Learning Using GPU-accelerated, In-database Analytics
 
Spark Summit EU talk by Nick Pentreath
Spark Summit EU talk by Nick PentreathSpark Summit EU talk by Nick Pentreath
Spark Summit EU talk by Nick Pentreath
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
On-boarding with JanusGraph Performance
On-boarding with JanusGraph PerformanceOn-boarding with JanusGraph Performance
On-boarding with JanusGraph Performance
 
Leveraging Apache Spark to Develop AI-Enabled Products and Services at Bosch
Leveraging Apache Spark to Develop AI-Enabled Products and Services at BoschLeveraging Apache Spark to Develop AI-Enabled Products and Services at Bosch
Leveraging Apache Spark to Develop AI-Enabled Products and Services at Bosch
 
Reveal's Advanced Analytics: Using R & Python
Reveal's Advanced Analytics: Using R & PythonReveal's Advanced Analytics: Using R & Python
Reveal's Advanced Analytics: Using R & Python
 
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
Deep learning and streaming in Apache Spark 2.2 by Matei ZahariaDeep learning and streaming in Apache Spark 2.2 by Matei Zaharia
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
Cytoscape CI Chapter 2
Cytoscape CI Chapter 2Cytoscape CI Chapter 2
Cytoscape CI Chapter 2
 
[DLHacks]Introduction to ChainerCV
[DLHacks]Introduction to ChainerCV[DLHacks]Introduction to ChainerCV
[DLHacks]Introduction to ChainerCV
 
Application of the Actor Model to Large Scale NDE Data Analysis
Application of the Actor Model to Large Scale NDE Data AnalysisApplication of the Actor Model to Large Scale NDE Data Analysis
Application of the Actor Model to Large Scale NDE Data Analysis
 
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
 

Recently uploaded

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

Python Raster Function - Esri Developer Conference - 2015

  • 1. Python Raster Function: Custom On-the-fly Analysis Feroz Abdul Kadar Jamie Drisdelle
  • 3. What’s a Raster Function? • Mapping of one raster to another. • Loosely • Transient: on the fly. • Different from a geoprocessing tool. … a transformation of one raster into another. The Fundamentals
  • 4. What’s a Raster Function Chain? The Basic Model Function Raster Dataset Mosaic Dataset Item Image Service Mosaic Dataset A raster function “chain” encapsulate your algorithm as a tree of functions.
  • 5. What’s a Raster Function Chain? The Basic Model
  • 7. What’s a Python Raster Function? • Natural evolution of the raster function’s COM API—usually implemented in .NET • Implement a raster function from the comfort of your Python module. • Architecture: Module loaded by an adapter—Python-aware and a first-class participant in the function chain. Your Python module—assisted by ArcGIS—is a raster function. The Extended Model
  • 8. What’s a Python Raster Function? The Extended Model Function Raster Dataset Mosaic Dataset Item Image Service Mosaic Dataset
  • 9. Motivation • Extend ArcGIS—participate in a raster function chain. • Primary pipeline for image data in ArcGIS—processing, analyzing, and visualizing… on the fly. • Portable. Reusable. Dynamic. Fast. Scalable. • Why Python? - Friendly & easy to learn. “readability first”. “batteries included”. - Huge collection of libraries. Vibrant community of Pythonistas and Pythoneers. - “…de facto superglue language for modern scientific computing.” - “…tools for almost every aspect of scientific computing are readily available in Python.” Why Raster Functions in Python?
  • 10. An Example Raster Function in Python: Linear Spectral Unmixing Courtesy: Jacob Wasilkowski. @jwasil
  • 11. Linear Spectral Unmixing • Determines abundance of certain material in a particular pixel. • Typically performed on lower resolution imagery (like Landsat) • Input training endmember spectra required for each class Introducing a Sample Use Case
  • 12. Linear Spectral Unmixing The Process Soil Vegetation Non-photosynthetic vegetation Shadows Shadow: [70.05629, 27.24081, 25.31275, 24.17432, 31.77904, 17.82422] Veg: [65.46086, 30.09995, 26.27376, 117.45741, 76.96012, 26.25062] NPV: [74.74029, 32.06931, 35.57350, 32.66032, 73.63062, 60.51104] Soil: [143.65580, 79.30271, 102.82176, 93.60246, 176.57705, 117.49280] Linear Unmixing
  • 13. Demo A Python Raster Function in Action: Linear Spectral Unmixing Courtesy: Jacob Wasilkowski. @jwasil
  • 14. The API • How does ArcGIS Desktop or Server interact with my raster function? • Get started—step-by-step guide • Real-world or reference implementations—excellent springboard • Well-documented API reference • What additional libraries are needed? How complicated is it? • Lightweight design—no external dependencies outside of NumPy to begin with. • ArcGIS’ adapter provides assistance—opt out to take control of specific aspects. Create a new raster function using simple and familiar Pythonesque constructs. How do I create Raster Function in Python?
  • 16. The API • customize our function object—a specific instance of our class—as soon as it's created. • Define raster function name & description. __init__
  • 17. The API • Define all input parameters to the function. • For each parameter, define: - Name (Identifier) - Display Name - Long Description - Data Type - Default Value - Required vs Optional - … getParameterInfo()
  • 18. The API • How are input rasters read—Padding, Mask, …? • How’s the output raster constructed—inherit NoData, Metadata, …? • Given: Nothing. • Returns: dictionary containing configuration attribute values. getConfiguration()
  • 19. The API • Define a subset of input rasters. • Pixels read from selected rasters. • Given: properties of the requested pixel block, all scalar parameter values. • Returns: names of selected rasters. selectRasters()
  • 20. The API • Defines the output raster. • Invoked each time a dataset containing the Python raster function is initialized. • Given: Raster info associated with all input rasters. • Returns: Raster Info of the output raster. updateRasterInfo()
  • 21. The API • Workhorse of the raster function. Process Pixels. • Given: • Expected pixel-block size+location • output raster properties (map space) • pixels+mask of selected input rasters • Returns: Pixels+mask of requested pixel block. updatePixels()
  • 22. The API • Create or update dataset- or band-level metadata. • Given: • property names • band index • current key metadata values • Returns: updated values of given properties updateKeyMetadata()
  • 23. The API • Given: • info on parent product, • context of execution. • Returns: • OK to Run (Boolean)—Licensed to execute or not? • Expected product level and extension. isLicensed()
  • 26. What’s a Raster Function Template? A raster function template anonymizes select raster and scalar inputs as Variables. The Basic Model Template Input Raster Variables Input Scalar Variables Output Raster
  • 27. Raster Function Templates • Create new function templates - Via Raster Function Template Editor - Layer > Symbology > Export As Raster Function Template - Function Raster Dataset > Functions > Save as • Function Raster Layer in a Map • Image Analysis Window • Raster Functions Pane in Pro • Layer > Properties > Functions tab A raster function template makes your processing or analysis portable. Basic Workflows
  • 28. Raster Function Templates • On a Mosaic Dataset - Populating a mosaic using the Add Rasters tool - Mosaic dataset items - Batch Edit Raster Functions or - Edit Raster Function Geoprocessing Tool. - As Processing Templates • On an Image Service—for server-side processing Learn more at https://github.com/Esri/raster-functions#raster-function-templates. Advanced Workflows
  • 29. Raster Function Templates • Name & Description • Type: Item, Group, or Mosaic. • Definition Query • Fields that control grouping. Properties
  • 30. Demo Processing Templates on a Mosaic Dataset
  • 33. Performance • Vectorize. • Use NumPy and SciPy. • Use Cython: For production-grade performance. • Bridge to C/C++ implementations via ctypes or Boost.Python. Leverage well-known options to optimize time-critical parts of your raster function.
  • 34. Publishing & Deployment • Python version • Desktop vs. Pro: Python 2.7 vs. 3.4 • Desktop vs. Server: 32- vs. 64-bit Python 2.7 • Package dependencies • Binary deployment • CPython bytecode. Cython compiled binary. • isLicensed method to restrict usage.
  • 35. GitHub • https://github.com/Esri/raster-functions • Curated collection of raster functions and templates. • Go ahead: - Browse samples to learn more. - Fork the repo. Experiment. - Log defects or enhancement requests as issues. - Send pull requests to contribute code. GitHub enables collaboration. Where do functions and templates live?
  • 36. Wiki • https://github.com/Esri/raster-functions/wiki • Details of interaction between ArcGIS and your Python raster function. • Recommendations and techniques for writing effective raster functions Where do I find the story?
  • 37. The Road Ahead • Tools for testing your raster functions—profiling or debugging. • Streamline usability of Python raster functions in ArcGIS Pro. • Integration with Portal workflows. • Expand and maintain the wiki: API, recommendations, resources. …for Pythonistas and Pythoneers with a passion for scientific computing.
  • 38. In Closing • Powerful pipeline for processing, analysis, and visualization. - Raster Functions. Chains. Templates. • Using simple constructs in Python: participate and exploit. • Code and docs are on GitHub. • We’ll help you along the way—@jdrisdelle and @akferoz. Wake up! We are done.
  • 39. Rate This Session www.esri.com/RateMyDevSummitSession Sessions on related topics: Python: Working with Raster Data—Wednesday at 4:00 Python: Working with Scientific Data—Wednesday at 5:30 http://www.esri.com/events/devsummit/agenda

Editor's Notes

  1. Python (NumPy/SciPy) for numerical computing; Python (NumPy/SciPy/pandas/statsmodels) for statistical analysis; Python (MatPlotLib) for plotting and visualization Python (scikit-learn) for machine learning; “Python is becoming the de facto superglue language for modern scientific computing.” --http://profjsb.github.io/python-seminar/ “These days, tools for almost every aspect of scientific computing are readily available in Python.” --http://www.talyarkoni.org/blog/2013/11/18/the-homogenization-of-scientific-computing-or-why-python-is-steadily-eating-other-languages-lunch/
  2. “Spectral imaging sensors often record scenes in which numerous disparate material substances contribute to the spectrum measured from a single pixel. Given such mixed pixels, we want to identify the individual constituent materials present in the mixture, as well as the proportions in which they appear. Spectral unmixing is the procedure by which the measured spectrum of a mixed pixel is decomposed into a collection of constituent spectra, or endmembers, and a set of corresponding fractions, or abundances, that indicate the proportion of each endmember present in the pixel. Endmembers normally correspond to familiar macroscopic objects in the scene, such as water, soil, metal, or any natural or man-made material. Unmixing provides a capability that is important in numerous tactical scenarios in which subpixel detail is valuable.” – Nirmal Keshava
  3. import numpy as np class Addition(): def __init__(self): self.name = "Addition Function" def getParameterInfo(self): return [{ 'name': 'r', 'dataType': 'raster', }] def updatePixels(self, tlc, shape, props, **pixelBlocks): r = pixelBlocks['r_pixels'] + 10 pixelBlocks['output_pixels'] = r.astype(props['pixelType']) return pixelBlocks
  4. 10.3.1: . http://desktop.arcgis.com/en/desktop/latest/manage-data/raster-and-images/editing-function-chains-in-md.htm . http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/edit-raster-function.htm Pro: . http://pro.arcgis.com/en/pro-app/help/data/imagery/apply-functions-to-a-dataset.htm
  5. Cython extends Python syntax so that you can conveniently build C extensions, either to speed up critical code, or to integrate with C/C++ libraries.
  6. Learn more: http://desktop.arcgis.com/en/desktop/latest/analyze/sharing-workflows/deploying-custom-python-packages.htm