The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open...
Transcript of The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open...
The integration of land change modelingframework FUTURES into GRASS GIS 7
Anna Petrasova, Vaclav Petras, Douglas A. Shoemaker, MonicaA. Dorning, Ross K. Meentemeyer
NCSU OSGeo Research and Education LabCenter for Geospatial AnalyticsNorth Carolina State University
July 16, 2015
1 / 39
FUTURES
FUTure Urban-Regional Environment Simulation (FUTURES)
stochastic, patch-based landchange model
simulates urban growth
model accounts for location,quantity, and pattern of change
incorporates positive feedbacks(new development attractsmore development)
allows spatial non-stationarity
2 / 39
[Meentemeyer et al., 2013]
3 / 39
The dark side of FUTURES
no documentation
know-how limited to certaincolleagues
code not reusable
different versions of code
no central storage for code
extensive manual data preparation
bad choice of programming language
https://xkcd.com/221
4 / 39
Open source approach
We hope FUTURES can make broader impact in land changecommunity...
...but more than just releasing the code online is needed.
We can take example from many open source projects which haveestablished ways and technologies for
collaboration
code development and distribution
providing documentation, user support
5 / 39
Integration
Standalone vs. integrated into open source GIS:
+ all standard GIS tools andalgorithms available
+ distribution and installationacross all platform solved
+ established ways to providedocumentation
+ existing user base withsupport
– less flexibility in certainaspects
– need to learn to use theparticular GIS
6 / 39
GRASS GIS
Why integrate FUTURES into GRASS GIS 7?
able to process large datasets
runs on HPC clusters
efficient I/O libraries
modular architecture – modules in C/C++ and Python, R
automatically generated CLI and GUI
addons hosted on OSGeo servers
easy installation: > g.extension r.futures
daily compiled binaries for Windows (thanks to M. Landa,FCE CTU in Prague)maintained by community and developers (API changes)
7 / 39
FUTURES conceptual diagram
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
8 / 39
FUTURES conceptual diagram
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
9 / 39
FUTURES conceptual diagram
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
10 / 39
Patch Growing Algorithm
stochastic algorithm
converts land in discrete patches
implemented in C/C++
computationallydemanding
inputs are patchcharacteristics(distribution of patchsizes and compactness)derived from historicaldata
11 / 39
Patch Growing Algorithm
stochastic algorithm
converts land in discrete patches
implemented in C/C++
computationallydemanding
inputs are patchcharacteristics(distribution of patchsizes and compactness)derived from historicaldata
12 / 39
Patch Growing Algorithm
stochastic algorithm
converts land in discrete patches
implemented in C/C++
computationallydemanding
inputs are patchcharacteristics(distribution of patchsizes and compactness)derived from historicaldata
13 / 39
Patch Growing Algorithm
stochastic algorithm
converts land in discrete patches
implemented in C/C++
computationallydemanding
inputs are patchcharacteristics(distribution of patchsizes and compactness)derived from historicaldata
14 / 39
Patch Growing Algorithm
stochastic algorithm
converts land in discrete patches
implemented in C/C++
computationallydemanding
inputs are patchcharacteristics(distribution of patchsizes and compactness)derived from historicaldata
15 / 39
FUTURES conceptual diagram
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
16 / 39
DEMAND submodel
estimates the rate of per capita land consumption specific toeach subregion
extrapolates between historical changes in population andland conversion
Population
Develo
ped
are
a
1996
2006
2015
2025
2035 inputs are historicallanduse, population data,population projection
ordinary least squaresregression (linear orlogarithmic relationships)
informally implementedas R scripts and ArcGISworkflows
17 / 39
FUTURES conceptual diagram
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
18 / 39
POTENTIAL submodel
multilevel logistic regression for development suitability
accounts for variation among subregions (for example policiesin different counties)
inputs are uncorrelatedpredictors (distance to roadsand development, slope, ...)
original implementation
data preparation in ArcGISregression coefficients derivedin Rpotential and probabilitysurface recomputed aftereach step in the main C code
19 / 39
Implementation overview
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
20 / 39
Implementation overview
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
r.futures.pga
21 / 39
r.futures.pga
Originally standalone C++ code converted into GRASS GIS addon
efficient raster reading and writing
fixed segfaults
general cleanup (dead code), revised input options
r.futures.pga [-s] developed=name predictors=name[,name,...]
demand=name devpot params=name discount factor=value
...
incentive table=name [constrain weight=name] [random seed=value]
output=name [output series=basename] [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
22 / 39
r.futures.pga
Originally standalone C++ code converted into GRASS GIS addon
efficient raster reading and writing
fixed segfaults
general cleanup (dead code), revised input options
23 / 39
r.futures.pga
Originally standalone C++ code converted into GRASS GIS addon
efficient raster reading and writing
fixed segfaults
general cleanup (dead code), revised input options
24 / 39
r.futures.pga
Originally standalone C++ code converted into GRASS GIS addon
efficient raster reading and writing
fixed segfaults
general cleanup (dead code), revised input options
25 / 39
r.futures.pga
Originally standalone C++ code converted into GRASS GIS addon
efficient raster reading and writing
fixed segfaults
general cleanup (dead code), revised input options
26 / 39
Implementation overview
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
r.futures.pgar.futures.calib
27 / 39
r.futures.calib
New addon written in Python for automated calibration of patchcharacteristics
provides optimal patch parameters for r.futures.pga bycomparing observed land change pattern with the simulatedpattern
runs in multiple processes
Higher compactness Lower compactness
28 / 39
Implementation overview
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
r.futures.pgar.futures.calib
r.futures.demand
29 / 39
Implementation overview
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
r.futures.pgar.futures.calib
r.futures.demand
r.futures.potential
30 / 39
r.futures.potential & r.futures.demand
Implementation still needed for
r.futures.demand – Python and Numpy
r.futures.potential
R wrapped in Python to provide standard GRASS interfaceusing dredge from R package MuMIn1 for automated modelselection (read the dredge disclaimer before using)
DEMAND and POTENTIAL statistical models can be implementedin different ways, but we need reference implementation.
1http://cran.r-project.org/web/packages/MuMIn/MuMIn.pdf31 / 39
Implementation overview
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
r.futures.pgar.futures.calib
r.futures.demand
r.futures.potential
r.sample.category
32 / 39
Implementation overview
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
r.futures.pgar.futures.calib
r.futures.demand
r.futures.potential
r.sample.category
r.futures.devpressure
33 / 39
Data preprocessing for POTENTIAL
Two new Python modules needed for FUTURES datapreprocessing, but can be used for other applications:
r.sample.category
Create sampling points fromeach category in a raster map
source: r.sample.category manual page
r.futures.devpressure
Moving window computation ofdistance decay effect
34 / 39
Implementation overview
SUB-MODELS OUTPUTSINPUT DATA
DEVELOPMENTPOTENTIAL
[Location]
PATCH GROWINGALGORITHM[Spatial Structure]
HISTORICALDEVELOPMENT
PATTERNS
ENVIRONMENTAL,INFRASTRUCTURAL,SOCIO-ECONOMIC
PREDICTORS
HISTORICALPOPULATION
& PROJECTIONS
DEVELOPMENTOUTCO MESSize & Shape?
Where?
Howmanypeople?
LANDDEMAND
[Quantity]
r.futures.pgar.futures.calib
r.futures.demand
r.futures.potential
r.sample.category
r.futures.devpressure
conceptual vs. userview
35 / 39
Next steps
Finish r.futures.demans and r.futures.potentialMore documentation needed:
tutorial
sample dataset – Raleigh for consistency with GRASS GISNorth Carolina sample dataset
use publicly available data (National Land Cover Database)
NLCD 2011
36 / 39
What do I need to run it?
1 Gather data (historical urban development, populationprojection, predictors)
2 Use a high-end workstation
3 Installation is simple, works on all platforms:
> g.extension r.futures
Code available online:trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.futures/
37 / 39
Take home message
1 Integrate your work into FOSS
2 Automate tasks
3 Document!
Thank you!
Contact: [email protected]
38 / 39
References
Meentemeyer, R. K., Tang, W., Dorning, M. A., Vogler, J. B., Cunniffe,N. J., & Shoemaker, D. A. (2013)
FUTURES: Multilevel Simulations of Emerging Urban–Rural LandscapeStructure Using a Stochastic Patch-Growing Algorithm
Annals of the Association of American Geographers, 103(4), 785–807.
Dorning, M. A., Koch, J., Shoemaker, D. A., & Meentemeyer, R. K.(2015)
Simulating urbanization scenarios reveals tradeoffs between conservationplanning strategies
Landscape and Urban Planning, 136, 28–39.
39 / 39