52North / SOS

52°North Sensor Observation Service
https://52north.org/software/software-projects/sos/
GNU General Public License v2.0
110 stars 82 forks source link

Create SQL script to insert observation data directly in the database #615

Open federicascolari opened 6 years ago

federicascolari commented 6 years ago

I have to write sensor observations directly to the database schema of the SOS installed on the RPi, in order to avoid creating InsertObservation statements and guarantee high frequency readings. Is there by any chance an available script for this task?

CarstenHollmann commented 6 years ago

Hi @federicascolari,

currently there is no script available that provides the SQL statements for an InsertObservation request.

What is your exact workflow? Insert the sensor via InsertSensor and then insert the observations directly into the database?

I would recomment to insert the Sensor via InsertSensor and the first observation via InsertObservation because then all the required information for the SOS are stored in the database tables. After that you have only to insert the observation data into the observationand ...value table (e.g. numericvalue).

Depending of the used SOS version and database concept you have to fill the observationHasOffering table and update the series table.

Therefore it would be greate if you could provide the SOS version you use and which database concept (series concept, old concept) do you use´. And which database do you use? PostgreSQL?

Thanks, Carsten

federicascolari commented 6 years ago

Hi @CarstenHollmann ! Thank you for your quick answer. Yes, that is exactly our task. The database we are using is PostgreSQL and as far as the SOS is regarded we installed the following: 52° North SOS-Importer 0.4 SOS 4.4.2 Release

Thank you once more, Federica