Observation identifier for observations inserted with InsertResultTemplate?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Observation identifier for observations inserted with InsertResultTemplate?

TSlawecki
I would like to give users of our 52N SOS server the capability to overwrite observations when corrections are needed. I had planned to do this at insert time by

1) checking for the existence of an observation at the given time and place for the parameter of interest,

2) deleting the observation if it exists, and then

3) inserting the new observation

However, I'm not seeing (in GetObservation or in the observation SQL table) an observation identifier to use in deleting the existing observation. Is this perhaps because all data to date has been added using InsertResult? If so, is there any way to add observation identifiers short of running (e.g.) some sort of a SQL UPDATE, or replacing the InsertResult with a series of InsertObservations?

Thanks,

Tad
Reply | Threaded
Open this post in threaded view
|

Re: Observation identifier for observations inserted with InsertResultTemplate?

Carsten Hollmann
Hi Tad,

the InsertResult/InsertResultTemplate does not yet support the
observation identifier.

You can use the InsertObservation requests and define the observation
identifier as gml:identifier in the OM_Observation as you mentioned.
Running a SQL UPDATE should also work.

 > 2) deleting the observation if it exists

If you would like to use the DeleteObservation operation, it does not
work because the 52N SOS only sets a deleted flag and does not
physically remove the observation from the database.
An InsertObservation for the same time, parameter and identifier will
the fail.

Best,
Carsten
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: Observation identifier for observations inserted with InsertResultTemplate?

TSlawecki
Carsten - Thanks. A follow-up ... what should happen if I mark an observation as deleted and do an InsertResult for the same  time, location and parameter but (I assume) no observation identifier? IIRC, the sequence

 1) InsertResult
 2) InsertResult with the same observation

fails; what might happen with the sequence

  1) InsertResult
  2) Mark observation(s) from InsertResult as deleted
  3) InsertResult again?

#2 might be a direct manual SQL UPDATE of the deletion flag or a combination of SQL UPDATE to assign an identifier and then using the DeleteObservation operation. Do you expect this might work, or would I need to trigger the SQL (?) script to truly erase the deleted observations first?

Thanks again,

Tad
Reply | Threaded
Open this post in threaded view
|

Re: Observation identifier for observations inserted with InsertResultTemplate?

Carsten Hollmann
Hi Tad,

if you mark an observation as deleted and insert an observation for the
same time, location and parameter it would fail. So you have to truly
erase the observation(s) that are marked as deleted before you insert
the "updated" observation.

In the Admin interface you find the "Delete deleted Observtions" button
in "Datasource Maintenance". This would delete all observations that are
marked as deleted.

Best,
Carsten
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines