transitlos.flex.export¶
Files for the browser: the compact binary tables the front-end needs to recompute scores and catchments (see frontend/).
export_for_browser(out_dir, lat, lon, prof, res, params, counts=None, count_labels=None)
writes meta.json sizes, bbox, the default ScoreParams (JSON), the shape catalog, the names of the census count columns stop_{mode,h,v,np}.bin station profiles int8 / float32 / float32 [SP], int32 [S]; stop_lonlat.bin float32 [S2] cell_station.bin, cell_dist.bin int32 [ncK], uint16 [ncK] cell_counts.bin float32 [ncncol]: census counts of each cell (population, jobs, ...), the numbers summed per winning stop cell_geom.bin float32 [nc14]: centre then 6 vertices, lon,lat (the demo viewer draws these; a production map gets geometry from tiles) viewer.html, score.js, editor.js, glmap.js copied from frontend/
shape_catalog()
¶
Presets for each curve, as tables (JSON), keyed by name -- what a UI offers in its 'shape' drop-downs.
publish_frontend(out)
¶
Copies the scripts and writes the stamped, version-addressed viewer page into out.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out
|
Output folder of the map. |
required |
export_for_browser(out_dir, lat, lon, prof, res, params=DEFAULT, geometry=True, counts=None, count_labels=None, extra_meta=None, points=None)
¶
points (optional DataFrame: stop_lon, stop_lat, station, stop_name): the real stop_ids drawn on the map (each coloured/sized/selected as its station).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_dir
|
Output folder (created). |
required | |
lat
|
Station latitudes. |
required | |
lon
|
Station longitudes. |
required | |
prof
|
Station profiles. |
required | |
res
|
Cell stations (:class: |
required | |
params
|
ScoreParams
|
Default scoring parameters. |
DEFAULT
|
geometry
|
bool
|
Also write the cell geometry. |
True
|
counts
|
Optional |
None
|
|
count_labels
|
Names of the count columns. |
None
|
|
extra_meta
|
Extra fields for |
None
|
|
points
|
Optional real stops (see above). |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
The |
export_routes(out_dir, station_lat, station_lon, parts, start_sec, end_sec, tile_deg=0.05, detour=1.3, simplify_m=8.0)
¶
Route data of the map editor (frontend/edit.js): which routes serve each station and their departures, so the browser can change a route
(speed, headway, mode, deleted) and rebuild the profiles of the stations it serves exactly as profiles.feed_candidates + select do.
writes routes/routes.json window, detour factor, the routes (id, name, colours, mode, stations) and the departure tiles (per tile its
stations and their offsets)
routes/lines.json GeoJSON of the routes' main shapes (property r = route index), simplified
routes/dep_
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_dir
|
The area's browser folder (the one of :func: |
required | |
station_lat
|
Latitudes of the exported stations (the station keys of |
required | |
station_lon
|
Their longitudes. |
required | |
parts
|
|
required | |
start_sec
|
float
|
Start of the scoring window (s after midnight). |
required |
end_sec
|
float
|
Its end. |
required |
tile_deg
|
float
|
Tile size of the departure files (degrees). |
0.05
|
detour
|
float
|
Street distance / straight distance of the area (new stations of the editor use it). |
1.3
|
simplify_m
|
float
|
Simplification tolerance of the route lines (m). |
8.0
|
Returns:
| Type | Description |
|---|---|
dict
|
Counts of what was written. |