Project Data
The data required by the web app is stored in a single object defined by a class named Project.
A Project object has all the information used by the GUI to display a set of tide gates. The constructor is passed the name of a CSV file that has a list of all the barriers and the ID of one of the data sets (currently either OPM or TNC_OR). The data in the CSV file and the target descriptions returned by the make_targets function in the targets module are used to initialize the attributes of the Project object.
| Attributes: |
|
|---|
Source code in src/tidegates/project.py
28 29 30 31 32 33 34 35 36 37 | |
_make_map_info()
Make a dataframe with attributes needed to display gates on a map. Map latitude and longitude columns in the input frame to Mercator coordinates, and copy the ID, region and barrier types so they can be displayed as tooltips.
src/tidegates/project.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
_make_region_list()
Make a list of unique region names, sorted by latitude, so regions are displayed in order from north to south
src/tidegates/project.py
56 57 58 59 60 61 62 63 | |
_make_totals()
Compute the total cost to repair all barriers in each region
src/tidegates/project.py
65 66 67 68 69 70 | |