Module 04
Maps for field use
Yesterday in the Great Smokies
Webcam
archive
GEO 409: Advanced GIS
Quick look ahead
🏀🤯
Five more modules
Field mapping
Intro to Lidar
Lidar II
3D mapping
Final project
Virtual field trip to
Downtown Lexington
38.046354,-84.495006
Imagery
Aerial vs. terrestrial
Active vs. passive sensors
Oblique vs. orthographic
Resolution
temporal (how old is it?)
spatial (how much detail is in it?)
spectral (color, b/w?)
Historic images from
ExploreUKy.edu
Goals
Review labs
create map layouts in ArcGIS Pro
make our first web page
and load maps into mobile app.
Lab review
Lab 3
Copy pasta 💣 no longer works as expected.
Fundamental skills are important.
Can I address my data?
Can I keep track of variables?
Do I practice?
Do I come to class, office hours, or ask questions?
This is challenging but with big reward.
We'll spend more time on this lab today.
In-class task
Load module and lab 3.
Open Catalog and investigate the data.
Prepare to run the lab 3 Notebook.
Picnic committee
Chairwoman: "Shearer, what is this Notebook?"
"We wanted the south facing slopes!"
Me: "I wrote a script to find the best spot."
"Either greater than SE or less than SW."
Chairwoman: "Check that logic!"
Picnic committee
Chairwoman: "We wanted the highest point and lowest elevation on campus!"
"And what's that funny business in the last cell?"
"Didn't we ask for a pretty Markdown cell?"
Me: "🥵 but hold on, I can fix that. 😎"
### Lab 3 [Example Notebook](https://nyc3.digitaloceanspaces.com/astoria/geo409/apps/blshea1_example_Lab-03.ipynb) --- ```python import arcpy # Set workspace arcpy.env.workspace = 'C:\\BoydsGIS\\data\\uky\\campus.gdb' # Set coordinate system to Kentucky ky = arcpy.SpatialReference(3089) arcpy.env.outputCoordinateSystem = ky # Overwrite existing files arcpy.env.overwriteOutput = True ``` --- ```py # Verify fc = arcpy.ListFeatureClasses() print(fc) # prints ['boundary'] ``` --- ```py dsm_data = 'https://kyraster.ky.gov/arcgis/rest/services/ElevationServices/Ky_DSM_First_Return_5FT_Phase1/ImageServer' dem_data = 'https://kyraster.ky.gov/arcgis/rest/services/ElevationServices/Ky_DEM_KYAPED_5FT/ImageServer' naip_2022 = 'https://kyraster.ky.gov/arcgis/rest/services/ImageServices/Ky_NAIP_2022_2FT/ImageServer' # Set extent arcpy.env.extent = 'boundary' # Load rasters dsm = arcpy.sa.Raster(dsm_data) dem = arcpy.sa.Raster(dem_data) naip = arcpy.sa.Raster(naip_2022) ``` --- ```python # Extract DEM and DSM to the campus AOI dem_e = arcpy.sa.ExtractByMask(dem, 'boundary') dsm_e = arcpy.sa.ExtractByMask(dsm, 'boundary') # Save them to workspace dsm_e.save('dsm_campus') dem_e.save('dem_campus') ``` --- ### After you extract campus from DEM and DSM ```python print(dem_e.getStatistics()) print(dsm_e.getStatistics()) ``` --- ```python # Create height model using the DSM and DEM height = dsm_e - dem_e # save height.save('height_campus') # Verify height ``` --- ```python # Find the highest point on campus max_height = arcpy.sa.ExtractByAttributes(height, f'VALUE = {height.maximum}') arcpy.conversion.RasterToPoint(max_height, f'highest') ``` --- ```python # Create aspect aspect = arcpy.sa.SurfaceParameters(dem_e, 'ASPECT', "#", "#", "#", "Foot") aspect ``` --- ```python # Extract NAIP to the campus AOI naip_e = arcpy.sa.ExtractByMask(naip, 'boundary') naip_e.save('naip_campus') # Create NDVI ndvi = arcpy.ia.NDVI(naip_e) ndvi.save('ndvi_campus') # Verify ndvi ``` --- ### Compare ```python # Make the query to find the best picnic spot south = ((aspect > 170) & (aspect < 190)) south2 = ((aspect > 170) | (aspect < 190)) ``` --- ### Markdown syntax ```md # Markdown Example 1. An area of campus that is not under trees and on a south facing slope is... 2. Tallest feature on campus is... 3. Lowest elevation on campus is... ![alt text](https://upload.wikimedia.org/wikipedia/commons/8/80/Picnic_in_Columbus.jpg) ``` --- ## Markdown rendered in browser 1. An area of campus that is not under trees and on a south facing slope is... 2. Tallest feature on campus is... 3. Lowest elevation on campus is... ![alt text](https://upload.wikimedia.org/wikipedia/commons/8/80/Picnic_in_Columbus.jpg)
Lab 4
Cartography! 💪
Using data from the last two lessons.
Taking a break from Python and ArcPy (if you have the required data)
to focus on ArcGIS Pro and web publishing.
Base map of Kentucky
Should have layers clipped to the state boundary
from module two.
Example
Notebook
.
Canopy height model
Should have layers for height and vegetation
from module three.
Example
Notebook
.
Problems?
Temporal resolutions.
Active vs. passive sensors.
In-class task
Use 2010 NAIP imagery to create vegetation index
using this
Notebook
.
Cartography
Cartography
Good maps depend on good data.
What's good?
Precise?
Accurate?
Comprehensive?
Relative to your understanding of the possibilities and limitations of the data.
Don't force it
Our checkpoints
1. Inspiration
Theme? Style? Color?
Check out the
David Rumsey Map Collection
2. Purpose
"My map shows..."
Revealed in concise title, subtitle, etc.
3. Medium
Digital data
as static image.
Literally painting with pixels.
Do artists know their medium?
4. Method
Obtain
visual hierarchy
.
Base map – ground – provides context
with layers of information – figures – ascending visually in importance.
Presentation is balanced & cohesive, with purpose easily understood.
5. Revision
Does it work?
Iterate over
purpose
medium
method
In-class task
Create layouts for
Kentucky Counties with selected land cover classes
Tree canopy height model for UKy central campus
(See lesson videos.)
Publishing
Requires more coding
Export Layout
Share
Web JPEG
Geospatial PDF
Coding tools ✏️📓🎓
Code stored as plain-text file
language given by file name extension.
A good text editor
highlights language
syntax
has a lot of extensions
and is 🚫
not
Notepad, MS Word, etc.
Our editors
Install
VS Code
🔥
Sharing tools
What if we lost work?
Share (synchronize) to a remote backup
and to remote collaborator(s).
Git
"Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people."
Git history
Git
was created by Linus Torvalds in 2005 for development of the Linux OS, with other developers contributing to its development.
GitHub.com
The web platform (owned by Microsoft) that uses Git to host collaborative coding and design projects.
Git is a DVCS
Distributed
local <=> remote projects synched (the backup)
Version Control
create snapshots of project at anytime
branch project to multiple versions
System
can scale up to many collaborators.
This is killer 🗡️
We can work on our own computer (with all of its resources)
while synchronizing with other remote collaborators.
Discover what others are
making
.
Git jargon
repository – the project
local – the computer you are at now
remote – a computer you do not have physical access to
clone – create a local synched copy from remote repo
commit – make snapshot of your project
push – put your changes to the remote
pull – get new changes from the remote
Install GitHub Desktop
Install
GitHub Desktop
.
Sign in to GitHub Desktop with your GitHub.com account.
Preferences > Accounts (macOS)
File > Options > Accounts (Windows OS)
Our workflow
Find invitation to lesson on Canvas
Accept invite and clone remote repo
Commit changes as you work
Push changes when you are finished
Pull changes when I request
CLONE
Markdown
A
simple markup language
(a method to style text) created in 2004 that looks good in source code form
uses the
.md
file extension
widely used in README files, common project documentation.
Use these
examples
as a guide editing Markdown.
MAKE
CHANGES
undo
Can undo almost anything
in GitHub Desktop
before commit:
Discard
changes
after commit:
Revert
last commit
Command line options
provide more control.
Git tips
Add @UKy-GIS to your GitHub.com profile
Fetch
and pull before you start
Commit and push often
Never store a repo inside another repo
100 MB file size limit 🐉 NEVER store downloaded data in a repo
In-class task
Clone down module repo
to root GIS folder.
Makes changes
commit and push up changes.
Mobile mapping
Avenza Maps
Geospatial PDFs (and TIFFs)
on your device
without cellular service.
In-class task
Load a map into Avenza Maps
from your repo.
Or, from the lesson.
STOP