Closed clhenrick closed 7 years ago
I imported both shapefiles into the ECGA Carto account and named them:
These are the tables that will be edited by the ECGA staff from within QGIS using the QGIS CartoDB plugin.
I copied the ecg_route_lines
table, named it ecg_route_lines_prod
, and locked it so it that it can't be edited. Same for ecg_route_cues
, it's called ecg_route_cues_prod
. We'll use these as the "production" tables with the app for now while we continue building out its features, most noticeably the geo routing. The ECGA team will be able to edit the ecg_route_cues
and ecg_route_lines
tables from QGIS.
Noting that for the ecg_lines table the "meters" column to "shape_leng" and I'm renaming it back to "meters". The values were also rounded for this column, that SQL is:
UPDATE ecg_route_lines SET meters = round(meters)::integer
Noticed that deleting a table in the new Carto UI and then attempting to rename a table to the same of the deleted one's name results in a number getting appended to the end of the table. So now the production table is called ecg_route_lines_prod_2
. Took me two attempts to figure that out, argh.
I implemented the database trigger so that when inserts happen:
Separate from the db trigger, I modified the pline_id
column so that it's now sequential and will auto update when new rows are inserted.
However, I have no way to test the trigger and tables with QGIS as we don't yet have an API Key from Carto. Waiting to hear back from @nilesbarnes to see if he sent the signed contract to Tyler over at Carto.
@gregallensworth also brought up a good point that we should add a trigger for when line segments are updated:
Will open a separate issue for creating the new db trigger.
Just a note that some of this is being handled by our GIS staff, and some by Chris.
@danrademacher think this is safe to close?
Yep
pline_id
value is added and themeters
value is calculated and added