View source: R/sdr_create_service_areas.R
Creates a distance or time based network service area around stations in
the provided data frame using the pgRouting function pgr_withpointsdd.
The service area geometry is written to the specified database table
in the specified database schema. The supplied identifier links
the stations in the data frame and the database table. Uses parallel processing.
1 2 3 4 5 6 7 8 9 10 11 12 | sdr_create_service_areas(
con,
out_path,
schema,
df,
identifier,
sa,
table,
columns = TRUE,
cost = "len",
target = 0.9
)
|
con |
An RPostgres database connection object. |
out_path |
Path to the output folder for logging. |
schema |
Character, the database schema name. |
df |
A data frame with a column named "location" which has the easting and northing of the station location. |
identifier |
Character, uniquely identifies a station in both the
provided data frame and in the target |
sa |
Numeric vector of integer values for the required service areas. Should be in metres when cost is distance and minutes when cost is time. |
table |
Character, the target database table name. |
columns |
Logical, whether service area columns need to be created in the
target database |
cost |
Character, either "len" for a distance-based service area or "time" for a time-based service area. Default is "len". |
target |
Numeric, the target percent of area of convex hull that ST_ConvexHull will try to approach before giving up or exiting. Default is 0.9. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.