sdr_create_json_catchment: Creates a GeoJSON probabilistic catchment for a station

Description Usage Arguments Details

View source: R/sdr_create_json_catchment.R

Description

Creates a GeoJSON probabilistic catchment for a station. Includes a spatial query to check that any candidate postcodes are within the 60 minute service area of the station (only important for concurrent mode as for isolation mode only those postcodes within 60 minutes of a station will be in that station's probability table).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sdr_create_json_catchment(
  con,
  schema,
  type,
  pcpoly = FALSE,
  crs,
  tablesuffix,
  abs_crs = NULL,
  cutoff = 0.01,
  tolerance = 0.1
)

Arguments

con

An RPostgres database connection object.

schema

Character, the database schema name.

type

Character, must be either "proposed" or "abstraction". Indicates whether this catchment is required for a proposed station or as part of an abstraction analysis. See details.

pcpoly

Logical. If TRUE the postcode polygon dataset is available and will be used for the catchment. If FALSE, the catchment will just consist of the postcode centroids. Default is FALSE.

crs

Character, the crscode of the station the catchment is for.

tablesuffix

Character, suffix of the probability table (i.e. the part after "schema.probability_")

abs_crs

Character, the crscode of a proposed station (or "concurrent" if using concurrent mode). Only relevant if type is set to "abstraction". When specified an after catchment is generated for station crs with station abs_crs present.

cutoff

Numeric, defines the threshold probability below which to exclude a postcode from the catchment. Default is 0.01 (i.e. any postcodes with a probability of >= 0.01 for the station defined in crs will be included in the catchment).

tolerance

Numeric, tolerance for ST_SimplifyPreserveTopology. Default is 0.1.

Details

If type is set to "proposed" then the station defined by crs is assumed to be a proposed station present in the schema.proposed_stations table. The 60-minute service area for the station is expected to be in this table and the GeoJSON catchment is also written to this table.

If type is "abstraction" then the station defined by crs is assumed to be an at-risk station that is part of an abstraction analysis. The 60-minute service area for the station is assumed to be located in the data.stations table and the catchment is written to the schema.abstraction_results table. If abs_crs is not specified then a before catchment is generated for station crs. If a proposed station is provided in abs_crs (or this is given the value "concurrent" in the case of concurrent mode) then an after catchment is generated, reflecting the situation after abs_crs.


station-demand-forecasting-tool/sdft documentation built on July 11, 2021, 4:23 a.m.