During the devlopment of the RESTful Binding Extension, a requirement arose for deleting single observations. To solve this, I developed the DeleteObservation extension oriented at the DeleteSensor operation.
You can delete only observations, that have a gml:identifier element. The current implementation is available via the following bindings:
- SOAP
 - POX
 - KVP
 - RESTful
 
Example requests are available via the latest development version from the current 4.0 dev branch. Just go to your locally deployed SOS_WEB_APP/client and select version 2.0, any binding and than the DeleteObservation example request. Before submitting, make sure to enter a valid observation id! Here are some illustrative examples:
KVP:
URL: ../SOS_WEB_APP/sos/kvp?service=SOS&version=2.0.0&request=DeleteObservation&observation=OBSERVATION_ID
POX:
URL: ../SOS_WEB_APP/sos/pox
Body:
[xml]
<?xml version="1.0" encoding="UTF-8"?>
<sosdo:DeleteObservation xmlns:sosdo="http://www.opengis.net/sosdo/1.0" version="2.0.0" service="SOS">
    <sosdo:observation>OBSERVATION_ID</sosdo:observation>
</sosdo:DeleteObservation>
[/xml]
SOAP
URL: ../SOS_WEB_APP/sos/soap
Body:
[xml]
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
    <env:Body>
        <sosdo:DeleteObservation xmlns:sosdo="http://www.opengis.net/sosdo/1.0" version="2.0.0" service="SOS">
            <sosdo:observation>OBSERVATION_ID</sosdo:observation>
        </sosdo:DeleteObservation>
    </env:Body>
</env:Envelope>
[/xml]
RESTful
URL: ../SOS_WEB_APP/sos/rest/observations/OBSRVATION_ID
HTTP method: DELETE
HTTP header: Accept: application/gml+xml
The DeleteObservation schema (Source) for the XML documents:
[xml]
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:sosdo="http://www.opengis.net/sosdo/1.0" xmlns:swes="http://www.opengis.net/swes/2.0" targetNamespace="http://www.opengis.net/sosdo/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<import namespace="http://www.opengis.net/swes/2.0" schemaLocation="http://schemas.opengis.net/swes/2.0/swes.xsd"/>
	<import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
	<!– ================================================= –>
	<element name="DeleteObservation" type="sosdo:DeleteObservationType"/>
	<complexType name="DeleteObservationType">
		<complexContent>
			<extension base="swes:ExtensibleRequestType">
				<sequence>
					<element name="observation" type="anyURI">
						<annotation>
							<appinfo>
								<gml:targetElement>unknown</gml:targetElement>
							</appinfo>
							<documentation>
								Pointer to the observation that shall be deleted.
							</documentation>
						</annotation>
					</element>
				</sequence>
			</extension>
		</complexContent>
	</complexType>
	<!– ================================================= –>
	<element name="DeleteObservationResponse" type="sosdo:DeleteObservationResponseType"/>
	<complexType name="DeleteObservationResponseType">
		<complexContent>
			<extension base="swes:ExtensibleResponseType">
				<sequence>
					<element name="deletedObservation" type="anyURI">
						<annotation>
							<appinfo>
								<gml:targetElement>unknown</gml:targetElement>
							</appinfo>
							<documentation>Pointer used to reference the observation
                                    that has been deleted by the service.</documentation>
						</annotation>
					</element>
				</sequence>
			</extension>
		</complexContent>
	</complexType>
</schema>
[/xml]
Your comments are very welcome.
Leave a Reply