You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a documentation of this database created in DBeaver Community.
Campaign Schema
Campaign schema holds information about the campaigns and their media, trajectory points of monitoring, data about trash, model of used AI and users who have collected the data.
`campaign` ER Diagram
`campaign` TablesTable `campaign.campaign`
Column Name
Data type
Unit
References (filled by)
Description
id
uuid
Generated ID
locomotion
text
API
How the data was collected (by foot, kayak, drone, etc.)
isaidriven
bool
yes/no
API
Whether wastes have been detected and counted using AI or observed by human observators
remark
text
API
Remarks sent by users after data collection
id_ref_user_fk
uuid
foreign key
API
ID of the user who has collected the data
riverside
text
right/left
API
River bank monitored (either right or left). The right river bank is at your right when looking downstream.
id_ref_model_fk
uuid
foreign key
ID that indicates AI version used together with BI scripts version
createdon
timestamp
ETL
Info to be extracted from video or GPX
has_been_computed
bool
true/false
Table `campaign.media`
Column Name
Data type
Unit
References (filled by)
Description
id
uuid
Generated ID
filename
text
API
Name (given or generated) of the file (mp4, json, jpeg, jpg)
createdby
text
Information about file's creator (given or generated)
isdeleted
bit
id_ref_campaign_fk
uuid
foreign key
Campaign ID
id_ref_trajectory_points_fk
uuid
Note: should it be removed?
time
timestamp
createdon
timestamp
Note: Is it useful because already in campaign.campaign?
blob_url
varchar
Table `campaign.model`
Column Name
Data type
Unit
References (filled by)
Description
id
uuid
Generated ID
version
int4
Manually
Updated manually when we decide to upgrade to a new AI version
createdon
timestamp
Manually
Updated manually when we decide to upgrade to a new AI version
Table `campaign.trajectory_point`
Column Name
Data type
Unit
References (filled by)
Description
id
uuid
Generated ID
the_geom
geometry
GPS coordinates for segment corresponding to the monitoring
id_ref_campaign_fk
uuid
foreign key
Campaign ID
elevation
float8
numeric (meters)
ETL
Elevation given for each track point of the campaign (Note: Is it really necessary?)
time
timestamp
ETL
speed
float8
numeric (m/s)
Speed between track points (Note: This is calculated data, right?)
lat
float8
numeric
Latitude for each track points
lon
float8
numeric
Longitude for each track points
createdon
timestamp
Note: Is it useful because already in campaign.campaign?
Table `campaign.trash`
Column Name
Data type
Unit
References (filled by)
Description
id
uuid
Generated ID
id_ref_campaign_fk
uuid
foreign key
Campaign ID
the_geom
geometry
GPS coordinates for each trash
elevation
float8
numeric (meters)
ETL
Elevation for each trash represented by a GPS point (Note: Is it really necessary?)
id_ref_trash_type_fk
int4
foreign key
Trash type ID
precision
float8
numeric (meters)
ETL
Precision of GPS
id_ref_model_fk
uuid
foreign key
ID that indicates AI version used together with BI scripts version
id_ref_image_fk
uuid
foreign key
Image ID (Note: This field becomes if_ref_media_fk???)
time
timestamp
ETL
createdon
timestamp
Note: Is it useful because already in campaign.campaign?
frame_2_box
json
list
ETL
Given the number of frames on which the same trash is observed. This field looks like - Frame2box = {1: [200, 230, 402, 450], 3: [200, 240, 300, 345]}
Table `campaign.trash_type`
Column Name
Data type
Unit
References (filled by)
Description
id
serial
Generated ID
name
text
Manually
Trash type name (Note: Need to add trash type of AI and manual version)
Table `campaign.user`
Column Name
Data type
Unit
References (filled by)
Description
id
uuid
Generated ID
firstname
text
API
User first name
lastname
text
API
User last name
email
text
API
User email
emailconfirmed
bool
User email confirmation
passwordhash
text
API
User password
yearofbirth
date
API
User year of birth
experience
text
Manually
User experience (advance etc.)
isdeleted
bool
createdon
timestamp
API
Timestamp of a given user creation
lastloggedon
timestamp
API
Timestamp of the last login of a given user
nickname
text
bi???
User Nickname
BI Schema
BI schema holds aggregated data about the campaigns and tracked rivers.
`bi` ER Diagram
`bi` TablesTable `bi.campaign`
Column Name
Data type
Unit
References (filled by)
Description
id
uuid
Generated ID
locomotion
text
API
How the data was collected (by foot, kayak, drone, etc.)
isaidriven
bool
yes/no
API
Whether wastes have been detected and counted using AI or observed by human observators
remark
text
API
Remarks sent by users after data collection
id_ref_user_fk
uuid
foreign key
API
ID of the user who has collected the data
riverside
text
right/left
API
River bank monitored (either right or left). The right river bank is at your right when looking downstream.
start_date
date
Start date and time of the campaign
end_date
date
End date and time of the campaign
start_point
geometry
list ?
Lat/Lon where the campaign has started
end_point
geometry
list ?
Lat/Lon where the campaign has ended
total_distance
float8
numeric (meters)
Distance traveled during the campaign (projected on river segment)
avg_speed
int4
numeric (m/s)
Average displacement speed during the campaign
duration
interval
numeric (seconds?)
Duration of the campaign
start_point_distance_sea
float8
numeric (meters)
Distance from the start point of the campaign to the river estuary
end_point_distance_sea
float8
numeric (meters)
Distance from the end point of the campaign to the river estuary
trash_count
int4
integer
Number of trash counted during the campaign
distance_start_end
float8
numeric (meters)
Distance traveled during the campaign (real distance traveled including zigzags if any)
id_re_model_fk
uuid
foreign key
ID that indicates AI version used together with BI scripts version
createdon
date
Date of the campaign
Table `bi.campaign_river`
Column Name
Data type
Unit
References (filled by)
Description
id
int4
Generated ID
id_ref_campaign_fk
uuid
foreign key
Campaign ID
river_name
text
River name
distance
numeric
meters
Distance monitored on each river
the_geom
geometry
GPS coordinates for river segment/track
createdon
timestamp
date
id_ref_river_fk
int4
foreign key
River ID
Table `bi.river`
Column Name
Data type
Unit
References (filled by)
Description
name
text
River name
the_geom
geometry
GPS coordinates for river segment/track
length
float8
numeric (meters)
River length
count_unique_trash
float8
integer
Sum of all trash counted on this river exept ... ?
count_trash
float8
integer
Sum of all trash counted on this river
distance_monitored
float8
Monitored distance
the_geom_monitored
geometry
GPS coordinates for monitored distance
trash_per_km
numeric
id
serial
Generated ID
Table `bi.trajectory_point`
Column Name
Data type
Unit
References (filled by)
Description
id
uuid
Generated ID
the_geom
geometry
Segment corresponding to the monitoring
id_ref_campaign_fk
uuid
foreign key
Campaign ID
elevation
float8
numeric (meters)
Elevation given for each track point of the campaign
distance
float8
numeric (meters)
Distance between track points ???
time_diff
interval
numeric (seconds)
Time difference between track points ???
time
timestamp
speed
float8
numeric (m/s)
Speed between track points
lat
float8
numeric
Latitude for each track points
lon
float8
numeric
Longitude for each track points
createdon
timestamp
date
Date of the campaign ?
Table `bi.trajectory_point_river`
Column Name
Data type
Unit
References (filled by)
Description
id
int4
Generated ID
id_ref_trajectory_point_fk
uuid
foreign key
ID of trajectory point
id_ref_campaign_fk
uuid
foreign key
Campaign ID
id_ref_river_fk
int4
foreign key
River ID
trajectory_point_the_geom
geometry
Segment corresponding to the monitoring projected on river
river_the_geom
geometry
Segment/track of river
closest_point_the_geom
geometry
For a given trajectory point of a campaign, the closest point on a river segment
distance_river_trajectory_point
float8
Distance between trajectory point and closest point on a river segment
How the data was collected (by foot, kayak, drone, etc.)
method
text
riverside
text
right/left
API
River bank monitored (either right or left). The right river bank is at your right when looking downstream.
river
text
user_first_name
text
user_last_name
text
Table `raw_data.trash`
Column Name
Data type
Unit
References (filled by)
Description
elevation
float8
latitude
float8
longitude
float8
object
text
time
text
file
text
campaign_id
float8
locomotion
text
API
How the data was collected (by foot, kayak, drone, etc.)
method
text
riverside
text
right/left
API
River bank monitored (either right or left). The right river bank is at your right when looking downstream.
river
text
user_first_name
text
user_last_name
text
the_geom
geometry
object_type
text
Table `raw_data.troncon_hydrographique`
Column Name
Data type
Unit
References (filled by)
Description
id
text
code_hydro
text
code_pays
text
nature
text
fictif
text
pos_sol
text
etat
text
date_creat
text
date_maj
text
date_app
text
date_conf
text
source
text
id_source
text
prec_plani
text
prec_alti
text
src_coord
text
src_alti
text
statut
text
persistanc
text
fosse
text
navigabl
text
salinite
text
num_ordre
text
cla_ordre
text
origine
text
per_ordre
text
sens_ecoul
text
res_coulan
text
delimit
text
largeur
text
bras
text
comment
text
code_carth
text
id_c_eau
text
id_s_hydro
text
id_ent_tr
text
nom_c_eau
text
nom_ent_tr
text
geometry
geometry
Referential Schema
Referential schema holds information about the geographic location (municipality – department – state – country) of tracked rivers and coastlines (the boundary between land and sea).
`referential` ER Diagram
`referential` TablesTable `referential.country`
Column Name
Data type
Unit
References (filled by)
Description
id
int4
Generated ID
the_geom
geometry
GPS coordinates
code
text
ISO code of country (2 letters)
name
text
Country name
createdon
timestamp
Table `referential.department`
Column Name
Data type
Unit
References (filled by)
Description
id
int4
Generated ID
the_geom
geometry
GPS coordinates
code
text
Department code
name
text
Department name
id_source
text
id_ref_state_fk
int4
createdon
timestamp
Table `referential.limits_land_sea`
Column Name
Data type
Unit
References (filled by)
Description
id
int4
Generated ID
the_geom
geometry
GPS coordinates
code
text
name
text
id_source
text
nature
text
origine
text
code_hydro
text
id_ref_country_fk
int4
createdon
timestamp
Table `referential.municipality`
Column Name
Data type
Unit
References (filled by)
Description
id
int4
Generated ID
the_geom
geometry
GPS coordinates
code
text
Municipality code
name
text
Municipality name
id_source
text
id_ref_department_fk
int4
createdon
timestamp
Table `referential.river`
Column Name
Data type
Unit
References (filled by)
Description
id
int4
Generated ID
the_geom
geometry
GPS coordinates
code
text
name
text
nature
text
importance
int4
origine
text
code_hydro
text
id_ref_country_fk
int4
bras
text
createdon
timestamp
Table `referential.state`
Column Name
Data type
Unit
References (filled by)
Description
id
int4
Generated ID
the_geom
geometry
GPS coordinates
code
text
State code
name
text
State name
id_source
text
id_ref_country_fk
int4
createdon
timestamp
Referential_dev Schema
Referential_dev schema is used for testing purposes.