Closed rcyyu closed 7 years ago
Merged data and removed unnecessary columns. Used the same code to make the king_street_dashoard.street_volumes_geojson
except with the changes. king_street_dashoard.street_volumes_geojson
still needs to be updated with the following code.
CREATE OR REPLACE VIEW ryu4.street_volumes_geojson AS
SELECT json_build_object('type', 'FeatureCollection', 'features', array_to_json(array_agg(f.*))) AS geojson
FROM ( SELECT 'Feature' AS type,
st_asgeojson(street_volumes.geom, 15, 2)::json AS geometry,
json_build_object('feature_code_desc', street_volumes.feature_code_desc, 'centreline_id', street_volumes.centreline_id, 'linear_name_full', street_volumes.linear_name_full,
'volume', street_volumes.volume, 'year', street_volumes.year, 'direction', street_volumes.direction, 'min_zoom', street_volumes.min_zoom, 'id', street_volumes.id, 'has_data', street_volumes.has_data,
'pct_change_day', (random() * 50::double precision - 25::double precision)::integer,
'pct_change_month', (random() * 50::double precision - 25::double precision)::integer,
'pct_change_year', (random() * 50::double precision - 25::double precision)::integer) AS properties
FROM streets_tiled_kingstreetpilot street_volumes) f;
Rather than having the current set up of 3 seperate JSON files to host geographic/volume data for each range, merge them all into one JSON file to save memory. Can be done by modifying
king_pilot_dash.street_volumes_geojson
to have 3 new columns calledpct_change_day
,pct_change_month
,pct_change_year
and randomly generated fake data for each. In addition to these changes, drop some of the columns which will not be used such aslinear_name_id
,oneway_dir_code
,dir_bin
.