SOS icon indicating copy to clipboard operation
SOS copied to clipboard

Create SQL script to insert observation data directly in the database

Open federicascolari opened this issue 6 years ago • 2 comments

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?

federicascolari avatar May 21 '18 14:05 federicascolari

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 observation and ...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

CarstenHollmann avatar May 23 '18 11:05 CarstenHollmann

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

federicascolari avatar May 24 '18 13:05 federicascolari