Learning
This page covers the three subjects this app sits on: GIS, Earth Engine and machine learning. Each section gives you the smallest set of ideas that makes the next document readable, then links to the documents themselves.
Note These links go to other organisations. They are not part of Nexstrata, and FRMS does not control them.
GIS basics
GIS is the handling of data that has a position on the Earth.
Vector and raster
Spatial data comes in two kinds.
- Vector data is points, lines and polygons. Each shape carries attributes. An observation is a point. A county boundary is a polygon. The observations in this app are vector data.
- Raster data is a grid of cells. Each cell holds one number for each band. Elevation, rainfall and satellite imagery are rasters. Each map layer in this app is a raster.
The pipeline does one job: it reads the raster cell below each vector point.
Coordinates
A coordinate needs a reference system before it means a place. This app uses WGS 84 (EPSG:4326), which is latitude and longitude in degrees. GPS units report the same system, so the numbers agree.
The map draws in Web Mercator (EPSG:3857), like almost every web map. Web Mercator makes areas near the poles look much larger than they are. Greenland is the usual example.
Resolution and scale
The resolution of a raster is the ground size of one cell. Sentinel-2 is 10 m. SRTM is 30 m. CHIRPS rainfall is approximately 5 km.
A value read at a point describes the whole cell. At 5 km, "the rainfall at this log" is the rainfall across an area larger than most towns.
Zoom does not add resolution. When you zoom past the native resolution of a layer, the app stretches the tiles. Read Layer keys and dates.
GIS: where to read more
- A Gentle Introduction to GIS โ free, short, and does not assume software.
- QGIS โ free desktop GIS. Open an export from this app in it. Read Export.
- The QGIS training manual โ a longer, practical course.
- EPSG.io โ look up a coordinate reference system by code.
Earth Engine
Google Earth Engine is a catalogue of public raster data, with a compute engine next to it. You do not download the rasters. You send the calculation to them.
The four objects
Almost every script uses four types:
ee.Imageโ one raster, with one or more bands.ee.ImageCollectionโ many images, usually a time series. Sentinel-2 is an image collection.ee.Featureandee.FeatureCollectionโ vector data. Your points are a feature collection.ee.Reducerโ how to combine many values into fewer. A mean, a median, a maximum, a histogram.
A typical script filters a collection by date and area, reduces it to one image, and samples that image at a set of points. That is what the enrichment pipeline does.
The one idea that confuses everyone
Your script runs in your browser. The calculation runs on Google's servers.
An ee.Number is not a JavaScript number. It is a description of a calculation that has not happened yet. You cannot print it with console.log and see a value. You must call getInfo(), or print() in the Code Editor, and wait.
This is also why a loop over an ee.List in JavaScript is slow or impossible. Use map() on the Earth Engine object instead.
Cost
Earth Engine charges for compute. A commercial project pays. A noncommercial project has a quota.
Two habits keep the cost low:
- Filter first. Filter by date and area before you do anything else.
- Export once. When a result does not change, write it to an asset and read the asset. Read Your own layers.
Earth Engine: where to read more
- The Earth Engine guides โ the official documentation. Start with "Get Started".
- The data catalogue โ each dataset with its bands, its resolution and its terms.
- The Code Editor โ write and run scripts in the browser.
- Google Earth Engine 101: An Introduction for Complete Beginners โ video. Start here if watching somebody work is easier than reading documentation.
- Google Earth Engine 101 โ StoryMap by Stace Maples. The same beginner introduction as a page you read at your own pace.
- Cloud-Based Remote Sensing with Google Earth Engine โ a free book of tutorials, from first script to applied work.
- geemap โ Earth Engine from Python, with maps in a notebook.
- The Awesome GEE Community Catalog โ datasets not in the official catalogue.
Machine learning basics
Machine learning fits a function to examples. You give it inputs and answers. It produces a rule that maps one to the other.
The words
- A feature is one input column. Elevation, slope and NDVI are features.
- A label is the answer you want. "This species fruits here" is a label.
- Supervised learning has labels. Unsupervised learning does not. The live clustering on the map is unsupervised: it groups the points without being told what the groups are.
- A model is the fitted rule.
The three mistakes
Overfitting. A model can memorise the examples instead of learning the pattern. It performs well on the data it saw and badly on new data.
Always hold data back. Fit the model on one part. Test it on the other. A score on the training data is not a result.
Leakage. Nearby points are not independent. Two finds 50 m apart share their elevation, slope and weather. A random split therefore puts nearly the same record in both the training set and the test set, and the score comes out too high.
Split by block or by region instead. This is spatial cross-validation.
Bias in the examples. A model learns the data you gave it, including its collection bias. A model fitted on iNaturalist records learns where people walk as well as where mushrooms fruit.
Machine learning: where to read more
- scikit-learn: an introduction to machine learning โ the standard Python library, with a short tutorial.
- Google's Machine Learning Crash Course โ free, and it covers the three mistakes above properly.
- An Introduction to Statistical Learning โ a free textbook. Read this when the crash course leaves you with questions.
Species distribution models
A species distribution model (SDM) fits the environment where a species was found, then maps where similar environments are.
This is the natural next step for the data in this app. The observations carry the coordinates. The enrichment carries the environment at those coordinates.
Presence-only data
An SDM usually has a hard problem: the data records where a species was found and never where it was not.
An absence of records means one of two things. The species is not there, or nobody looked. An iNaturalist dataset has a great deal of the second.
A presence-only method compares the presences against background points. Background points describe the range of available environments, not the places where the species is absent.
MaxEnt
MaxEnt is the most used presence-only method. It finds the distribution that matches the environment of the presence points and is otherwise as close to the background as possible. "Maximum entropy" is that last clause: assume nothing that the data does not say.
In practice MaxEnt is a form of penalised regression. The penalty, called regularisation, stops it from fitting noise.
How to begin with the data in this app
- Choose one species. Start with a species that has several hundred records. Fewer than approximately 30 presences is not enough for a testable model.
- Run an enrichment job over those records, with the terrain, soil and vegetation layers switched on. Read Pipeline jobs.
- Export the result as CSV or GeoJSON. Read Export.
- Remove the obscured records. iNaturalist obscures the location of sensitive taxa. The environment at an obscured point describes a place where the observation was not. The export carries the accuracy and precision columns so you can filter on them.
- Thin the records. Keep one record per cell of approximately 1 km. This reduces the effect of one well-visited trailhead.
- Choose the background. Use the other records in the dataset as the background, not a random sample of the map. Those records are the places where people looked and found something else. This is the target-group background method, and it is the most effective correction for bias in opportunistic data.
- Fit and test the model. Use spatial blocks for the test split, not a random split.
- Read the response curves before the map. A response curve shows what the model learned about one variable. A curve that rises with distance from a road tells you the model learned the effort, not the species.
Which software
| Tool | Where it runs | Notes |
|---|---|---|
ee.Classifier.amnhMaxent | Earth Engine | MaxEnt inside Earth Engine. The predictors are already there. |
| elapid | Python | MaxEnt and related models, with a scikit-learn interface. |
| SDMtune | R | Fits, tunes and tests. Good documentation on the tests. |
| Wallace | R, in a browser | A guided interface. It writes the code for what you did. |
MaxEnt: where to read more
- Elith et al., A statistical explanation of MaxEnt for ecologists โ read this first. It is the clearest description of what MaxEnt actually computes.
- Merow et al., A practical guide to MaxEnt โ the settings, and what each one does to the result.
- Phillips et al., Sample selection bias and presence-only distribution models โ the target-group background method in step 6 above.
- Valavi et al., blockCV โ spatial cross-validation, and why a random split gives a score that is too high.
- Species Distribution Modeling with MaxEnt โ video. A walkthrough of fitting a MaxEnt model.
Soils
Soil decides how long the ground stays wet after rain. That is the half of fruiting weather that a rainfall layer cannot tell you.
The soil layers in this app draw texture class, depth to bedrock and sand content. Read What the layer groups contain.
The formal classification of soils in the United States is USDA soil taxonomy. It is a hierarchy of six levels: order, suborder, great group, subgroup, family and series. The twelve orders at the top are the level useful on a map.
- USDA soil taxonomy on Wikipedia โ the twelve orders, with what defines each one.
- Keys to Soil Taxonomy โ the official reference from the USDA NRCS.
- Web Soil Survey โ look up the mapped soil at one place in the United States.
- Soil Orders and the Hierarchy of Soil Taxonomy โ video. Six levels and twelve orders is a lot of vocabulary to meet on a page.
- Soil Classification โ video. How soils are grouped and why the class tells you how the ground behaves.
Mycology
- The Front Range Mycological Society โ forays, identification help and talks.
- iNaturalist โ where the observations in this app come from. Add your own.
- MycoPortal โ herbarium records, which are vouchered where an iNaturalist record usually is not.
- Index Fungorum โ the current accepted name for a fungus.