The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open...

39
The integration of land change modeling framework FUTURES into GRASS GIS 7 Anna Petrasova, Vaclav Petras, Douglas A. Shoemaker, Monica A. Dorning, Ross K. Meentemeyer NCSU OSGeo Research and Education Lab Center for Geospatial Analytics North Carolina State University July 16, 2015 1 / 39

Transcript of The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open...

Page 1: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 2: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 3: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

[Meentemeyer et al., 2013]

3 / 39

Page 4: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 5: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 6: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 7: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 8: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 9: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 10: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 11: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 12: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 13: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 14: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 15: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 16: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 17: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 18: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 19: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 20: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 21: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 22: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 23: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 24: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 25: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 26: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 27: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 28: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 29: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 30: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 31: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 32: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 33: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 34: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 35: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 36: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 37: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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

Page 38: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

Take home message

1 Integrate your work into FOSS

2 Automate tasks

3 Document!

Thank you!

Contact: [email protected]

38 / 39

Page 39: The integration of land change modeling framework FUTURES ...Standalone vs. integrated into open source GIS: +all standard GIS tools and algorithms available +distribution and installation

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