Description Usage Arguments Details
View source: R/sdr_create_json_catchment.R
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).
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
)
|
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 |
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 |
tolerance |
Numeric, tolerance for ST_SimplifyPreserveTopology. Default is 0.1. |
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
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.