Advanced Analysis of Satellite Imagery
Using Python
Hong Xu, Kaixi Zhang
Workshop Outline
• ArcGIS is a platform for imagery
• ArcGIS has rich image analysis APIs
- This workshop will focus on Python, specifically ArcPy in Pro 2.5 release
• Use cases
- Annual Max NDVI Trend Analysis using time series Landsat images
- Analyze land cover changes using linear spectral unmixing
ArcGIS Provides a Comprehensive Platform for Imagery and Remote Sensing
Analysis
Visualization & Indexes
Exploration Change Analysis
Management Image Space
and Mensuration
& Dissemination
Classification
Image
Analyst
Raster
Oriented Imagery Processing
AI / Deep Learning Functions
Full-Motion Video
Charting
Image Server
Map Production
Street Views Ortho Mapping
Spectral Profile
Drone Mapping
Content Stereo
Temporal
Profile
Small Sats
High-Resolution Satellites Seamless
Orthophotos
Drone2Map
DTM Ortho Maker
Generation
Aerial Photos All Major Sensors
Integrated and Massively Scalable
Drones
Data Management
Making Imagery Accessible – Image Management and Dissemination
• Mosaic datasets - optimal data model for managing imagery and rasters
• 20+ satellite data: Landsat, MODIS, Sentinel, etc.
• Reference imagery and maintain metadata
• Define processing to be applied
• Scalable and flexible
• Multidimensional raster
• Supports multidimensional raster analysis
• Image server
• Dynamic Mosaicking
• On-the-fly processing
• Persist large datasets as required
• Scalable
• Server as Image Services, WMS, WCS, KML
Image Analysis
Extracting Information from Imagery
Classification, deep learning, machine learning, prediction,
multidimensional raster analysis
• Image Analyst tools and ArcGIS Pro UX
-Complete image classification
workflow
-Interface with deep learning
toolkits to create training data
-Inferencing to identify, label, or
classify imagery
• Raster functions - fast on-the-fly and persisted image processing
• Raster analytics - scale up and distribute analysis for large datasets
ArcGIS Python Environment for Image Processing and Analysis
• Python packages
- ArcPy
- [Link] (Image Analyst)
- ArcGIS API for Python
• Code snippets and demos use
- ArcPy in Pro 2.5
- ArcGIS Notebooks
Processing One Image Raster Function
• Raster
NDVI
band
...
band
Process a Collection of Images
• Landsat time series imagery
- 16-day cycle, 40 years
- 30m/10m
- Blue, Green, Red, NIR, SWIR-1, SWRI-2, TIR, Pan
• To discover
- What is the water occurrence rate in past 10 years?
- Did deforestation happen in this area?
- What are the land cover changes?
- What are the pattern and trend?
- Etc.
Workflow of Processing a Collection of Images Using Python
Raster Filter Map Reduce
Collection
Use Case 1 : Annual Max NDVI Trend Analysis using time series Landsat
images
• Input: a folder contains 173 Landsat scenes
• Output: a time series Annual Maximum NDVI and a trend raster
Raster Collection Raster
Collection Filter Map Reduce
RasterCollection (rasters, {attribute_dict})
RasterCollection
item Raster
Attribute_1
...
...
Attribute_N
item
Raster Collection Raster
Collection Filter Map Reduce
• Created from
- List of rasters
- mosaic dataset , Image service, multidimensional raster
[Link]
[Link]
Filter Raster
Collection Filter Map Reduce
• Filter items by
- Spatial extent
- Time extent
- Geometry
- Where clause and attributes
- Raster properties
Map Raster
Collection Filter Map Reduce
• Map a function for each item in the RasterCollection
- N -> N
• [Link](func)
N -> N
def MyFunc(item):
in_raster = item[‘Raster’]
processed_raster = process_function(in_raster…)
return {‘raster’:processed_raster, …}
processed_rc = [Link](MyFunc)
Map Raster
Collection Filter Map Reduce
• Support many built-in functions
Band index functions
BandArithmatic, Cig, Cire,ClayMinerals, EVI, FerroursMinerals, GEMI, GNDVI, GVITM, IronOxide, MSAVI, MTVI2, NDVI,
NDVIre, NDWI, PVI, RTVICore, SAVI, SRre, Sultan, TSAVI, VARI
Classification
Random Tree, Support Vector Machine, Maximum Likelihood, ISO Cluster, Linear Spectral Unmixing.
Pixel stretch functions
Stretch, convolution, Pansharpen, and etc.
Analysis functions
TasseledCap, Threshold, HeatIndex, WindChill, Apply and etc.
[Link] (in_raster, raster_function, {raster_function_arguments})
- more…
• Custom functions
Reduce Raster
Collection Filter Map Reduce
• Reduce by computing pixel values from items
- N->1
• Supported methods
- Min, Max, Mean, Sum, Median, Majority
- Mosaic (Frist, Last)
N -> 1
Multidimensional Analysis Raster
Collection Filter Map Reduce
• Convert to a multidimensional raster Multi-
dimensional
- RasterCollection::ToMultidimensionalRaster Analysis
• Perform analysis using functions N -> M N -> 1
- Aggregate
- Anomaly
- Trend
- Multidimensional algebra
- …
Annual Max NDVI
Trend Analysis using
time series Landsat
images
Kaixi
Analyze land cover
changes using linear
spectral unmixing
Kaixi
Use Case 2: Analyze Land Cover Change Using Linear Unmixing
• Input: a mosaic dataset contains 1087 Images
• Processing: linear unmixing function
• Output: time series fraction + statistics output
Mosaicking a Collection of Images
• [Link] (mosaic_method)
- [Link](‘LAST’)
- [Link](‘FIRST’)
• Code snippet: mosaic RGB band of most recent images
Processing Settings
• Output formats
- CRF (.crf) : output one item or multiple items as a multidimensional raster
- TIFF (.tif) : Output single item
• Output compression
[Link] = "LERC 0.01" # for controlled accuracy
[Link] = "LERC 0" # lossless
[Link] = " LZ77 75" # lossless
[Link] = " JPEG 75" # lossy
• Parallel processing factor
- [Link] = "6"
- [Link] = "90%"
Help References
• [Link]
• [Link]
[Link]
• Same capabilities and APIs for ArcGIS for Python will be available in ArcGIS 10.8.1
Understanding Urban Expansion Using Nightlight Imagery
• Yearly nightlight images (1992-
2013)
• Trend function
• Render as RGB