[Home]
The Weather station DB is a sqlite DB (basicly a relational DB stored in a single file). The path of the file in the server is :
/data/sensors/Sensori40/anagrafica.db
and you can issue standard SQL statements with its text shell:
sqlite3 /data/sensors/Sensori40/anagrafica.db
This is the ER schema of the DB; you will be dealing with Stations and Sensors tables only
If you want to get rid of an instance of station or sensor, it's enough to delete it from the corresponding table, knowing its primary key PK. So for example:
DELETE FROM Stations WHERE idstation=<PK>;
DELETE FROM Sensors WHERE idsensor=<PK>;
To add a new station you have to insert a new record in the Stations table; these are the mandatory fields :
Field | Description/Istructions |
IDStation | Integer primary key |
IDSupplier | 44 |
StationSupplierTAG | ‘FEWS-LC_n’ (n is the ID station in Deltares-FEWS) |
Name | Name of the station |
Alt | Altitude in meters |
Lond | Longitude in EPSG 4326 |
Latd | Latitude in EPSG 4326 |
To add a new sensor to an existing station you have to add a new record in the Sensors table following these rules:
Field | Description/Istructions |
IDSensor | Integer primary key |
IDStation | Foreign key to Stations table (PK of the station) |
PluvioSampleType | see support table A |
IDSensorType | see support table A |
SensorClass | see support table A |
DescrC | see support table A |
SupplierTAG | The identification string of the sensor, found in the header of the ingestion ASC file |
Support Table A
Type of sensor | PluvioSampleType | IDSensorType | SensorClass | DescrC |
Raingauge | 1 | 20001 | 2 | Raingauge |
Water level | 0 | 30001 | 3 | Water Level |
Air Temperature | 0 | 50002 | 5 | Air temperature |
Hygrometer | 0 | 90000 | 9 | Rel. Humidity |
Wind direction | 0 | 100000 | 10 | Degrees |
Wind speed | 0 | 110002 | 11 | Wind speed |
All the description in the previous table are freely customizable
[Home]