sdr_submit()
to sdft_submit()
. Internal functions retain sdr_
prefix (these
are still exported for expert use only)sdft_submit
()st_collect()
on the
node geoms prior to using st_concavehull()
to generate service areas in sdr_create_service_areas
.
All the points appear to be 2D, so not clear what is causing this. However, it can be
corrected by using ST_Force2D()
on the geom prior to the st_collect()
.sdr_submit()
function that takes database connection details
and directory path (for inputs and outputs) as arguments. User must set the database
user password using key_set()
.added new script start.R
. This simply calls main.R using source()
. start.R
can
then be run from the terminal using rscript. If main.R is called directly using
rscript then stop()
calls will not terminate the model.
problem if category was 'F'. Type was not specified when stations.csv read nor when proposed_stations table written to database. When category was 'F' type Boolean was assumed by default. Must be type text.
pre-flight checks
allow car park spaces to be zero
the location_geom column in proposed_stations is used by the SQL function to measure distances from postcode centroids to the proposed station. This should therefore be generated from the proposed station's access NGR. However, this was instead being generated (in main.R) using the station's physical location NGR. This has been corrected.
bug in sd_generate_choicesets
. When sdr_crs_pc_nearest_stationswithpoints()
is called
crs
is passed as the third argument of the function. This parameter is used in
sdr_crs_pc_nearest_stationswithpoints()
to avoid
expensive distance lookups when the proposed or at_risk station is not in the set of stations
to be measured. This is fine for generating a choiceset for a proposed station,
or for a before abstraction analysis choiceset. However, this is the wrong parameter
if an after abstraction analysis is being carried out as in that case crs
contains
the proposed station CRS not the at-risk station. This has been corrected to use pc_crs instead.
expanded station service areas to include 2, 3 and 4km. Should improve performance of choiceset generation process.
In the table data.hhsize there were trailing spaces in some of the area_code values.
This requires correcting by running:
update data.hhsize set area_code = trim(area_code)
additional service areas (2, 3, and 4km) added to data.stations table
data.stations table updated with car parking spaces for Great Northern stations. NRE shows these stations as having a car park but no spaces information. These car parks are run by Saba and details of spaces was obtained from https://www.sabaparking.co.uk/great-northern-railway.
data.stations table updated with date station opened (where recorded).
data.stations table updated to amend car parking spaces:
Pye Corner, Newport - NRE states car par but doesn't give spaces. According to BBC article there are 70 spaces: https://www.bbc.co.uk/news/uk-wales-south-east-wales-22550481. Google Maps satellite view indicate 60-65.
Bus services. The following stations change from NA to TRUE:
Pye Corner
Bus services. The following stations change from NA to FALSE:
sdr_create_json_catchment()
to improve catchment display performance.
Probability is now rounded to 1 decimal places and then st_union is used to
dissolve the postcode polygons, grouped by probability. The GeoJSON is then
generated. This means that any catchment will now have a maximum feature count
of 10. Also defined maxdecimaldigits
for st_asgeojson
, set to 5 rather than
the default of 15.sdr_create_service_area()
. ST_ConcaveHull
can return a point or line
in some circumstances. Need to apply a buffer to ensure sa is a polygon and can be
written to table.sdr_crs_pc_nearest_stationswithpoints()
- in the select
case 60km and 80km service areas were incorrectly specified as 30km and 40km.sdr_create_service_areas()
(logical) to indicate
whether the service area columns should be created. Increases flexibility of
function.sdr_generate_probability_table()
function amended.sapply
replaced with vapply
throughout. Preferred as sapply
is not type safe.sdr_generate_choicesets()
replaced with materialized
views.Removed any edges and nodes disconnected from the main network graph from the
OS OpenRoads tables. The affected nodes were identified using the pgRouting
function pgr_connectedComponents()
and were then used to delete affected edges from
openroads.roadlinks and nodes from openroads.roadnodes. This deals with potential
problem of the nearest edge to a postcode or station not being connected to the
rest of the road network (a potential issue for routing and building station
service areas). Centroidnodes and roadlink virtual node tables regenerated. Example
disconnected network (in green) shown below:
Full stations data created (up-to-date with latest station openings and closures).
Initial release
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.