![Page 1: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/1.jpg)
Automating Image Management and
Dissemination using PythonJamie Drisdelle, Zoey Zou
![Page 2: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/2.jpg)
Overview
• Introduction to mosaic dataset and raster product
• Automate mosaic dataset authoring workflow with python
- To discover metadata in raster dataset
- To create and add data to mosaic dataset
- To configure mosaic dataset
• Introduction to image service
• Automate publishing/updating of image service with python
• Making image service REST request in python
![Page 3: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/3.jpg)
Mosaic Dataset
• A geodatabase data model used to catalog and process your collections
of imagery
- Stored as a table and viewed as a table or image
• Indirect pixel management
- Images can remain in their native format on disk or be loaded into the
geodatabase
• Unlimited size*
• Provides dynamic mosaicking and on-the-fly processing
• License requirement – Standard or Advanced
![Page 4: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/4.jpg)
Building a mosaic dataset
• Store in a geodatabase
- Build with geoprocessing tools
- Automation with models or Python
• Simple workflow
1. Create mosaic dataset
2. Add imagery (raster type)
3. Optionally, edit properties and functions
• Can interactively edit and view in ArcMap
- All layers are displayed
- Edit and add fields in table window
![Page 5: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/5.jpg)
Raster products
• Simplifies using sensor data
- Quick and easy visualization of common band combinations
- Simple drag-n-drop, less clicking
• Key metadata
- Sensor name
- Acquisition date
- Wavelength
• Function templates
- Multispectral, Pansharpen
• Temporary function raster dataset
![Page 6: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/6.jpg)
Image collection management with Mosaic Dataset
• Geoprocessing tools
- Creation
- Create Mosaic Dataset
- Add Rasters
- Remove Rasters
- Enhancement
- Define Mosaic Dataset Nodata
- Build Footprints
- Build Seamlines
- Color Balancing
- Optimize
- Build Overview
• All tools are accessible through arcpy
![Page 7: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/7.jpg)
Automate Mosaic
Dataset Creation
with Python
![Page 8: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/8.jpg)
Create Mosaic Dataset BasicDiscover the type of image data, use proper raster type
Check property to find data type
Add data to mosaic dataset with the correct type
Find raster data in your workspace
![Page 9: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/9.jpg)
Create Derived Mosaic Dataset
Create derived mosaic dataset
- Create derived mosaic dataset for specific project
- Add data from existing mosaic dataset to a new mosaic dataset
- Use Table raster type
![Page 10: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/10.jpg)
Create Derived Mosaic Dataset
Raster type settings are saved as art.xml file
Modify raster type settings
![Page 11: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/11.jpg)
Create Derived Mosaic DatasetModify raster type settings example
![Page 12: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/12.jpg)
Modify Mosaic Dataset
• Add/Join/Query new attributes to mosaic dataset tables
• Access mosaic dataset raster item in raster field
Modify mosaic dataset in catalog view
![Page 13: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/13.jpg)
Optimize Mosaic Dataset
• Define Nodata & Build Pyramids & Calculate Stats
• Build Seamlines & Apply Color Correction
• Build Overviews
More configuration
![Page 14: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/14.jpg)
Prepare Mosaic Dataset for Live Update
• Image Service places share lock on mosaic dataset
• Use Enterprise Geodatabase Mosaic Dataset
• No change of schema or create/delete table allowed
- Prepare boundary for future data
- Prepare fields and tables with Alter Mosaic Dataset Schema tool
- Fields for different raster types
- Tables for overviews, etc.
- Cannot change mosaic dataset properties while serving
- Number of bands
- Pixel type
- Cell size etc.
![Page 15: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/15.jpg)
Demo
![Page 16: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/16.jpg)
What can you do with an image service?
• Use it as an image (visual analysis)
• Use it as raster data (pixel analysis)
• Access it as a catalog (mosaic dataset)
![Page 17: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/17.jpg)
Image service source data
• Data sources
- Raster datasets
- Mosaic datasets
- Requires ArcGIS Server Image Extension
- Raster or mosaic layers
- To control rendering
- Preset some layer properties
- Predefined query
![Page 18: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/18.jpg)
How can you access an image service?
• ArcGIS Desktop
• ArcGIS Pro
• ArcGIS Explorer
• Web APIs (Silverlight, Flex, JavaScript)
• ArcGIS.com
• REST, SOAP
• WMS, WCS, KML
• 3rd Party Applications
![Page 19: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/19.jpg)
Publishing an image service
• New publishing workflow
• Register databases
• Share from data source
• Requires service definition (.sd)
![Page 20: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/20.jpg)
Publish and Update
Image Service with
Python
![Page 21: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/21.jpg)
Imagery Sharing
• Create publisher server connection file
• Create image service definition draft
Create image service definition draft
![Page 22: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/22.jpg)
Imagery Sharing
• A sample *.sddraft file
Configure service setting
![Page 23: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/23.jpg)
Imagery Sharing
• Add a raster function template to the service definition
Edit service setting
![Page 24: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/24.jpg)
Imagery SharingAnalyze service definition draft
![Page 25: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/25.jpg)
Imagery Sharing
• Stage *.sddraft file to service definition *.sd file
• Publish service definition file to ArcGIS Server
Stage and publish
![Page 26: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/26.jpg)
Demo
![Page 27: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/27.jpg)
Use Image Service
REST API with
Python
![Page 28: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/28.jpg)
Image Service REST API
• Get service information
• Query item
• Export Image
- Define geometry
- Define mosaic rule
- LockRaster to export from specific item
- Support compression
- Request different rendering rules
- Export format
- Only TIFF format keep spatial reference information
What is in REST API
REST API reference:
https://servername:6443/arcgis/sdk/rest/index.html
![Page 29: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/29.jpg)
Image Service REST API
• Construction request in JSON
• Submit request and get response with urllib2
Make REST request – the standard way
![Page 30: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/30.jpg)
Demo
![Page 31: Automating Image Management and Dissemnination using Python · Mosaic Dataset •A geodatabase data model used to catalog and process your collections of imagery-Stored as a table](https://reader030.vdocument.in/reader030/viewer/2022011913/5fac28adf56440073341faf5/html5/thumbnails/31.jpg)
Questions?