compute_poisson_potential: Compute the attractivity potential on a grid from balance...

View source: R/ttt_compute_poisson_potential.R

compute_poisson_potentialR Documentation

Compute the attractivity potential on a grid from balance value on polygon following the method of Tobler.

Description

Compute the attractivity potential on a grid from balance value on polygon following the method of Tobler. TTT equivalent of the potflow program of Waldo Tobler POTENTIAL FIELD FROM DATA GIVEN BY POLYGONS CONVERTED TO A LATTICE USING THE POLYGRID PROGRAM. COMPUTED AS THE SOLUTION TO THE POISSON EQUATION WITH BOUNDARY CONDITION DZ/DN=0. SUMMER 1978, REVISED, CONVERTED TO BASIC, SPRING 1994. Rev 6/8/98 poisson.potential returns an sf

Usage

compute_poisson_potential(
  xsf,
  varname = "delta",
  method = "jacobi",
  nb_it = 1000,
  cellsize = sqrt((sf::st_bbox(xsf)[3] - sf::st_bbox(xsf)[1]) * (sf::st_bbox(xsf)[4] -
    sf::st_bbox(xsf)[2])/2500)
)

Arguments

xsf

an sf data.frame of polygons

varname

name of the feature where the balance of each polygons are stored

method

resolution method for poisson equation either jacobi or solve

nb_it

number of iteration for jacobi resolution

cellsize

size of the

Value

an sf data.frame with

Examples

data(dollars)
dollars$polygones$delta = rowSums(dollars$OD)-colSums(dollars$OD)
pot=compute_poisson_potential(dollars$polygones)

tributetotobler/ttt documentation built on Sept. 15, 2022, 5:41 p.m.