diff --git a/.gitignore b/.gitignore index f60dadb94f..2e3b1e0013 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ extensions/do/core/configuration.db **.*~ *.tern-project extensions/inspire/coding/configuration.db +console.log diff --git a/.travis.yml b/.travis.yml index 2d5175b3f7..7a6893470c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: java jdk: - openjdk7 - - oraclejdk7 - oraclejdk8 addons: hosts: diff --git a/NOTICE b/NOTICE index dcf0b2da9d..251697c4ec 100644 --- a/NOTICE +++ b/NOTICE @@ -234,6 +234,7 @@ This project includes: Main module under GNU Lesser General Public License (LGPL) version 2.1 mchange-commons-java under GNU Lesser General Public License, Version 2.1 or Eclipse Public License, Version 1.0 Metadata under GNU Lesser General Public License (LGPL) version 2.1 + Microsoft JDBC Driver for SQL Server under MIT License Mockito under The MIT License Mozilla Rhino under Mozilla Public License, Version 2.0 MySQL Connector/J under The GNU General Public License, Version 2 @@ -307,7 +308,6 @@ This project includes: spring-security-taglibs under The Apache Software License, Version 2.0 spring-security-web under The Apache Software License, Version 2.0 SQLite JDBC under The Apache Software License, Version 2.0 - sqljdbc4 under MICROSOFT SOFTWARE LICENSE TERMS, http://download.microsoft.com/download/0/2/A/02AAE597-3865-456C-AE7F-613F99F850A8/license.txt StAX API under The Apache Software License, Version 2.0 udunits under (MIT-style) netCDF C library license vecmath under GPL 2.0 license w/ CPE diff --git a/README.md b/README.md index ab2a7ce350..f4faef9fc8 100644 --- a/README.md +++ b/README.md @@ -1,84 +1,197 @@ -# 52°North SOS [![OpenHUB](https://www.openhub.net/p/SensorObservationService/widgets/project_thin_badge.gif)](https://www.openhub.net/p/SensorObservationService) -README file for the 52°North Sensor Observation Service (SOS) version 4.4.x +# 52°North Sensor Observation Service (SOS) +| Master | Develop | OpenHUB | +| ------------- | ------------- | ------------- | +| [![Master Build Status](https://travis-ci.org/52North/SOS.png?branch=master)](https://travis-ci.org/52North/SOS) | [![Develop Build Status](https://travis-ci.org/52North/SOS.png?branch=develop)](https://travis-ci.org/52North/SOS) | [![OpenHUB](https://www.openhub.net/p/SensorObservationService/widgets/project_thin_badge.gif)](https://www.openhub.net/p/SensorObservationService) | -This is the repository of the [52°North Sensor Observation Service (SOS)][1]. +## Description + +### Standardized, web-based upload and download of sensor data and sensor metadata + +**The 52°North Sensor Observation Service (SOS) provides an interoperable web-based interface for inserting and querying sensor data and sensor descriptions. It aggregates observations from live in-situ sensors as well as historical data sets (time series data).** The 52°North SOS is a reference implementation of the -[OGC Sensor Observation Service specification (version 2.0)][2]. It was -implemented during the [OGC Web Services Testbed, Phase 9 (OWS-9)][3] and -tested to be compliant to this specification within the [OGC CITE testing][4] -in December of 2012. +[OGC Sensor Observation Service specification (version 2.0)](https://portal.opengeospatial.org/files/?artifact_id=47599), an interoperable interface for publishing and querying sensor data and metadata. +It was implemented during the [OGC Web Services Testbed, Phase 9 (OWS-9)](http://www.ogcnetwork.net/ows-9) +and tested to be compliant to this specification within the [OGC CITE testing](http://cite.opengeospatial.org/test_engine) in December of 2012. -## Build Status +The 52°North SOS enables the user to: -* Master: [![Master Build Status](https://travis-ci.org/52North/SOS.png?branch=master)](https://travis-ci.org/52North/SOS) -* Develop: [![Develop Build Status](https://travis-ci.org/52North/SOS.png?branch=develop)](https://travis-ci.org/52North/SOS) + - insert and retrieve georeferenced observation data + - access georeferenced measurement data in a standardized format (ISO/OGC Observation and Measurement - O&M 2.0, OGC WaterML 2.0) + - insert and retrieve sensor descriptions (encoded according to the OGC SensorML standard - SML 1.0.1, SML 2.0) + - publish measurement data (near real-time, as well as archived data) -## Branches +An extension accommodates additional INSPIRE Directive requirements, thus ensuring interoperable exchange of any kind of observation data across political, administrative and organizational boundaries. Client applications, such as [Helgoland](http://www-neu.52north.org/software/software-projects/helgoland/) enable analysis and visualization of the measurement data provided via the SOS server. + +### Features -This project follows the [Gitflow branching model](http://nvie.com/posts/a-successful-git-branching-model/). "master" reflects the latest stable release. -Ongoing development is done in branch [develop](../../tree/develop) and dedicated feature branches (feature-*). + - [INSPIRE Download Service](http://inspire.ec.europa.eu/id/document/tg/download-sos) for measurement data + - [Guidelines for the use of Observations & Measurements and Sensor Web Enablement-related standards in INSPIRE (D2.9)](http://inspire.ec.europa.eu/id/document/tg/d2.9-o%26m-swe) + - [OGC Hydro Profile] (http://docs.opengeospatial.org/bp/14-004r1/14-004r1.html), including GetDataAvailability operation + - [SensorML 1.0.1 and 2.0](http://www.opengeospatial.org/standards/sensorml) + - [WaterML 2.0](http://www.opengeospatial.org/standards/waterml) + - [AQD e-Reporting flows E](https://www.eionet.europa.eu/aqportal/requirements/dataflows) + - Multiple DB support (by using the [Hibernate ORM framework](http://hibernate.org/orm/)) + - Bundle including [Sensor Web REST-API](https://github.com/52North/series-rest-api) and [helgoland](https://github.com/52North/helgoland/) + - DeleteObservation operation, to delete observation by identifier (not part of the SOS 2.0 specification) + - [Efficient XML Interchange (EXI) 1.0 format](http://52north.org/communities/sensorweb/sos/index.html#www.w3.orgTRexi) + - Support for [GoundWaterML 2 GeologyLog observation](http://www.opengeospatial.org/standards/gwml2) + +### Future -## Code Compilation +From version 5.x of the 52N SOS, the database model and the DAO layer of 52N SOS and the [52N Sensor Web REST-API](https://github.com/52North/series-rest-api) would be merged to finally provide an easy-to-install and easy-to-configure service that provides the OGC SOS 2.0 interface and the 52N Sensor WEB REST-API to easily access the observed data via a restful interface. -This project is managed with Maven3. Simply run `mvn clean install` -to create a deployable .WAR file. +For that the similar database models of both services would be harmonized to use the same model. Furthermore, the new database model is to be defined in this way that a simple basic database model would provide the main features of the SOS and the Sensor WEB REST-API and can be easily extended to provide further features. -## Distributions +The Data Access Objects (DAO) layer would also be harmonized to provide a single point for accessing and manipulating the data in the database. This would reduce the maintenance and new database features would be easier supported by the SOS and the REST interface. -Here you can find some information that relates to the distributions of the 52°North SOS. +In the [Sensor Web Suite database project](https://github.com/52North/series-hibernate) the harmonized database model and the DAO layer would be provided as a separate project that would be use in the future 52N SOS and 52N Sensor WEB REST-API implementations. Additionally the [52N SOS Proxy](https://github.com/52North/series-sos-proxy) will also use this project to persist the metadata of the harvested SOS services. -### Download +![Image of Sensor Web Suite](https://github.com/52North/SOS/tree/develop/misc/pics/sensor_web_db_dao.PNG) -The latest release of 52°North SOS can be downloaded from this website: +This figure shows the future relation between the 52N Sensor Web Suite database project, the SOS and the Sensor WEB REST-API. - http://52north.org/downloads/category/3-sos +## Quick Start -### Contents - * `/src` : The source files of 52°North SOS modules - * `/bin` : Executable binary of 52°North SOS webapp module - * `LICENSE` : The license of 52°North SOS - * `NOTICE` : Third Party libraries and their licenses - * `README` : This file - * `RELEASE-NOTES` : The release notes of the 52°North SOS + Get started - the [installation guide](https://wiki.52north.org/SensorWeb/SensorObservationServiceIVDocumentation#Installation) helps you install and configure the 52°North SOS. -No printer friendly documentation exist for this release. Instead, refer to the [wiki documentation][5]. +## User Guide -### Installation + An OGC SOS [tutorial](http://www.ogcnetwork.net/SOS_2_0/tutorial) is available. -No printer friendly installation guide exist for this release. Instead, refer to the [wiki documentation][5]. +## Demo -## Contributing + http://sensorweb.demo.52north.org/sensorwebtestbed/ -You are interesting in contributing the 52°North SOS and you want to pull your changes to the 52N repository to make it available to all? +## License -In that case we need your official permission and for this purpose we have a so called contributors license agreement (CLA) in place. With this agreement you grant us the rights to use and publish your code under an open source license. + The 52°North SOS is published under the [GNU General Public License, Version 2 (GPLv2)](http://www.gnu.org/licenses/gpl-2.0.html) -A link to the contributors license agreement and further explanations are available here: +## Changelog - http://52north.org/about/licensing/cla-guidelines + The latest changes, additions, bugfixes, etc. can be found in the [RELEASE-NOTES](https://github.com/52North/SOS/blob/website-markdowns/RELEASE-NOTES) +## References -## Support and Contact + - [IRCEL-CELINE](www.irceline.be/) (Belgium): *Current and archived air quality data for all of Belgium* + - [Wupperverband](https://www.wupperverband.de/) (Germnay): *Regional water board providing a multitude of hydrological measurment data with the help of SOS standards* + - [Swedish EPA](http://www.swedishepa.se/)/[IVL](http://www.ivl.se/)/[SMHI](http://www.smhi.se/) (Schweden): *Current and archived air quality data for all of Sweden, as well as delivery this data to the European Protection Agency* + - [RIVM](http://www.rivm.nl/) (Netherlands): *Current and archived air quality data for all of the Netherlands* + - [Lithuanian EPA](http://gamta.lt/cms/index?lang=en) (Lithuania): *Current and archived air quality data for all of Lithuania* + - [European Environment Agency (EEA)](http://www.eea.europa.eu/): *Use of SOS interface to collect data from the member countries, as well as to publish the collective data* + - [PEGELONLINE](https://www.pegelonline.wsv.de/) (Germany): *Interoperable publication of te federal waterways' hydrological measurment data.* -You can get support in the community mailing list and forums: +## Credits - http://52north.org/resources/mailing-lists-and-forums/ +### Contributors + +The development the 52°North Sensor Observation Service implementations was contributed by + +| Name | Organisation | +| ------------- | :-------------: | +| [Carsten Hollmann](http://52north.org/about/52-north-team/25-carsten-hollmann) | [52°North](http://52north.org) | +| [Eike Hinderk Jürrens](http://52north.org/about/52-north-team/14-eike-hinderk-juerrens) | [52°North](http://52north.org) | +| [Christian Autermann](http://52north.org/about/52-north-team/30-autermann-christian) | [52°North](http://52north.org) | +| [Christoph Stasch](http://52north.org/about/52-north-team/31-stasch-christoph) | [52°North](http://52north.org) | +| Shane StClair | [Axiom Data Science](http://www.axiomdatascience.com) | +| Victor González | [geomati.co](http://geomati.co/en) | +| Oscar Fonts | [geomati.co](http://geomati.co/en) | +| Carlos Giraldo | [Instituto Tecnológico de Galicia (ITG)](http://www.itg.es/) | +| Alexander Kmoch | [Z_GIS](http://www.zgis.at), [Universität Salzburg (Austria and Germany)](http://www.uni-salzburg.at) | +| Carl Schroedl | Center for Integrated Data Analytics ([CIDA](http://cida.usgs.gov)), [USGS](http://www.usgs.gov) | +| Jordan Walker | Center for Integrated Data Analytics ([CIDA](http://cida.usgs.gov)), [USGS](http://www.usgs.gov) | + +### Contributing organizations + +The development the 52°North Sensor Observation Service implementations was contributed by several organizations + +

52N

+ +| | | | | +| :-------------: | :-------------: | :-------------: | :-------------: | +| IfGI | Axiom Data Science | geomati.co | ITG | +| ZIGS | Your logo?!
Get involved!
| Placeholder | Placeholder | | | -If you encounter any issues with the software or if you would like to see -certain functionality added, let us know at: + +### Funding organizations/projects + +The development the 52°North Sensor Observation Service implementations was supported by several organizations and projects. Among other we would like to thank the following organisations and project + +| Project/Logo | Description | +| :-------------: | :------------- | +| NeXOS - Next generation, Cost-effective, Compact, Multifunctional Web Enabled Ocean Sensor Systems Empowering Marine, Maritime and Fisheries Management | The development of this version of the 52°North SOS was supported by the European FP7 research project NeXOS (co-funded by the European Commission under the grant agreement n°614102) | +| BMBFCOLABIS - Collaborative Early Warning Information Systems for Urban Infrastructures | The development of this version of the 52°North SOS was supported by the German Federal Ministry of Education and Research research project COLABIS (co-funded by the German Federal Ministry of Education and Research, programme Geotechnologien, under grant agreement no. 03G0852A) | +| SeaDataCloud | The development of this version of the 52°North SOS was supported by the Horizon 2020 research project SeaDataCloud (co-funded by the European Commission under the grant agreement n°730960) | +| ODIP II - Ocean Data Interoperability Platform | The development of this version of the 52°North SOS was supported by the Horizon 2020 research project ODIP II (co-funded by the European Commission under the grant agreement n°654310) | +| INSPIRE ISA ARE3NA | The enhancements to make the 52°North SOS an INSPIRE compliant Download Service were funded by the JRC under the ISA Programme's Action 1.17: A Reusable INSPIRE Reference Platform (ARE3NA). | +| IOOS - Integrated Ocean Observing System | The IOOS project with the mission:
Lead the integration of ocean, coastal, and Great Lakes observing capabilities, in collaboration with Federal and non-Federal partners, to maximize access to data and generation of information products, inform decision making, and promote economic, environmental, and social benefits to our Nation and the world. | +| BRGM - Bureau de Recherches Géologiques et Minières | BRGM, the French geological survey, is France's reference public institution for Earth Science applications in the management of surface and subsurface resources and risks. | +| Wupperverband | The Wupperverband for water, humans and the environment (Germany) | +| Belgian Interregional Environment Agency (IRCEL - CELINE) | The Belgian Interregional Environment Agency (IRCEL - CELINE) is active in the domain of air quality (modelling, forecasts, informing the public on the state of their air quality, e-reporting to the EU under the air quality directives, participating in scientific research on air quality, etc.). IRCEL — CELINE is a permanent cooperation between three regional environment agencies: Agence wallonne de l'Air et du Climat (AWAC), Bruxelles Environnement - Leefmilieu Brussel and Vlaamse Milieumaatschappij (VMM). | +| IVL Swedish Environmental Research Institute | The IVL Swedish Environmental Research Institute is an independent, non-profit research institute, owned by a foundation jointly established by the Swedish Government and Swedish industry. | +| ITZBund| The ITZBund Information Technology Services Centre of the Federal Government (Germany) | +| German Aerospace Centre | The German Aerospace Centre (Deutsches Zentrum fuer Luft- und Raumfahrt, DLR) and part of their Environmental and Crisis Information System (Umwelt- und Kriseninformationssystem, UKis) | +| SMART Aquifer Characterisation Programme (SAC) | The SMART Project, funded by the Ministry of Business, Innovation and Employment (07/2011 – 06/2017):
Experts in the Smart Project will develop, apply, and validate pioneering new techniques for understanding New Zealand‘s groundwater resources. Satellite and airborne remote sensing techniques and Sensor Observation Services including seismic signals from earthquakes are used for rapid and costeffective characterisation and mapping of New Zealand‘s aquifer systems. Together with a stakeholder network the research team will use new methods to overcome the current time- and resourceconsuming challenges of in-time data acquisition. Special spatial skills in hydrogeology, geology, satellite remote sensing, geophysics, seismology, uncertainty mathematics and spatial information technology will be developed to assist with improvement of New Zealand‘s freshwater management. | +| | The OGC Web Services, Phase 9 (OWS-9) Testbed | +| | The OGC Web Services, Phase 10 (OWS-10) Testbed | +| | Rijkswaterstaat - Dutch Ministry of Infrastructure and the Environment (The Netherlands) | +| EO2HEAVEN - Earth Observation and ENVironmental Modeling for the Mitigation of HEAlth Risks | The development of this version of the 52°North SOS was supported by the European FP7 research project EO2HEAVEN (co-funded by the European Commission under the grant agreement n°244100) | +| GeoViQua - QUAlity aware VIsualization for the Global Earth Observation System of Systems | The development of this version of the 52°North SOS was supported by the European FP7 research project GeoViQua (co-funded by the European Commission under the grant agreement n°265178) | +| GEOWOW - GEOSS interoperability for Weather, Ocean and Water | The development of this version of the 52°North SOS was supported by the European FP7 research project GEOWOW (co-funded by the European Commission under the grant agreement n°282915) | + +## Contact - Carsten Hollmann (c.hollmann@52north.org) - Christian Autermann (c.autermann@52north.org) - - Eike Hinderk Jürrens [@EHJ-52n](e.h.juerrens@52north.org) + - Eike Hinderk Jürrens [(EHJ-52n)](https://github.com/EHJ-52n/) + +## Download -The Sensor Web Community +The binaries of the 52N SOS releases are provided are provided with the releases on GitHub: -52°North Inititative for Geospatial Open Source Software GmbH, Germany + https://github.com/52North/SOS/releases + +### Contents + * `/src` : The source files of 52°North SOS modules + * `/bin` : Executable binary of 52°North SOS webapp module + * `LICENSE` : The license of 52°North SOS + * `NOTICE` : Third Party libraries and their licenses + * `README` : This file + * `RELEASE-NOTES` : The release notes of the 52°North SOS + +No printer friendly documentation exist for this release. Instead, refer to the [wiki documentation](https://wiki.52north.org/SensorWeb/SensorObservationServiceIVDocumentation). --- -[1]: http://52north.org/communities/sensorweb/sos/index.html -[2]: https://portal.opengeospatial.org/files/?artifact_id=47599 -[3]: http://www.ogcnetwork.net/ows-9 -[4]: http://cite.opengeospatial.org/test_engine -[5]: https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation +## Support + +You can get support in the community mailing list and forums: + + http://52north.org/resources/mailing-lists-and-forums/ + +## License + +The 52N SOS is licenses under the [GNU General Public License v2 (GPLv2)](http://www.gnu.org/licenses/gpl-2.0.html). + +The used 3rd party libraries and under which they are licensed is listed in the [NOITICE file](https://github.com/52North/SOS/blob/develop/NOTICE) + +## Contribute + +You are interesting in contributing the 52°North SOS and you want to pull your changes to the 52N repository to make it available to all? + +In that case we need your official permission and for this purpose we have a so called contributors license agreement (CLA) in place. With this agreement you grant us the rights to use and publish your code under an open source license. + +A link to the contributors license agreement and further explanations are available here: + + http://52north.org/about/licensing/cla-guidelines + +## Branches + +This project follows the [Gitflow branching model](http://nvie.com/posts/a-successful-git-branching-model/). "master" reflects the latest stable release. +Ongoing development is done in branch [develop](../../tree/develop) and dedicated feature branches (feature-*). + +## Code Compilation + +This project is managed with Maven3. Simply run `mvn clean install` +to create a deployable .WAR file. + + +52°North Inititative for Geospatial Open Source Software GmbH, Germany diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 436d32c12b..a38998aa74 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -5,6 +5,42 @@ RELEASE NOTES in Observation&Measurement), information about the sensor itself (encoded in a SensorML instance document), and information about the sensor mounting platform (SensorML as well). + + Release 52n-sensorweb-sos-4.4.x +==================================== + + --- New features --- + + * + + --- Changes --- + + * + + --- Fixed issues --- + + * + + Release 52n-sensorweb-sos-4.4.1 +==================================== + + --- New features --- + + * Support for ReferencedObservation + * Support for insertion of profile observations via InsertResult/Template operations + + --- Changes --- + + * Load Microsoft SQL Server JDBC from Maven repository + * Improvements on cache serialization + + --- Fixed issues --- + + * Issue #566: Reload Capabilities Cache leads to severe error + * Issue #571: Sensors disappear (same as #566) + * Fix resetting of HIBERNATE_DIRECTORY config on save + * Fix the deletion of child observations + * Fix issue with not correct observation type for GWML GeologyLogCoverage Release 52n-sensorweb-sos-4.4.0 ==================================== @@ -101,6 +137,36 @@ RELEASE NOTES * Avoid query for next value chunk if previous has less than chunk size + Release 52n-sensorweb-sos-4.3.16 +====================================== + + --- New features --- + + + --- Changes --- + + + --- Fixed issues --- + + * Issue #566: Reload Capabilities Cache leads to severe error + * Issue #571: Sensors disappear (same as #566) + + + Release 52n-sensorweb-sos-4.3.15 +===================================== + + --- New features --- + + + --- Changes --- + + + --- Fixed issues --- + + * avoid orphaned session objects after re-configure SOS +* prevents resetting HIBERNATE_DIRECTORY config (missing extension/readonly folder) + + Release 52n-sensorweb-sos-4.3.14 ===================================== @@ -361,12 +427,12 @@ RELEASE NOTES * Primary validated assessment data -modelled (E1b) * Primary up-to-date assessment data - measurements (E2a) * More information about AQD e-Reporting: http://www.eionet.europa.eu/aqportal - * Documentation: https://wiki.52north.org/bin/view/SensorWeb/AqdEReporting + * Documentation: https://wiki.52north.org/SensorWeb/AqdEReporting * Flexible identifier * The flexible identifier extension offers the possibility to return human readable names as identifiers instead of the sometimes cryptic identifiers. * Affects offering, procedure, observableProperty and featureOfInterest. - * Documentation: https://wiki.52north.org/bin/view/SensorWeb/FlexibleIdentifier + * Documentation: https://wiki.52north.org/SensorWeb/FlexibleIdentifier * Add core and custom datasources for Oracle (#228) * Support clear datasource for SQL Server (#199) * Add webapp-bundle module which builds a 52N SOS war including @@ -397,15 +463,15 @@ RELEASE NOTES --- New features --- * INSPIRE SOS: - * Details: https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation#INSPIRE_Download_Service_extensi + * Details: https://wiki.52north.org/SensorWeb/SensorObservationServiceIVDocumentation#INSPIRE_Download_Service_extensi * Multilingualism: * Name/description of offering, procedure, observableProperty, and featureOfInterest can be defined in different languages * Define/Change via the admin interface, insertion via transactional operations is not yet supported. - * Details: https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation#Multilingualism_support + * Details: https://wiki.52north.org/SensorWeb/SensorObservationServiceIVDocumentation#Multilingualism_support * Coordinate transformation: * Requested coordinates are transformed to the defined database CRS * Coordinates in the responses are transformed to the requested or defined response CRS - *Details: https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation#CRS_support + *Details: https://wiki.52north.org/SensorWeb/SensorObservationServiceIVDocumentation#CRS_support *https://github.com/52North/SOS/pull/131 * Support for transactional feature relation insertion * Insert valid sampledFeature feature and add relation to database diff --git a/bindings/exi/pom.xml b/bindings/exi/pom.xml index e951348871..19419b3e7d 100644 --- a/bindings/exi/pom.xml +++ b/bindings/exi/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos bindings - 4.4.0 + 4.4.1 binding-exi 52°North SOS - EXI Efficient XML Interchange Binding diff --git a/bindings/json/pom.xml b/bindings/json/pom.xml index 71d967cc89..1d0bb2591f 100644 --- a/bindings/json/pom.xml +++ b/bindings/json/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos bindings - 4.4.0 + 4.4.1 binding-json 52°North SOS - JSON Binding diff --git a/bindings/kvp/pom.xml b/bindings/kvp/pom.xml index 0c3cffaa60..a02915a2aa 100644 --- a/bindings/kvp/pom.xml +++ b/bindings/kvp/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos bindings - 4.4.0 + 4.4.1 4.0.0 binding-kvp diff --git a/bindings/pom.xml b/bindings/pom.xml index 53770b5cad..e711ee76d9 100644 --- a/bindings/pom.xml +++ b/bindings/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 bindings pom diff --git a/bindings/pox/pom.xml b/bindings/pox/pom.xml index 272768800c..e764ae6ed3 100644 --- a/bindings/pox/pom.xml +++ b/bindings/pox/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos bindings - 4.4.0 + 4.4.1 4.0.0 binding-pox diff --git a/bindings/register/pom.xml b/bindings/register/pom.xml index c4363d016d..9b5dffc62c 100644 --- a/bindings/register/pom.xml +++ b/bindings/register/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos bindings - 4.4.0 + 4.4.1 4.0.0 binding-register diff --git a/bindings/rest/code/pom.xml b/bindings/rest/code/pom.xml index c882e7309a..00771324ed 100644 --- a/bindings/rest/code/pom.xml +++ b/bindings/rest/code/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos rest - 4.4.0 + 4.4.1 rest-code 52°North SOS - Extension REST Binding - Core diff --git a/bindings/rest/pom.xml b/bindings/rest/pom.xml index e4669342d7..551fb4badc 100644 --- a/bindings/rest/pom.xml +++ b/bindings/rest/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos bindings - 4.4.0 + 4.4.1 4.0.0 rest diff --git a/bindings/rest/xml/pom.xml b/bindings/rest/xml/pom.xml index 65fcf4c7b7..1695ad91ff 100644 --- a/bindings/rest/xml/pom.xml +++ b/bindings/rest/xml/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos rest - 4.4.0 + 4.4.1 rest-xml 52°North SOS - Extension REST Binding - XML diff --git a/bindings/soap/pom.xml b/bindings/soap/pom.xml index 0490d28e2a..0acb5a2be2 100644 --- a/bindings/soap/pom.xml +++ b/bindings/soap/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos bindings - 4.4.0 + 4.4.1 4.0.0 binding-soap diff --git a/coding/cv-gml/pom.xml b/coding/cv-gml/pom.xml index 89ec6d794f..f4cd0ba09f 100644 --- a/coding/cv-gml/pom.xml +++ b/coding/cv-gml/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-cv-gml diff --git a/coding/cv-gml/src/main/java/org/n52/svalbard/cv/v02/encode/AbstractCVDiscretePointCoverageTypeEncoder.java b/coding/cv-gml/src/main/java/org/n52/svalbard/cv/v02/encode/AbstractCVDiscretePointCoverageTypeEncoder.java index ee3c305e7a..c8f57ba5dc 100644 --- a/coding/cv-gml/src/main/java/org/n52/svalbard/cv/v02/encode/AbstractCVDiscretePointCoverageTypeEncoder.java +++ b/coding/cv-gml/src/main/java/org/n52/svalbard/cv/v02/encode/AbstractCVDiscretePointCoverageTypeEncoder.java @@ -48,6 +48,7 @@ import org.n52.sos.ogc.om.values.CountValue; import org.n52.sos.ogc.om.values.CvDiscretePointCoverage; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.GeometryValue; import org.n52.sos.ogc.om.values.HrefAttributeValue; import org.n52.sos.ogc.om.values.MultiPointCoverage; @@ -340,12 +341,12 @@ public XmlObject visit(CvDiscretePointCoverage value) throws OwsExceptionReport } @Override - public XmlObject visit(MultiPointCoverage multiPointCoverage) throws OwsExceptionReport { + public XmlObject visit(MultiPointCoverage value) throws OwsExceptionReport { return null; } @Override - public XmlObject visit(RectifiedGridCoverage rectifiedGridCoverage) throws OwsExceptionReport { + public XmlObject visit(RectifiedGridCoverage value) throws OwsExceptionReport { return null; } @@ -353,5 +354,10 @@ public XmlObject visit(RectifiedGridCoverage rectifiedGridCoverage) throws OwsEx public XmlObject visit(ProfileValue value) throws OwsExceptionReport { return CodingHelper.encodeObjectToXml(value.getDefaultElementEncoding(), value); } + + @Override + public XmlObject visit(QuantityRangeValue value) throws OwsExceptionReport { + return null; + } } } diff --git a/coding/exi/pom.xml b/coding/exi/pom.xml index a27b315c4e..88430954c7 100644 --- a/coding/exi/pom.xml +++ b/coding/exi/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-exi diff --git a/coding/gml-cov/pom.xml b/coding/gml-cov/pom.xml index 6a61178b6f..e3e16a04a8 100644 --- a/coding/gml-cov/pom.xml +++ b/coding/gml-cov/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-gml-cov diff --git a/coding/gml/pom.xml b/coding/gml/pom.xml index 9d68306d65..8d457d381b 100644 --- a/coding/gml/pom.xml +++ b/coding/gml/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-gml diff --git a/coding/gml/src/main/java/org/n52/svalbard/gml/v321/encode/AbstractCoverageEncoder.java b/coding/gml/src/main/java/org/n52/svalbard/gml/v321/encode/AbstractCoverageEncoder.java index 1c4115b41f..c01a4197db 100644 --- a/coding/gml/src/main/java/org/n52/svalbard/gml/v321/encode/AbstractCoverageEncoder.java +++ b/coding/gml/src/main/java/org/n52/svalbard/gml/v321/encode/AbstractCoverageEncoder.java @@ -37,15 +37,17 @@ import org.n52.sos.ogc.om.values.CountValue; import org.n52.sos.ogc.om.values.DiscreteCoverage; import org.n52.sos.ogc.om.values.QuantityValue; +import org.n52.sos.ogc.om.values.TextValue; import org.n52.sos.ogc.om.values.Value; import org.n52.sos.ogc.ows.OwsExceptionReport; +import com.google.common.base.Joiner; import com.google.common.collect.Lists; import net.opengis.gml.x32.BooleanListDocument; -import net.opengis.gml.x32.CategoryListDocument; -import net.opengis.gml.x32.CodeOrNilReasonListType; +import net.opengis.gml.x32.CoordinatesType; import net.opengis.gml.x32.CountListDocument; +import net.opengis.gml.x32.DataBlockType; import net.opengis.gml.x32.DiscreteCoverageType; import net.opengis.gml.x32.MeasureOrNilReasonListType; import net.opengis.gml.x32.QuantityListDocument; @@ -94,25 +96,21 @@ protected void encodeValueList(RangeSetType rst, DiscreteCoverage discreteCov List list = getList(discreteCoverage); Value value = discreteCoverage.getRangeSet().iterator().next(); if (value instanceof BooleanValue) { - BooleanListDocument bld = BooleanListDocument.Factory.newInstance(); + BooleanListDocument bld = BooleanListDocument.Factory.newInstance(getXmlOptions()); bld.setBooleanList(list); rst.set(bld); - } else if (value instanceof CategoryValue) { - CategoryListDocument cld = CategoryListDocument.Factory.newInstance(); - CodeOrNilReasonListType conrlt = cld.addNewCategoryList(); - if (discreteCoverage.isSetUnit()) { - conrlt.setCodeSpace(discreteCoverage.getUnit()); - } else if (value.isSetUnit()) { - conrlt.setCodeSpace(value.getUnit()); - } - conrlt.setListValue(list); - rst.set(cld); + } else if (value instanceof CategoryValue || value instanceof TextValue) { + DataBlockType dbt = rst.addNewDataBlock(); + dbt.addNewRangeParameters().setHref(discreteCoverage.getRangeParameters()); + CoordinatesType ct = dbt.addNewTupleList(); + ct.setCs(","); + ct.setStringValue(Joiner.on(",").join(list)); } else if (value instanceof CountValue) { - CountListDocument cld = CountListDocument.Factory.newInstance(); + CountListDocument cld = CountListDocument.Factory.newInstance(getXmlOptions()); cld.setCountList(list); rst.set(cld); } else if (value instanceof QuantityValue) { - QuantityListDocument qld = QuantityListDocument.Factory.newInstance(); + QuantityListDocument qld = QuantityListDocument.Factory.newInstance(getXmlOptions()); MeasureOrNilReasonListType monrlt = qld.addNewQuantityList(); if (discreteCoverage.isSetUnit()) { monrlt.setUom(discreteCoverage.getUnit()); @@ -121,8 +119,6 @@ protected void encodeValueList(RangeSetType rst, DiscreteCoverage discreteCov } monrlt.setListValue(list); rst.set(qld); - } else { - rst.setNil(); } } diff --git a/coding/gml/src/main/java/org/n52/svalbard/gml/v321/encode/AbstractRectifiedGridCoverageTypeEncoder.java b/coding/gml/src/main/java/org/n52/svalbard/gml/v321/encode/AbstractRectifiedGridCoverageTypeEncoder.java index c31b152a7a..7cac722e9f 100644 --- a/coding/gml/src/main/java/org/n52/svalbard/gml/v321/encode/AbstractRectifiedGridCoverageTypeEncoder.java +++ b/coding/gml/src/main/java/org/n52/svalbard/gml/v321/encode/AbstractRectifiedGridCoverageTypeEncoder.java @@ -28,16 +28,28 @@ */ package org.n52.svalbard.gml.v321.encode; +import java.util.ArrayList; +import java.util.List; import java.util.Map; +import java.util.SortedSet; import org.apache.xmlbeans.XmlObject; import org.n52.sos.encode.Encoder; import org.n52.sos.ogc.gml.GmlConstants; +import org.n52.sos.ogc.om.values.QuantityValued; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.ogc.sos.SosConstants.HelperValues; +import org.n52.sos.ogc.swe.RangeValue; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +import net.opengis.gml.x32.DirectPositionListType; +import net.opengis.gml.x32.DirectPositionType; import net.opengis.gml.x32.DiscreteCoverageType; +import net.opengis.gml.x32.LineStringDocument; +import net.opengis.gml.x32.LineStringType; import net.opengis.gml.x33.ce.SimpleMultiPointDocument; import net.opengis.gml.x33.ce.SimpleMultiPointType; @@ -74,11 +86,61 @@ protected DiscreteCoverageType encodeRectifiedGridCoverage(RectifiedGridCoverage } private XmlObject encodeDomainSet(RectifiedGridCoverage rectifiedGridCoverage) { - SimpleMultiPointDocument smpd = SimpleMultiPointDocument.Factory.newInstance(); - SimpleMultiPointType smpt = smpd.addNewSimpleMultiPoint(); - smpt.setId("smp_" + rectifiedGridCoverage.getGmlId()); - smpt.addNewPosList().setListValue(rectifiedGridCoverage.getDomainSet()); - return smpd; + List> domainSet = rectifiedGridCoverage.getDomainSet(); + if (!checkForRange(domainSet)) { + SimpleMultiPointDocument smpd = SimpleMultiPointDocument.Factory.newInstance(); + SimpleMultiPointType smpt = smpd.addNewSimpleMultiPoint(); + smpt.setId("smp_" + rectifiedGridCoverage.getGmlId()); + DirectPositionListType dplt = smpt.addNewPosList(); + List uoms = getUoms(domainSet); + if (!uoms.isEmpty()) { + dplt.setUomLabels(Lists.newArrayList(uoms)); + } + dplt.setListValue(getList(rectifiedGridCoverage.getDomainSet())); + return smpd; + } else { + LineStringDocument lsd = LineStringDocument.Factory.newInstance(); + LineStringType lst = lsd.addNewLineString(); + lst.setId("ls_" + rectifiedGridCoverage.getGmlId()); + lst.setUomLabels(getUoms(domainSet)); + for (QuantityValued quantityValued : domainSet) { + Object value = quantityValued.getValue(); + if (value instanceof Double) { + lst.addNewPos().setListValue(Lists.newArrayList((Double)value)); + } else if (value instanceof RangeValue) { + lst.addNewPos().setListValue(((RangeValue) value).getRangeAsList()); + } + } + return lsd; + } + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + private List getList(List> domainSet) { + List list = new ArrayList<>(); + for (QuantityValued quantityValued : domainSet) { + if (quantityValued.getValue() instanceof Double) { + list.add(((Double)quantityValued.getValue())); + } + } + return list; + } + + private boolean checkForRange(List> domainSet) { + for (QuantityValued quantityValued : domainSet) { + if (quantityValued.getValue() instanceof RangeValue) { + return true; + } + } + return false; + } + + private List getUoms(List> domainSet) { + SortedSet uoms = Sets.newTreeSet(); + for (QuantityValued values : domainSet) { + uoms.add(values.getUnit()); + } + return Lists.newArrayList(uoms); } @Override @@ -86,5 +148,5 @@ public void addNamespacePrefixToMap(Map nameSpacePrefixMap) { super.addNamespacePrefixToMap(nameSpacePrefixMap); nameSpacePrefixMap.put(GmlConstants.NS_GML_32, GmlConstants.NS_GML_PREFIX); } - + } diff --git a/coding/gml/src/test/java/org/n52/svalbard/gml/v321/encode/RectifiedGridCoverageDocumentEncoderTest.java b/coding/gml/src/test/java/org/n52/svalbard/gml/v321/encode/RectifiedGridCoverageDocumentEncoderTest.java index bd22cf61bc..67a31b7229 100644 --- a/coding/gml/src/test/java/org/n52/svalbard/gml/v321/encode/RectifiedGridCoverageDocumentEncoderTest.java +++ b/coding/gml/src/test/java/org/n52/svalbard/gml/v321/encode/RectifiedGridCoverageDocumentEncoderTest.java @@ -32,18 +32,17 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; -import java.util.SortedMap; - +import org.apache.xmlbeans.XmlOptions; import org.junit.Test; import org.n52.sos.exception.ows.concrete.UnsupportedEncoderInputException; +import org.n52.sos.ogc.om.values.CategoryValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; -import org.n52.sos.ogc.om.values.Value; +import org.n52.sos.ogc.om.values.TextValue; import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.util.XmlHelper; -import com.google.common.collect.Maps; - import net.opengis.gml.x32.RectifiedGridCoverageDocument; public class RectifiedGridCoverageDocumentEncoderTest { @@ -51,20 +50,52 @@ public class RectifiedGridCoverageDocumentEncoderTest { private RectifiedGridCoverageDocumentEncoder encoder = new RectifiedGridCoverageDocumentEncoder(); @Test - public void test_encoding() throws UnsupportedEncoderInputException, OwsExceptionReport { + public void test_quantity_encoding() throws UnsupportedEncoderInputException, OwsExceptionReport { RectifiedGridCoverageDocument encoded = encoder.encode(getRectifiedGridCoverage()); - assertThat(XmlHelper.validateDocument(encoded), is(TRUE)); + System.out.println(encoded.xmlText(new XmlOptions().setSavePrettyPrint())); + } + + @Test + public void test_category_encoding() throws UnsupportedEncoderInputException, OwsExceptionReport { + RectifiedGridCoverageDocument encoded = encoder.encode(getCategoryRectifiedGridCoverage()); + assertThat(XmlHelper.validateDocument(encoded), is(TRUE)); + System.out.println(encoded.xmlText(new XmlOptions().setSavePrettyPrint())); + } + + @Test + public void test_text_encoding() throws UnsupportedEncoderInputException, OwsExceptionReport { + RectifiedGridCoverageDocument encoded = encoder.encode(getTextRectifiedGridCoverage()); + assertThat(XmlHelper.validateDocument(encoded), is(TRUE)); + System.out.println(encoded.xmlText(new XmlOptions().setSavePrettyPrint())); } private RectifiedGridCoverage getRectifiedGridCoverage() { - RectifiedGridCoverage gridCoverage = new RectifiedGridCoverage("test"); - SortedMap> values = Maps.newTreeMap(); - values.put(2.5, new QuantityValue(10.0)); - values.put(5.0, new QuantityValue(8.0)); - values.put(10.0, new QuantityValue(3.0)); - gridCoverage.setValue(values); - gridCoverage.setUnit("C"); - return gridCoverage; + RectifiedGridCoverage rgc = new RectifiedGridCoverage("quantity"); + rgc.addValue(new QuantityValue(2.5, "m"), new QuantityValue(10.0)); + rgc.addValue(new QuantityValue(5.0, "m"), new QuantityValue(8.0)); + rgc.addValue(new QuantityValue(10.0, "m"), new QuantityValue(3.0)); + rgc.setUnit("C"); + return rgc; + } + + private RectifiedGridCoverage getCategoryRectifiedGridCoverage() { + RectifiedGridCoverage rgc = new RectifiedGridCoverage("category"); + rgc.setUnit("d"); + rgc.setRangeParameters("category_param"); + rgc.addValue(new QuantityRangeValue(0.0, 5.0, "m"), new CategoryValue("test category")); + rgc.addValue(new QuantityRangeValue(5.0, 10.0, "m"), new CategoryValue("test category 2")); + rgc.addValue(new QuantityRangeValue(10.0, 15.0, "m"), new CategoryValue("test category 2 test")); + return rgc; + } + + private RectifiedGridCoverage getTextRectifiedGridCoverage() { + RectifiedGridCoverage rgc = new RectifiedGridCoverage("text"); + rgc.setUnit("d"); + rgc.setRangeParameters("text_param"); + rgc.addValue(new QuantityRangeValue(0.0, 5.0, "m"), new TextValue("test text")); + rgc.addValue(new QuantityRangeValue(5.0, 10.0, "m"), new TextValue("test text 2")); + rgc.addValue(new QuantityRangeValue(10.0, 15.0, "m"), new TextValue("test text 2 test")); + return rgc; } } diff --git a/coding/gwml/pom.xml b/coding/gwml/pom.xml index 1f96869df1..7aa5505aec 100644 --- a/coding/gwml/pom.xml +++ b/coding/gwml/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-gwml diff --git a/coding/gwml/src/main/java/org/n52/sos/convert/GwmlObservationModifier.java b/coding/gwml/src/main/java/org/n52/sos/convert/GwmlObservationModifier.java index 8f7b287613..1e8d6cd861 100644 --- a/coding/gwml/src/main/java/org/n52/sos/convert/GwmlObservationModifier.java +++ b/coding/gwml/src/main/java/org/n52/sos/convert/GwmlObservationModifier.java @@ -35,6 +35,7 @@ import org.n52.sos.ogc.gwml.GWMLConstants; import org.n52.sos.ogc.om.NamedValue; +import org.n52.sos.ogc.om.OmConstants; import org.n52.sos.ogc.om.OmObservation; import org.n52.sos.ogc.om.SingleObservationValue; import org.n52.sos.ogc.om.values.BooleanValue; @@ -50,8 +51,11 @@ import org.n52.sos.ogc.sos.SosConstants; import org.n52.sos.request.AbstractServiceRequest; import org.n52.sos.request.GetObservationByIdRequest; +import org.n52.sos.request.GetObservationRequest; +import org.n52.sos.response.AbstractObservationResponse; import org.n52.sos.response.AbstractServiceResponse; import org.n52.sos.response.GetObservationByIdResponse; +import org.n52.sos.response.GetObservationResponse; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -64,6 +68,7 @@ private static Set getKeyTypes() { Set services = Sets.newHashSet(SosConstants.SOS); Set versions = Sets.newHashSet(Sos1Constants.SERVICEVERSION, Sos2Constants.SERVICEVERSION); Map, AbstractServiceResponse> requestResponseMap = Maps.newHashMap(); + requestResponseMap.put(new GetObservationRequest(), new GetObservationResponse()); requestResponseMap.put(new GetObservationByIdRequest(), new GetObservationByIdResponse()); Set keys = Sets.newHashSet(); for (String service : services) { @@ -86,17 +91,23 @@ public Set getRequestResponseModifierKeyTypes() @Override public AbstractServiceResponse modifyResponse(AbstractServiceRequest request, AbstractServiceResponse response) throws OwsExceptionReport { - if (response instanceof GetObservationByIdResponse) { - return checkGetObservationByIdResponse((GetObservationByIdResponse)response); + if (response instanceof AbstractObservationResponse) { + return checkGetObservationResponse((AbstractObservationResponse)response); } return super.modifyResponse(request, response); } - private AbstractServiceResponse checkGetObservationByIdResponse(GetObservationByIdResponse response) { + private AbstractServiceResponse checkGetObservationResponse(AbstractObservationResponse response) { for (OmObservation o : response.getObservationCollection()) { if (o.getObservationConstellation().isSetObservationType() && (GWMLConstants.OBS_TYPE_GEOLOGY_LOG.equals(o.getObservationConstellation().getObservationType()) - || GWMLConstants.OBS_TYPE_GEOLOGY_LOG_COVERAGE.equals(o.getObservationConstellation().getObservationType()))) { + || GWMLConstants.OBS_TYPE_GEOLOGY_LOG_COVERAGE.equals(o.getObservationConstellation().getObservationType()) + || OmConstants.OBS_TYPE_PROFILE_OBSERVATION.equals(o.getObservationConstellation().getObservationType()))) { + if (OmConstants.NS_OM_2.equals(response.getResponseFormat()) + || GWMLConstants.NS_GWML_22.equals(response.getResponseFormat()) + || GWMLConstants.NS_GWML_WELL_22.equals(response.getResponseFormat())) { + o.getObservationConstellation().setObservationType(GWMLConstants.OBS_TYPE_GEOLOGY_LOG); + } if (o.isSetValue() && o.getValue() instanceof SingleObservationValue) { if (o.getValue().getValue() instanceof BooleanValue || o.getValue().getValue() instanceof CategoryValue || o.getValue().getValue() instanceof CountValue || o.getValue().getValue() instanceof QuantityValue diff --git a/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/AbstractGroundWaterMLEncoder.java b/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/AbstractGroundWaterMLEncoder.java index 2c220aec1f..027d5edafd 100644 --- a/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/AbstractGroundWaterMLEncoder.java +++ b/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/AbstractGroundWaterMLEncoder.java @@ -48,11 +48,12 @@ public abstract class AbstractGroundWaterMLEncoder extends AbstractSpecifi @Override public void addNamespacePrefixToMap(Map nameSpacePrefixMap) { nameSpacePrefixMap.put(GWMLConstants.NS_GWML_22, GWMLConstants.NS_GWML_2_PREFIX); + nameSpacePrefixMap.put(GWMLConstants.NS_GWML_WELL_22, GWMLConstants.NS_GWML_WELL_2_PREFIX); } @Override public Set getSchemaLocations() { - return Sets.newHashSet(GWMLConstants.GWML_22_SCHEMA_LOCATION); + return Sets.newHashSet(GWMLConstants.GWML_22_SCHEMA_LOCATION, GWMLConstants.GWML_WELL_22_SCHEMA_LOCATION); } protected static XmlObject encodeGML(Object o) throws OwsExceptionReport { diff --git a/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/GWGeologyLogObservationTypeEncoder.java b/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/GWGeologyLogObservationTypeEncoder.java index 292ead8a58..fc4b66a653 100644 --- a/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/GWGeologyLogObservationTypeEncoder.java +++ b/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/GWGeologyLogObservationTypeEncoder.java @@ -46,6 +46,7 @@ import org.n52.sos.ogc.swe.simpleType.SweQuantity; import org.n52.sos.service.ServiceConstants.SupportedTypeKey; import org.n52.sos.util.CodingHelper; +import org.n52.sos.util.CollectionHelper; import org.n52.sos.w3c.SchemaLocation; import com.google.common.collect.Sets; @@ -57,13 +58,15 @@ public class GWGeologyLogObservationTypeEncoder extends OmEncoderv20 { - private static final Set ENCODER_KEYS = - CodingHelper.encoderKeysForElements(GWMLConstants.NS_GWML_22, OmObservation.class); + @SuppressWarnings("unchecked") + private static final Set ENCODER_KEYS = CollectionHelper.union( + CodingHelper.encoderKeysForElements(GWMLConstants.NS_GWML_22, OmObservation.class), + CodingHelper.encoderKeysForElements(GWMLConstants.NS_GWML_WELL_22, OmObservation.class)); private static final Map> SUPPORTED_TYPES = Collections.singletonMap( SupportedTypeKey.ObservationType, (Set) Sets.newHashSet(GWMLConstants.OBS_TYPE_GEOLOGY_LOG, GWMLConstants.OBS_TYPE_GEOLOGY_LOG, OmConstants.OBS_TYPE_CATEGORY_OBSERVATION, - OmConstants.OBS_TYPE_TEXT_OBSERVATION)); + OmConstants.OBS_TYPE_TEXT_OBSERVATION, OmConstants.OBS_TYPE_PROFILE_OBSERVATION)); private static final Map>> SUPPORTED_RESPONSE_FORMATS = Collections.singletonMap( SosConstants.SOS, @@ -155,11 +158,14 @@ protected void addAddtitionalInformation(OMObservationType omot, OmObservation o @Override public void addNamespacePrefixToMap(Map nameSpacePrefixMap) { nameSpacePrefixMap.put(GWMLConstants.NS_GWML_22, GWMLConstants.NS_GWML_2_PREFIX); + nameSpacePrefixMap.put(GWMLConstants.NS_GWML_WELL_22, GWMLConstants.NS_GWML_WELL_2_PREFIX); } @Override public Set getSchemaLocations() { - return Sets.newHashSet(GWMLConstants.GWML_22_SCHEMA_LOCATION); + Set schemaLocations = Sets.newHashSet(GWMLConstants.GWML_22_SCHEMA_LOCATION, GWMLConstants.GWML_WELL_22_SCHEMA_LOCATION); + schemaLocations.addAll(super.getSchemaLocations()); + return schemaLocations; } private void encodeStartDepth(StartDepth sd, SweQuantity sweQuantity) throws OwsExceptionReport { diff --git a/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/GwmlEncoderv22.java b/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/GwmlEncoderv22.java index 23262d18da..4c7bbf9e0a 100644 --- a/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/GwmlEncoderv22.java +++ b/coding/gwml/src/main/java/org/n52/svalbard/gwml/v22/encode/GwmlEncoderv22.java @@ -59,6 +59,7 @@ import org.n52.sos.ogc.sos.SosConstants; import org.n52.sos.service.ServiceConstants.SupportedTypeKey; import org.n52.sos.util.CodingHelper; +import org.n52.sos.util.CollectionHelper; import org.n52.sos.util.http.MediaType; import org.n52.sos.w3c.SchemaLocation; import org.n52.svalbard.gwml.v22.encode.streaming.GwmlV22XmlStreamWriter; @@ -70,11 +71,15 @@ public class GwmlEncoderv22 extends OmEncoderv20 { */ private static final Logger LOGGER = LoggerFactory.getLogger(GwmlEncoderv22.class); - private static final Set ENCODER_KEYS = CodingHelper.encoderKeysForElements(GWMLConstants.NS_GWML_22, - OmObservation.class, NamedValue.class, SingleObservationValue.class, MultiObservationValues.class); + @SuppressWarnings("unchecked") + private static final Set ENCODER_KEYS = CollectionHelper.union( + CodingHelper.encoderKeysForElements(GWMLConstants.NS_GWML_22, + OmObservation.class, NamedValue.class, SingleObservationValue.class, MultiObservationValues.class), + CodingHelper.encoderKeysForElements(GWMLConstants.NS_GWML_WELL_22, + OmObservation.class, NamedValue.class, SingleObservationValue.class, MultiObservationValues.class)); private static final Map> SUPPORTED_TYPES = Collections.singletonMap( - SupportedTypeKey.ObservationType, (Set) Sets.newHashSet(GWMLConstants.OBS_TYPE_GEOLOGY_LOG)); + SupportedTypeKey.ObservationType, (Set) Sets.newHashSet(GWMLConstants.OBS_TYPE_GEOLOGY_LOG, OmConstants.OBS_TYPE_PROFILE_OBSERVATION)); private static final Map>> SUPPORTED_RESPONSE_FORMATS = Collections.singletonMap( SosConstants.SOS, @@ -86,7 +91,7 @@ public GwmlEncoderv22() { } - @Override + @Override public Set getEncoderKeyType() { return Collections.unmodifiableSet(ENCODER_KEYS); } @@ -133,14 +138,17 @@ public MediaType getContentType() { @Override public Set getSchemaLocations() { - return Sets.newHashSet(OmConstants.OM_20_SCHEMA_LOCATION); + Set schemaLocations = Sets.newHashSet(GWMLConstants.GWML_22_SCHEMA_LOCATION, GWMLConstants.GWML_WELL_22_SCHEMA_LOCATION); + schemaLocations.addAll(super.getSchemaLocations()); + return schemaLocations; } @Override protected OMObservationType createOmObservationType() { return super.createOmObservationType(); } - + + @Override public void encode(Object objectToEncode, OutputStream outputStream, EncodingValues encodingValues) throws OwsExceptionReport { diff --git a/coding/inspire/ompr/pom.xml b/coding/inspire/ompr/pom.xml index 57613aea89..01e5cc1807 100644 --- a/coding/inspire/ompr/pom.xml +++ b/coding/inspire/ompr/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding-inspire - 4.4.0 + 4.4.1 4.0.0 coding-inspire-ompr diff --git a/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessDocumentEncoder.java b/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessDocumentEncoder.java index 77310fff24..660ff76924 100644 --- a/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessDocumentEncoder.java +++ b/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessDocumentEncoder.java @@ -57,7 +57,9 @@ public class ProcessDocumentEncoder extends ProcessTypeEncoder { protected static final Set ENCODER_KEYS = Sets.newHashSet(new ClassToClassEncoderKey(Process.class, ProcessDocument.class), new XmlDocumentEncoderKey(InspireOMPRConstants.NS_OMPR_30, Process.class), - new XmlDocumentEncoderKey(InspireOMPRConstants.NS_OMPR_30, SosProcedureDescription.class)); + new XmlDocumentEncoderKey(InspireOMPRConstants.NS_OMPR_30, SosProcedureDescription.class), + new XmlDocumentEncoderKey("http://inspire.ec.europa.eu/featureconcept/Process", Process.class), + new XmlDocumentEncoderKey("http://inspire.ec.europa.eu/featureconcept/Process", SosProcedureDescription.class)); public ProcessDocumentEncoder() { LOGGER.debug("Encoder for the following keys initialized successfully: {}!", diff --git a/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessPropertyTypeEncoder.java b/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessPropertyTypeEncoder.java index b8f728c590..e15aec256f 100644 --- a/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessPropertyTypeEncoder.java +++ b/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessPropertyTypeEncoder.java @@ -35,6 +35,7 @@ import org.apache.xmlbeans.XmlObject; import org.n52.sos.encode.ClassToClassEncoderKey; import org.n52.sos.encode.EncoderKey; +import org.n52.sos.encode.XmlDocumentEncoderKey; import org.n52.sos.encode.XmlPropertyTypeEncoderKey; import org.n52.sos.exception.ows.concrete.UnsupportedEncoderInputException; import org.n52.sos.ogc.ows.OwsExceptionReport; @@ -58,7 +59,9 @@ public class ProcessPropertyTypeEncoder extends ProcessTypeEncoder { protected static final Set ENCODER_KEYS = Sets.newHashSet(new ClassToClassEncoderKey(Process.class, ProcessDocument.class), new XmlPropertyTypeEncoderKey(InspireOMPRConstants.NS_OMPR_30, Process.class), - new XmlPropertyTypeEncoderKey(InspireOMPRConstants.NS_OMPR_30, SosProcedureDescription.class)); + new XmlPropertyTypeEncoderKey(InspireOMPRConstants.NS_OMPR_30, SosProcedureDescription.class), + new XmlDocumentEncoderKey("http://inspire.ec.europa.eu/featureconcept/Process", Process.class), + new XmlDocumentEncoderKey("http://inspire.ec.europa.eu/featureconcept/Process", SosProcedureDescription.class)); public ProcessPropertyTypeEncoder() { LOGGER.debug("Encoder for the following keys initialized successfully: {}!", diff --git a/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessTypeEncoder.java b/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessTypeEncoder.java index 3d38ea2f29..21ec032f14 100644 --- a/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessTypeEncoder.java +++ b/coding/inspire/ompr/src/main/java/org/n52/svalbard/inspire/ompr/v30/encode/ProcessTypeEncoder.java @@ -99,6 +99,8 @@ ImmutableMap.> builder() private static final Set ENCODER_KEYS = union( encoderKeysForElements(InspireOMPRConstants.NS_OMPR_30, SosProcedureDescription.class, Process.class), encoderKeysForElements(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_MIME_TYPE, SosProcedureDescription.class, + Process.class), + encoderKeysForElements("http://inspire.ec.europa.eu/featureconcept/Process", SosProcedureDescription.class, Process.class)); public ProcessTypeEncoder() { diff --git a/coding/inspire/omso/pom.xml b/coding/inspire/omso/pom.xml index 7d8eeb70e4..fba3af8784 100644 --- a/coding/inspire/omso/pom.xml +++ b/coding/inspire/omso/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding-inspire - 4.4.0 + 4.4.1 4.0.0 coding-inspire-omso diff --git a/coding/inspire/pom.xml b/coding/inspire/pom.xml index cdcb250b86..708ab4413b 100644 --- a/coding/inspire/pom.xml +++ b/coding/inspire/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 coding-inspire pom diff --git a/coding/json-common/pom.xml b/coding/json-common/pom.xml index 3f7118e20a..8abc32ad20 100644 --- a/coding/json-common/pom.xml +++ b/coding/json-common/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-json-common diff --git a/coding/json-common/src/main/java/org/n52/sos/coding/json/SchemaConstants.java b/coding/json-common/src/main/java/org/n52/sos/coding/json/SchemaConstants.java index ff18a31c46..34c0791e89 100644 --- a/coding/json-common/src/main/java/org/n52/sos/coding/json/SchemaConstants.java +++ b/coding/json-common/src/main/java/org/n52/sos/coding/json/SchemaConstants.java @@ -95,6 +95,8 @@ interface Observation { String MEASUREMENT = "http://www.52north.org/schema/json/Measurement#"; String SWE_ARRAY_OBSERVATION = "http://www.52north.org/schema/json/SWEArrayObservation#"; + + String REFERENCE_OBSERVATION = "http://www.52north.org/schema/json/ReferenceObservation#"; String TEMPLATE_OBSERVATION = "http://www.52north.org/schema/json/TemplateObservation#"; } diff --git a/coding/json-common/src/main/resources/schema/ReferenceObservation.json b/coding/json-common/src/main/resources/schema/ReferenceObservation.json new file mode 100644 index 0000000000..4528c52019 --- /dev/null +++ b/coding/json-common/src/main/resources/schema/ReferenceObservation.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "http://www.52north.org/schema/json/ReferenceObservation#", + "allOf": [ + { + "$ref": "http://www.52north.org/schema/json/ObservationWithResult#" + } + ], + "properties": { + "type": { + "enum": [ + "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation" + ] + }, + "result": { + "type": "object", + "required": [ + "href", + "title", + "role" + ], + "properties": { + "href": { + "type": "string" + }, + "title": { + "type": "string" + }, + "role": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/coding/json/pom.xml b/coding/json/pom.xml index 74aa812e84..2dacf00516 100644 --- a/coding/json/pom.xml +++ b/coding/json/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-json diff --git a/coding/json/src/main/java/org/n52/sos/decode/json/impl/ObservationDecoder.java b/coding/json/src/main/java/org/n52/sos/decode/json/impl/ObservationDecoder.java index b771ef4363..47de0f6168 100644 --- a/coding/json/src/main/java/org/n52/sos/decode/json/impl/ObservationDecoder.java +++ b/coding/json/src/main/java/org/n52/sos/decode/json/impl/ObservationDecoder.java @@ -59,6 +59,7 @@ import org.n52.sos.ogc.om.values.GeometryValue; import org.n52.sos.ogc.om.values.HrefAttributeValue; import org.n52.sos.ogc.om.values.QuantityValue; +import org.n52.sos.ogc.om.values.ReferenceValue; import org.n52.sos.ogc.om.values.TextValue; import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.ogc.sensorML.SensorML; @@ -232,6 +233,8 @@ private ObservationValue parseValue(JsonNode node) throws OwsExceptionReport return parseTruthObservationValue(node); } else if (type.equals(OmConstants.OBS_TYPE_CATEGORY_OBSERVATION)) { return parseCategoryObservationValue(node); + } else if (type.equals(OmConstants.OBS_TYPE_REFERENCE_OBSERVATION)) { + return parseReferenceObservationValue(node); } else if (type.equals(OmConstants.OBS_TYPE_GEOMETRY_OBSERVATION)) { return parseGeometryObservation(node); } else { @@ -281,4 +284,23 @@ private ObservationValue parseGeometryObservation(JsonNode node) throws OwsEx return new SingleObservationValue(parsePhenomenonTime(node), v); } + private ObservationValue parseReferenceObservationValue(JsonNode node) throws OwsExceptionReport { + ReferenceValue v = new ReferenceValue(parseReferenceValue(node.path(JSONConstants.RESULT))); + return new SingleObservationValue(parsePhenomenonTime(node), v); + } + + private ReferenceType parseReferenceValue(JsonNode node) { + ReferenceType ref = new ReferenceType(); + if (!node.path(JSONConstants.HREF).isMissingNode()) { + ref.setHref(node.path(JSONConstants.HREF).asText()); + } + if (!node.path(JSONConstants.TITLE).isMissingNode()) { + ref.setTitle(node.path(JSONConstants.TITLE).asText()); + } + if (!node.path(JSONConstants.ROLE).isMissingNode()) { + ref.setRole(node.path(JSONConstants.ROLE).asText()); + } + return ref; + } + } diff --git a/coding/json/src/main/java/org/n52/sos/encode/json/impl/AbstractObservationResponseEncoder.java b/coding/json/src/main/java/org/n52/sos/encode/json/impl/AbstractObservationResponseEncoder.java index 828f62b2b1..7ba3dea716 100644 --- a/coding/json/src/main/java/org/n52/sos/encode/json/impl/AbstractObservationResponseEncoder.java +++ b/coding/json/src/main/java/org/n52/sos/encode/json/impl/AbstractObservationResponseEncoder.java @@ -96,6 +96,7 @@ public Map> getSupportedResponseFormatObservationTypes() { (Set) Sets.newHashSet(OmConstants.OBS_TYPE_CATEGORY_OBSERVATION, OmConstants.OBS_TYPE_COUNT_OBSERVATION, OmConstants.OBS_TYPE_GEOMETRY_OBSERVATION, OmConstants.OBS_TYPE_MEASUREMENT, OmConstants.OBS_TYPE_TEXT_OBSERVATION, - OmConstants.OBS_TYPE_TRUTH_OBSERVATION, OmConstants.OBS_TYPE_SWE_ARRAY_OBSERVATION)); + OmConstants.OBS_TYPE_TRUTH_OBSERVATION, OmConstants.OBS_TYPE_SWE_ARRAY_OBSERVATION, + OmConstants.OBS_TYPE_REFERENCE_OBSERVATION)); } } diff --git a/coding/json/src/main/java/org/n52/sos/encode/json/impl/ObservationEncoder.java b/coding/json/src/main/java/org/n52/sos/encode/json/impl/ObservationEncoder.java index 4fe3bfdae3..f4f35bf81f 100644 --- a/coding/json/src/main/java/org/n52/sos/encode/json/impl/ObservationEncoder.java +++ b/coding/json/src/main/java/org/n52/sos/encode/json/impl/ObservationEncoder.java @@ -46,6 +46,7 @@ import org.n52.sos.ogc.om.values.CountValue; import org.n52.sos.ogc.om.values.CvDiscretePointCoverage; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.GeometryValue; import org.n52.sos.ogc.om.values.HrefAttributeValue; import org.n52.sos.ogc.om.values.MultiPointCoverage; @@ -291,6 +292,11 @@ public JsonNode visit(RectifiedGridCoverage value) throws OwsExceptionReport { public JsonNode visit(ProfileValue value) throws OwsExceptionReport { throw new UnsupportedEncoderInputException(ObservationEncoder.this, value); } + + @Override + public JsonNode visit(QuantityRangeValue value) throws OwsExceptionReport { + throw new UnsupportedEncoderInputException(ObservationEncoder.this, value); + } }); } @@ -298,8 +304,12 @@ private JsonNode encodeReferenceValue(ReferenceValue value) { ReferenceType ref = value.getValue(); ObjectNode node = nodeFactory().objectNode(); node.put(JSONConstants.HREF, ref.getHref()); - node.put(JSONConstants.ROLE, ref.getRole()); - node.put(JSONConstants.TITLE, ref.getTitle()); + if (ref.isSetRole()) { + node.put(JSONConstants.ROLE, ref.getRole()); + } + if (ref.isSetTitle()) { + node.put(JSONConstants.TITLE, ref.getTitle()); + } return node; } @@ -355,7 +365,7 @@ private JsonNode encodeGeometryValue(Value value) throws OwsExceptionReport { GeometryValue geometryValue = (GeometryValue) value; return encodeObjectToJson(geometryValue.getValue()); } - + private JsonNode encodeComplexValue(Value value) throws OwsExceptionReport { ArrayNode result = nodeFactory().arrayNode(); ComplexValue complexValue = (ComplexValue) value; diff --git a/coding/netcdf/api/pom.xml b/coding/netcdf/api/pom.xml index a6ad2c2309..9ca3dbc22c 100644 --- a/coding/netcdf/api/pom.xml +++ b/coding/netcdf/api/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos netcdf - 4.4.0 + 4.4.1 4.0.0 api-netcdf diff --git a/coding/netcdf/coding/pom.xml b/coding/netcdf/coding/pom.xml index e26773fa39..9cf85899df 100644 --- a/coding/netcdf/coding/pom.xml +++ b/coding/netcdf/coding/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos netcdf - 4.4.0 + 4.4.1 4.0.0 coding-netcdf diff --git a/coding/netcdf/oceansites/pom.xml b/coding/netcdf/oceansites/pom.xml index 155d644cc5..34146cebef 100644 --- a/coding/netcdf/oceansites/pom.xml +++ b/coding/netcdf/oceansites/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos netcdf - 4.4.0 + 4.4.1 4.0.0 coding-oceansites diff --git a/coding/netcdf/pom.xml b/coding/netcdf/pom.xml index 5f13643779..40e7822d54 100644 --- a/coding/netcdf/pom.xml +++ b/coding/netcdf/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 netcdf diff --git a/coding/ows-v110/pom.xml b/coding/ows-v110/pom.xml index 44a1cbcff4..a9d95a83d6 100644 --- a/coding/ows-v110/pom.xml +++ b/coding/ows-v110/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-ows-v110 diff --git a/coding/pom.xml b/coding/pom.xml index 96ab0a34ec..a8760b7c8e 100644 --- a/coding/pom.xml +++ b/coding/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 coding pom diff --git a/coding/sensorML-v101/pom.xml b/coding/sensorML-v101/pom.xml index 6f4bac05bf..476c76a71a 100644 --- a/coding/sensorML-v101/pom.xml +++ b/coding/sensorML-v101/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-sensorML-v101 diff --git a/coding/sensorML-v20/pom.xml b/coding/sensorML-v20/pom.xml index 09befe4d42..6631602553 100644 --- a/coding/sensorML-v20/pom.xml +++ b/coding/sensorML-v20/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-sensorML-v20 diff --git a/coding/sensorML/pom.xml b/coding/sensorML/pom.xml index ffb6e5e31f..9c13b4da38 100644 --- a/coding/sensorML/pom.xml +++ b/coding/sensorML/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 coding-sensorML jar diff --git a/coding/sos-v100/pom.xml b/coding/sos-v100/pom.xml index 0f987dc006..b35ec1c5b4 100644 --- a/coding/sos-v100/pom.xml +++ b/coding/sos-v100/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-sos-v100 diff --git a/coding/sos-v20/pom.xml b/coding/sos-v20/pom.xml index 37be0b1f60..1fb4a28958 100644 --- a/coding/sos-v20/pom.xml +++ b/coding/sos-v20/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-sos-v20 diff --git a/coding/sos-v20/src/main/java/org/n52/sos/decode/OmDecoderv20.java b/coding/sos-v20/src/main/java/org/n52/sos/decode/OmDecoderv20.java index 25af0253a0..564cdaf0b8 100644 --- a/coding/sos-v20/src/main/java/org/n52/sos/decode/OmDecoderv20.java +++ b/coding/sos-v20/src/main/java/org/n52/sos/decode/OmDecoderv20.java @@ -65,6 +65,7 @@ import org.n52.sos.ogc.om.values.GeometryValue; import org.n52.sos.ogc.om.values.NilTemplateValue; import org.n52.sos.ogc.om.values.QuantityValue; +import org.n52.sos.ogc.om.values.ReferenceValue; import org.n52.sos.ogc.om.values.SweDataArrayValue; import org.n52.sos.ogc.om.values.TextValue; import org.n52.sos.ogc.ows.OwsExceptionReport; @@ -345,6 +346,9 @@ else if (xbResult.schemaType() == XmlString.type) { QuantityValue quantitiyValue = new QuantityValue(measureType.getValue(), measureType.getUnit()); return new SingleObservationValue<>(quantitiyValue); } else if (decodedObject instanceof ReferenceType) { + if (omObservation.isSetType() && omObservation.getType().isSetHref() && omObservation.getType().getHref().equals(OmConstants.OBS_TYPE_REFERENCE_OBSERVATION)) { + return new SingleObservationValue<>(new ReferenceValue(((ReferenceType) decodedObject))); + } return new SingleObservationValue<>(new CategoryValue(((ReferenceType) decodedObject).getHref())); } else if (decodedObject instanceof Geometry) { return new SingleObservationValue<>(new GeometryValue((Geometry) decodedObject)); diff --git a/coding/sos-v20/src/main/java/org/n52/sos/encode/AbstractOmEncoderv20.java b/coding/sos-v20/src/main/java/org/n52/sos/encode/AbstractOmEncoderv20.java index c9ee99050b..05dd964c10 100644 --- a/coding/sos-v20/src/main/java/org/n52/sos/encode/AbstractOmEncoderv20.java +++ b/coding/sos-v20/src/main/java/org/n52/sos/encode/AbstractOmEncoderv20.java @@ -89,6 +89,7 @@ import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -763,6 +764,11 @@ public XmlObject visit(QuantityValue value) throws OwsExceptionReport { return encodeGML(value, createHelperValues(value)); } + @Override + public XmlObject visit(QuantityRangeValue value) throws OwsExceptionReport { + return defaultValue(value); + } + @Override public XmlObject visit(ReferenceValue value) throws OwsExceptionReport { diff --git a/coding/sos-v20/src/main/java/org/n52/sos/encode/OmEncoderv20.java b/coding/sos-v20/src/main/java/org/n52/sos/encode/OmEncoderv20.java index a1164cb269..db40634f8f 100644 --- a/coding/sos-v20/src/main/java/org/n52/sos/encode/OmEncoderv20.java +++ b/coding/sos-v20/src/main/java/org/n52/sos/encode/OmEncoderv20.java @@ -62,6 +62,7 @@ import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -118,7 +119,7 @@ public class OmEncoderv20 extends AbstractOmEncoderv20 { OmConstants.OBS_TYPE_COUNT_OBSERVATION, OmConstants.OBS_TYPE_GEOMETRY_OBSERVATION, OmConstants.OBS_TYPE_MEASUREMENT, OmConstants.OBS_TYPE_TEXT_OBSERVATION, OmConstants.OBS_TYPE_TRUTH_OBSERVATION, OmConstants.OBS_TYPE_SWE_ARRAY_OBSERVATION, - OmConstants.OBS_TYPE_COMPLEX_OBSERVATION)); + OmConstants.OBS_TYPE_COMPLEX_OBSERVATION, OmConstants.OBS_TYPE_REFERENCE_OBSERVATION)); private static final Map>> SUPPORTED_RESPONSE_FORMATS = Collections.singletonMap( SosConstants.SOS, @@ -424,6 +425,9 @@ public XmlObject visit(QuantityValue value) @Override public XmlObject visit(ReferenceValue value) throws OwsExceptionReport { + if (value.isSetValue()) { + return encodeGML(value.getValue()); + } return null; } @@ -481,12 +485,12 @@ public XmlObject visit(CvDiscretePointCoverage value) throws OwsExceptionReport } @Override - public XmlObject visit(MultiPointCoverage multiPointCoverage) throws OwsExceptionReport { + public XmlObject visit(MultiPointCoverage value) throws OwsExceptionReport { return null; } @Override - public XmlObject visit(RectifiedGridCoverage rectifiedGridCoverage) throws OwsExceptionReport { + public XmlObject visit(RectifiedGridCoverage value) throws OwsExceptionReport { return null; } @@ -495,5 +499,10 @@ public XmlObject visit(ProfileValue value) throws OwsExceptionReport { return CodingHelper.encodeObjectToXmlPropertyType(value.getDefaultElementEncoding(), value); } + @Override + public XmlObject visit(QuantityRangeValue value) throws OwsExceptionReport { + return null; + } + } } diff --git a/coding/uvf/pom.xml b/coding/uvf/pom.xml index 5d56c8de99..ec858ff7c2 100644 --- a/coding/uvf/pom.xml +++ b/coding/uvf/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-uvf diff --git a/coding/wml-v20/pom.xml b/coding/wml-v20/pom.xml index a712baed4c..73db61bddd 100644 --- a/coding/wml-v20/pom.xml +++ b/coding/wml-v20/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding - 4.4.0 + 4.4.1 4.0.0 coding-wml-v20 diff --git a/coding/wml-v20/src/main/java/org/n52/sos/encode/AbstractWmlEncoderv20.java b/coding/wml-v20/src/main/java/org/n52/sos/encode/AbstractWmlEncoderv20.java index f6e6c2ccaa..759862ca28 100644 --- a/coding/wml-v20/src/main/java/org/n52/sos/encode/AbstractWmlEncoderv20.java +++ b/coding/wml-v20/src/main/java/org/n52/sos/encode/AbstractWmlEncoderv20.java @@ -392,7 +392,10 @@ protected ObservationProcessDocument createObservationProcess(ObservationProcess } else { observationProcess.setId("process." + JavaHelper.generateID(procedure.toString())); } - + if (procedure.isSetIdentifier()) { + observationProcess.addNewIdentifier() + .set(CodingHelper.encodeObjectToXml(GmlConstants.NS_GML_32, procedure.getIdentifierCodeWithAuthority())); + } if (procedure.isSetName()) { for (final CodeType sosName : procedure.getName()) { observationProcess.addNewName() diff --git a/coding/wml-v20/src/main/java/org/n52/sos/encode/WmlTVPEncoderv20.java b/coding/wml-v20/src/main/java/org/n52/sos/encode/WmlTVPEncoderv20.java index 5ab58de070..0bf19fca7b 100644 --- a/coding/wml-v20/src/main/java/org/n52/sos/encode/WmlTVPEncoderv20.java +++ b/coding/wml-v20/src/main/java/org/n52/sos/encode/WmlTVPEncoderv20.java @@ -40,7 +40,6 @@ import org.n52.sos.encode.streaming.WmlTVPEncoderv20XmlStreamWriter; import org.n52.sos.exception.CodedException; import org.n52.sos.exception.ows.NoApplicableCodeException; -import org.n52.sos.exception.ows.concrete.DateTimeFormatException; import org.n52.sos.exception.ows.concrete.UnsupportedEncoderInputException; import org.n52.sos.ogc.om.AbstractObservationValue; import org.n52.sos.ogc.om.MultiObservationValues; diff --git a/converter/identifier-modifier/abstract-identifier/pom.xml b/converter/identifier-modifier/abstract-identifier/pom.xml index 7e34f9abf3..97a3c85277 100644 --- a/converter/identifier-modifier/abstract-identifier/pom.xml +++ b/converter/identifier-modifier/abstract-identifier/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos identifier-modifier - 4.4.0 + 4.4.1 abstract-identifier jar diff --git a/converter/identifier-modifier/flexible-identifier/pom.xml b/converter/identifier-modifier/flexible-identifier/pom.xml index 4da51b51da..99bea8b106 100644 --- a/converter/identifier-modifier/flexible-identifier/pom.xml +++ b/converter/identifier-modifier/flexible-identifier/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos identifier-modifier - 4.4.0 + 4.4.1 flexible-identifier jar diff --git a/converter/identifier-modifier/pom.xml b/converter/identifier-modifier/pom.xml index 02445871b4..f1c4e47391 100644 --- a/converter/identifier-modifier/pom.xml +++ b/converter/identifier-modifier/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos converter - 4.4.0 + 4.4.1 identifier-modifier pom diff --git a/converter/identifier-modifier/prefixed-identifier/pom.xml b/converter/identifier-modifier/prefixed-identifier/pom.xml index cb1ff4996e..3375b8197a 100644 --- a/converter/identifier-modifier/prefixed-identifier/pom.xml +++ b/converter/identifier-modifier/prefixed-identifier/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos identifier-modifier - 4.4.0 + 4.4.1 prefixed-identifier jar diff --git a/converter/pom.xml b/converter/pom.xml index 3b69d44b98..9ffc08de76 100644 --- a/converter/pom.xml +++ b/converter/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 converter pom diff --git a/converter/seriestype/pom.xml b/converter/seriestype/pom.xml index 7caba68bbf..58d142a1a0 100644 --- a/converter/seriestype/pom.xml +++ b/converter/seriestype/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos converter - 4.4.0 + 4.4.1 seriestype jar diff --git a/converter/split-and-merge/pom.xml b/converter/split-and-merge/pom.xml index ae19858af5..56a722e7e9 100644 --- a/converter/split-and-merge/pom.xml +++ b/converter/split-and-merge/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos converter - 4.4.0 + 4.4.1 split-and-merge jar diff --git a/converter/transformation/coordinate/pom.xml b/converter/transformation/coordinate/pom.xml index a2b20a4dfc..ab37a3386b 100644 --- a/converter/transformation/coordinate/pom.xml +++ b/converter/transformation/coordinate/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos transformation - 4.4.0 + 4.4.1 request-response-coordinate-transformer jar diff --git a/converter/transformation/pom.xml b/converter/transformation/pom.xml index bb177712ec..ddd46685c8 100644 --- a/converter/transformation/pom.xml +++ b/converter/transformation/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos converter - 4.4.0 + 4.4.1 transformation pom diff --git a/core/admin/pom.xml b/core/admin/pom.xml index 870246e2dc..c0f26114b7 100644 --- a/core/admin/pom.xml +++ b/core/admin/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos core - 4.4.0 + 4.4.1 admin 52°North SOS - Administrator Service Operator diff --git a/core/api/pom.xml b/core/api/pom.xml index df1446aa56..0b878e6e1b 100644 --- a/core/api/pom.xml +++ b/core/api/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos core - 4.4.0 + 4.4.1 4.0.0 api diff --git a/core/api/src/main/java/org/n52/sos/coding/CodingRepository.java b/core/api/src/main/java/org/n52/sos/coding/CodingRepository.java index c28fb581a8..32ca984295 100644 --- a/core/api/src/main/java/org/n52/sos/coding/CodingRepository.java +++ b/core/api/src/main/java/org/n52/sos/coding/CodingRepository.java @@ -291,7 +291,6 @@ private void generateSchemaLocationMap() { schemaLocations.put(((XmlEncoderKey) key).getNamespace(), encoder.getSchemaLocations()); } } - } } } diff --git a/core/api/src/main/java/org/n52/sos/ogc/gml/AbstractReferenceType.java b/core/api/src/main/java/org/n52/sos/ogc/gml/AbstractReferenceType.java index a36efd7507..69f674cde6 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/gml/AbstractReferenceType.java +++ b/core/api/src/main/java/org/n52/sos/ogc/gml/AbstractReferenceType.java @@ -89,8 +89,9 @@ public String getRole() { * @param href * Href to set */ - public void setHref(String href) { + public AbstractReferenceType setHref(String href) { this.href = new W3CHrefAttribute(href); + return this; } /** diff --git a/core/api/src/main/java/org/n52/sos/ogc/gwml/GWMLConstants.java b/core/api/src/main/java/org/n52/sos/ogc/gwml/GWMLConstants.java index 0dbca7111f..81679f653e 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/gwml/GWMLConstants.java +++ b/core/api/src/main/java/org/n52/sos/ogc/gwml/GWMLConstants.java @@ -33,13 +33,21 @@ public interface GWMLConstants { - String NS_GWML_22 = "http://www.opengis.net/gwml/2.2"; + String NS_GWML_22 = "http://www.opengis.net/gwml/2.2"; + + String NS_GWML_WELL_22 = "http://www.opengis.net/gwml-well/2.2"; String NS_GWML_2_PREFIX = "gwml2"; - String SCHEMA_LOCATION_URL_GWML_22 = "http://ngwd-bdnes.cits.nrcan.gc.ca/service/gwml/schemas/2.2/gwml2.xsd"; + String NS_GWML_WELL_2_PREFIX = "gwml2w"; + + String SCHEMA_LOCATION_URL_GWML_22 = "http://schemas.opengis.net/gwml/2.2/gwml2.xsd"; + + String SCHEMA_LOCATION_URL_GWML_WELL_22 = "http://schemas.opengis.net/gwml/2.2/gwml2-well.xsd"; SchemaLocation GWML_22_SCHEMA_LOCATION = new SchemaLocation(NS_GWML_22, SCHEMA_LOCATION_URL_GWML_22); + + SchemaLocation GWML_WELL_22_SCHEMA_LOCATION = new SchemaLocation(NS_GWML_WELL_22, SCHEMA_LOCATION_URL_GWML_WELL_22); String OBS_TYPE_GEOLOGY_LOG = "http://www.opengis.net/def/observationType/OGC-GWML/2.2/GW_GeologyLog"; diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/OmConstants.java b/core/api/src/main/java/org/n52/sos/ogc/om/OmConstants.java index 85ca413450..832f452f77 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/OmConstants.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/OmConstants.java @@ -100,6 +100,8 @@ public interface OmConstants { String EN_COUNT_OBSERVATION = "CountObservation"; String EN_TEXT_OBSERVATION = "TextObservation"; + + String EN_REFERENCE_OBSERVATION = "ReferenceObservation"; String EN_TRUTH_OBSERVATION = "TruthObservation"; @@ -214,6 +216,10 @@ public interface OmConstants { String PARAMETER_NAME_FROM_ELEVATION = "fromEelvation"; String PARAMETER_NAME_TO_ELEVATION = "toElevation"; + + String PARAMETER = "parameter"; + + String OM_PARAMETER = "om:parameter"; // observation types String OBS_TYPE_MEASUREMENT = "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement"; @@ -242,11 +248,16 @@ public interface OmConstants { // no Definition in O&M and not in Lightweight Profile String OBS_TYPE_TEXT_OBSERVATION = "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_TextObservation"; + + String OBS_TYPE_PROFILE_OBSERVATION = "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ProfileObservation"; String OBS_TYPE_UNKNOWN = OGCConstants.UNKNOWN; String OBS_TYPE_SWE_ARRAY_OBSERVATION = "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation"; + + String OBS_TYPE_REFERENCE_OBSERVATION = + "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation"; String OBS_RESULT_TYPE_OBSERVATION = "http://www.opengis.net/sensorML/2.0/DataArray"; @@ -269,6 +280,8 @@ public interface OmConstants { QName RESULT_MODEL_TRUTH_OBSERVATION = new QName(NS_OM, EN_TRUTH_OBSERVATION, NS_OM_PREFIX); QName RESULT_MODEL_TEXT_OBSERVATION = new QName(NS_OM, EN_TEXT_OBSERVATION, NS_OM_PREFIX); + + QName RESULT_MODEL_REFERENCE_OBSERVATION = new QName(NS_OM, EN_REFERENCE_OBSERVATION, NS_OM_PREFIX); /** * Array of constants for result models. @@ -308,7 +321,8 @@ public interface OmConstants { OBS_TYPE_GEOMETRY_OBSERVATION, OBS_TYPE_TEXT_OBSERVATION, OBS_TYPE_TRUTH_OBSERVATION, - OBS_TYPE_SWE_ARRAY_OBSERVATION + OBS_TYPE_SWE_ARRAY_OBSERVATION, + OBS_TYPE_PROFILE_OBSERVATION ); } diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/OmObservation.java b/core/api/src/main/java/org/n52/sos/ogc/om/OmObservation.java index fb4e941536..07d2c828b2 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/OmObservation.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/OmObservation.java @@ -34,14 +34,12 @@ import java.util.Set; import org.n52.sos.ogc.gml.AbstractFeature; -import org.n52.sos.ogc.gml.ReferenceType; import org.n52.sos.ogc.gml.time.Time; import org.n52.sos.ogc.gml.time.TimeInstant; import org.n52.sos.ogc.gml.time.TimePeriod; import org.n52.sos.ogc.om.quality.OmResultQuality; -import org.n52.sos.ogc.om.values.GeometryValue; import org.n52.sos.ogc.om.values.NilTemplateValue; -import org.n52.sos.ogc.om.values.QuantityValue; +import org.n52.sos.ogc.om.values.ProfileValue; import org.n52.sos.ogc.om.values.TVPValue; import org.n52.sos.util.CollectionHelper; import org.n52.sos.util.StringHelper; @@ -84,8 +82,8 @@ public class OmObservation extends AbstractFeature implements Serializable, Attr /** * O&M parameter */ - private Collection> parameter; - + private ParameterHolder parameterHolder = new ParameterHolder(); + /** * Map with observation values for each obsservableProeprty */ @@ -402,10 +400,15 @@ private void mergeResultTimes(final OmObservation sosObservation) { * @param observationValue * Observation to merge */ - protected void mergeValues(final ObservationValue observationValue) { + protected boolean mergeValues(final ObservationValue observationValue) { TVPValue tvpValue; if (getValue() instanceof SingleObservationValue) { - tvpValue = convertSingleValueToMultiValue((SingleObservationValue) value); + if (getValue().getValue() instanceof ProfileValue && observationValue.getValue() instanceof ProfileValue){ + ((ProfileValue)getValue().getValue()).addValues(((ProfileValue)observationValue.getValue()).getValue()); + return true; + } else { + tvpValue = convertSingleValueToMultiValue((SingleObservationValue) value); + } } else { tvpValue = (TVPValue) ((MultiObservationValues) value).getValue(); } @@ -420,6 +423,7 @@ protected void mergeValues(final ObservationValue observationValue) { final MultiObservationValues multiValue = (MultiObservationValues) observationValue; tvpValue.addValues(((TVPValue) multiValue.getValue()).getValue()); } + return true; } /** @@ -531,7 +535,7 @@ public boolean isSetValidTime() { * @return the parameter */ public Collection> getParameter() { - return parameter; + return parameterHolder.getParameter(); } /** @@ -541,7 +545,7 @@ public Collection> getParameter() { * the parameter to set */ public void setParameter(Collection> parameter) { - this.parameter = parameter; + this.parameterHolder.addParameter(parameter); } /** @@ -551,10 +555,11 @@ public void setParameter(Collection> parameter) { * the namedValue to add to parameter */ public void addParameter(NamedValue namedValue) { - if (parameter == null) { - parameter = Sets.newTreeSet(); - } - parameter.add(namedValue); + parameterHolder.addParameter(namedValue); + } + + public ParameterHolder getParameterHolder() { + return parameterHolder; } /** @@ -563,7 +568,7 @@ public void addParameter(NamedValue namedValue) { * @return true, if parameter is set */ public boolean isSetParameter() { - return CollectionHelper.isNotEmpty(getParameter()); + return parameterHolder != null && CollectionHelper.isNotEmpty(getParameter()); } /** @@ -572,21 +577,16 @@ public boolean isSetParameter() { * @return true, if spatial filtering profile parameter is set */ public boolean isSetSpatialFilteringProfileParameter() { - if (isSetParameter()) { - for (NamedValue namedValue : getParameter()) { - if (isSamplingGeometryParameter(namedValue)) { - return true; - } - } - } - return false; + return parameterHolder.isSetSpatialFilteringProfileParameter(); } /** * Remove spatial filtering profile parameter */ public void removeSpatialFilteringProfileParameter() { - removeParameter(getSpatialFilteringProfileParameter()); + if (isSetSpatialFilteringProfileParameter()) { + removeParameter(getSpatialFilteringProfileParameter()); + } } /** @@ -596,7 +596,7 @@ public void removeSpatialFilteringProfileParameter() { * Parameter to remove */ public void removeParameter(NamedValue parameter) { - getParameter().remove(parameter); + getParameterHolder().removeParameter(parameter); } /** @@ -607,10 +607,7 @@ public void removeParameter(NamedValue parameter) { * @return this */ public OmObservation addSpatialFilteringProfileParameter(Geometry samplingGeometry) { - final NamedValue namedValue = new NamedValue<>(); - namedValue.setName(new ReferenceType(OmConstants.PARAM_NAME_SAMPLING_GEOMETRY)); - namedValue.setValue(new GeometryValue(samplingGeometry)); - addParameter(namedValue); + parameterHolder.addSpatialFilteringProfileParameter(samplingGeometry); return this; } @@ -619,44 +616,17 @@ public OmObservation addSpatialFilteringProfileParameter(Geometry samplingGeomet * * @return Spatial filtering profile parameter */ - @SuppressWarnings("unchecked") public NamedValue getSpatialFilteringProfileParameter() { - if (isSetParameter()) { - for (NamedValue namedValue : getParameter()) { - if (isSamplingGeometryParameter(namedValue)) { - return (NamedValue) namedValue; - } - } - } - return null; + return parameterHolder.getSpatialFilteringProfileParameter(); } - /** - * Check whether sampling geometry for spatial filtering profile is set - * - * @return true, if sampling geometry for spatial filtering - * profile is set - */ - private boolean isSamplingGeometryParameter(NamedValue namedValue) { - return namedValue.isSetName() && namedValue.getName().isSetHref() - && namedValue.getName().getHref().equals(OmConstants.PARAM_NAME_SAMPLING_GEOMETRY) - && namedValue.getValue() instanceof GeometryValue; - } - /** * Check whether height parameter is set * * @return true, if height parameter is set */ public boolean isSetHeightParameter() { - if (isSetParameter()) { - for (NamedValue namedValue : getParameter()) { - if (isHeightParameter(namedValue)) { - return true; - } - } - } - return false; + return parameterHolder.isSetHeightParameter(); } /** @@ -664,25 +634,10 @@ public boolean isSetHeightParameter() { * * @return Height parameter */ - @SuppressWarnings("unchecked") public NamedValue getHeightParameter() { - if (isSetParameter()) { - for (NamedValue namedValue : getParameter()) { - if (isHeightParameter(namedValue)) { - return (NamedValue) namedValue; - } - } - } - return null; + return parameterHolder.getHeightParameter(); } - private boolean isHeightParameter(NamedValue namedValue) { - return namedValue.isSetName() && namedValue.getName().isSetHref() - && (namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_HEIGHT_URL) - || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_HEIGHT) - || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_ELEVATION)) - && namedValue.getValue() instanceof QuantityValue; - } /** * Check whether depth parameter is set @@ -690,14 +645,7 @@ private boolean isHeightParameter(NamedValue namedValue) { * @return true, if depth parameter is set */ public boolean isSetDepthParameter() { - if (isSetParameter()) { - for (NamedValue namedValue : getParameter()) { - if (isDepthParameter(namedValue)) { - return true; - } - } - } - return false; + return parameterHolder.isSetDepthParameter(); } /** @@ -705,47 +653,19 @@ public boolean isSetDepthParameter() { * * @return Depth parameter */ - @SuppressWarnings("unchecked") public NamedValue getDepthParameter() { - if (isSetParameter()) { - for (NamedValue namedValue : getParameter()) { - if (isHeightDepthParameter(namedValue)) { - return (NamedValue) namedValue; - } - } - } - return null; + return parameterHolder.getDepthParameter(); } - private boolean isDepthParameter(NamedValue namedValue) { - return namedValue.isSetName() && namedValue.getName().isSetHref() - && (namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_DEPTH_URL) - || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_DEPTH)) - && namedValue.getValue() instanceof QuantityValue; - } public boolean isSetHeightDepthParameter() { - if (isSetParameter()) { - for (NamedValue namedValue : getParameter()) { - if (isHeightDepthParameter(namedValue)) { - return true; - } - } - } - return false; + return parameterHolder.isSetHeightDepthParameter(); } public NamedValue getHeightDepthParameter() { - if (isSetDepthParameter()) { - return getDepthParameter(); - } - return getHeightParameter(); + return parameterHolder.getHeightDepthParameter(); } - private boolean isHeightDepthParameter(NamedValue namedValue) { - return isHeightParameter(namedValue) || isDepthParameter(namedValue); - } - public OmObservation cloneTemplate() { return cloneTemplate(new OmObservation()); } diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/ParameterHolder.java b/core/api/src/main/java/org/n52/sos/ogc/om/ParameterHolder.java new file mode 100644 index 0000000000..d380d7fa3c --- /dev/null +++ b/core/api/src/main/java/org/n52/sos/ogc/om/ParameterHolder.java @@ -0,0 +1,312 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ogc.om; + +import java.util.Collection; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.n52.sos.ogc.gml.ReferenceType; +import org.n52.sos.ogc.om.values.GeometryValue; +import org.n52.sos.ogc.om.values.QuantityValue; +import org.n52.sos.util.CollectionHelper; + +import com.vividsolutions.jts.geom.Geometry; + +public class ParameterHolder { + + private SortedSet> parameter = new TreeSet>(); + + public SortedSet> getParameter() { + return parameter; + } + + public ParameterHolder setParameter(Collection> parameter) { + parameter.clear(); + if (parameter != null) { + this.parameter.addAll(parameter); + } + return this; + } + + public ParameterHolder addParameter(Collection> parameter) { + if (parameter != null) { + this.parameter.addAll(parameter); + } + return this; + } + + public ParameterHolder addParameter(NamedValue parameter) { + if (parameter != null) { + this.parameter.add(parameter); + } + return this; + } + + public boolean removeParameter(NamedValue parameter) { + if (parameter != null) { + return this.parameter.remove(parameter); + } + return false; + } + + public boolean isSetParameter() { + return CollectionHelper.isNotEmpty(getParameter()); + } + + /** + * Check whether height parameter is set + * + * @return true, if height parameter is set + */ + public boolean isSetHeightParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isHeightParameter(namedValue)) { + return true; + } + } + } + return false; + } + + /** + * Get height parameter + * + * @return Height parameter + */ + @SuppressWarnings("unchecked") + public NamedValue getHeightParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isHeightParameter(namedValue)) { + return (NamedValue) namedValue; + } + } + } + return null; + } + + private boolean isHeightParameter(NamedValue namedValue) { + return namedValue.isSetName() && namedValue.getName().isSetHref() + && (namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_HEIGHT_URL) + || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_HEIGHT) + || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_ELEVATION) + || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_FROM_DEPTH)) + && namedValue.getValue() instanceof QuantityValue; + } + + /** + * Check whether depth parameter is set + * + * @return true, if depth parameter is set + */ + public boolean isSetDepthParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isDepthParameter(namedValue)) { + return true; + } + } + } + return false; + } + + /** + * Get depth parameter + * + * @return Depth parameter + */ + @SuppressWarnings("unchecked") + public NamedValue getDepthParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isHeightDepthParameter(namedValue)) { + return (NamedValue) namedValue; + } + } + } + return null; + } + + private boolean isDepthParameter(NamedValue namedValue) { + return namedValue.isSetName() && namedValue.getName().isSetHref() + && (namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_DEPTH_URL) + || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_DEPTH)) + && namedValue.getValue() instanceof QuantityValue; + } + + public boolean isSetHeightDepthParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isHeightDepthParameter(namedValue)) { + return true; + } + } + } + return false; + } + + public NamedValue getHeightDepthParameter() { + if (isSetDepthParameter()) { + return getDepthParameter(); + } + return getHeightParameter(); + } + + private boolean isHeightDepthParameter(NamedValue namedValue) { + return isHeightParameter(namedValue) || isDepthParameter(namedValue); + } + + public boolean isSetFromToParameter() { + return isSetFromParameter() || isSetToParameter(); + } + + private boolean isSetToParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isToParameter(namedValue)) { + return true; + } + } + } + return false; + } + + private boolean isSetFromParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isFromParameter(namedValue)) { + return true; + } + } + } + return false; + } + + private boolean isToParameter(NamedValue namedValue) { + return namedValue.isSetName() && namedValue.getName().isSetHref() + && (namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_TO_DEPTH) + || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_TO_HEIGHT) + || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_TO)) + && namedValue.getValue() instanceof QuantityValue; + } + + private boolean isFromParameter(NamedValue namedValue) { + return namedValue.isSetName() && namedValue.getName().isSetHref() + && (namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_FROM_DEPTH) + || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_FROM_HEIGHT) + || namedValue.getName().getHref().equals(OmConstants.PARAMETER_NAME_FROM)) + && namedValue.getValue() instanceof QuantityValue; + } + + @SuppressWarnings("unchecked") + public NamedValue getToParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isToParameter(namedValue)) { + return (NamedValue) namedValue; + } + } + } + return null; + } + + @SuppressWarnings("unchecked") + public NamedValue getFromParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isFromParameter(namedValue)) { + return (NamedValue) namedValue; + } + } + } + return null; + } + + /** + * Check whether spatial filtering profile parameter is set + * + * @return true, if spatial filtering profile parameter is set + */ + public boolean isSetSpatialFilteringProfileParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isSamplingGeometryParameter(namedValue)) { + return true; + } + } + } + return false; + } + + /** + * Add sampling geometry to observation + * + * @param samplingGeometry + * The sampling geometry to set + * @return this + */ + public ParameterHolder addSpatialFilteringProfileParameter(Geometry samplingGeometry) { + final NamedValue namedValue = new NamedValue<>(); + namedValue.setName(new ReferenceType(OmConstants.PARAM_NAME_SAMPLING_GEOMETRY)); + namedValue.setValue(new GeometryValue(samplingGeometry)); + addParameter(namedValue); + return this; + } + + /** + * Get spatial filtering profile parameter + * + * @return Spatial filtering profile parameter + */ + @SuppressWarnings("unchecked") + public NamedValue getSpatialFilteringProfileParameter() { + if (isSetParameter()) { + for (NamedValue namedValue : getParameter()) { + if (isSamplingGeometryParameter(namedValue)) { + return (NamedValue) namedValue; + } + } + } + return null; + } + + /** + * Check whether sampling geometry for spatial filtering profile is set + * + * @return true, if sampling geometry for spatial filtering + * profile is set + */ + private boolean isSamplingGeometryParameter(NamedValue namedValue) { + return namedValue.isSetName() && namedValue.getName().isSetHref() + && namedValue.getName().getHref().equals(OmConstants.PARAM_NAME_SAMPLING_GEOMETRY) + && namedValue.getValue() instanceof GeometryValue; + } +} diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/DiscreteCoverage.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/DiscreteCoverage.java index d4fcc055a6..9a8410aaef 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/values/DiscreteCoverage.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/DiscreteCoverage.java @@ -43,5 +43,17 @@ public interface DiscreteCoverage extends Value { String getGmlId(); Collection> getRangeSet(); + + /** + * @return the rangeParameters + */ + String getRangeParameters(); + + /** + * @param rangeParameters the rangeParameters to set + */ + void setRangeParameters(String rangeParameters); + + boolean isSetRangeParameters(); } diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/MultiPointCoverage.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/MultiPointCoverage.java index 405728e2f4..f2ecd0d0bc 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/values/MultiPointCoverage.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/MultiPointCoverage.java @@ -71,6 +71,8 @@ public class MultiPointCoverage implements DiscreteCoverage */ private UoM unit; + private String rangeParameters; + public MultiPointCoverage(String gmlId) { if (Strings.isNullOrEmpty(gmlId)) { gmlId = JavaHelper.generateID(toString()); @@ -186,6 +188,21 @@ public List> getRangeSet() { return getPointValue().getValues(); } + @Override + public String getRangeParameters() { + return rangeParameters; + } + + @Override + public void setRangeParameters(String rangeParameters) { + this.rangeParameters = rangeParameters; + } + + @Override + public boolean isSetRangeParameters() { + return !Strings.isNullOrEmpty(getRangeParameters()); + } + @Override public X accept(ValueVisitor visitor) throws OwsExceptionReport { return visitor.visit(this); diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileLevel.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileLevel.java index 1118b3b0df..af2b5a3d2d 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileLevel.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileLevel.java @@ -28,8 +28,15 @@ */ package org.n52.sos.ogc.om.values; +import java.util.Collection; import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; +import org.n52.sos.ogc.gml.ReferenceType; +import org.n52.sos.ogc.gml.time.Time; +import org.n52.sos.ogc.om.NamedValue; +import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.ogc.swe.SweAbstractDataComponent; import org.n52.sos.ogc.swe.SweDataRecord; import org.n52.sos.ogc.swe.SweField; @@ -50,6 +57,7 @@ public class ProfileLevel implements Comparable { private QuantityValue levelEnd; private List> value = Lists.newArrayList(); private Geometry location; + private Time phenomenonTime; /** * constructor @@ -172,6 +180,24 @@ public boolean isSetLocation() { return getLocation() != null; } + /** + * @return the phenomenonTime + */ + public Time getPhenomenonTime() { + return phenomenonTime; + } + + /** + * @param phenomenonTime the phenomenonTime to set + */ + public void setPhenomenonTime(Time phenomenonTime) { + this.phenomenonTime = phenomenonTime; + } + + public boolean isSetPhenomenonTime() { + return getPhenomenonTime() != null; + } + @Override public int compareTo(ProfileLevel o) { if (o == null) { @@ -219,4 +245,19 @@ public SweDataRecord valueAsDataRecord(SweDataRecord dataRecord) { } return dataRecord; } + + public Collection accept(ProfileLevelVisitor visitor) throws OwsExceptionReport { + return visitor.visit(this); + } + + public Collection> getLevelStartEndAsParameter() { + SortedSet> parameter = new TreeSet>(); + if (isSetLevelStart() && getLevelStart().isSetDefinition()) { + parameter.add(new NamedValue(new ReferenceType(getLevelStart().getDefinition()), getLevelStart())); + } + if (isSetLevelEnd() && getLevelEnd().isSetDefinition()) { + parameter.add(new NamedValue(new ReferenceType(getLevelEnd().getDefinition()), getLevelEnd())); + } + return parameter; + } } \ No newline at end of file diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileLevelVisitor.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileLevelVisitor.java new file mode 100644 index 0000000000..3e402377a0 --- /dev/null +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileLevelVisitor.java @@ -0,0 +1,39 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ogc.om.values; + +import java.util.Collection; + +import org.n52.sos.ogc.ows.OwsExceptionReport; + +public interface ProfileLevelVisitor { + + Collection visit(ProfileLevel value) + throws OwsExceptionReport; +} diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileValue.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileValue.java index 28b5738b99..fec01f1a2e 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileValue.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/ProfileValue.java @@ -28,10 +28,14 @@ */ package org.n52.sos.ogc.om.values; +import java.util.HashSet; import java.util.List; +import java.util.TreeMap; import org.n52.sos.ogc.UoM; import org.n52.sos.ogc.gml.AbstractFeature; +import org.n52.sos.ogc.gml.time.Time; +import org.n52.sos.ogc.gml.time.TimePeriod; import org.n52.sos.ogc.gwml.GWMLConstants; import org.n52.sos.ogc.om.values.visitor.ValueVisitor; import org.n52.sos.ogc.om.values.visitor.VoidValueVisitor; @@ -39,8 +43,15 @@ import org.n52.sos.ogc.swe.SweDataRecord; import org.n52.sos.ogc.swe.SweField; import org.n52.sos.ogc.swe.simpleType.SweQuantity; +import org.n52.sos.service.AbstractLoggingConfigurator.Level; +import org.n52.sos.util.GeometryHandler; import com.google.common.collect.Lists; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.geom.PrecisionModel; /** * Represents the GroundWaterML 2.0 GW_GeologyLogCoverage @@ -69,6 +80,11 @@ public ProfileValue addValue(ProfileLevel value) { this.values.add(value); return this; } + + public ProfileValue addValues(List value) { + this.values.addAll(value); + return this; + } @Override public List getValue() { @@ -146,7 +162,7 @@ public boolean isSetFromLevel() { return getFromLevel() != null; } - public boolean isFromLevel() { + private boolean isFromLevel() { return this.fromLevel != null; } @@ -229,4 +245,41 @@ public SweDataRecord asDataRecord() { return dataRecord; } + public Time getPhenomenonTime() { + TimePeriod time = new TimePeriod(); + for (ProfileLevel profileLevel : values) { + if (profileLevel.isSetPhenomenonTime()) { + time.extendToContain(profileLevel.getPhenomenonTime()); + } + } + return time; + } + + public boolean isSetGeometry() { + return isSetValue() && getValue().iterator().next().isSetLocation(); + } + + public Geometry getGeometry() { + if (isSetGeometry()) { + TreeMap map = new TreeMap<>(); + int srid = -1; + for (ProfileLevel level : getValue()) { + if (level.isSetPhenomenonTime() && level.isSetLocation()) { + if (srid < 0) { + srid = level.getLocation().getSRID(); + } + map.put(level.getPhenomenonTime(), level.getLocation().getCoordinate()); + } + } + if (!map.isEmpty()) { + if (new HashSet<>(map.values()).size() == 1) { + return getValue().iterator().next().getLocation(); + } else { + return new GeometryFactory(new PrecisionModel(), srid).createLineString(map.values().toArray(new Coordinate[1])); + } + } + } + return null; + } + } diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityRangeValue.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityRangeValue.java new file mode 100644 index 0000000000..67c4b7223d --- /dev/null +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityRangeValue.java @@ -0,0 +1,135 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ogc.om.values; + +import org.n52.sos.ogc.UoM; +import org.n52.sos.ogc.om.values.visitor.ValueVisitor; +import org.n52.sos.ogc.om.values.visitor.VoidValueVisitor; +import org.n52.sos.ogc.ows.OwsExceptionReport; +import org.n52.sos.ogc.swe.RangeValue; +import org.n52.sos.ogc.swe.simpleType.SweQuantityRange; +import org.n52.sos.util.Comparables; + +public class QuantityRangeValue extends SweQuantityRange implements QuantityValued, QuantityRangeValue> { + /** + * serial number + */ + private static final long serialVersionUID = 9192378261383584604L; + + /** + * constructor + * + * @param value + * Measurement value + */ + public QuantityRangeValue(Double rangeStart, Double rangeEnd) { + super(); + super.setValue(new RangeValue(rangeStart, rangeEnd)); + } + + /** + * constructor + * + * @param value + * Measurement value + * @param unit + * Unit of measure + */ + public QuantityRangeValue(Double rangeStart, Double rangeEnd, String unit) { + this(rangeStart, rangeEnd); + this.setUnit(unit); + } + + @Override + public QuantityRangeValue setValue(RangeValue value) { + super.setValue(value); + return this; + } + + @Override + public void setUnit(String unit) { + super.setUom(unit); + } + + @Override + public String getUnit() { + return super.getUom(); + } + + @Override + public UoM getUnitObject() { + return super.getUomObject(); + } + + @Override + public void setUnit(UoM unit) { + super.setUom(unit); + } + + @Override + public boolean isSetUnit() { + return super.isSetUom(); + } + + @Override + public String toString() { + return String + .format("QuantityValue [value=%s, unit=%s]", getValue(), getUnit()); + } + + @Override + public X accept(ValueVisitor visitor) + throws OwsExceptionReport { + return visitor.visit(this); + } + + @Override + public void accept(VoidValueVisitor visitor) + throws OwsExceptionReport { + visitor.visit(this); + } + + @Override + public int compareTo(QuantityRangeValue o) { + if (o == null) { + throw new NullPointerException(); + } + if (getValue() == null ^ o.getValue() == null) { + return (getValue() == null) ? -1 : 1; + } + if (getValue() == null && o.getValue() == null) { + return 0; + } + return Comparables.chain(o).compare(getValue(), o.getValue()).result(); + } + + + + +} diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityValue.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityValue.java index 48b4988f4a..1122864f3f 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityValue.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityValue.java @@ -40,7 +40,7 @@ * @since 4.0.0 * */ -public class QuantityValue extends SweQuantity implements Value, Comparable { +public class QuantityValue extends SweQuantity implements QuantityValued { /** * serial number */ diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityValued.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityValued.java new file mode 100644 index 0000000000..e46b018500 --- /dev/null +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/QuantityValued.java @@ -0,0 +1,33 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ogc.om.values; + +public interface QuantityValued extends Value, Comparable { + +} diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/RectifiedGridCoverage.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/RectifiedGridCoverage.java index a8f4544d69..1f096ff668 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/values/RectifiedGridCoverage.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/RectifiedGridCoverage.java @@ -50,13 +50,15 @@ * @since 4.4.0 * */ -public class RectifiedGridCoverage implements DiscreteCoverage>> { +public class RectifiedGridCoverage implements DiscreteCoverage, Value>> { private static final long serialVersionUID = 5209844268871191549L; private String gmlId; - private SortedMap> value = Maps.newTreeMap(); + private SortedMap, Value> value = Maps.newTreeMap(); + + private String rangeParameters; private UoM unit; @@ -74,22 +76,30 @@ public String getGmlId() { } @Override - public RectifiedGridCoverage setValue(SortedMap> value) { + public RectifiedGridCoverage setValue(SortedMap, Value> value) { this.value.clear(); addValue(value); return this; } + + public void addValue(QuantityValued key, Value value) { + this.value.put(key, value); + } public void addValue(Double key, Value value) { - this.value.put(key, value); + this.value.put(new QuantityValue(key), value); + } + + public void addValue(Double from, Double to, Value value) { + this.value.put(new QuantityRangeValue(from, to), value); } - public void addValue(SortedMap> value) { + public void addValue(SortedMap, Value> value) { this.value.putAll(value); } @Override - public SortedMap> getValue() { + public SortedMap, Value> getValue() { return value; } @@ -141,7 +151,7 @@ public void accept(VoidValueVisitor visitor) throws OwsExceptionReport { * * @return The domainSet as {@link Double} {@link List} */ - public List getDomainSet() { + public List> getDomainSet() { return Lists.newArrayList(getValue().keySet()); } @@ -149,4 +159,19 @@ public Collection> getRangeSet() { return getValue().values(); } + @Override + public String getRangeParameters() { + return rangeParameters; + } + + @Override + public void setRangeParameters(String rangeParameters) { + this.rangeParameters = rangeParameters; + } + + @Override + public boolean isSetRangeParameters() { + return !Strings.isNullOrEmpty(getRangeParameters()); + } + } diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/visitor/PofileLevelVisitor.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/visitor/PofileLevelVisitor.java new file mode 100644 index 0000000000..be1e12b92e --- /dev/null +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/visitor/PofileLevelVisitor.java @@ -0,0 +1,33 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ogc.om.values.visitor; + +public class PofileLevelVisitor { + +} diff --git a/core/api/src/main/java/org/n52/sos/ogc/om/values/visitor/ValueVisitor.java b/core/api/src/main/java/org/n52/sos/ogc/om/values/visitor/ValueVisitor.java index b206250581..ef92da2116 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/om/values/visitor/ValueVisitor.java +++ b/core/api/src/main/java/org/n52/sos/ogc/om/values/visitor/ValueVisitor.java @@ -34,6 +34,7 @@ import org.n52.sos.ogc.om.values.CountValue; import org.n52.sos.ogc.om.values.CvDiscretePointCoverage; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.GeometryValue; import org.n52.sos.ogc.om.values.HrefAttributeValue; import org.n52.sos.ogc.om.values.MultiPointCoverage; @@ -105,10 +106,14 @@ T visit(RectifiedGridCoverage value) T visit(ProfileValue value) throws OwsExceptionReport; - + T visit(UnknownValue value) throws OwsExceptionReport; T visit(XmlValue value) throws OwsExceptionReport; + + T visit(QuantityRangeValue value) + throws OwsExceptionReport; + } diff --git a/coding/wml-v20/src/main/java/org/n52/sos/ogc/wml/ConformanceClassesWML2.java b/core/api/src/main/java/org/n52/sos/ogc/series/wml/ConformanceClassesWML2.java similarity index 100% rename from coding/wml-v20/src/main/java/org/n52/sos/ogc/wml/ConformanceClassesWML2.java rename to core/api/src/main/java/org/n52/sos/ogc/series/wml/ConformanceClassesWML2.java diff --git a/coding/wml-v20/src/main/java/org/n52/sos/ogc/wml/ConformanceClassesWML2DR.java b/core/api/src/main/java/org/n52/sos/ogc/series/wml/ConformanceClassesWML2DR.java similarity index 100% rename from coding/wml-v20/src/main/java/org/n52/sos/ogc/wml/ConformanceClassesWML2DR.java rename to core/api/src/main/java/org/n52/sos/ogc/series/wml/ConformanceClassesWML2DR.java diff --git a/coding/wml-v20/src/main/java/org/n52/sos/ogc/wml/ObservationProcess.java b/core/api/src/main/java/org/n52/sos/ogc/series/wml/ObservationProcess.java similarity index 100% rename from coding/wml-v20/src/main/java/org/n52/sos/ogc/wml/ObservationProcess.java rename to core/api/src/main/java/org/n52/sos/ogc/series/wml/ObservationProcess.java diff --git a/core/api/src/main/java/org/n52/sos/ogc/swe/RangeValue.java b/core/api/src/main/java/org/n52/sos/ogc/swe/RangeValue.java index 5c48528448..2dfd4881d5 100644 --- a/core/api/src/main/java/org/n52/sos/ogc/swe/RangeValue.java +++ b/core/api/src/main/java/org/n52/sos/ogc/swe/RangeValue.java @@ -36,7 +36,7 @@ * * @param */ -public class RangeValue { +public class RangeValue implements Comparable>{ private T rangeStart; @@ -146,4 +146,24 @@ public boolean equals(final Object obj) { public RangeValue clone() { return new RangeValue(getRangeStart(), getRangeStart()); } + + @Override + public int compareTo(RangeValue o) { + if (o instanceof RangeValue) { + if (checkCompareToParameter(getRangeStart(), o.getRangeEnd()) + && checkCompareToParameter(getRangeEnd(), o.getRangeEnd())) { + return 0; + } + return 1; + } + return -1; + } + + private boolean checkCompareToParameter(T t, T t2) { + if (t == null || (t == null && t2 == null)) { + return true; + } + return t != null && t2 != null && t.equals(t2); + } + } diff --git a/core/api/src/main/java/org/n52/sos/service/MiscSettings.java b/core/api/src/main/java/org/n52/sos/service/MiscSettings.java index 6bad6ffb83..4f368bca6f 100644 --- a/core/api/src/main/java/org/n52/sos/service/MiscSettings.java +++ b/core/api/src/main/java/org/n52/sos/service/MiscSettings.java @@ -78,6 +78,8 @@ public class MiscSettings implements SettingDefinitionProvider { public static final String RETURN_OVERALL_EXTREMA_FOR_FIRST_LATEST = "profile.hydrology.overallExtrema"; + public static final String CONVERT_COMPLEX_PROFILE_TO_SINGLE_PROFILES = "misc.convertComplexProfileToSingleProfiles"; + public static final SettingDefinitionGroup GROUP = new SettingDefinitionGroup() .setTitle("Miscellaneous") @@ -208,13 +210,24 @@ public class MiscSettings implements SettingDefinitionProvider { "The service will return overall extrema for first/latest observation " + "queries when this option is activated. When disabled, only for " + "each time series"); + + public static final BooleanSettingDefinition CONVERT_COMPLEX_PROFILE_TO_SINGLE_PROFILES_DEFINITION = + new BooleanSettingDefinition() + .setGroup(GROUP) + .setOrder(ORDER_17) + .setKey(CONVERT_COMPLEX_PROFILE_TO_SINGLE_PROFILES) + .setDefaultValue(true) + .setTitle("Should the SOS convert complex profiles to single profiles?") + .setDescription( + "Should the SOS convert complex profiles to single profiles?"); private static final Set> DEFINITIONS = ImmutableSet.> of( TOKEN_SEPERATOR_DEFINITION, TUPLE_SEPERATOR_DEFINITION,DECIMAL_SEPERATOR_DEFINITION, SRS_NAME_PREFIX_SOS_V1_DEFINITION, SRS_NAME_PREFIX_SOS_V2_DEFINITION, DEFAULT_OFFERING_PREFIX_DEFINITION, DEFAULT_PROCEDURE_PREFIX_DEFINITION, CHARACTER_ENCODING_DEFINITION, HTTP_STATUS_CODE_USE_IN_KVP_POX_BINDING_DEFINITION, HYDRO_MAX_NUMBER_OF_RETURNED_TIME_SERIES_DEFINITION, - HYDRO_MAX_NUMBER_OF_RETURNED_VALUES_DEFINITION, RETURN_OVERALL_EXTREMA_FOR_FIRST_LATEST_DEFINITION + HYDRO_MAX_NUMBER_OF_RETURNED_VALUES_DEFINITION, RETURN_OVERALL_EXTREMA_FOR_FIRST_LATEST_DEFINITION, + CONVERT_COMPLEX_PROFILE_TO_SINGLE_PROFILES_DEFINITION /*, RELATED_SAMPLING_FEATURE_ROLE_FOR_CHILD_FEATURES_DEFINITION */); @Override diff --git a/core/api/src/main/java/org/n52/sos/service/ServiceConfiguration.java b/core/api/src/main/java/org/n52/sos/service/ServiceConfiguration.java index 5b939ae49e..59c1b49466 100644 --- a/core/api/src/main/java/org/n52/sos/service/ServiceConfiguration.java +++ b/core/api/src/main/java/org/n52/sos/service/ServiceConfiguration.java @@ -161,6 +161,8 @@ private ServiceConfiguration() { private File cacheFileFolder; private boolean createFeatureGeometryFromSamplingGeometries = false; + + private boolean convertComplexProfileToSingleProfiles = true; /** * Returns the default token seperator for results. @@ -515,6 +517,15 @@ public void setCreateFeatureGeometryFromSamplingGeometries(boolean createFeature public boolean isCreateFeatureGeometryFromSamplingGeometries() { return createFeatureGeometryFromSamplingGeometries; } + + @Setting(MiscSettings.CONVERT_COMPLEX_PROFILE_TO_SINGLE_PROFILES) + public void setConvertComplexProfileToSingleProfiles(boolean convertComplexProfileToSingleProfiles) { + this.convertComplexProfileToSingleProfiles = convertComplexProfileToSingleProfiles; + } + + public boolean isConvertComplexProfileToSingleProfiles() { + return this.convertComplexProfileToSingleProfiles; + } /* * Now, we return the list of returned features and not a complex encoded diff --git a/core/api/src/main/java/org/n52/sos/service/ServiceSettings.java b/core/api/src/main/java/org/n52/sos/service/ServiceSettings.java index 5af89ae9f0..47b2e2af39 100644 --- a/core/api/src/main/java/org/n52/sos/service/ServiceSettings.java +++ b/core/api/src/main/java/org/n52/sos/service/ServiceSettings.java @@ -88,7 +88,7 @@ public class ServiceSettings implements SettingDefinitionProvider { "The endpoint URL of this sos which will be shown in the GetCapabilities response " + "(e.g. http://localhost:8080/52nSOS/sos or http://localhost:8080/52nSOS/service)." + " The path to a specific binding (like /soap) will appended to this URL." - + " For detailed information, please read the documentation."); + + " For detailed information, please read the documentation."); public static final StringSettingDefinition SENSOR_DIRECTORY_DEFINITION = new StringSettingDefinition() diff --git a/core/api/src/main/java/org/n52/sos/util/OMHelper.java b/core/api/src/main/java/org/n52/sos/util/OMHelper.java index 71b8b0e11b..fb972dc8a8 100644 --- a/core/api/src/main/java/org/n52/sos/util/OMHelper.java +++ b/core/api/src/main/java/org/n52/sos/util/OMHelper.java @@ -43,11 +43,12 @@ import org.n52.sos.ogc.om.values.ComplexValue; import org.n52.sos.ogc.om.values.CountValue; import org.n52.sos.ogc.om.values.CvDiscretePointCoverage; -import org.n52.sos.ogc.om.values.ProfileValue; import org.n52.sos.ogc.om.values.GeometryValue; import org.n52.sos.ogc.om.values.HrefAttributeValue; import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; +import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -136,6 +137,8 @@ public static String getObservationTypeFor(final QName resultModel) { return OmConstants.OBS_TYPE_TRUTH_OBSERVATION; } else if (OmConstants.RESULT_MODEL_TEXT_OBSERVATION.equals(resultModel)) { return OmConstants.OBS_TYPE_TEXT_OBSERVATION; + } else if (OmConstants.RESULT_MODEL_TEXT_OBSERVATION.equals(resultModel)) { + return OmConstants.OBS_TYPE_REFERENCE_OBSERVATION; } else if (OmConstants.RESULT_MODEL_COMPLEX_OBSERVATION.equals(resultModel)) { return OmConstants.OBS_TYPE_COMPLEX_OBSERVATION; } @@ -172,6 +175,8 @@ public static QName getQNameFor(final String observationType) { return OmConstants.RESULT_MODEL_TRUTH_OBSERVATION; case OmConstants.OBS_TYPE_TEXT_OBSERVATION: return OmConstants.RESULT_MODEL_TEXT_OBSERVATION; + case OmConstants.OBS_TYPE_REFERENCE_OBSERVATION: + return OmConstants.RESULT_MODEL_REFERENCE_OBSERVATION; case OmConstants.OBS_TYPE_COMPLEX_OBSERVATION: return OmConstants.RESULT_MODEL_COMPLEX_OBSERVATION; } @@ -231,7 +236,7 @@ public String visit(QuantityValue value) { @Override public String visit(ReferenceValue value) { - return defaultValue(); + return OmConstants.OBS_TYPE_REFERENCE_OBSERVATION; } @Override @@ -275,12 +280,12 @@ public String visit(CvDiscretePointCoverage value) throws OwsExceptionReport { } @Override - public String visit(MultiPointCoverage multiPointCoverage) throws OwsExceptionReport { + public String visit(MultiPointCoverage value) throws OwsExceptionReport { return defaultValue(); } @Override - public String visit(RectifiedGridCoverage rectifiedGridCoverage) throws OwsExceptionReport { + public String visit(RectifiedGridCoverage value) throws OwsExceptionReport { return defaultValue(); } @@ -288,5 +293,10 @@ public String visit(RectifiedGridCoverage rectifiedGridCoverage) throws OwsExcep public String visit(ProfileValue value) throws OwsExceptionReport { return GWMLConstants.OBS_TYPE_GEOLOGY_LOG; } + + @Override + public String visit(QuantityRangeValue value) throws OwsExceptionReport { + return defaultValue(); + } } } diff --git a/core/cache/pom.xml b/core/cache/pom.xml index 77f6d433ae..b4362d169e 100644 --- a/core/cache/pom.xml +++ b/core/cache/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos core - 4.4.0 + 4.4.1 cache 52°North SOS - Cache diff --git a/core/cache/src/main/java/org/n52/sos/cache/ctrl/persistence/AbstractPersistingCachePersistenceStrategy.java b/core/cache/src/main/java/org/n52/sos/cache/ctrl/persistence/AbstractPersistingCachePersistenceStrategy.java index 7ed6471297..589f6bddd4 100644 --- a/core/cache/src/main/java/org/n52/sos/cache/ctrl/persistence/AbstractPersistingCachePersistenceStrategy.java +++ b/core/cache/src/main/java/org/n52/sos/cache/ctrl/persistence/AbstractPersistingCachePersistenceStrategy.java @@ -30,6 +30,8 @@ import org.n52.sos.cache.ContentCachePersistenceStrategy; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -80,8 +82,9 @@ public Optional load() { LOGGER.debug("Reading cache from temp file '{}'", f.getAbsolutePath()); ObjectInputStream in = null; + long start = System.currentTimeMillis(); try { - in = new ObjectInputStream(new FileInputStream(f)); + in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(f))); return Optional.of((WritableContentCache) in.readObject()); } catch (IOException t) { LOGGER.error(String.format("Error reading cache file '%s'", @@ -91,6 +94,7 @@ public Optional load() { f.getAbsolutePath()), t); } finally { IOUtils.closeQuietly(in); + LOGGER.debug("Loading cache from file with size {} took {} ms!", f.length(), (System.currentTimeMillis() - start)); } f.delete(); } else { @@ -103,12 +107,13 @@ public Optional load() { protected void persistCache(ContentCache cache) { File f = getCacheFile(); if (!f.exists() || f.delete()) { - ObjectOutputStream out = null; if (cache != null) { + ObjectOutputStream out = null; LOGGER.debug("Serializing cache to {}", f.getAbsolutePath()); + long start = System.currentTimeMillis(); try { if (f.createNewFile() && f.canWrite()) { - out = new ObjectOutputStream(new FileOutputStream(f)); + out = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(f))); out.writeObject(cache); } else { LOGGER.error("Can not create writable file {}", @@ -120,6 +125,7 @@ protected void persistCache(ContentCache cache) { f.getAbsolutePath()), t); } finally { IOUtils.closeQuietly(out); + LOGGER.debug("Writing cache to file with size {} took {} ms!", f.length(), (System.currentTimeMillis() - start)); } } } diff --git a/core/cache/src/main/java/org/n52/sos/cache/ctrl/persistence/AsyncCachePersistenceStrategy.java b/core/cache/src/main/java/org/n52/sos/cache/ctrl/persistence/AsyncCachePersistenceStrategy.java index 95dac5c4ea..252c7b1b49 100644 --- a/core/cache/src/main/java/org/n52/sos/cache/ctrl/persistence/AsyncCachePersistenceStrategy.java +++ b/core/cache/src/main/java/org/n52/sos/cache/ctrl/persistence/AsyncCachePersistenceStrategy.java @@ -103,7 +103,7 @@ public void persistOnShutdown(ContentCache cache) { persistCache(cache); } -private class Updater implements Runnable { + private class Updater implements Runnable { private boolean reschedule = true; diff --git a/core/gc-dao/pom.xml b/core/gc-dao/pom.xml index 4fb0dfad63..ab4751cf73 100644 --- a/core/gc-dao/pom.xml +++ b/core/gc-dao/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos core - 4.4.0 + 4.4.1 4.0.0 gc-dao diff --git a/core/pom.xml b/core/pom.xml index f2bdedfae1..ff8a7c42be 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 core pom diff --git a/core/profile/coding/pom.xml b/core/profile/coding/pom.xml index 44e82469a4..242b8c0ce2 100644 --- a/core/profile/coding/pom.xml +++ b/core/profile/coding/pom.xml @@ -3,7 +3,7 @@ profile org.n52.sensorweb.sos - 4.4.0 + 4.4.1 4.0.0 profile-coding diff --git a/core/profile/pom.xml b/core/profile/pom.xml index dcec5e2cd0..3ea7d45950 100644 --- a/core/profile/pom.xml +++ b/core/profile/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos core - 4.4.0 + 4.4.1 4.0.0 profile diff --git a/core/profile/xml/pom.xml b/core/profile/xml/pom.xml index 36cc2d237b..204cf8dadd 100644 --- a/core/profile/xml/pom.xml +++ b/core/profile/xml/pom.xml @@ -3,7 +3,7 @@ profile org.n52.sensorweb.sos - 4.4.0 + 4.4.1 4.0.0 profile-xml diff --git a/core/sqlite-config/pom.xml b/core/sqlite-config/pom.xml index 93f1022c1c..78ff3725ef 100644 --- a/core/sqlite-config/pom.xml +++ b/core/sqlite-config/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos core - 4.4.0 + 4.4.1 sqlite-config 52°North SOS - SQLite Configuration diff --git a/core/test/pom.xml b/core/test/pom.xml index a7622e9d7f..d00ea9ff9f 100644 --- a/core/test/pom.xml +++ b/core/test/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos core - 4.4.0 + 4.4.1 test 52°North SOS - Test Module diff --git a/extensions/aqd/api/pom.xml b/extensions/aqd/api/pom.xml index 74e67ce70d..1100855f33 100644 --- a/extensions/aqd/api/pom.xml +++ b/extensions/aqd/api/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos aqd - 4.4.0 + 4.4.1 4.0.0 api-aqd-v10 diff --git a/extensions/aqd/coding/aqd-v10/pom.xml b/extensions/aqd/coding/aqd-v10/pom.xml index ba2a3a9cf5..b0e68b4be3 100644 --- a/extensions/aqd/coding/aqd-v10/pom.xml +++ b/extensions/aqd/coding/aqd-v10/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos coding-aqd - 4.4.0 + 4.4.1 4.0.0 coding-aqd-v10 diff --git a/extensions/aqd/coding/pom.xml b/extensions/aqd/coding/pom.xml index ceee267139..e183b578d1 100644 --- a/extensions/aqd/coding/pom.xml +++ b/extensions/aqd/coding/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos aqd - 4.4.0 + 4.4.1 4.0.0 coding-aqd diff --git a/extensions/aqd/ereporting-identifier/pom.xml b/extensions/aqd/ereporting-identifier/pom.xml index c11165f937..3542cafda1 100644 --- a/extensions/aqd/ereporting-identifier/pom.xml +++ b/extensions/aqd/ereporting-identifier/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos aqd - 4.4.0 + 4.4.1 ereporting-identifier jar diff --git a/extensions/aqd/ereporting/pom.xml b/extensions/aqd/ereporting/pom.xml index 0fc04b065b..a2f10cc59e 100644 --- a/extensions/aqd/ereporting/pom.xml +++ b/extensions/aqd/ereporting/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos aqd - 4.4.0 + 4.4.1 ereporting jar diff --git a/extensions/aqd/operation/pom.xml b/extensions/aqd/operation/pom.xml index f4b4a1ce4a..8442289a1f 100644 --- a/extensions/aqd/operation/pom.xml +++ b/extensions/aqd/operation/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos aqd - 4.4.0 + 4.4.1 4.0.0 core-aqd-v10 diff --git a/extensions/aqd/pom.xml b/extensions/aqd/pom.xml index 5a7cbce8eb..4769e39c96 100644 --- a/extensions/aqd/pom.xml +++ b/extensions/aqd/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos extensions - 4.4.0 + 4.4.1 4.0.0 aqd diff --git a/extensions/aqd/split-and-merge/pom.xml b/extensions/aqd/split-and-merge/pom.xml index 6965b4b63b..51fb1d2928 100644 --- a/extensions/aqd/split-and-merge/pom.xml +++ b/extensions/aqd/split-and-merge/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos aqd - 4.4.0 + 4.4.1 aqd-split-and-merge jar diff --git a/extensions/do/core/pom.xml b/extensions/do/core/pom.xml index 34840c0e00..c3a3ce6e94 100644 --- a/extensions/do/core/pom.xml +++ b/extensions/do/core/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos do - 4.4.0 + 4.4.1 4.0.0 do-core diff --git a/extensions/do/hibernate/pom.xml b/extensions/do/hibernate/pom.xml index a41f92e98f..a2278e8994 100644 --- a/extensions/do/hibernate/pom.xml +++ b/extensions/do/hibernate/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos do - 4.4.0 + 4.4.1 4.0.0 do-hibernate diff --git a/extensions/do/hibernate/src/main/java/org/n52/sos/ext/deleteobservation/DeleteObservationDAO.java b/extensions/do/hibernate/src/main/java/org/n52/sos/ext/deleteobservation/DeleteObservationDAO.java index 63431f8b6f..39c0654a66 100644 --- a/extensions/do/hibernate/src/main/java/org/n52/sos/ext/deleteobservation/DeleteObservationDAO.java +++ b/extensions/do/hibernate/src/main/java/org/n52/sos/ext/deleteobservation/DeleteObservationDAO.java @@ -42,6 +42,8 @@ import org.n52.sos.ds.hibernate.dao.DaoFactory; import org.n52.sos.ds.hibernate.dao.observation.series.SeriesDAO; import org.n52.sos.ds.hibernate.entities.observation.Observation; +import org.n52.sos.ds.hibernate.entities.observation.full.ComplexObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ProfileObservation; import org.n52.sos.ds.hibernate.entities.observation.series.Series; import org.n52.sos.ds.hibernate.entities.observation.series.SeriesObservation; import org.n52.sos.ds.hibernate.util.TemporalRestrictions; @@ -148,6 +150,15 @@ private void deleteObservationByParameter(DeleteObservationRequest request, Dele private void delete(Observation observation, Session session) { if (observation != null) { + if (observation instanceof ComplexObservation) { + for (Observation o : ((ComplexObservation)observation).getValue()) { + delete(o, session); + } + } else if (observation instanceof ProfileObservation) { + for (Observation o : ((ProfileObservation)observation).getValue()) { + delete(o, session); + } + } observation.setDeleted(true); session.saveOrUpdate(observation); checkSeriesForFirstLatest(observation, session); @@ -166,8 +177,8 @@ private void delete(Observation observation, Session session) { private void checkSeriesForFirstLatest(Observation observation, Session session) { if (observation instanceof SeriesObservation) { Series series = ((SeriesObservation) observation).getSeries(); - if (series.getFirstTimeStamp().equals(observation.getPhenomenonTimeStart()) - || series.getLastTimeStamp().equals(observation.getPhenomenonTimeEnd())) { + if ((series.isSetFirstTimeStamp() && series.getFirstTimeStamp().equals(observation.getPhenomenonTimeStart())) + || (series.isSetLastTimeStamp() && series.getLastTimeStamp().equals(observation.getPhenomenonTimeEnd()))) { new SeriesDAO().updateSeriesAfterObservationDeletion(series, (SeriesObservation) observation, session); } } diff --git a/extensions/do/json/pom.xml b/extensions/do/json/pom.xml index 888eb2e0bd..2c067538bd 100644 --- a/extensions/do/json/pom.xml +++ b/extensions/do/json/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos do - 4.4.0 + 4.4.1 4.0.0 do-json diff --git a/extensions/do/kvp/pom.xml b/extensions/do/kvp/pom.xml index f755ff5163..2ec72cfd48 100644 --- a/extensions/do/kvp/pom.xml +++ b/extensions/do/kvp/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos do - 4.4.0 + 4.4.1 4.0.0 do-kvp diff --git a/extensions/do/pom.xml b/extensions/do/pom.xml index 2ce3119fc2..72adeb0658 100644 --- a/extensions/do/pom.xml +++ b/extensions/do/pom.xml @@ -3,12 +3,12 @@ org.n52.sensorweb.sos extensions - 4.4.0 + 4.4.1 4.0.0 pom do - 4.4.0 + 4.4.1 52°North SOS - Extension Delete Observation 52°North SOS Extension Delete Observation diff --git a/extensions/do/xml/pom.xml b/extensions/do/xml/pom.xml index 47798ed414..8ae86751ef 100644 --- a/extensions/do/xml/pom.xml +++ b/extensions/do/xml/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos do - 4.4.0 + 4.4.1 4.0.0 do-xml diff --git a/extensions/drt/coding/pom.xml b/extensions/drt/coding/pom.xml index fb5e4e4fbd..8946bb8130 100644 --- a/extensions/drt/coding/pom.xml +++ b/extensions/drt/coding/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.n52.sensorweb.sos - 4.4.0 + 4.4.1 drt drt-coding diff --git a/extensions/drt/hibernate/pom.xml b/extensions/drt/hibernate/pom.xml index e01159c15a..91f72e0c95 100644 --- a/extensions/drt/hibernate/pom.xml +++ b/extensions/drt/hibernate/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.n52.sensorweb.sos - 4.4.0 + 4.4.1 drt drt-hibernate diff --git a/extensions/drt/operation/pom.xml b/extensions/drt/operation/pom.xml index f1c8a247a0..214a850c5a 100644 --- a/extensions/drt/operation/pom.xml +++ b/extensions/drt/operation/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.n52.sensorweb.sos - 4.4.0 + 4.4.1 drt drt-operation diff --git a/extensions/drt/pom.xml b/extensions/drt/pom.xml index 085ed9aa01..fbd5ba2f1d 100644 --- a/extensions/drt/pom.xml +++ b/extensions/drt/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos extensions - 4.4.0 + 4.4.1 4.0.0 drt diff --git a/extensions/gda/coding/pom.xml b/extensions/gda/coding/pom.xml index c8c88b12d4..d78beac511 100644 --- a/extensions/gda/coding/pom.xml +++ b/extensions/gda/coding/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos gda - 4.4.0 + 4.4.1 gda-coding 52°North Svalbard - Extension GetDataAvailability - SOS 2.0 coding diff --git a/extensions/gda/hibernate/pom.xml b/extensions/gda/hibernate/pom.xml index 30ae09e043..4ffd95ea7d 100644 --- a/extensions/gda/hibernate/pom.xml +++ b/extensions/gda/hibernate/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos gda - 4.4.0 + 4.4.1 gda-hibernate 52°North SOS - Extension GetDataAvailability - Hibernate DAO diff --git a/extensions/gda/operation/pom.xml b/extensions/gda/operation/pom.xml index 407994d423..06326a236d 100644 --- a/extensions/gda/operation/pom.xml +++ b/extensions/gda/operation/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos gda - 4.4.0 + 4.4.1 gda-operation 52°North SOS - Extension GetDataAvailability - SOS 2.0 Operation diff --git a/extensions/gda/pom.xml b/extensions/gda/pom.xml index fcceee3aaf..9184d159bc 100644 --- a/extensions/gda/pom.xml +++ b/extensions/gda/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos extensions - 4.4.0 + 4.4.1 4.0.0 gda diff --git a/extensions/ifoi/coding/pom.xml b/extensions/ifoi/coding/pom.xml index 831fe37fb4..707d4b05b3 100644 --- a/extensions/ifoi/coding/pom.xml +++ b/extensions/ifoi/coding/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos ifoi - 4.4.0 + 4.4.1 ifoi-coding 52°North Svalbard - Extension InsertFeatureOfInterest coding diff --git a/extensions/ifoi/hibernate/pom.xml b/extensions/ifoi/hibernate/pom.xml index 172fa2c221..ade7578842 100644 --- a/extensions/ifoi/hibernate/pom.xml +++ b/extensions/ifoi/hibernate/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos ifoi - 4.4.0 + 4.4.1 ifoi-hibernate 52°North SOS - Extension InsertFeatureOfInterest - Hibernate DAO diff --git a/extensions/ifoi/operation/pom.xml b/extensions/ifoi/operation/pom.xml index 7d010a2268..3a1bd4c74f 100644 --- a/extensions/ifoi/operation/pom.xml +++ b/extensions/ifoi/operation/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos ifoi - 4.4.0 + 4.4.1 ifoi-operation 52°North SOS - Extension InsertFeatureOfInterest - SOS 2.0 Operation diff --git a/extensions/ifoi/pom.xml b/extensions/ifoi/pom.xml index 0e60f5c3f6..62ffc51ef9 100644 --- a/extensions/ifoi/pom.xml +++ b/extensions/ifoi/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos extensions - 4.4.0 + 4.4.1 4.0.0 ifoi diff --git a/extensions/inspire/api/pom.xml b/extensions/inspire/api/pom.xml index e835155c4a..9dff195355 100644 --- a/extensions/inspire/api/pom.xml +++ b/extensions/inspire/api/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos inspire - 4.4.0 + 4.4.1 4.0.0 inspire-api diff --git a/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/base2/Contact.java b/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/base2/Contact.java index 9bbf60db61..b3dc5557fb 100644 --- a/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/base2/Contact.java +++ b/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/base2/Contact.java @@ -166,7 +166,7 @@ public Contact setTelephoneFacsimile(Nillable> telephoneFacsimile) * the telephoneFacsimile to add */ public Contact addTelephoneFacsimile(String telephoneFacsimile) { - if (this.telephoneFacsimile.isAbsent()) { + if (this.telephoneFacsimile.isAbsent() || this.telephoneFacsimile.isNil()) { this.telephoneFacsimile = Nillable.of((List)Lists.newArrayList()); } this.telephoneFacsimile.get().add(Preconditions.checkNotNull(telephoneFacsimile)); @@ -202,7 +202,7 @@ public Contact setTelephoneVoice(Nillable> telephoneVoice) { * the telephoneVoice to add */ public Contact addTelephoneVoice(String telephoneVoice) { - if (this.telephoneVoice.isAbsent()) { + if (this.telephoneVoice.isAbsent() || this.telephoneVoice.isNil()) { this.telephoneVoice = Nillable.of((List)Lists.newArrayList()); } this.telephoneVoice.get().add(Preconditions.checkNotNull(telephoneVoice)); diff --git a/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/MultiPointObservation.java b/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/MultiPointObservation.java index ced494663a..02e2738048 100644 --- a/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/MultiPointObservation.java +++ b/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/MultiPointObservation.java @@ -112,7 +112,7 @@ public void setValue(ObservationValue value) { } @Override - protected void mergeValues(ObservationValue observationValue) { + protected boolean mergeValues(ObservationValue observationValue) { if (observationValue.getValue() instanceof MultiPointCoverage) { List valuesToMerge = ((MultiPointCoverage) observationValue.getValue()).getValue(); ((MultiPointCoverage) getValue().getValue()).addValues(valuesToMerge); @@ -126,8 +126,9 @@ protected void mergeValues(ObservationValue observationValue) { } } } + return true; } else { - super.mergeValues(observationValue); + return super.mergeValues(observationValue); } } diff --git a/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/ProfileObservation.java b/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/ProfileObservation.java index 9d2e039589..f1814bad4d 100644 --- a/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/ProfileObservation.java +++ b/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/ProfileObservation.java @@ -40,6 +40,7 @@ import org.n52.sos.ogc.om.features.samplingFeatures.AbstractSamplingFeature; import org.n52.sos.ogc.om.values.ProfileLevel; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferencableGridCoverage; import org.n52.sos.util.CollectionHelper; @@ -89,10 +90,16 @@ public void setValue(ObservationValue value) { ProfileValue profile = (ProfileValue) value.getValue(); RectifiedGridCoverage rectifiedGridCoverage = new RectifiedGridCoverage(getObservationID()); rectifiedGridCoverage.setUnit(value.getValue().getUnit()); + rectifiedGridCoverage.setRangeParameters(getObservationConstellation().getObservablePropertyIdentifier()); List coordinates = Lists.newArrayList(); int srid = 0; for (ProfileLevel level : profile.getValue()) { - rectifiedGridCoverage.addValue(level.getLevelStart().getValue(), level.getSimpleValue()); + if (level.isSetLevelEnd()) { + rectifiedGridCoverage.addValue(new QuantityRangeValue(level.getLevelStart().getValue(), + level.getLevelEnd().getValue(), level.getLevelStart().getUnit()), level.getSimpleValue()); + } else { + rectifiedGridCoverage.addValue(level.getLevelStart().getValue(), level.getSimpleValue()); + } if (level.isSetLocation()) { Coordinate coordinate = level.getLocation().getCoordinate(); coordinate.z = level.getLevelStart().getValue(); @@ -110,12 +117,13 @@ public void setValue(ObservationValue value) { double heightDepth = 0; if (isSetHeightDepthParameter()) { heightDepth = getHeightDepthParameter().getValue().getValue(); + removeParameter(getHeightDepthParameter()); } RectifiedGridCoverage rectifiedGridCoverage = new RectifiedGridCoverage(getObservationID()); rectifiedGridCoverage.setUnit(value.getValue().getUnit()); rectifiedGridCoverage.addValue(heightDepth, value.getValue()); super.setValue(new SingleObservationValue<>(value.getPhenomenonTime(), rectifiedGridCoverage)); - removeParameter(getHeightDepthParameter()); + } } @@ -136,19 +144,22 @@ private void setFeatureGeometry(List coordinates, int srid) { } @Override - protected void mergeValues(ObservationValue observationValue) { - if (observationValue.getValue() instanceof RectifiedGridCoverage) { - ((RectifiedGridCoverage)getValue().getValue()).addValue(((RectifiedGridCoverage)observationValue.getValue()).getValue()); -// } else if (observationValue.getValue() instanceof ReverencableGridCoverage) { -// ((ReverencableGridCoverage)getValue()).addValue(((ReverencableGridCoverage)observationValue).getValue()); - - if (getObservationConstellation().getFeatureOfInterest() instanceof AbstractSamplingFeature) { - if (((AbstractSamplingFeature) getObservationConstellation().getFeatureOfInterest()).isSetGeometry()) { - // TODO check for SamplingCurve and Depht/Height - } - } - } else { - super.mergeValues(observationValue); - } + protected boolean mergeValues(ObservationValue observationValue) { + if (observationValue.getValue() instanceof RectifiedGridCoverage) { + ((RectifiedGridCoverage) getValue().getValue()) + .addValue(((RectifiedGridCoverage) observationValue.getValue()).getValue()); + // } else if (observationValue.getValue() instanceof + // ReverencableGridCoverage) { + // ((ReverencableGridCoverage)getValue()).addValue(((ReverencableGridCoverage)observationValue).getValue()); + + if (getObservationConstellation().getFeatureOfInterest() instanceof AbstractSamplingFeature) { + if (((AbstractSamplingFeature) getObservationConstellation().getFeatureOfInterest()).isSetGeometry()) { + // TODO check for SamplingCurve and Depht/Height + } + } + return true; + } else { + return super.mergeValues(observationValue); + } } } diff --git a/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/TrajectoryObservation.java b/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/TrajectoryObservation.java index 0bf0033a14..f519ef8ea5 100644 --- a/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/TrajectoryObservation.java +++ b/extensions/inspire/api/src/main/java/org/n52/svalbard/inspire/omso/TrajectoryObservation.java @@ -141,7 +141,7 @@ public void mergeWithObservation(OmObservation observation) { } @Override - protected void mergeValues(ObservationValue observationValue) { + protected boolean mergeValues(ObservationValue observationValue) { if (observationValue.getValue() instanceof TLVTValue) { TLVTValue tlvtValue = (TLVTValue) observationValue.getValue(); List valuesToMerge = tlvtValue.getValue(); @@ -149,8 +149,9 @@ protected void mergeValues(ObservationValue observationValue) { // (List)((TLVTValue)observationValue.getValue()).getValue(); ((TLVTValue) getValue().getValue()).addValues(valuesToMerge); checkForFeature(valuesToMerge); + return true; } else { - super.mergeValues(observationValue); + return super.mergeValues(observationValue); } } diff --git a/extensions/inspire/code/pom.xml b/extensions/inspire/code/pom.xml index 5f180ffc52..b689d4aa99 100644 --- a/extensions/inspire/code/pom.xml +++ b/extensions/inspire/code/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos inspire - 4.4.0 + 4.4.1 4.0.0 inspire-code diff --git a/extensions/inspire/code/src/main/java/org/n52/sos/convert/InspireOmpr30FeatureConceptConverter.java b/extensions/inspire/code/src/main/java/org/n52/sos/convert/InspireOmpr30FeatureConceptConverter.java new file mode 100644 index 0000000000..782c89e304 --- /dev/null +++ b/extensions/inspire/code/src/main/java/org/n52/sos/convert/InspireOmpr30FeatureConceptConverter.java @@ -0,0 +1,66 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.convert; + +import java.util.Collections; +import java.util.List; + +import org.n52.sos.ogc.sos.SosProcedureDescription; +import org.n52.sos.util.CollectionHelper; +import org.n52.svalbard.inspire.ompr.InspireOMPRConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Joiner; + +public class InspireOmpr30FeatureConceptConverter implements Converter { + + private static final Logger LOGGER = LoggerFactory.getLogger(InspireOmpr30FeatureConceptConverter.class); + + private static final List CONVERTER_KEY_TYPES = CollectionHelper.list( + new ConverterKeyType(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_URL, "http://inspire.ec.europa.eu/featureconcept/Process"), + new ConverterKeyType("http://inspire.ec.europa.eu/featureconcept/Process", InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_URL), + new ConverterKeyType(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_MIME_TYPE, "http://inspire.ec.europa.eu/featureconcept/Process"), + new ConverterKeyType("http://inspire.ec.europa.eu/featureconcept/Process", InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_MIME_TYPE)); + + public InspireOmpr30FeatureConceptConverter() { + LOGGER.debug("Converter for the following keys initialized successfully: {}!", + Joiner.on(", ").join(CONVERTER_KEY_TYPES)); + } + + @Override + public List getConverterKeyTypes() { + return Collections.unmodifiableList(CONVERTER_KEY_TYPES); + } + + @Override + public SosProcedureDescription convert(SosProcedureDescription objectToConvert) throws ConverterException { + return objectToConvert.setDescriptionFormat(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_URL); + } +} diff --git a/extensions/inspire/code/src/main/java/org/n52/sos/convert/InspireOmpr30WaterML20Converter.java b/extensions/inspire/code/src/main/java/org/n52/sos/convert/InspireOmpr30WaterML20Converter.java new file mode 100644 index 0000000000..61cd94cba3 --- /dev/null +++ b/extensions/inspire/code/src/main/java/org/n52/sos/convert/InspireOmpr30WaterML20Converter.java @@ -0,0 +1,116 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.convert; + +import java.util.Collections; +import java.util.List; + +import org.n52.sos.ogc.gml.ReferenceType; +import org.n52.sos.ogc.series.wml.ObservationProcess; +import org.n52.sos.ogc.series.wml.WaterMLConstants; +import org.n52.sos.ogc.sos.SosProcedureDescription; +import org.n52.sos.ogc.sos.SosProcedureDescriptionUnknowType; +import org.n52.sos.util.CollectionHelper; +import org.n52.svalbard.inspire.ompr.InspireOMPRConstants; +import org.n52.svalbard.inspire.ompr.Process; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Joiner; + +public class InspireOmpr30WaterML20Converter implements Converter { + + private static final Logger LOGGER = LoggerFactory.getLogger(InspireOmpr30WaterML20Converter.class); + + private static final List CONVERTER_KEY_TYPES = CollectionHelper.list( + new ConverterKeyType(WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING, InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_URL), + new ConverterKeyType(WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING, InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_MIME_TYPE), + new ConverterKeyType(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_URL,WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING), + new ConverterKeyType(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_MIME_TYPE,WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING), + new ConverterKeyType(WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING, "http://inspire.ec.europa.eu/featureconcept/Process"), + new ConverterKeyType("http://inspire.ec.europa.eu/featureconcept/Process",WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING)); + + public InspireOmpr30WaterML20Converter() { + LOGGER.debug("Converter for the following keys initialized successfully: {}!", + Joiner.on(", ").join(CONVERTER_KEY_TYPES)); + } + + @Override + public List getConverterKeyTypes() { + return Collections.unmodifiableList(CONVERTER_KEY_TYPES); + } + + @Override + public SosProcedureDescription convert(SosProcedureDescription objectToConvert) throws ConverterException { + if (objectToConvert.getDescriptionFormat().equals(WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING)) { + return convertWML2ObservationProcessToInspireProcess(objectToConvert); + } else if (objectToConvert.getDescriptionFormat().equals(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_URL) + || objectToConvert.getDescriptionFormat().equals(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_MIME_TYPE) + || objectToConvert.getDescriptionFormat().equals("http://inspire.ec.europa.eu/featureconcept/Process")) { + return convertInspireProcessToWML2ObservationProcess(objectToConvert); + } + return new SosProcedureDescriptionUnknowType(objectToConvert.getIdentifier(), objectToConvert.getDescriptionFormat(), null); + } + + private SosProcedureDescription convertWML2ObservationProcessToInspireProcess( + SosProcedureDescription objectToConvert) { + ObservationProcess op = (ObservationProcess) objectToConvert; + Process p = new Process(); + p.setIdentifier(op.getIdentifier()); + if (op.isSetName()) { + p.setName(op.getName()); + } + if (op.isSetDescription()) { + p.setDescription(op.getDescription()); + } + p.setDescriptionFormat(InspireOMPRConstants.OMPR_30_OUTPUT_FORMAT_URL); + return p; + } + + private SosProcedureDescription convertInspireProcessToWML2ObservationProcess( + SosProcedureDescription objectToConvert) { + Process p = (Process) objectToConvert; + ObservationProcess op = new ObservationProcess(); + op.setIdentifier(p.getIdentifier()); + if (p.isSetName()) { + op.setName(p.getName()); + } + if (p.isSetDescription()) { + op.setDescription(p.getDescription()); + } + if (p.isSetType()) { + op.setProcessType(new ReferenceType(p.getType())); + } else { + op.setProcessType(new ReferenceType(WaterMLConstants.PROCESS_TYPE_UNKNOWN)); + } + op.setDescriptionFormat(WaterMLConstants.NS_WML_20_PROCEDURE_ENCODING); + return op; + } + +} diff --git a/extensions/inspire/code/src/main/java/org/n52/sos/ds/hibernate/util/procedure/generator/HibernateProcedureDescriptionGeneratorFactoryInspireOmpr30.java b/extensions/inspire/code/src/main/java/org/n52/sos/ds/hibernate/util/procedure/generator/HibernateProcedureDescriptionGeneratorFactoryInspireOmpr30.java index d168750fb8..90a8209180 100644 --- a/extensions/inspire/code/src/main/java/org/n52/sos/ds/hibernate/util/procedure/generator/HibernateProcedureDescriptionGeneratorFactoryInspireOmpr30.java +++ b/extensions/inspire/code/src/main/java/org/n52/sos/ds/hibernate/util/procedure/generator/HibernateProcedureDescriptionGeneratorFactoryInspireOmpr30.java @@ -57,7 +57,8 @@ public class HibernateProcedureDescriptionGeneratorFactoryInspireOmpr30 private static final List GENERATOR_KEY_TYPES = CollectionHelper - .list(new HibernateProcedureDescriptionGeneratorFactoryKeyType(InspireOMPRConstants.NS_OMPR_30)); + .list(new HibernateProcedureDescriptionGeneratorFactoryKeyType(InspireOMPRConstants.NS_OMPR_30), + new HibernateProcedureDescriptionGeneratorFactoryKeyType("http://inspire.ec.europa.eu/featureconcept/Process")); @Override public List getHibernateProcedureDescriptionGeneratorFactoryKeyTypes() { diff --git a/extensions/inspire/code/src/main/resources/META-INF/services/org.n52.sos.convert.Converter b/extensions/inspire/code/src/main/resources/META-INF/services/org.n52.sos.convert.Converter index 75379fe941..3304dea13b 100644 --- a/extensions/inspire/code/src/main/resources/META-INF/services/org.n52.sos.convert.Converter +++ b/extensions/inspire/code/src/main/resources/META-INF/services/org.n52.sos.convert.Converter @@ -1,2 +1,4 @@ org.n52.sos.convert.InspireOmpr30SensorML20Converter -org.n52.sos.convert.InspireOmpr30SensorML101Converter \ No newline at end of file +org.n52.sos.convert.InspireOmpr30SensorML101Converter +org.n52.sos.convert.InspireOmpr30WaterML20Converter +org.n52.sos.convert.InspireOmpr30FeatureConceptConverter \ No newline at end of file diff --git a/extensions/inspire/coding/pom.xml b/extensions/inspire/coding/pom.xml index 599e2e486e..f415ce8590 100644 --- a/extensions/inspire/coding/pom.xml +++ b/extensions/inspire/coding/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos inspire - 4.4.0 + 4.4.1 4.0.0 inspire-coding diff --git a/extensions/inspire/pom.xml b/extensions/inspire/pom.xml index d189324b39..90dccba6c7 100644 --- a/extensions/inspire/pom.xml +++ b/extensions/inspire/pom.xml @@ -3,11 +3,11 @@ org.n52.sensorweb.sos extensions - 4.4.0 + 4.4.1 4.0.0 inspire - 4.4.0 + 4.4.1 pom 52°North SOS - SOS 2.0 Inspire extension 52°North Sensor Observation Service Inspire extension module diff --git a/extensions/pom.xml b/extensions/pom.xml index 01b7cfed56..d8889dd52a 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 extensions pom diff --git a/extensions/related-offering/pom.xml b/extensions/related-offering/pom.xml index 57130f0fc1..7314cb7db4 100644 --- a/extensions/related-offering/pom.xml +++ b/extensions/related-offering/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos extensions - 4.4.0 + 4.4.1 4.0.0 coding-related-offering diff --git a/hibernate/common/pom.xml b/hibernate/common/pom.xml index 608ad904ca..446e836a5e 100644 --- a/hibernate/common/pom.xml +++ b/hibernate/common/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate - 4.4.0 + 4.4.1 4.0.0 hibernate-common diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/FeatureOfInterestDAO.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/FeatureOfInterestDAO.java index f4585b771e..65f838980b 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/FeatureOfInterestDAO.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/FeatureOfInterestDAO.java @@ -264,7 +264,7 @@ public List getFeatureOfInterestObjects(final Session session } protected Criteria getDefaultCriteria(final Session session) { - return session.createCriteria(FeatureOfInterest.class); + return session.createCriteria(FeatureOfInterest.class).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); } /** @@ -573,11 +573,18 @@ public List getPublishedFeatureOfInterest(Session session) th public Criteria getPublishedFeatureOfInterestCriteria(Session session) throws CodedException { Criteria c = getDefaultCriteria(session); if (HibernateHelper.isEntitySupported(Series.class)) { - c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); - c.add(Subqueries.propertyIn(FeatureOfInterest.ID, getDetachedCriteriaSeries(session))); + c.add(Subqueries.propertyNotIn(FeatureOfInterest.ID, getPublishedDetachedCriteriaSeries(session))); } return c; } + + private DetachedCriteria getPublishedDetachedCriteriaSeries(Session session) throws CodedException { + final DetachedCriteria detachedCriteria = + DetachedCriteria.forClass(DaoFactory.getInstance().getSeriesDAO().getSeriesClass()); + detachedCriteria.add(Restrictions.disjunction(Restrictions.eq(Series.DELETED, true), Restrictions.eq(Series.PUBLISHED, false))); + detachedCriteria.setProjection(Projections.distinct(Projections.property(Series.FEATURE_OF_INTEREST))); + return detachedCriteria; + } private DetachedCriteria getDetachedCriteriaSeries(Session session) throws CodedException { final DetachedCriteria detachedCriteria = diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/FeatureParameterDAO.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/FeatureParameterDAO.java index 4f503bf195..72aa27af53 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/FeatureParameterDAO.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/FeatureParameterDAO.java @@ -49,6 +49,7 @@ import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -300,6 +301,11 @@ public ValuedParameter visit(XmlValue value) return persist(parameterFactory.xml(), value.getValue().xmlText()); } + @Override + public ValuedParameter visit(QuantityRangeValue value) throws OwsExceptionReport { + throw notSupported(value); + } + private OwsExceptionReport notSupported(Value value) throws OwsExceptionReport { throw new NoApplicableCodeException() diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ObservablePropertyDAO.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ObservablePropertyDAO.java index ee66869629..b3e58c8584 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ObservablePropertyDAO.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ObservablePropertyDAO.java @@ -47,7 +47,6 @@ import org.n52.sos.ds.hibernate.entities.ObservationConstellation; import org.n52.sos.ds.hibernate.entities.Offering; import org.n52.sos.ds.hibernate.entities.Procedure; -import org.n52.sos.ds.hibernate.entities.TObservableProperty; import org.n52.sos.ds.hibernate.entities.observation.AbstractObservation; import org.n52.sos.ds.hibernate.entities.observation.legacy.ContextualReferencedLegacyObservation; import org.n52.sos.ds.hibernate.entities.observation.series.ContextualReferencedSeriesObservation; @@ -263,7 +262,7 @@ public List getObservablePropertyObjects(final Session sessi */ @SuppressWarnings("unchecked") @Deprecated - public List getTObservablePropertyObjects(final Session session) { + public List getTObservablePropertyObjects(final Session session) { Criteria criteria = session.createCriteria(ObservableProperty.class); LOGGER.debug("QUERY getTObservablePropertyObjects(): {}", HibernateHelper .getSqlString(criteria)); @@ -293,6 +292,19 @@ public Map getOrInsertObservablePropertyAsMap( return existing; } + public ObservableProperty getOrInsertObservableProperty(AbstractPhenomenon observableProperty, Session session) { + ObservableProperty obsProp =getObservablePropertyForIdentifier(observableProperty.getIdentifier(), session); + if (obsProp == null) { + obsProp = new ObservableProperty(); + addIdentifierNameDescription(observableProperty, obsProp, session); + obsProp.setHiddenChild(false); + session.save(obsProp); + session.flush(); + session.refresh(obsProp); + } + return obsProp; + } + protected void insertNonExisting( List observableProperties, boolean hiddenChild, @@ -462,8 +474,8 @@ private DetachedCriteria getDetachedCriteriaObservablePropertiesForOfferingFromO @SuppressWarnings("unchecked") public List getPublishedObservableProperty(Session session) throws CodedException { if (HibernateHelper.isEntitySupported(Series.class)) { - Criteria c = session.createCriteria(ObservableProperty.class).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); - c.add(Subqueries.propertyIn(ObservableProperty.ID, getDetachedCriteriaSeries(session))); + Criteria c = getDefaultCriteria(session); + c.add(Subqueries.propertyNotIn(ObservableProperty.ID, getDetachedCriteriaSeries(session))); return c.list(); } return getObservablePropertyObjects(session); @@ -471,7 +483,7 @@ public List getPublishedObservableProperty(Session session) private DetachedCriteria getDetachedCriteriaSeries(Session session) throws CodedException { final DetachedCriteria detachedCriteria = DetachedCriteria.forClass(DaoFactory.getInstance().getSeriesDAO().getSeriesClass()); - detachedCriteria.add(Restrictions.eq(Series.DELETED, false)).add(Restrictions.eq(Series.PUBLISHED, true)); + detachedCriteria.add(Restrictions.disjunction(Restrictions.eq(Series.DELETED, true), Restrictions.eq(Series.PUBLISHED, false))); detachedCriteria.setProjection(Projections.distinct(Projections.property(Series.OBSERVABLE_PROPERTY))); return detachedCriteria; } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/OfferingDAO.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/OfferingDAO.java index 7a2a85d87a..18749a8cba 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/OfferingDAO.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/OfferingDAO.java @@ -746,7 +746,7 @@ public void addOfferingRestricionForObservation(DetachedCriteria dc, String offe public List getPublishedOffering(Collection identifiers, Session session) throws CodedException { if (HibernateHelper.isEntitySupported(Series.class)) { Criteria c = getDefaultCriteria(session); - c.add(Subqueries.propertyIn(Offering.ID, getDetachedCriteriaSeries(session))); + c.add(Subqueries.propertyNotIn(Offering.ID, getDetachedCriteriaSeries(session))); return c.list(); } return getOfferingObjectsForCacheUpdate(identifiers, session); @@ -754,7 +754,7 @@ public List getPublishedOffering(Collection identifiers, Sessi private DetachedCriteria getDetachedCriteriaSeries(Session session) throws CodedException { final DetachedCriteria detachedCriteria = DetachedCriteria.forClass(DaoFactory.getInstance().getSeriesDAO().getSeriesClass()); - detachedCriteria.add(Restrictions.eq(Series.DELETED, false)).add(Restrictions.eq(Series.PUBLISHED, true)); + detachedCriteria.add(Restrictions.disjunction(Restrictions.eq(Series.DELETED, true), Restrictions.eq(Series.PUBLISHED, false))); detachedCriteria.setProjection(Projections.distinct(Projections.property(Series.OFFERING))); return detachedCriteria; } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ParameterDAO.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ParameterDAO.java index 1b8e5723b6..0a40e89ad2 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ParameterDAO.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ParameterDAO.java @@ -49,6 +49,7 @@ import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -303,6 +304,11 @@ public ValuedParameter visit(ProfileValue value) throws OwsExceptionReport { throw notSupported(value); } + @Override + public ValuedParameter visit(QuantityRangeValue value) throws OwsExceptionReport { + throw notSupported(value); + } + private OwsExceptionReport notSupported(Value value) throws OwsExceptionReport { throw new NoApplicableCodeException() diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ProcedureDAO.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ProcedureDAO.java index ce158cea8a..35431ff1eb 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ProcedureDAO.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ProcedureDAO.java @@ -76,7 +76,6 @@ import org.n52.sos.exception.ows.concrete.UnsupportedOperatorException; import org.n52.sos.exception.ows.concrete.UnsupportedTimeException; import org.n52.sos.exception.ows.concrete.UnsupportedValueReferenceException; -import org.n52.sos.ogc.gml.CodeType; import org.n52.sos.ogc.gml.time.Time; import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.ogc.sos.SosProcedureDescription; @@ -1068,8 +1067,8 @@ public Map getProcedureFormatMap(Session session) { @SuppressWarnings("unchecked") public List getPublishedProcedure(Session session) throws CodedException { if (HibernateHelper.isEntitySupported(Series.class)) { - Criteria c = session.createCriteria(Procedure.class).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); - c.add(Subqueries.propertyIn(Procedure.ID, getDetachedCriteriaSeries(session))); + Criteria c = getDefaultCriteria(session); + c.add(Subqueries.propertyNotIn(Procedure.ID, getDetachedCriteriaSeries(session))); return c.list(); } return getProcedureObjects(session); @@ -1077,7 +1076,7 @@ public List getPublishedProcedure(Session session) throws CodedExcept private DetachedCriteria getDetachedCriteriaSeries(Session session) throws CodedException { final DetachedCriteria detachedCriteria = DetachedCriteria.forClass(DaoFactory.getInstance().getSeriesDAO().getSeriesClass()); - detachedCriteria.add(Restrictions.eq(Series.DELETED, false)).add(Restrictions.eq(Series.PUBLISHED, true)); + detachedCriteria.add(Restrictions.disjunction(Restrictions.eq(Series.DELETED, true), Restrictions.eq(Series.PUBLISHED, false))); detachedCriteria.setProjection(Projections.distinct(Projections.property(Series.PROCEDURE))); return detachedCriteria; } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java index fe923338d6..84ca700d66 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/AbstractObservationDAO.java @@ -29,6 +29,7 @@ package org.n52.sos.ds.hibernate.dao.observation; import java.sql.Timestamp; +import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.List; @@ -83,6 +84,7 @@ import org.n52.sos.ds.hibernate.entities.observation.full.GeometryObservation; import org.n52.sos.ds.hibernate.entities.observation.full.NumericObservation; import org.n52.sos.ds.hibernate.entities.observation.full.ProfileObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ReferenceObservation; import org.n52.sos.ds.hibernate.entities.observation.full.SweDataArrayObservation; import org.n52.sos.ds.hibernate.entities.observation.full.TextObservation; import org.n52.sos.ds.hibernate.entities.parameter.observation.Parameter; @@ -106,7 +108,9 @@ import org.n52.sos.ogc.gml.time.Time.TimeIndeterminateValue; import org.n52.sos.ogc.gml.time.TimeInstant; import org.n52.sos.ogc.gml.time.TimePeriod; +import org.n52.sos.ogc.gwml.GWMLConstants; import org.n52.sos.ogc.om.NamedValue; +import org.n52.sos.ogc.om.OmConstants; import org.n52.sos.ogc.om.OmObservation; import org.n52.sos.ogc.om.SingleObservationValue; import org.n52.sos.ogc.om.values.BooleanValue; @@ -118,7 +122,10 @@ import org.n52.sos.ogc.om.values.HrefAttributeValue; import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; +import org.n52.sos.ogc.om.values.ProfileLevel; +import org.n52.sos.ogc.om.values.ProfileLevelVisitor; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -134,6 +141,7 @@ import org.n52.sos.ogc.sos.Sos2Constants; import org.n52.sos.ogc.sos.SosConstants.SosIndeterminateTime; import org.n52.sos.ogc.sos.SosEnvelope; +import org.n52.sos.ogc.swe.SweAbstractDataComponent; import org.n52.sos.ogc.swe.SweAbstractDataRecord; import org.n52.sos.ogc.swe.SweField; import org.n52.sos.request.GetObservationRequest; @@ -389,7 +397,33 @@ public boolean checkCategoryObservationsFor(String offeringIdentifier, Session s public boolean checkTextObservationsFor(String offeringIdentifier, Session session) { return checkObservationFor(getObservationFactory().textClass(), offeringIdentifier, session); } + + /** + * Check if there are complex observations for the offering + * + * @param offeringIdentifier + * Offering identifier + * @param session + * Hibernate session + * @return If there are observations or not + */ + public boolean checkComplexObservationsFor(String offeringIdentifier, Session session) { + return checkObservationFor(getObservationFactory().complexClass(), offeringIdentifier, session); + } + /** + * Check if there are profile observations for the offering + * + * @param offeringIdentifier + * Offering identifier + * @param session + * Hibernate session + * @return If there are observations or not + */ + public boolean checkProfileObservationsFor(String offeringIdentifier, Session session) { + return checkObservationFor(getObservationFactory().profileClass(), offeringIdentifier, session); + } + /** * Check if there are blob observations for the offering * @@ -428,7 +462,20 @@ public boolean checkGeometryObservationsFor(String offeringIdentifier, Session s public boolean checkSweDataArrayObservationsFor(String offeringIdentifier, Session session) { return checkObservationFor(getObservationFactory().sweDataArrayClass(), offeringIdentifier, session); } - + + /** + * Check if there are referenced observations for the offering + * + * @param offeringIdentifier + * Offering identifier + * @param session + * Hibernate session + * @return If there are observations or not + */ + public boolean checkReferenceObservationsFor(String offeringIdentifier, Session session) { + return checkObservationFor(getObservationFactory().referenceClass(), offeringIdentifier, session); + } + /** * Get Hibernate Criteria for result model * @@ -1390,7 +1437,7 @@ public ParameterFactory getParameterFactory() { } private static class ObservationPersister - implements ValueVisitor> { + implements ValueVisitor>, ProfileLevelVisitor> { private static final ObservationVisitor SERIES_TYPE_VISITOR = new SeriesTypeVisitor(); private final ObservationConstellation observationConstellation; private final AbstractFeatureOfInterest featureOfInterest; @@ -1488,6 +1535,11 @@ public Observation visit(QuantityValue value) } + @Override + public Observation visit(QuantityRangeValue value) throws OwsExceptionReport { + throw notSupported(value); + } + @Override public Observation visit(TextValue value) throws OwsExceptionReport { @@ -1529,7 +1581,7 @@ public Observation visit(NilTemplateValue value) @Override public Observation visit(ReferenceValue value) throws OwsExceptionReport { - throw notSupported(value); + return persist(observationFactory.reference(), value.getValue()); } @Override @@ -1561,7 +1613,21 @@ public Observation visit(RectifiedGridCoverage value) throws OwsExceptionRepo @Override public Observation visit(ProfileValue value) throws OwsExceptionReport { - throw notSupported(value); + ProfileObservation profile = observationFactory.profile(); + profile.setParent(true); + sosObservation.getValue().setPhenomenonTime(value.getPhenomenonTime()); + return persist(profile, persistChildren(value.getValue())); + } + + @Override + public Collection> visit(ProfileLevel value) throws OwsExceptionReport { + List> childObservations = new ArrayList<>(); + if (value.isSetValue()) { + for (Value v : value.getValue()) { + childObservations.add(v.accept(this)); + } + } + return childObservations; } @Override @@ -1569,6 +1635,8 @@ public Observation visit(XmlValue value) throws OwsExceptionReport { throw notSupported(value); } + + private Set> persistChildren(SweAbstractDataRecord dataRecord) throws HibernateException, OwsExceptionReport { @@ -1582,6 +1650,47 @@ private Set> persistChildren(SweAbstractDataRecord dataRecord) return children; } + private Set> persistChildren(List values) throws OwsExceptionReport { + Set> children = new TreeSet<>(); + for (ProfileLevel level : values) { + if (level.isSetValue()) { + for (Value v : level.getValue()) { + if (v instanceof SweAbstractDataComponent && ((SweAbstractDataComponent) v).isSetDefinition()) { + children.add(v.accept(createChildPersister(level, ((SweAbstractDataComponent) v).getDefinition()))); + } else { + children.add(v.accept(createChildPersister(level))); + } + } + } + } + session.flush(); + return children; + } + + private OmObservation getObservationWithLevelParameter(ProfileLevel level) { + OmObservation o = new OmObservation(); + sosObservation.copyTo(o); + o.setParameter(level.getLevelStartEndAsParameter()); + if (level.isSetPhenomenonTime()) { + o.setValue(new SingleObservationValue<>()); + o.getValue().setPhenomenonTime(level.getPhenomenonTime()); + } + return o; + } + + private ObservationPersister createChildPersister(ProfileLevel level, String observableProperty) throws OwsExceptionReport { + return new ObservationPersister(daos, caches, getObservationWithLevelParameter(level), + getObservationConstellation(getObservableProperty(observableProperty)), featureOfInterest, + getSamplingGeometryFromLevel(level), offerings, session, true); + } + + private ObservationPersister createChildPersister(ProfileLevel level) throws OwsExceptionReport { + return new ObservationPersister(daos, caches, getObservationWithLevelParameter(level), + observationConstellation, featureOfInterest, + getSamplingGeometryFromLevel(level), offerings, session, true); + + } + private ObservationPersister createChildPersister(ObservableProperty observableProperty) throws OwsExceptionReport { return new ObservationPersister(daos, caches, sosObservation, getObservationConstellation(observableProperty), featureOfInterest, @@ -1608,7 +1717,11 @@ private OwsExceptionReport notSupported(Value value) private ObservableProperty getObservablePropertyForField(SweField field) { String definition = field.getElement().getDefinition(); - return daos.observableProperty().getObservablePropertyForIdentifier(definition, session); + return getObservableProperty(definition); + } + + private ObservableProperty getObservableProperty(String observableProperty) { + return daos.observableProperty().getObservablePropertyForIdentifier(observableProperty, session); } private > T setUnitAndPersist(T observation, Value value) throws OwsExceptionReport { @@ -1635,22 +1748,28 @@ private > T persist(T observation, V value) throws O daos.observation().addName(sosObservation, observation, session); daos.observation().addDescription(sosObservation, observation); daos.observation().addTime(sosObservation, observation); - + observation.setValue(value); observation.setSamplingGeometry(samplingGeometry); checkUpdateFeatureOfInterestGeometry(); ObservationContext observationContext = daos.observation().createObservationContext(); String observationType = observation.accept(ObservationTypeObservationVisitor.getInstance()); - - if (!daos.observationConstellation().checkObservationType(observationConstellation, observationType, session)) { - throw new InvalidParameterValueException() - .withMessage("The requested observationType (%s) is invalid for procedure = %s, observedProperty = %s and offering = %s! The valid observationType is '%s'!", - observationType, - observationConstellation.getProcedure().getIdentifier(), - observationConstellation.getObservableProperty().getIdentifier(), - observationConstellation.getOffering().getIdentifier(), - observationConstellation.getObservationType().getObservationType()); + if (!isProfileObservation() || (isProfileObservation() && !childObservation)) { + if (!daos.observationConstellation().checkObservationType(observationConstellation, observationType, session)) { + throw new InvalidParameterValueException() + .withMessage("The requested observationType (%s) is invalid for procedure = %s, observedProperty = %s and offering = %s! The valid observationType is '%s'!", + observationType, + observationConstellation.getProcedure().getIdentifier(), + observationConstellation.getObservableProperty().getIdentifier(), + observationConstellation.getOffering().getIdentifier(), + observationConstellation.getObservationType().getObservationType()); + } + if (sosObservation.isSetSeriesType()) { + observationContext.setSeriesType(sosObservation.getSeriesType()); + } else { + observationContext.setSeriesType(observation.accept(SERIES_TYPE_VISITOR)); + } } if (observationConstellation != null) { @@ -1658,12 +1777,7 @@ private > T persist(T observation, V value) throws O observationContext.setProcedure(observationConstellation.getProcedure()); observationContext.setOffering(observationConstellation.getOffering()); } - observation.setValue(value); - if (sosObservation.isSetSeriesType()) { - observationContext.setSeriesType(sosObservation.getSeriesType()); - } else { - observationContext.setSeriesType(observation.accept(SERIES_TYPE_VISITOR)); - } + if (childObservation) { observationContext.setHiddenChild(true); } @@ -1680,10 +1794,28 @@ private > T persist(T observation, V value) throws O return observation; } + private boolean isProfileObservation() { + return observationConstellation.isSetObservationType() + && (OmConstants.OBS_TYPE_PROFILE_OBSERVATION.equals(observationConstellation.getObservationType().getObservationType()) + || GWMLConstants.OBS_TYPE_GEOLOGY_LOG.equals(observationConstellation.getObservationType().getObservationType()) + || GWMLConstants.OBS_TYPE_GEOLOGY_LOG_COVERAGE.equals(observationConstellation.getObservationType().getObservationType())); + } + + private Geometry getSamplingGeometryFromLevel(ProfileLevel level) throws OwsExceptionReport { + if (level.isSetLocation()) { + return GeometryHandler.getInstance().switchCoordinateAxisFromToDatasourceIfNeeded(level.getLocation()); + } + return null; + } + private static Geometry getSamplingGeometry(OmObservation sosObservation) throws OwsExceptionReport { if (!sosObservation.isSetSpatialFilteringProfileParameter()) { return null; } + if (sosObservation.isSetValue() && sosObservation.getValue().isSetValue() && sosObservation.getValue().getValue() instanceof ProfileValue + && ((ProfileValue)sosObservation.getValue().getValue()).isSetGeometry()) { + return GeometryHandler.getInstance().switchCoordinateAxisFromToDatasourceIfNeeded(((ProfileValue)sosObservation.getValue().getValue()).getGeometry()); + } NamedValue spatialFilteringProfileParameter = sosObservation.getSpatialFilteringProfileParameter(); Geometry geometry = spatialFilteringProfileParameter.getValue().getValue(); return GeometryHandler.getInstance().switchCoordinateAxisFromToDatasourceIfNeeded(geometry); @@ -1799,8 +1931,19 @@ public String visit(SweDataArrayObservation o) throws OwsExceptionReport { @Override public String visit(ProfileObservation o) throws OwsExceptionReport { + if (o.isSetValue()) { + for (Observation value : o.getValue()) { + return value.accept(this) + "-profile"; + } + } return "profile"; } + + @Override + public String visit(ReferenceObservation o) + throws OwsExceptionReport { + return "reference"; + } } } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/ObservationFactory.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/ObservationFactory.java index 742fc3e308..b68c3bc0ef 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/ObservationFactory.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/ObservationFactory.java @@ -38,6 +38,8 @@ import org.n52.sos.ds.hibernate.entities.observation.full.CountObservation; import org.n52.sos.ds.hibernate.entities.observation.full.GeometryObservation; import org.n52.sos.ds.hibernate.entities.observation.full.NumericObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ProfileObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ReferenceObservation; import org.n52.sos.ds.hibernate.entities.observation.full.SweDataArrayObservation; import org.n52.sos.ds.hibernate.entities.observation.full.TextObservation; import org.n52.sos.exception.ows.NoApplicableCodeException; @@ -116,6 +118,20 @@ public ComplexObservation complex() throws OwsExceptionReport { return instantiate(complexClass()); } + + public abstract Class profileClass(); + + public ProfileObservation profile() + throws OwsExceptionReport { + return instantiate(profileClass()); + } + + public abstract Class referenceClass(); + + public ReferenceObservation reference() + throws OwsExceptionReport { + return instantiate(referenceClass()); + } private > T instantiate(Class c) throws OwsExceptionReport { @@ -148,6 +164,8 @@ public Class classForObservationType( return complexClass(); case OmConstants.OBS_TYPE_SWE_ARRAY_OBSERVATION: return sweDataArrayClass(); + case OmConstants.OBS_TYPE_REFERENCE_OBSERVATION: + return referenceClass(); case OmConstants.OBS_TYPE_UNKNOWN: return blobClass(); } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/ObservationTypeObservationVisitor.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/ObservationTypeObservationVisitor.java index e8492b85b1..0fef106b7c 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/ObservationTypeObservationVisitor.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/ObservationTypeObservationVisitor.java @@ -37,6 +37,7 @@ import org.n52.sos.ds.hibernate.entities.observation.full.GeometryObservation; import org.n52.sos.ds.hibernate.entities.observation.full.NumericObservation; import org.n52.sos.ds.hibernate.entities.observation.full.ProfileObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ReferenceObservation; import org.n52.sos.ds.hibernate.entities.observation.full.SweDataArrayObservation; import org.n52.sos.ds.hibernate.entities.observation.full.TextObservation; import org.n52.sos.ogc.gwml.GWMLConstants; @@ -100,7 +101,13 @@ public String visit(SweDataArrayObservation o) { @Override public String visit(ProfileObservation o) throws OwsExceptionReport { - return GWMLConstants.OBS_TYPE_GEOLOGY_LOG; + return OmConstants.OBS_TYPE_PROFILE_OBSERVATION; + } + + @Override + public String visit(ReferenceObservation o) + throws OwsExceptionReport { + return OmConstants.OBS_TYPE_REFERENCE_OBSERVATION; } public static ObservationTypeObservationVisitor getInstance() { diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/legacy/LegacyObservationFactory.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/legacy/LegacyObservationFactory.java index fdeadf7121..e30ab1483f 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/legacy/LegacyObservationFactory.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/legacy/LegacyObservationFactory.java @@ -39,6 +39,8 @@ import org.n52.sos.ds.hibernate.entities.observation.full.CountObservation; import org.n52.sos.ds.hibernate.entities.observation.full.GeometryObservation; import org.n52.sos.ds.hibernate.entities.observation.full.NumericObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ProfileObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ReferenceObservation; import org.n52.sos.ds.hibernate.entities.observation.full.SweDataArrayObservation; import org.n52.sos.ds.hibernate.entities.observation.full.TextObservation; import org.n52.sos.ds.hibernate.entities.observation.legacy.AbstractLegacyObservation; @@ -124,6 +126,16 @@ public Class complexClass() { return LegacyComplexObservation.class; } + @Override + public Class profileClass() { + return null; + } + + @Override + public Class referenceClass() { + return null; + } + public static LegacyObservationFactory getInstance() { return Holder.INSTANCE; } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/series/AbstractSeriesDAO.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/series/AbstractSeriesDAO.java index f52b755bfa..cd7d5f411a 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/series/AbstractSeriesDAO.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/series/AbstractSeriesDAO.java @@ -212,6 +212,11 @@ protected Series getOrInsert(ObservationContext ctx, final Session session) thro session.saveOrUpdate(series); session.flush(); session.refresh(series); + } else if (ctx.isSetSeriesType() && !series.isSetSeriesType()) { + ctx.addValuesToSeries(series); + session.saveOrUpdate(series); + session.flush(); + session.refresh(series); } return series; } @@ -545,7 +550,7 @@ public void updateSeriesWithFirstLatestValues(Series series, Observation hObs */ public void updateSeriesAfterObservationDeletion(Series series, SeriesObservation observation, Session session) { SeriesObservationDAO seriesObservationDAO = new SeriesObservationDAO(); - if (series.getFirstTimeStamp().equals(observation.getPhenomenonTimeStart())) { + if (series.isSetFirstTimeStamp() && series.getFirstTimeStamp().equals(observation.getPhenomenonTimeStart())) { SeriesObservation firstObservation = seriesObservationDAO.getFirstObservationFor(series, session); if (firstObservation != null) { series.setFirstTimeStamp(firstObservation.getPhenomenonTimeStart()); @@ -559,7 +564,7 @@ public void updateSeriesAfterObservationDeletion(Series series, SeriesObservatio } } } - if (series.getLastTimeStamp().equals(observation.getPhenomenonTimeEnd())) { + if (series.isSetLastTimeStamp() && series.getLastTimeStamp().equals(observation.getPhenomenonTimeEnd())) { SeriesObservation latestObservation = seriesObservationDAO.getLastObservationFor(series, session); if (latestObservation != null) { series.setLastTimeStamp(latestObservation.getPhenomenonTimeEnd()); diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/series/SeriesObservationFactory.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/series/SeriesObservationFactory.java index 2db255b393..d9f6e56e89 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/series/SeriesObservationFactory.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/observation/series/SeriesObservationFactory.java @@ -36,6 +36,8 @@ import org.n52.sos.ds.hibernate.entities.observation.full.CountObservation; import org.n52.sos.ds.hibernate.entities.observation.full.GeometryObservation; import org.n52.sos.ds.hibernate.entities.observation.full.NumericObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ProfileObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ReferenceObservation; import org.n52.sos.ds.hibernate.entities.observation.full.SweDataArrayObservation; import org.n52.sos.ds.hibernate.entities.observation.full.TextObservation; import org.n52.sos.ds.hibernate.entities.observation.series.AbstractSeriesObservation; @@ -50,6 +52,8 @@ import org.n52.sos.ds.hibernate.entities.observation.series.full.SeriesCountObservation; import org.n52.sos.ds.hibernate.entities.observation.series.full.SeriesGeometryObservation; import org.n52.sos.ds.hibernate.entities.observation.series.full.SeriesNumericObservation; +import org.n52.sos.ds.hibernate.entities.observation.series.full.SeriesProfileObservation; +import org.n52.sos.ds.hibernate.entities.observation.series.full.SeriesReferenceObservation; import org.n52.sos.ds.hibernate.entities.observation.series.full.SeriesSweDataArrayObservation; import org.n52.sos.ds.hibernate.entities.observation.series.full.SeriesTextObservation; @@ -123,6 +127,16 @@ public Class complexClass() { return SeriesComplexObservation.class; } + @Override + public Class profileClass() { + return SeriesProfileObservation.class; + } + + @Override + public Class referenceClass() { + return SeriesReferenceObservation.class; + } + public Series series() { return new Series(); } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/ObservationVisitor.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/ObservationVisitor.java index c4768d6d61..a6b7362565 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/ObservationVisitor.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/ObservationVisitor.java @@ -36,8 +36,10 @@ import org.n52.sos.ds.hibernate.entities.observation.full.GeometryObservation; import org.n52.sos.ds.hibernate.entities.observation.full.NumericObservation; import org.n52.sos.ds.hibernate.entities.observation.full.ProfileObservation; +import org.n52.sos.ds.hibernate.entities.observation.full.ReferenceObservation; import org.n52.sos.ds.hibernate.entities.observation.full.SweDataArrayObservation; import org.n52.sos.ds.hibernate.entities.observation.full.TextObservation; +import org.n52.sos.ds.hibernate.entities.observation.series.full.SeriesReferenceObservation; import org.n52.sos.ogc.ows.OwsExceptionReport; /** @@ -76,5 +78,8 @@ T visit(SweDataArrayObservation o) T visit(ProfileObservation o) throws OwsExceptionReport; + + T visit(ReferenceObservation o) + throws OwsExceptionReport; } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/ValuedObservationVisitor.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/ValuedObservationVisitor.java index 20201297ff..c430cb551f 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/ValuedObservationVisitor.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/ValuedObservationVisitor.java @@ -36,6 +36,7 @@ import org.n52.sos.ds.hibernate.entities.observation.valued.GeometryValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.NumericValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.ProfileValuedObservation; +import org.n52.sos.ds.hibernate.entities.observation.valued.ReferenceValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.SweDataArrayValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.TextValuedObservation; import org.n52.sos.ogc.ows.OwsExceptionReport; @@ -77,5 +78,7 @@ T visit(SweDataArrayValuedObservation o) T visit(ProfileValuedObservation o) throws OwsExceptionReport; + T visit(ReferenceValuedObservation o) + throws OwsExceptionReport; } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/VoidValuedObservationVisitor.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/VoidValuedObservationVisitor.java index 51fe0bf393..ac0f6d23c8 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/VoidValuedObservationVisitor.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/VoidValuedObservationVisitor.java @@ -36,6 +36,7 @@ import org.n52.sos.ds.hibernate.entities.observation.valued.GeometryValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.NumericValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.ProfileValuedObservation; +import org.n52.sos.ds.hibernate.entities.observation.valued.ReferenceValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.SweDataArrayValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.TextValuedObservation; import org.n52.sos.ogc.ows.OwsExceptionReport; @@ -77,6 +78,9 @@ protected abstract void _visit(SweDataArrayValuedObservation o) protected abstract void _visit(ProfileValuedObservation o) throws OwsExceptionReport; + + protected abstract void _visit(ReferenceValuedObservation o) + throws OwsExceptionReport; @Override public Void visit(NumericValuedObservation o) @@ -148,4 +152,10 @@ public Void visit(ProfileValuedObservation o) return null; } + public Void visit(ReferenceValuedObservation o) + throws OwsExceptionReport { + _visit(o); + return null; + } + } diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/full/ReferenceObservation.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/full/ReferenceObservation.java new file mode 100644 index 0000000000..e6336acabe --- /dev/null +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/full/ReferenceObservation.java @@ -0,0 +1,35 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ds.hibernate.entities.observation.full; + +import org.n52.sos.ds.hibernate.entities.observation.Observation; +import org.n52.sos.ds.hibernate.entities.observation.valued.ReferenceValuedObservation; +import org.n52.sos.ogc.gml.ReferenceType; + +public interface ReferenceObservation extends ReferenceValuedObservation, Observation {} diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/series/full/SeriesReferenceObservation.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/series/full/SeriesReferenceObservation.java new file mode 100644 index 0000000000..ca6d514805 --- /dev/null +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/series/full/SeriesReferenceObservation.java @@ -0,0 +1,153 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ds.hibernate.entities.observation.series.full; + +import org.n52.sos.ds.hibernate.entities.observation.ObservationVisitor; +import org.n52.sos.ds.hibernate.entities.observation.ValuedObservationVisitor; +import org.n52.sos.ds.hibernate.entities.observation.VoidObservationVisitor; +import org.n52.sos.ds.hibernate.entities.observation.VoidValuedObservationVisitor; +import org.n52.sos.ds.hibernate.entities.observation.full.ReferenceObservation; +import org.n52.sos.ds.hibernate.entities.observation.series.AbstractSeriesObservation; +import org.n52.sos.ogc.gml.ReferenceType; +import org.n52.sos.ogc.ows.OwsExceptionReport; +import org.n52.sos.util.StringHelper; + +public class SeriesReferenceObservation + extends + AbstractSeriesObservation + implements + ReferenceObservation { + + private static final long serialVersionUID = 1L; + private ReferenceType value; + private String href; + private String title; + private String role; + + @Override + public ReferenceType getValue() { + if (value == null) { + value = new ReferenceType(); + } + value.setHref(getHref()); + value.setTitle(getTitle()); + value.setRole(role); + return value; + } + + @Override + public void setValue(ReferenceType value) { + this.value = value; + setHref(value.isSetHref() ? value.getHref() : null); + setTitle(value.isSetTitle() ? value.getTitle() : null); + setRole(value.isSetRole() ? value.getRole() : null); + } + + @Override + public boolean isSetValue() { + return isSetHref(); + } + + @Override + public String getValueAsString() { + return getHref(); + } + + @Override + public String getHref() { + return href; + } + + @Override + public void setHref(String href) { + this.href = href; + } + + @Override + public boolean isSetHref() { + return StringHelper.isNotEmpty(getHref()); + } + + /** + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * @param title the title to set + */ + public void setTitle(String title) { + this.title = title; + } + + public boolean isSetTitle() { + return StringHelper.isNotEmpty(getTitle()); + } + + @Override + public String getRole() { + return role; + } + + @Override + public void setRole(String role) { + this.role = role; + } + + @Override + public boolean isSetRole() { + return StringHelper.isNotEmpty(getRole()); + } + + @Override + public void accept(VoidObservationVisitor visitor) + throws OwsExceptionReport { + visitor.visit(this); + } + + @Override + public T accept(ObservationVisitor visitor) + throws OwsExceptionReport { + return visitor.visit(this); + } + + @Override + public void accept(VoidValuedObservationVisitor visitor) + throws OwsExceptionReport { + visitor.visit(this); + } + + @Override + public T accept(ValuedObservationVisitor visitor) + throws OwsExceptionReport { + return visitor.visit(this); + } +} diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/series/valued/ReferenceValuedSeriesObservation.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/series/valued/ReferenceValuedSeriesObservation.java new file mode 100644 index 0000000000..c0868abde2 --- /dev/null +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/series/valued/ReferenceValuedSeriesObservation.java @@ -0,0 +1,139 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ds.hibernate.entities.observation.series.valued; + +import org.n52.sos.ds.hibernate.entities.observation.ValuedObservationVisitor; +import org.n52.sos.ds.hibernate.entities.observation.VoidValuedObservationVisitor; +import org.n52.sos.ds.hibernate.entities.observation.series.AbstractValuedSeriesObservation; +import org.n52.sos.ds.hibernate.entities.observation.valued.ReferenceValuedObservation; +import org.n52.sos.ogc.gml.ReferenceType; +import org.n52.sos.ogc.ows.OwsExceptionReport; +import org.n52.sos.util.StringHelper; + +public class ReferenceValuedSeriesObservation + extends + AbstractValuedSeriesObservation + implements + ReferenceValuedObservation { + + private static final long serialVersionUID = 1L; + private ReferenceType value; + private String href; + private String title; + private String role; + + @Override + public ReferenceType getValue() { + if (value == null) { + value = new ReferenceType(); + } + value.setHref(getHref()); + value.setTitle(getTitle()); + value.setRole(role); + return value; + } + + @Override + public void setValue(ReferenceType value) { + this.value = value; + setHref(value.isSetHref() ? value.getHref() : null); + setTitle(value.isSetTitle() ? value.getTitle() : null); + setRole(value.isSetRole() ? value.getRole() : null); + } + + @Override + public boolean isSetValue() { + return isSetHref(); + } + + @Override + public String getValueAsString() { + return getHref(); + } + + @Override + public String getHref() { + return href; + } + + @Override + public void setHref(String href) { + this.href = href; + } + + @Override + public boolean isSetHref() { + return StringHelper.isNotEmpty(getHref()); + } + + /** + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * @param title the title to set + */ + public void setTitle(String title) { + this.title = title; + } + + public boolean isSetTitle() { + return StringHelper.isNotEmpty(getTitle()); + } + + @Override + public String getRole() { + return role; + } + + @Override + public void setRole(String role) { + this.role = role; + } + + @Override + public boolean isSetRole() { + return StringHelper.isNotEmpty(getRole()); + } + + @Override + public void accept(VoidValuedObservationVisitor visitor) + throws OwsExceptionReport { + visitor.visit(this); + } + + @Override + public T accept(ValuedObservationVisitor visitor) + throws OwsExceptionReport { + return visitor.visit(this); + } +} \ No newline at end of file diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/valued/ReferenceValuedObservation.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/valued/ReferenceValuedObservation.java new file mode 100644 index 0000000000..2e3797a5b9 --- /dev/null +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/observation/valued/ReferenceValuedObservation.java @@ -0,0 +1,54 @@ +/** + * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source + * Software GmbH + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * If the program is linked with libraries which are licensed under one of + * the following licenses, the combination of the program with the linked + * library is not considered a "derivative work" of the program: + * + * - Apache License, version 2.0 + * - Apache Software License, version 1.0 + * - GNU Lesser General Public License, version 3 + * - Mozilla Public License, versions 1.0, 1.1 and 2.0 + * - Common Development and Distribution License (CDDL), version 1.0 + * + * Therefore the distribution of the program linked with libraries licensed + * under the aforementioned licenses, is permitted by the copyright holders + * if the distribution is compliant with both the GNU General Public + * License version 2 and the aforementioned licenses. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + */ +package org.n52.sos.ds.hibernate.entities.observation.valued; + +import org.n52.sos.ds.hibernate.entities.observation.ValuedObservation; +import org.n52.sos.ogc.gml.ReferenceType; + +public interface ReferenceValuedObservation extends ValuedObservation { + + String getHref(); + + void setHref(String href); + + boolean isSetHref(); + + String getTitle(); + + void setTitle(String title); + + boolean isSetTitle(); + + String getRole(); + + void setRole(String role); + + boolean isSetRole(); + +} diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/feature/FeatureParameterFactory.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/feature/FeatureParameterFactory.java index 95d36be8dc..810dba1e93 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/feature/FeatureParameterFactory.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/feature/FeatureParameterFactory.java @@ -40,6 +40,7 @@ import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -156,6 +157,11 @@ public ValuedParameter visit(QuantityValue value) throws OwsExceptionReport { return quantity(); } + @Override + public ValuedParameter visit(QuantityRangeValue value) throws OwsExceptionReport { + throw notSupported(value); + } + @Override public ValuedParameter visit(ReferenceValue value) throws OwsExceptionReport { throw notSupported(value); diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/observation/ParameterFactory.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/observation/ParameterFactory.java index 244413684d..faecf2110f 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/observation/ParameterFactory.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/observation/ParameterFactory.java @@ -40,6 +40,7 @@ import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -212,6 +213,11 @@ public ValuedParameter visit(ProfileValue value) throws OwsExceptionReport { throw notSupported(value); } + @Override + public ValuedParameter visit(QuantityRangeValue value) throws OwsExceptionReport { + throw notSupported(value); + } + private OwsExceptionReport notSupported(Value value) throws OwsExceptionReport { throw new NoApplicableCodeException() diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/series/SeriesParameterFactory.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/series/SeriesParameterFactory.java index e6675d952a..b70fedf884 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/series/SeriesParameterFactory.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/entities/parameter/series/SeriesParameterFactory.java @@ -40,6 +40,7 @@ import org.n52.sos.ogc.om.values.MultiPointCoverage; import org.n52.sos.ogc.om.values.NilTemplateValue; import org.n52.sos.ogc.om.values.ProfileValue; +import org.n52.sos.ogc.om.values.QuantityRangeValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.RectifiedGridCoverage; import org.n52.sos.ogc.om.values.ReferenceValue; @@ -212,6 +213,11 @@ public ValuedParameter visit(ProfileValue value) throws OwsExceptionReport { throw notSupported(value); } + @Override + public ValuedParameter visit(QuantityRangeValue value) throws OwsExceptionReport { + throw notSupported(value); + } + private OwsExceptionReport notSupported(Value value) throws OwsExceptionReport { throw new NoApplicableCodeException() diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/HibernateObservationUtilities.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/HibernateObservationUtilities.java index 46478e130f..b6a0fe7bfe 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/HibernateObservationUtilities.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/HibernateObservationUtilities.java @@ -169,6 +169,22 @@ public static Collection createSosObservationFromERepor public static List unfoldObservation(OmObservation o) throws OwsExceptionReport { return new ObservationUnfolder(o).unfold(); } + + /** + * Unfold observation with MultiObservationValue to multiple observations + * with SingleObservationValue + * + * @param o + * OmObservation to unfold + * @param complexToSingleProfiles + * If a complex value should be converted to single profile observations. + * @return OmObservation list + * @throws OwsExceptionReport + * If unfolding fails + */ + public static List unfoldObservation(OmObservation o, boolean complexToSingleProfiles) throws OwsExceptionReport { + return new ObservationUnfolder(o).unfold(complexToSingleProfiles); + } /** * Get observation ids from observation objects diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationUnfolder.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationUnfolder.java index c5cfcab22f..fe8601112c 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationUnfolder.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationUnfolder.java @@ -34,25 +34,38 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; +import java.util.TreeMap; +import org.joda.time.DateTime; +import org.joda.time.Minutes; +import org.n52.sos.ds.hibernate.dao.observation.ValueCreatingSweDataComponentVisitor; import org.n52.sos.exception.CodedException; import org.n52.sos.exception.ows.NoApplicableCodeException; import org.n52.sos.ogc.gml.AbstractFeature; import org.n52.sos.ogc.gml.CodeWithAuthority; +import org.n52.sos.ogc.gml.ReferenceType; import org.n52.sos.ogc.gml.time.Time; import org.n52.sos.ogc.gml.time.TimeInstant; import org.n52.sos.ogc.gml.time.TimePeriod; import org.n52.sos.ogc.om.MultiObservationValues; +import org.n52.sos.ogc.om.NamedValue; +import org.n52.sos.ogc.om.ObservationMergeIndicator; +import org.n52.sos.ogc.om.ObservationMerger; import org.n52.sos.ogc.om.ObservationValue; import org.n52.sos.ogc.om.OmConstants; +import org.n52.sos.ogc.om.OmObservableProperty; import org.n52.sos.ogc.om.OmObservation; import org.n52.sos.ogc.om.OmObservationConstellation; +import org.n52.sos.ogc.om.ParameterHolder; import org.n52.sos.ogc.om.SingleObservationValue; import org.n52.sos.ogc.om.features.samplingFeatures.SamplingFeature; import org.n52.sos.ogc.om.values.BooleanValue; import org.n52.sos.ogc.om.values.CategoryValue; import org.n52.sos.ogc.om.values.ComplexValue; import org.n52.sos.ogc.om.values.CountValue; +import org.n52.sos.ogc.om.values.ProfileLevel; +import org.n52.sos.ogc.om.values.ProfileValue; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.SweDataArrayValue; import org.n52.sos.ogc.om.values.TextValue; @@ -95,6 +108,7 @@ */ public class ObservationUnfolder { private final OmObservation multiObservation; + private final SweHelper helper = new SweHelper(); public ObservationUnfolder(OmObservation multiObservation) { @@ -102,12 +116,17 @@ public ObservationUnfolder(OmObservation multiObservation) { } public List unfold() throws OwsExceptionReport { + return unfold(false); + } + + public List unfold(boolean complexToSingleProfiles) throws OwsExceptionReport { if (multiObservation.getValue() instanceof SingleObservationValue) { return Collections.singletonList(multiObservation); } else { final List observationCollection = new ArrayList(); Map features = new HashMap<>(); Map procedures = new HashMap<>(); + boolean complex = false; if (((MultiObservationValues) multiObservation.getValue()).getValue() instanceof SweDataArrayValue) { final SweDataArrayValue arrayValue = (SweDataArrayValue) ((MultiObservationValues) multiObservation.getValue()).getValue(); @@ -130,9 +149,9 @@ public List unfold() throws OwsExceptionReport { final Map, String> definitionsForObservedValues = Maps.newHashMap(); Value observedValue = null; GeometryHolder samplingGeometry = new GeometryHolder(); + ParameterHolder parameterHolder = new ParameterHolder(); String featureOfInterest = null; String procedure = null; - for (SweField field : elementType.getFields()) { final SweAbstractDataComponent dataComponent = field.getElement(); String token = block.get(tokenIndex.get()); @@ -186,13 +205,20 @@ else if (dataComponent instanceof SweAbstractSimpleType) { } else if (dataComponent instanceof SweText && dataComponent.getDefinition().contains("om:procedure")) { procedure = token; + } else if (dataComponent instanceof SweQuantity && checkDefinitionForDephtHeight(field)) { + parseFieldAsParameter(field, token, parameterHolder); } else { observedValue = parseSweAbstractSimpleType(dataComponent, token); } } else if (dataComponent instanceof SweDataRecord) { try { - observedValue = - parseSweDataRecord(((SweDataRecord) dataComponent).clone(), block, tokenIndex); + if (dataComponent.getDefinition().contains(OmConstants.OM_PARAMETER)) { + parseDataRecordAsParameter((SweDataRecord) dataComponent, block, tokenIndex, + parameterHolder); + } else { + observedValue = parseSweDataRecord(((SweDataRecord) dataComponent).clone(), block, + tokenIndex, parameterHolder); + } } catch (CloneNotSupportedException e) { throw new NoApplicableCodeException().causedBy(e).withMessage( "Unable to copy element '%s'.", dataComponent.getClass().getName()); @@ -210,41 +236,122 @@ else if (dataComponent instanceof SweAbstractSimpleType) { dataComponent != null ? dataComponent.getClass().getName() : "null"); } if (observedValue != null) { + definitionsForObservedValues.put(observedValue, dataComponent.getDefinition()); observedValues.add(observedValue); observedValue = null; } - tokenIndex.incrementAndGet(); + tokenIndex.incrementAndGet(); } for (final Value iValue : observedValues) { - final OmObservation newObservation = - createSingleValueObservation(multiObservation, phenomenonTime, resultTime, iValue); - if (samplingGeometry != null && samplingGeometry.hasGeometry()) { - newObservation.addSpatialFilteringProfileParameter(samplingGeometry.getGeometry()); - } - if (!Strings.isNullOrEmpty(featureOfInterest)) { - if (!features.containsKey(featureOfInterest)) { - features.put(featureOfInterest, new SamplingFeature(new CodeWithAuthority(featureOfInterest))); + List newObservations = new ArrayList<>(); + if (isProfileObservations(parameterHolder)) { + if (iValue instanceof ComplexValue && complexToSingleProfiles) { + complex = true; + for (SweField field : ((ComplexValue) iValue).getValue().getFields()) { + if (!checkDefinitionForDephtHeight(field)) { + String definition = field.getElement().getDefinition(); + newObservations + .add(createSingleValueObservation(multiObservation, phenomenonTime, + resultTime, definition, + convertToProfileValue( + field.accept(ValueCreatingSweDataComponentVisitor + .getInstance()), + samplingGeometry, phenomenonTime, parameterHolder))); + } + } + + } else { + newObservations.add(createSingleValueObservation(multiObservation, phenomenonTime, + resultTime, convertToProfileValue(iValue, samplingGeometry, phenomenonTime, + parameterHolder))); } - newObservation.getObservationConstellation() - .setFeatureOfInterest(features.get(featureOfInterest)); + if (parameterHolder.isSetHeightDepthParameter()) { + parameterHolder.removeParameter(parameterHolder.getHeightDepthParameter()); + } + if (parameterHolder.isSetFromToParameter()) { + parameterHolder.removeParameter(parameterHolder.getFromParameter()); + parameterHolder.removeParameter(parameterHolder.getToParameter()); + } + + } else { + newObservations.add(createSingleValueObservation(multiObservation, phenomenonTime, + resultTime, iValue)); } - if (!Strings.isNullOrEmpty(procedure)) { - if (!procedures.containsKey(procedure)) { - procedures.put(procedure, new SensorML().setIdentifier(procedure)); + for (OmObservation newObservation : newObservations) { + if (samplingGeometry != null && samplingGeometry.hasGeometry()) { + newObservation.addSpatialFilteringProfileParameter(samplingGeometry.getGeometry()); + } + if (!Strings.isNullOrEmpty(featureOfInterest)) { + if (!features.containsKey(featureOfInterest)) { + features.put(featureOfInterest, + new SamplingFeature(new CodeWithAuthority(featureOfInterest))); + } + newObservation.getObservationConstellation() + .setFeatureOfInterest(features.get(featureOfInterest)); } - newObservation.getObservationConstellation().setProcedure(procedures.get(procedure)); + if (!Strings.isNullOrEmpty(procedure)) { + if (!procedures.containsKey(procedure)) { + procedures.put(procedure, new SensorML().setIdentifier(procedure)); + } + newObservation.getObservationConstellation().setProcedure(procedures.get(procedure)); + } + if (parameterHolder.isSetParameter()) { + newObservation.setParameter(parameterHolder.getParameter()); + } + observationCollection.add(newObservation); } - observationCollection.add(newObservation); } featureOfInterest = null; procedure = null; } } + if (isProfileObservations()) { + if (complex) { + List observations = new ArrayList<>(); + for (List list : getProfileLists(observationCollection)) { + observations.addAll(new ObservationMerger().mergeObservations(list, + ObservationMergeIndicator.defaultObservationMergerIndicator())); + } + return observations; + } else { + return new ObservationMerger().mergeObservations(observationCollection, + ObservationMergeIndicator.defaultObservationMergerIndicator().setPhenomenonTime(true)); + } + } return observationCollection; } } + private List> getProfileLists(List observationCollection) { + List> list = new ArrayList<>(); + Map map = getMap(observationCollection); + DateTime currentTime = null; + List currentObservations = new ArrayList<>(); + for (Entry entry : map.entrySet()) { + if (currentTime != null && Minutes.minutesBetween(currentTime, entry.getKey()).getMinutes() > 5) { + list.add(Lists.newArrayList(currentObservations)); + currentObservations.clear(); + } + currentObservations.add(entry.getValue()); + currentTime = entry.getKey(); + } + list.add(Lists.newArrayList(currentObservations)); + return list; + } + + private Map getMap(List observationCollection) { + Map map = new TreeMap<>(); + for (OmObservation omObservation : observationCollection) { + if (omObservation.getPhenomenonTime() instanceof TimeInstant) { + map.put(((TimeInstant) omObservation.getPhenomenonTime()).getValue(), omObservation); + } else if (omObservation.getPhenomenonTime() instanceof TimePeriod) { + map.put(((TimePeriod) omObservation.getPhenomenonTime()).getStart(), omObservation); + } + } + return map; + } + private Value parseSweAbstractSimpleType(SweAbstractDataComponent dataComponent, String token) throws CodedException { Value observedValue = null; @@ -267,13 +374,17 @@ private Value parseSweAbstractSimpleType(SweAbstractDataComponent dataCompone return observedValue; } - private Value parseSweDataRecord(SweDataRecord record, List block, IncDecInteger tokenIndex) - throws CodedException { + private Value parseSweDataRecord(SweDataRecord record, List block, IncDecInteger tokenIndex, + ParameterHolder parameterHolder) throws CodedException { boolean tokenIndexIncreased = false; for (SweField field : record.getFields()) { String token = block.get(tokenIndex.get()); if (field.getElement() instanceof SweQuantity) { - ((SweQuantity) field.getElement()).setValue(Double.parseDouble(token)); + if (checkDefinitionForDephtHeight(field)) { + parseFieldAsParameter(field, token, parameterHolder); + } else { + ((SweQuantity) field.getElement()).setValue(Double.parseDouble(token)); + } } else if (field.getElement() instanceof SweBoolean) { ((SweBoolean) field.getElement()).setValue(Boolean.parseBoolean(token)); } else if (field.getElement() instanceof SweText) { @@ -283,7 +394,7 @@ private Value parseSweDataRecord(SweDataRecord record, List block, In } else if (field.getElement() instanceof SweCount) { ((SweCount) field.getElement()).setValue(Integer.parseInt(token)); } else { - throw new NoApplicableCodeException().withMessage("sweField type '%s' not supported", + throw new NoApplicableCodeException().withMessage("sweField type '%s' not yet supported", field != null ? field.getClass().getName() : "null"); } tokenIndex.incrementAndGet(); @@ -296,30 +407,41 @@ private Value parseSweDataRecord(SweDataRecord record, List block, In return new ComplexValue(record); } - @SuppressWarnings({ "unchecked", "rawtypes" }) private OmObservation createSingleValueObservation(final OmObservation multiObservation, final Time phenomenonTime, TimeInstant resultTime, final Value iValue) throws CodedException { - final ObservationValue value = new SingleObservationValue(phenomenonTime, iValue); - final OmObservation newObservation = new OmObservation(); - newObservation.setNoDataValue(multiObservation.getNoDataValue()); + return createSingleValueObservation(multiObservation, phenomenonTime, resultTime, + getObservationConstellation(multiObservation), iValue); + } + + private OmObservation createSingleValueObservation(final OmObservation multiObservation, final Time phenomenonTime, + TimeInstant resultTime, String observedProperty, final Value iValue) throws CodedException { /* * TODO create new ObservationConstellation only with the specified * observed property and observation type */ - OmObservationConstellation obsConst = multiObservation.getObservationConstellation(); + OmObservationConstellation obsConst = getObservationConstellation(multiObservation); + // change observedProperty + obsConst.setObservableProperty(new OmObservableProperty(observedProperty)); + + return createSingleValueObservation(multiObservation, phenomenonTime, resultTime, obsConst, iValue); + } + + private OmObservationConstellation getObservationConstellation(OmObservation multiObservation2) + throws CodedException { try { - obsConst = multiObservation.getObservationConstellation().clone(); + return multiObservation.getObservationConstellation().clone(); } catch (CloneNotSupportedException e) { - throw new NoApplicableCodeException() - .causedBy(e) - .withMessage("Error while cloning %s!", OmObservationConstellation.class.getName()); + throw new NoApplicableCodeException().causedBy(e).withMessage("Error while cloning %s!", + OmObservationConstellation.class.getName()); } - - /* - * createObservationConstellationForSubObservation ( multiObservation . - * getObservationConstellation ( ) , iValue , - * definitionsForObservedValues . get ( iValue ) ) - */ + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + private OmObservation createSingleValueObservation(final OmObservation multiObservation, final Time phenomenonTime, + TimeInstant resultTime, OmObservationConstellation obsConst, final Value iValue) throws CodedException { + final ObservationValue value = new SingleObservationValue(phenomenonTime, iValue); + final OmObservation newObservation = new OmObservation(); + newObservation.setNoDataValue(multiObservation.getNoDataValue()); newObservation.setObservationConstellation(obsConst); newObservation.setValidTime(multiObservation.getValidTime()); if (resultTime != null && !resultTime.isEmpty()) { @@ -361,7 +483,7 @@ private void parseSweVectorAsGeometry(SweVector sweVector, List block, I holder.setLongitude(value); } } else { - throw new NoApplicableCodeException().withMessage("sweField type '%s' not supported", + throw new NoApplicableCodeException().withMessage("sweField type '%s' not yet supported", coordinate != null ? coordinate.getClass().getName() : "null"); } tokenIndex.incrementAndGet(); @@ -375,7 +497,120 @@ private void parseSweVectorAsGeometry(SweVector sweVector, List block, I } } - + private void parseDataRecordAsParameter(SweDataRecord record, List block, IncDecInteger tokenIndex, + ParameterHolder parameterHolder) throws CodedException { + boolean tokenIndexIncreased = false; + for (SweField field : record.getFields()) { + String token = block.get(tokenIndex.get()); + parseFieldAsParameter(field, token, parameterHolder); + tokenIndex.incrementAndGet(); + tokenIndexIncreased = true; + } + // decrease token index because it is increased in the calling method. + if (tokenIndexIncreased) { + tokenIndex.decrementAndGet(); + } + } + + private boolean parseFieldAsParameter(SweField field, String token, ParameterHolder parameterHolder) + throws CodedException { + Value value = null; + ReferenceType name = new ReferenceType(field.getElement().getDefinition()); + if (field.getElement() instanceof SweQuantity) { + value = new QuantityValue(Double.parseDouble(token), ((SweQuantity) field.getElement()).getUomObject()); + } else if (field.getElement() instanceof SweBoolean) { + value = new BooleanValue(Boolean.parseBoolean(token)); + } else if (field.getElement() instanceof SweText) { + value = new TextValue(token); + } else if (field.getElement() instanceof SweCategory) { + value = new CategoryValue(token); + } else if (field.getElement() instanceof SweCount) { + value = new CountValue(Integer.parseInt(token)); + } else { + throw new NoApplicableCodeException().withMessage("sweField type '%s' not yet supported", + field != null ? field.getClass().getName() : "null"); + } + parameterHolder.addParameter(new NamedValue<>(getParameterName(name), value)); + return true; + } + + private Value convertToProfileValue(Value value, GeometryHolder samplingGeometry, Time phenomenonTime, + ParameterHolder parameterHolder) throws OwsExceptionReport { + ProfileLevel profileLevel = new ProfileLevel(); + profileLevel.setLocation(samplingGeometry.getGeometry()); + profileLevel.setPhenomenonTime(phenomenonTime); + if (value instanceof ComplexValue) { + for (SweField field : ((ComplexValue) value).getValue().getFields()) { + if (!checkDefinitionForDephtHeight(field)) { + Value levelValue = field.accept(ValueCreatingSweDataComponentVisitor.getInstance()); + if (levelValue instanceof SweAbstractDataComponent) { + String definition = field.getElement().getDefinition(); + ((SweAbstractDataComponent) levelValue).setIdentifier(definition); + ((SweAbstractDataComponent) levelValue).setDefinition(definition); + } + } + } + } else { + profileLevel.addValue(value); + } + if (parameterHolder.isSetHeightDepthParameter()) { + if (parameterHolder.isSetHeightParameter()) { + profileLevel.setLevelStart(toQuantityValue(parameterHolder.getHeightParameter())); + } + if (parameterHolder.isSetDepthParameter()) { + profileLevel.setLevelStart(toQuantityValue(parameterHolder.getDepthParameter())); + } + } else if (parameterHolder.isSetFromToParameter()) { + profileLevel.setLevelStart(toQuantityValue(parameterHolder.getFromParameter())); + profileLevel.setLevelEnd(toQuantityValue(parameterHolder.getToParameter())); + } + return new ProfileValue().addValue(profileLevel); + } + + private QuantityValue toQuantityValue(NamedValue parameter) { + QuantityValue value = (QuantityValue) parameter.getValue(); + value.setDefinition(parameter.getName().getHref()); + return value; + } + + private boolean isProfileObservations() { + return multiObservation.getObservationConstellation().isSetObservationType() && multiObservation + .getObservationConstellation().getObservationType().equals(OmConstants.OBS_TYPE_PROFILE_OBSERVATION); + } + + private boolean isProfileObservations(ParameterHolder parameterHolder) { + if (isProfileObservations() + || (multiObservation.getObservationConstellation().isSetObservationType() + && multiObservation.getObservationConstellation().getObservationType() + .equals(OmConstants.OBS_TYPE_COMPLEX_OBSERVATION) + && parameterHolder.isSetHeightDepthParameter())) { + multiObservation.getObservationConstellation() + .setObservationType(OmConstants.OBS_TYPE_PROFILE_OBSERVATION); + return true; + } + return false; + } + + private boolean checkDefinitionForDephtHeight(SweField field) { + return field != null && field.getElement().isSetDefinition() + && (field.getElement().getDefinition().contains("depth") + || field.getElement().getDefinition().contains("height") + || field.getElement().getDefinition().equalsIgnoreCase("from") + || field.getElement().getDefinition().equalsIgnoreCase("to")); + } + + private ReferenceType getParameterName(ReferenceType name) { + if (name.getHref().contains("depth")) { + return (ReferenceType) new ReferenceType().setHref("depth"); + } else if (name.getHref().contains("height")) { + return (ReferenceType) new ReferenceType().setHref("height"); + } else if (name.getHref().equalsIgnoreCase("from")) { + return (ReferenceType) new ReferenceType().setHref("from"); + } else if (name.getHref().equalsIgnoreCase("to")) { + return (ReferenceType) new ReferenceType().setHref("to"); + } + return name; + } public class GeometryHolder { private Double latitude; diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationValueCreator.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationValueCreator.java index 798ee61d85..ee63c0f30a 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationValueCreator.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/ObservationValueCreator.java @@ -39,6 +39,7 @@ import org.n52.sos.ds.hibernate.entities.observation.series.valued.CategoryValuedSeriesObservation; import org.n52.sos.ds.hibernate.entities.observation.series.valued.GeometryValuedSeriesObservation; import org.n52.sos.ds.hibernate.entities.observation.series.valued.NumericValuedSeriesObservation; +import org.n52.sos.ds.hibernate.entities.observation.series.valued.ReferenceValuedSeriesObservation; import org.n52.sos.ds.hibernate.entities.observation.series.valued.TextValuedSeriesObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.BlobValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.BooleanValuedObservation; @@ -49,6 +50,7 @@ import org.n52.sos.ds.hibernate.entities.observation.valued.IdentifierNamDescription; import org.n52.sos.ds.hibernate.entities.observation.valued.NumericValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.ProfileValuedObservation; +import org.n52.sos.ds.hibernate.entities.observation.valued.ReferenceValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.SweDataArrayValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.TextValuedObservation; import org.n52.sos.ogc.UoM; @@ -59,6 +61,7 @@ import org.n52.sos.ogc.om.values.GeometryValue; import org.n52.sos.ogc.om.values.ProfileValue; import org.n52.sos.ogc.om.values.QuantityValue; +import org.n52.sos.ogc.om.values.ReferenceValue; import org.n52.sos.ogc.om.values.SweDataArrayValue; import org.n52.sos.ogc.om.values.TextValue; import org.n52.sos.ogc.om.values.UnknownValue; @@ -164,6 +167,14 @@ public ProfileValue visit(ProfileValuedObservation o) throws OwsExceptionReport return ProfileGeneratorSplitter.create(o); } + @Override + public ReferenceValue visit(ReferenceValuedObservation o) { + ReferenceValue v = new ReferenceValue(o.getValue()); + if (!addUnit(o, v) && o instanceof ReferenceValuedSeriesObservation && ((ReferenceValuedSeriesObservation) o).getSeries().isSetUnit()) { + v.setUnit(getUnit(((ReferenceValuedSeriesObservation) o).getSeries().getUnit())); + } + return v; + } @SuppressWarnings("rawtypes") protected void addAdditonalData(IdentifierNamDescription o, SweAbstractSimpleType v) { diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/SweAbstractDataComponentCreator.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/SweAbstractDataComponentCreator.java index 421e7707bb..132fdfe794 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/SweAbstractDataComponentCreator.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/observation/SweAbstractDataComponentCreator.java @@ -44,6 +44,7 @@ import org.n52.sos.ds.hibernate.entities.observation.valued.GeometryValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.NumericValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.ProfileValuedObservation; +import org.n52.sos.ds.hibernate.entities.observation.valued.ReferenceValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.SweDataArrayValuedObservation; import org.n52.sos.ds.hibernate.entities.observation.valued.TextValuedObservation; import org.n52.sos.exception.ows.NoApplicableCodeException; @@ -148,6 +149,17 @@ public SweDataArray visit(SweDataArrayValuedObservation o) public SweAbstractDataComponent visit(ProfileValuedObservation o) throws OwsExceptionReport { return ProfileGeneratorSplitter.createValue(o); } + + @Override + public SweCategory visit(ReferenceValuedObservation o) { + SweCategory component = new SweCategory(); + if (o.isSetHref()) { + component.setValue(o.getHref()); + } else if (o.isSetTitle()) { + component.setValue(o.getTitle()); + } + return setCommonValues(component, o); + } protected T setCommonValues( T component, ValuedObservation valuedObservation) { diff --git a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/create/GeneratedDescriptionCreationStrategy.java b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/create/GeneratedDescriptionCreationStrategy.java index 6953771d44..c5929da338 100644 --- a/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/create/GeneratedDescriptionCreationStrategy.java +++ b/hibernate/common/src/main/java/org/n52/sos/ds/hibernate/util/procedure/create/GeneratedDescriptionCreationStrategy.java @@ -53,7 +53,9 @@ public class GeneratedDescriptionCreationStrategy implements public SosProcedureDescription create(Procedure p, String descriptionFormat, Locale i18n, Session s) throws OwsExceptionReport { SosProcedureDescription desc = getFactory(descriptionFormat).create(p, i18n, s); - desc.setDescriptionFormat(descriptionFormat); + if (Strings.isNullOrEmpty(desc.getDescriptionFormat())) { + desc.setDescriptionFormat(descriptionFormat); + } return desc; } diff --git a/hibernate/dao/pom.xml b/hibernate/dao/pom.xml index 6b0bc1bd69..94dfe31a06 100644 --- a/hibernate/dao/pom.xml +++ b/hibernate/dao/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate - 4.4.0 + 4.4.1 4.0.0 hibernate-dao @@ -42,6 +42,11 @@ hibernate-h2 test + + ${project.groupId} + sqlite-config + test + ${project.groupId} test diff --git a/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/InsertResultDAO.java b/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/InsertResultDAO.java index 70e81234fc..bc459cf776 100644 --- a/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/InsertResultDAO.java +++ b/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/InsertResultDAO.java @@ -39,15 +39,22 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.n52.sos.coding.CodingRepository; +import org.n52.sos.config.SettingsManager; import org.n52.sos.ds.AbstractInsertResultDAO; import org.n52.sos.ds.HibernateDatasourceConstants; import org.n52.sos.ds.hibernate.dao.DaoFactory; import org.n52.sos.ds.hibernate.dao.FeatureOfInterestDAO; +import org.n52.sos.ds.hibernate.dao.ObservablePropertyDAO; import org.n52.sos.ds.hibernate.dao.ObservationConstellationDAO; +import org.n52.sos.ds.hibernate.dao.ObservationTypeDAO; +import org.n52.sos.ds.hibernate.dao.OfferingDAO; +import org.n52.sos.ds.hibernate.dao.ProcedureDAO; import org.n52.sos.ds.hibernate.dao.ResultTemplateDAO; import org.n52.sos.ds.hibernate.dao.observation.AbstractObservationDAO; import org.n52.sos.ds.hibernate.entities.Codespace; +import org.n52.sos.ds.hibernate.entities.ObservableProperty; import org.n52.sos.ds.hibernate.entities.ObservationConstellation; +import org.n52.sos.ds.hibernate.entities.Offering; import org.n52.sos.ds.hibernate.entities.Procedure; import org.n52.sos.ds.hibernate.entities.ResultTemplate; import org.n52.sos.ds.hibernate.entities.Unit; @@ -66,6 +73,7 @@ import org.n52.sos.ogc.om.OmObservationConstellation; import org.n52.sos.ogc.om.SingleObservationValue; import org.n52.sos.ogc.om.features.samplingFeatures.SamplingFeature; +import org.n52.sos.ogc.om.values.ProfileValue; import org.n52.sos.ogc.om.values.SweDataArrayValue; import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.ogc.sensorML.SensorML; @@ -91,6 +99,7 @@ import org.n52.sos.ogc.swe.simpleType.SweText; import org.n52.sos.request.InsertResultRequest; import org.n52.sos.response.InsertResultResponse; +import org.n52.sos.service.ServiceConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -150,6 +159,7 @@ public synchronized InsertResultResponse insertResult(final InsertResultRequest } final ObservationConstellationDAO obsConstDao = new ObservationConstellationDAO(); + final ObservationTypeDAO obsTypeDao = new ObservationTypeDAO(); Map obsConsts = new HashMap<>(); int insertion = 0; @@ -160,8 +170,12 @@ public synchronized InsertResultResponse insertResult(final InsertResultRequest for (final OmObservation observation : observations) { OmObservationConstellation omObsConst = observation.getObservationConstellation(); if (!obsConsts.containsKey(omObsConst)) { - obsConsts.put(omObsConst, - obsConstDao.getObservationConstellation(omObsConst, session)); + ObservationConstellation oc = obsConstDao.getObservationConstellation(omObsConst, session); + if (oc != null) { + obsConsts.put(omObsConst, oc); + } else if (oc == null && isConvertComplexProfileToSingleProfiles() && observation.isSetValue() && observation.getValue().isSetValue() && observation.getValue().getValue() instanceof ProfileValue) { + obsConsts.put(omObsConst, insertObservationConstellationForProfiles(obsConstDao, obsTypeDao, observation, session)); + } } ObservationConstellation obsConst = obsConsts.get(observation.getObservationConstellation()); AbstractFeatureOfInterest feature = null; @@ -271,7 +285,8 @@ private OmObservation getSingleObservationFromResultValues(final String version, protected List getSingleObservationsFromObservation(final OmObservation observation) throws OwsExceptionReport { try { - return HibernateObservationUtilities.unfoldObservation(observation); + + return HibernateObservationUtilities.unfoldObservation(observation, isConvertComplexProfileToSingleProfiles()); } catch (final Exception e) { throw new InvalidParameterValueException() .causedBy(e) @@ -526,6 +541,23 @@ private String[] separateValues(final String values, final String separator) { return values.split(separator); } + private ObservationConstellation insertObservationConstellationForProfiles(ObservationConstellationDAO obsConstDao, + ObservationTypeDAO obsTypeDao, OmObservation o, Session session) { + Procedure procedure = new ProcedureDAO().getProcedureForIdentifier(o.getObservationConstellation().getProcedureIdentifier(), session); + ObservableProperty observableProperty = new ObservablePropertyDAO().getOrInsertObservableProperty(o.getObservationConstellation().getObservableProperty(), session); + Offering offering = new OfferingDAO().getOfferingForIdentifier(o.getObservationConstellation().getOfferings().iterator().next(), session); + + ObservationConstellation oc = obsConstDao.checkOrInsertObservationConstellation(procedure, observableProperty, offering, false, session); + if (o.getObservationConstellation().isSetObservationType()) { + oc.setObservationType(obsTypeDao.getObservationTypeObject(o.getObservationConstellation().getObservationType(), session)); + } + return oc; + } + + private boolean isConvertComplexProfileToSingleProfiles() { + return ServiceConfiguration.getInstance().isConvertComplexProfileToSingleProfiles(); + } + @Override public CapabilitiesExtension getExtension() { final SosInsertionCapabilities insertionCapabilities = new SosInsertionCapabilities(); @@ -552,5 +584,7 @@ public boolean hasRelatedOperation() { public String getRelatedOperation() { return getOperationName(); } + + } diff --git a/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/InsertResultTemplateDAO.java b/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/InsertResultTemplateDAO.java index 548931903a..73fa39b0c0 100644 --- a/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/InsertResultTemplateDAO.java +++ b/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/InsertResultTemplateDAO.java @@ -224,9 +224,9 @@ private void checkResultStructure(SosResultStructure resultStructure, String obs "Supported resultStructure is swe:field content swe:Time or swe:TimeRange with element definition '%s', " + " optional swe:Time with element definition '%s' and swe:field content swe:AbstractSimpleComponent or swe:DataRecord " + "with element definition '%s' or swe:Vector with element defintion '%s' or swe:Text with element definitions " - + "'%s' and '%s'!", + + "'%s' and '%s' and swe:DataRecord with element definition '%s'!", OmConstants.PHENOMENON_TIME, OmConstants.RESULT_TIME, observedProperty, OmConstants.PARAM_NAME_SAMPLING_GEOMETRY, - helper.OM_FEATURE_OF_INTEREST, helper.OM_PROCEDURE); + helper.OM_FEATURE_OF_INTEREST, helper.OM_PROCEDURE, OmConstants.OM_PARAMETER); } } @@ -248,6 +248,9 @@ private int getAllowedSize(SweDataRecord record) throws CodedException { additionalValues++; } } + if (helper.checkDataRecordForParameter(swefield)) { + additionalValues++; + } } return allowedSize + additionalValues; } diff --git a/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/cache/base/OfferingCacheUpdateTask.java b/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/cache/base/OfferingCacheUpdateTask.java index 01a8d2217f..d5bfdbfa9a 100644 --- a/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/cache/base/OfferingCacheUpdateTask.java +++ b/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/cache/base/OfferingCacheUpdateTask.java @@ -302,6 +302,12 @@ private Set getObservationTypesFromObservations(Session session) throws observationTypes.add(OmConstants.OBS_TYPE_GEOMETRY_OBSERVATION); } else if (observationDAO.checkSweDataArrayObservationsFor(offeringId, session)) { observationTypes.add(OmConstants.OBS_TYPE_SWE_ARRAY_OBSERVATION); + } else if (observationDAO.checkComplexObservationsFor(offeringId, session)) { + observationTypes.add(OmConstants.OBS_TYPE_COMPLEX_OBSERVATION); + } else if (observationDAO.checkProfileObservationsFor(offeringId, session)) { + observationTypes.add(OmConstants.OBS_TYPE_PROFILE_OBSERVATION); + } else if (observationDAO.checkReferenceObservationsFor(offeringId, session)) { + observationTypes.add(OmConstants.OBS_TYPE_REFERENCE_OBSERVATION); } return observationTypes; } diff --git a/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/util/ResultHandlingHelper.java b/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/util/ResultHandlingHelper.java index 78d63e35f4..b48f8f4cc9 100644 --- a/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/util/ResultHandlingHelper.java +++ b/hibernate/dao/src/main/java/org/n52/sos/ds/hibernate/util/ResultHandlingHelper.java @@ -462,11 +462,12 @@ private SweVector getVector(List fields) throws CodedException { } public boolean checkDataRecordForObservedProperty(SweField swefield, String observedProperty) throws CodedException { - if (isDataRecord(swefield) && !checkDefinition(swefield, observedProperty)) { + if (isDataRecord(swefield) && !checkDefinition(swefield, observedProperty) && !checkDataRecordForParameter(swefield)) { throw new NoApplicableCodeException().at(Sos2Constants.InsertResultTemplateParams.resultStructure) .withMessage( - "The swe:DataRecord element is currently only supported for the definition of the observedProperty and the definition should be '%s'!", - observedProperty); + "The swe:DataRecord element is currently only supported for the definition of the observedProperty and om:parameter. " + + "The definition should be '%s' or '%s'!", + observedProperty, OmConstants.PARAMETER); } return true; } @@ -520,6 +521,14 @@ public boolean isVector(SweField sweField) { return sweField.getElement() instanceof SweVector; } + public boolean checkDataRecordForParameter(SweField swefield) throws CodedException { + if (isDataRecord(swefield) && !checkDefinition(swefield, OmConstants.OM_PARAMETER)) { + return false; + } + return true; + + } + private GeometryHandler getGeomtryHandler() { return GeometryHandler.getInstance(); } diff --git a/hibernate/dao/src/main/resources/META-INF/services/org.n52.sos.config.SettingDefinitionProvider b/hibernate/dao/src/main/resources/META-INF/services/org.n52.sos.config.SettingDefinitionProvider index 241a5f928c..963e959972 100644 --- a/hibernate/dao/src/main/resources/META-INF/services/org.n52.sos.config.SettingDefinitionProvider +++ b/hibernate/dao/src/main/resources/META-INF/services/org.n52.sos.config.SettingDefinitionProvider @@ -1 +1,2 @@ -org.n52.sos.ds.hibernate.values.HibernateStreamingSettings \ No newline at end of file +org.n52.sos.ds.hibernate.values.HibernateStreamingSettings +org.n52.sos.service.MiscSettings \ No newline at end of file diff --git a/hibernate/dao/src/test/java/org/n52/sos/ds/hibernate/InsertDAOTest.java b/hibernate/dao/src/test/java/org/n52/sos/ds/hibernate/InsertDAOTest.java index d4be72fb00..26e45757fe 100644 --- a/hibernate/dao/src/test/java/org/n52/sos/ds/hibernate/InsertDAOTest.java +++ b/hibernate/dao/src/test/java/org/n52/sos/ds/hibernate/InsertDAOTest.java @@ -46,6 +46,7 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -253,7 +254,6 @@ public static List data() { @Before public void setUp() throws OwsExceptionReport, ConverterException { - Session session = getSession(); insertSensor(PROCEDURE1, OFFERING1, OBSPROP1, null); insertSensor(PROCEDURE2, OFFERING2, OBSPROP2, PROCEDURE1); diff --git a/hibernate/dao/src/test/java/org/n52/sos/ds/hibernate/InsertResultDAOTest.java b/hibernate/dao/src/test/java/org/n52/sos/ds/hibernate/InsertResultDAOTest.java index 0506ac67c0..5c64103dbc 100644 --- a/hibernate/dao/src/test/java/org/n52/sos/ds/hibernate/InsertResultDAOTest.java +++ b/hibernate/dao/src/test/java/org/n52/sos/ds/hibernate/InsertResultDAOTest.java @@ -31,9 +31,13 @@ import java.util.HashMap; import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; import org.junit.Test; +import org.n52.sos.config.SettingsManager; import org.n52.sos.exception.CodedException; import org.n52.sos.ogc.om.OmConstants; +import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.ogc.swe.SweDataRecord; import org.n52.sos.ogc.swe.SweField; import org.n52.sos.ogc.swe.simpleType.SweQuantity; @@ -49,6 +53,16 @@ public class InsertResultDAOTest extends HibernateTestCase { private InsertResultDAO insertResultDAO = new InsertResultDAO(); + @After + public void tearDown() throws OwsExceptionReport, InterruptedException { + H2Configuration.truncate(); + } + + @AfterClass + public static void cleanUp() { + H2Configuration.recreate(); + } + @Test public void test_getIndexForObservedPropertyAndUnit_SimpleObservation() throws CodedException { final SweDataRecord record = createRecordWithSimpleObservation(); diff --git a/hibernate/datasource/common/pom.xml b/hibernate/datasource/common/pom.xml index cdb6814238..9071ac33eb 100644 --- a/hibernate/datasource/common/pom.xml +++ b/hibernate/datasource/common/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate-datasource - 4.4.0 + 4.4.1 4.0.0 hibernate-datasource-common diff --git a/hibernate/datasource/h2/pom.xml b/hibernate/datasource/h2/pom.xml index 0dc9b35d61..ed00077319 100644 --- a/hibernate/datasource/h2/pom.xml +++ b/hibernate/datasource/h2/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate-datasource - 4.4.0 + 4.4.1 4.0.0 hibernate-datasource-h2 diff --git a/hibernate/datasource/mysql/pom.xml b/hibernate/datasource/mysql/pom.xml index f8eeed4915..a16252a56e 100644 --- a/hibernate/datasource/mysql/pom.xml +++ b/hibernate/datasource/mysql/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate-datasource - 4.4.0 + 4.4.1 4.0.0 hibernate-datasource-mysql diff --git a/hibernate/datasource/oracle/pom.xml b/hibernate/datasource/oracle/pom.xml index dbec76f339..0a7f93de3c 100644 --- a/hibernate/datasource/oracle/pom.xml +++ b/hibernate/datasource/oracle/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate-datasource - 4.4.0 + 4.4.1 4.0.0 hibernate-datasource-oracle diff --git a/hibernate/datasource/pom.xml b/hibernate/datasource/pom.xml index d15dda6650..0c5b98357e 100644 --- a/hibernate/datasource/pom.xml +++ b/hibernate/datasource/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate - 4.4.0 + 4.4.1 4.0.0 hibernate-datasource @@ -15,6 +15,7 @@ h2 mysql common + sqlserver @@ -58,11 +59,5 @@ oracle - - sqlserver - - sqlserver - - diff --git a/hibernate/datasource/postgres/pom.xml b/hibernate/datasource/postgres/pom.xml index 38c3084e5b..ddcf109739 100644 --- a/hibernate/datasource/postgres/pom.xml +++ b/hibernate/datasource/postgres/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate-datasource - 4.4.0 + 4.4.1 4.0.0 hibernate-datasource-postgres diff --git a/hibernate/datasource/sqlserver/pom.xml b/hibernate/datasource/sqlserver/pom.xml index b722c8e3c3..c3389a2fb5 100644 --- a/hibernate/datasource/sqlserver/pom.xml +++ b/hibernate/datasource/sqlserver/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate-datasource - 4.4.0 + 4.4.1 4.0.0 hibernate-datasource-sqlserver @@ -24,9 +24,8 @@ hibernate-datasource-common - com.microsoft - sqljdbc4 - provided + com.microsoft.sqlserver + mssql-jdbc diff --git a/hibernate/feature/pom.xml b/hibernate/feature/pom.xml index 34542d6310..9bf8b6ff77 100644 --- a/hibernate/feature/pom.xml +++ b/hibernate/feature/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate - 4.4.0 + 4.4.1 4.0.0 hibernate-feature diff --git a/hibernate/generator/pom.xml b/hibernate/generator/pom.xml index 1f73a28d62..c19185c484 100644 --- a/hibernate/generator/pom.xml +++ b/hibernate/generator/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos hibernate - 4.4.0 + 4.4.1 hibernate-script-generator 52°North SOS - Hibernate Generator diff --git a/hibernate/generator/src/main/java/org/n52/sos/SQLScriptGenerator.java b/hibernate/generator/src/main/java/org/n52/sos/SQLScriptGenerator.java index 5ae7e74aa9..252bfe5755 100644 --- a/hibernate/generator/src/main/java/org/n52/sos/SQLScriptGenerator.java +++ b/hibernate/generator/src/main/java/org/n52/sos/SQLScriptGenerator.java @@ -81,7 +81,7 @@ private Dialect getDialect(int selection) throws Exception { printToScreen("To execute the SQL script generator for Oracle you have to uncomment the dependency in the pom.xml."); printToScreen("If the Oracle JDBC driver is not installed in your local Maven repository, "); printToScreen("follow the first steps describes here: "); - printToScreen("https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation#Oracle_support."); + printToScreen("https://wiki.52north.org/SensorWeb/SensorObservationServiceIVDocumentation#Oracle_support."); throw new MissingDriverException(); } diff --git a/hibernate/h2/pom.xml b/hibernate/h2/pom.xml index b0213d910f..0c09771a88 100644 --- a/hibernate/h2/pom.xml +++ b/hibernate/h2/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos hibernate - 4.4.0 + 4.4.1 hibernate-h2 52°North SOS - Hibernate H2 diff --git a/hibernate/mappings/pom.xml b/hibernate/mappings/pom.xml index 6f64a3cc31..9e8495819e 100644 --- a/hibernate/mappings/pom.xml +++ b/hibernate/mappings/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos hibernate - 4.4.0 + 4.4.1 hibernate-mappings 52°North SOS - Hibernate Mappings diff --git a/hibernate/mappings/src/main/resources/mapping/series/observation/Observation.hbm.xml b/hibernate/mappings/src/main/resources/mapping/series/observation/Observation.hbm.xml index 02418d4b0d..0d362894fb 100644 --- a/hibernate/mappings/src/main/resources/mapping/series/observation/Observation.hbm.xml +++ b/hibernate/mappings/src/main/resources/mapping/series/observation/Observation.hbm.xml @@ -439,5 +439,33 @@ + + Value table for category observation + + + Foreign Key (FK) to the related observation from the observation table. Contains "observation".observationid + + + + + href value + + + + + title value + + + + + role value + + + diff --git a/hibernate/mappings/src/main/resources/mapping/series/observation/ValuedObservation.hbm.xml b/hibernate/mappings/src/main/resources/mapping/series/observation/ValuedObservation.hbm.xml index ea409bad17..7b337e29f2 100644 --- a/hibernate/mappings/src/main/resources/mapping/series/observation/ValuedObservation.hbm.xml +++ b/hibernate/mappings/src/main/resources/mapping/series/observation/ValuedObservation.hbm.xml @@ -421,5 +421,33 @@ + + Value table for category observation + + + Foreign Key (FK) to the related observation from the observation table. Contains "observation".observationid + + + + + href value + + + + + title value + + + + + role value + + + diff --git a/hibernate/pom.xml b/hibernate/pom.xml index 55170fa86a..0acd4c4ca8 100644 --- a/hibernate/pom.xml +++ b/hibernate/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 hibernate pom diff --git a/hibernate/session-factory/pom.xml b/hibernate/session-factory/pom.xml index fa28d600bd..828ba34616 100644 --- a/hibernate/session-factory/pom.xml +++ b/hibernate/session-factory/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos hibernate - 4.4.0 + 4.4.1 4.0.0 hibernate-session-factory diff --git a/misc/db/MySQL/series/MySQL_update_43_44.sql b/misc/db/MySQL/series/MySQL_update_43_44.sql index a21dc0f7a7..a2ec01f882 100644 --- a/misc/db/MySQL/series/MySQL_update_43_44.sql +++ b/misc/db/MySQL/series/MySQL_update_43_44.sql @@ -120,4 +120,8 @@ alter table sos.textfeatparamvalue add constraint featParamTextValueFk foreign k alter table sos.textparametervalue add constraint parameterTextValueFk foreign key (parameterId) references sos.parameter; alter table sos.xmlfeatparamvalue add constraint featParamXmlValueFk foreign key (parameterId) references sos.featureparameter; alter table sos.xmlparametervalue add constraint parameterXmlValueFk foreign key (parameterId) references sos.parameter; +ALTER TABLE sos.featureofinterest ALTER hibernatediscriminator TYPE character varying(255); +ALTER TABLE sos.featureofinterest ALTER hibernatediscriminator DROP NOT NULL; +UPDATE sos.featureofinterest SET hibernatediscriminator = null; +ALTER TABLE sos.observableproperty DROP COLUMN hibernatediscriminator; call CreateSequence('sos.relatedObservationId_seq', 1, 1) \ No newline at end of file diff --git a/misc/db/Oracle/series/ORACLE_update_43_44.sql b/misc/db/Oracle/series/ORACLE_update_43_44.sql index 0265985ab1..cea3268591 100644 --- a/misc/db/Oracle/series/ORACLE_update_43_44.sql +++ b/misc/db/Oracle/series/ORACLE_update_43_44.sql @@ -120,4 +120,8 @@ alter table oracle.textfeatparamvalue add constraint featParamTextValueFk foreig alter table oracle.textparametervalue add constraint parameterTextValueFk foreign key (parameterId) references oracle.parameter; alter table oracle.xmlfeatparamvalue add constraint featParamXmlValueFk foreign key (parameterId) references oracle.featureparameter; alter table oracle.xmlparametervalue add constraint parameterXmlValueFk foreign key (parameterId) references oracle.parameter; +ALTER TABLE oracle.featureofinterest ALTER hibernatediscriminator TYPE character varying(255); +ALTER TABLE oracle.featureofinterest ALTER hibernatediscriminator DROP NOT NULL; +UPDATE oracle.featureofinterest SET hibernatediscriminator = null; +ALTER TABLE oracle.observableproperty DROP COLUMN hibernatediscriminator; create sequence oracle.relatedObservationId_seq \ No newline at end of file diff --git a/misc/db/PostgreSQL/series/PG_update_43_44.sql b/misc/db/PostgreSQL/series/PG_update_43_44.sql index c1a15b3cf8..fbf31fd137 100644 --- a/misc/db/PostgreSQL/series/PG_update_43_44.sql +++ b/misc/db/PostgreSQL/series/PG_update_43_44.sql @@ -120,4 +120,8 @@ alter table public.textfeatparamvalue add constraint featParamTextValueFk foreig alter table public.textparametervalue add constraint parameterTextValueFk foreign key (parameterId) references public.parameter; alter table public.xmlfeatparamvalue add constraint featParamXmlValueFk foreign key (parameterId) references public.featureparameter; alter table public.xmlparametervalue add constraint parameterXmlValueFk foreign key (parameterId) references public.parameter; +ALTER TABLE public.featureofinterest ALTER hibernatediscriminator TYPE character varying(255); +ALTER TABLE public.featureofinterest ALTER hibernatediscriminator DROP NOT NULL; +UPDATE public.featureofinterest SET hibernatediscriminator = null; +ALTER TABLE public.observableproperty DROP COLUMN hibernatediscriminator; create sequence public.relatedObservationId_seq \ No newline at end of file diff --git a/misc/db/SqlServer/series/SqlServer_update_43_44.sql b/misc/db/SqlServer/series/SqlServer_update_43_44.sql index 24cd497513..6e4ece1c17 100644 --- a/misc/db/SqlServer/series/SqlServer_update_43_44.sql +++ b/misc/db/SqlServer/series/SqlServer_update_43_44.sql @@ -120,4 +120,8 @@ alter table dbo.textfeatparamvalue add constraint featParamTextValueFk foreign k alter table dbo.textparametervalue add constraint parameterTextValueFk foreign key (parameterId) references dbo.parameter; alter table dbo.xmlfeatparamvalue add constraint featParamXmlValueFk foreign key (parameterId) references dbo.featureparameter; alter table dbo.xmlparametervalue add constraint parameterXmlValueFk foreign key (parameterId) references dbo.parameter; +ALTER TABLE dbo.featureofinterest ALTER hibernatediscriminator TYPE character varying(255); +ALTER TABLE dbo.featureofinterest ALTER hibernatediscriminator DROP NOT NULL; +UPDATE dbo.featureofinterest SET hibernatediscriminator = null; +ALTER TABLE dbo.observableproperty DROP COLUMN hibernatediscriminator; create sequence dbo.relatedObservationId_seq \ No newline at end of file diff --git a/misc/pics/sensor_web_db_dao.PNG b/misc/pics/sensor_web_db_dao.PNG new file mode 100644 index 0000000000..ae3d9c6b90 Binary files /dev/null and b/misc/pics/sensor_web_db_dao.PNG differ diff --git a/operations/core-v100/pom.xml b/operations/core-v100/pom.xml index f34613decd..490ddc12e8 100644 --- a/operations/core-v100/pom.xml +++ b/operations/core-v100/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos operations - 4.4.0 + 4.4.1 4.0.0 core-v100 diff --git a/operations/core-v20/pom.xml b/operations/core-v20/pom.xml index e6f78684e3..e4f64fbf84 100644 --- a/operations/core-v20/pom.xml +++ b/operations/core-v20/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos operations - 4.4.0 + 4.4.1 4.0.0 core-v20 diff --git a/operations/enhanced-v20/pom.xml b/operations/enhanced-v20/pom.xml index fb392fe55f..a588dd7e04 100644 --- a/operations/enhanced-v20/pom.xml +++ b/operations/enhanced-v20/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos operations - 4.4.0 + 4.4.1 4.0.0 enhanced-v20 diff --git a/operations/pom.xml b/operations/pom.xml index b5cd5dc68c..ca48755ffb 100644 --- a/operations/pom.xml +++ b/operations/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 operations pom diff --git a/operations/resultHandling-v20/pom.xml b/operations/resultHandling-v20/pom.xml index 9cbc68c6c9..14f7773c5c 100644 --- a/operations/resultHandling-v20/pom.xml +++ b/operations/resultHandling-v20/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos operations - 4.4.0 + 4.4.1 4.0.0 resultHandling-v20 diff --git a/operations/transactional-v20/pom.xml b/operations/transactional-v20/pom.xml index d0765cc572..f77444c90b 100644 --- a/operations/transactional-v20/pom.xml +++ b/operations/transactional-v20/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos operations - 4.4.0 + 4.4.1 4.0.0 transactional-v20 diff --git a/pom.xml b/pom.xml index 01e30d9c0e..bb30583cce 100644 --- a/pom.xml +++ b/pom.xml @@ -10,10 +10,10 @@ 4.0.0 org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 52°North Sensor Observation Service 52°North Sensor Observation Service - Parent POM for defining dependency versions - https://wiki.52north.org/bin/view/SensorWeb/SensorObservationServiceIVDocumentation + https://wiki.52north.org/SensorWeb/SensorObservationServiceIVDocumentation 2012 pom @@ -75,7 +75,7 @@ 14.0 2.7.3 11.2.0 - 4.0 + 6.2.1.jre7 2.3.0 @@ -1256,33 +1256,33 @@ ${ojdbc6.version} - com.microsoft - sqljdbc4 - ${sqljdbc4.version} + com.microsoft.sqlserver + mssql-jdbc + ${sqljdbc.version} org.geotools gt-epsg-hsql ${geotools.version} - - - javax.media - jai_core - - + + + javax.media + jai_core + + org.geotools gt-main ${geotools.version} - - - javax.media - jai_core - - - + + + javax.media + jai_core + + + org.geotools gt-referencing @@ -1292,10 +1292,10 @@ java3d vecmath - - javax.media - jai_core - + + javax.media + jai_core + @@ -1303,17 +1303,17 @@ vecmath 1.5.2 - - org.geotools - gt-api - ${geotools.version} - - - javax.media - jai_core - - - + + org.geotools + gt-api + ${geotools.version} + + + javax.media + jai_core + + + org.reflections reflections @@ -1461,22 +1461,18 @@ - org.codehaus.groovy.maven - gmaven-plugin - 1.0 + org.codehaus.mojo + build-helper-maven-plugin + 3.0.0 - initialize + timestamp-property - execute + timestamp-property - - import java.util.Date - import java.text.MessageFormat - def vartimestamp = MessageFormat.format("{0,date,yyyy}", new Date()) - project.properties['currentYearDynamic'] = vartimestamp - + currentYearDynamic + yyyy @@ -1558,6 +1554,7 @@ + org.jasig.maven diff --git a/spring/admin-controller/pom.xml b/spring/admin-controller/pom.xml index 74d88ae4ec..f7862fe333 100644 --- a/spring/admin-controller/pom.xml +++ b/spring/admin-controller/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos spring - 4.4.0 + 4.4.1 admin-controller 52°North SOS - Web Admin Controller diff --git a/spring/client-controller/pom.xml b/spring/client-controller/pom.xml index 510846ac4d..4ad1693759 100644 --- a/spring/client-controller/pom.xml +++ b/spring/client-controller/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos spring - 4.4.0 + 4.4.1 client-controller 52°North SOS - Web Client Controller diff --git a/spring/common-controller/pom.xml b/spring/common-controller/pom.xml index 8f0f2c0d80..761820b60d 100644 --- a/spring/common-controller/pom.xml +++ b/spring/common-controller/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos spring - 4.4.0 + 4.4.1 common-controller 52°North SOS - Web Common Controller diff --git a/spring/install-controller/pom.xml b/spring/install-controller/pom.xml index ec92127eff..11926264b5 100644 --- a/spring/install-controller/pom.xml +++ b/spring/install-controller/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos spring - 4.4.0 + 4.4.1 install-controller 52°North SOS - Web Install Controller diff --git a/spring/pom.xml b/spring/pom.xml index 01c700ae05..66c46b8a3f 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -4,7 +4,7 @@ 52n-sos org.n52.sensorweb.sos - 4.4.0 + 4.4.1 spring pom diff --git a/spring/views/pom.xml b/spring/views/pom.xml index e3e8fe5adf..c8bc761c41 100644 --- a/spring/views/pom.xml +++ b/spring/views/pom.xml @@ -4,7 +4,7 @@ org.n52.sensorweb.sos spring - 4.4.0 + 4.4.1 views 52°North SOS - Web Views diff --git a/spring/views/src/main/webapp/WEB-INF/views/documentation.jsp b/spring/views/src/main/webapp/WEB-INF/views/documentation.jsp index 2a045b177c..6969665545 100644 --- a/spring/views/src/main/webapp/WEB-INF/views/documentation.jsp +++ b/spring/views/src/main/webapp/WEB-INF/views/documentation.jsp @@ -39,11 +39,11 @@
-

The 52°North SOS documentation is available in the 52°North Wiki.

+

The 52°North SOS documentation is available in the 52°North Wiki.

-

The user guide, including installation and configuration documentation, can be found here.

+

The user guide, including installation and configuration documentation, can be found here.

-

The developer guide can be found here.

+

The developer guide can be found here.

Other Documentations

diff --git a/spring/views/src/main/webapp/WEB-INF/views/get-involved.jsp b/spring/views/src/main/webapp/WEB-INF/views/get-involved.jsp index 00eaa0bbf8..65e3137bda 100644 --- a/spring/views/src/main/webapp/WEB-INF/views/get-involved.jsp +++ b/spring/views/src/main/webapp/WEB-INF/views/get-involved.jsp @@ -43,7 +43,7 @@

Tell the world!

-

If your SOS instance is publicly available please consider informing us or the community on swe@52north.org or use our forums so that many people can profit from your hard work. If you like, your SOS can also be listed in our Wiki as an example.

+

If your SOS instance is publicly available please consider informing us or the community on swe@52north.org or use our forums so that many people can profit from your hard work. If you like, your SOS can also be listed in our Wiki as an example.

Code development/ bug fixing

The best way to get to know a software is to use it! Implement features that you yourself need - new software, code snippets, adaptations, extensions, etc. Help others solve their problems. Fix bugs and enhance the existing software. There are many ways to get started!

diff --git a/spring/views/src/main/webapp/WEB-INF/views/index.jsp b/spring/views/src/main/webapp/WEB-INF/views/index.jsp index ec7d5ed270..f840e70adb 100644 --- a/spring/views/src/main/webapp/WEB-INF/views/index.jsp +++ b/spring/views/src/main/webapp/WEB-INF/views/index.jsp @@ -123,20 +123,19 @@ The development of this version of the 52°North SOS was supported by the European FP7 research project NeXOS (co-funded by the European Commission under the grant agreement n°614102) - COLABIS - Collaborative Early Warning Information Systems for Urban Infrastructures"/> - The development of this version of the 52°North SOS was supported by the German Federal Ministry of Education and Research research project COLABIS (co-funded by the German Federal Ministry of Education and Research, programme Geotechnologien, under grant agreement no. 03G0852A) - - - EO2HEAVEN - Earth Observation and ENVironmental Modeling for the Mitigation of HEAlth Risks"/> - The development of this version of the 52°North SOS was supported by the European FP7 research project EO2HEAVEN (co-funded by the European Commission under the grant agreement n°244100) - - - GEOWOW - GEOSS interoperability for Weather, Ocean and Water"/> - The development of this version of the 52°North SOS was supported by the European FP7 research project GEOWOW (co-funded by the European Commission under the grant agreement n°282915) + + BMBF + COLABIS - Collaborative Early Warning Information Systems for Urban Infrastructures + + The development of this version of the 52°North SOS was supported by the German Federal Ministry of Education and Research research project COLABIS (co-funded by the German Federal Ministry of Education and Research, programme Geotechnologien, under grant agreement no. 03G0852A) + + + SeaDataCloud + The development of this version of the 52°North SOS was supported by the Horizon 2020 research project SeaDataCloud (co-funded by the European Commission under the grant agreement n°730960) - - GeoViQua - QUAlity aware VIsualization for the Global Earth Observation System of Systems"/> - The development of this version of the 52°North SOS was supported by the European FP7 research project GeoViQua (co-funded by the European Commission under the grant agreement n°265178) + + ODIP II - Ocean Data Interoperability Platform + The development of this version of the 52°North SOS was supported by the Horizon 2020 research project ODIP II (co-funded by the European Commission under the grant agreement n°654310) @@ -160,7 +159,7 @@ Belgian Interregional Environment Agency (IRCEL - CELINE)"/> - The Belgian Interregional Environment Agency (IRCEL - CELINE) is primarily active with the domain of air quality (modelling, forecasts, informing the public on the state of their air quality, e-reporting to the EU under the air quality directives, participating in scientific research on air quality, etc.). IRCEL – CELINE is a permanent cooperation between three regional environment agencies: Agence wallonne de l'Air et du Climat (AWAC), Bruxelles Environnement - Leefmilieu Brussel and Vlaamse Milieumaatschappij (VMM). + The Belgian Interregional Environment Agency (IRCEL - CELINE) is active in the domain of air quality (modelling, forecasts, informing the public on the state of their air quality, e-reporting to the EU under the air quality directives, participating in scientific research on air quality, etc.). IRCEL – CELINE is a permanent cooperation between three regional environment agencies: Agence wallonne de l'Air et du Climat (AWAC), Bruxelles Environnement - Leefmilieu Brussel and Vlaamse Milieumaatschappij (VMM). IVL Swedish Environmental Research Institute"/> @@ -175,8 +174,9 @@ The SMART Project, funded by the Ministry of Business, Innovation and Employment (07/2011 – 06/2017):
Experts in the Smart Project will develop, apply, and validate pioneering new techniques for understanding New Zealand‘s groundwater resources. Satellite and airborne remote sensing techniques and Sensor Observation Services including seismic signals from earthquakes are used for rapid and costeffective characterisation and mapping of New Zealand‘s aquifer systems. Together with a stakeholder network the research team will use new methods to overcome the current time- and resourceconsuming challenges of in-time data acquisition. Special spatial skills in hydrogeology, geology, satellite remote sensing, geophysics, seismology, uncertainty mathematics and spatial information technology will be developed to assist with improvement of New Zealand‘s freshwater management. - DLZ-IT"/> - The DLZ-IT BMVBS Information Technology Services Centre of Federal Ministry of Transport, Building and Urban Development (Germany) + | ITZBund| The ITZBund Information Technology Services Centre of the Federal Government (Germany) | + ITZBund"/> + The ITZBund Information Technology Services Centre of the Federal Government (Germany) @@ -188,7 +188,19 @@ - The Rijkswaterstaat - Dutch Ministry of Infrastructure and the Environment (The Netherlands) + Rijkswaterstaat - Dutch Ministry of Infrastructure and the Environment (The Netherlands) + + + EO2HEAVEN - Earth Observation and ENVironmental Modeling for the Mitigation of HEAlth Risks"/> + The development of this version of the 52°North SOS was supported by the European FP7 research project EO2HEAVEN (co-funded by the European Commission under the grant agreement n°244100) + + + GeoViQua - QUAlity aware VIsualization for the Global Earth Observation System of Systems"/> + The development of this version of the 52°North SOS was supported by the European FP7 research project GeoViQua (co-funded by the European Commission under the grant agreement n°265178) + + + GEOWOW - GEOSS interoperability for Weather, Ocean and Water"/> + The development of this version of the 52°North SOS was supported by the European FP7 research project GEOWOW (co-funded by the European Commission under the grant agreement n°282915) diff --git a/spring/views/src/main/webapp/WEB-INF/views/install/index.jsp b/spring/views/src/main/webapp/WEB-INF/views/install/index.jsp index 068c84e465..7e0fad7abd 100644 --- a/spring/views/src/main/webapp/WEB-INF/views/install/index.jsp +++ b/spring/views/src/main/webapp/WEB-INF/views/install/index.jsp @@ -60,7 +60,7 @@

Documentation for Oracle can be found here. - How to install the 52°North SOS with Oracle is described in the SOS wiki + How to install the 52°North SOS with Oracle is described in the SOS wiki

If you like to use MySQL 5.6.x you can find here a detailed installation guide for the different platforms @@ -68,7 +68,7 @@

If you like to use Microsoft SQL Server 2012 you can find detailed installation information on the Microsoft SQL Server Developer Network page. - How to install the 52°North SOS with SQL Server is described in the SOS wiki + How to install the 52°North SOS with SQL Server is described in the SOS wiki

diff --git a/spring/views/src/main/webapp/WEB-INF/views/install/settings.jsp b/spring/views/src/main/webapp/WEB-INF/views/install/settings.jsp index 33bc4114be..0aaf1b8df4 100644 --- a/spring/views/src/main/webapp/WEB-INF/views/install/settings.jsp +++ b/spring/views/src/main/webapp/WEB-INF/views/install/settings.jsp @@ -84,7 +84,7 @@ "#service_transactionalallowedips > div.controls > span.help-block", 1000, "
" + - "Consider entering the IP of our machine: " + + "Consider entering the IP of your machine: " + "" + "" + "" + diff --git a/spring/views/src/main/webapp/static/images/funding/ConnectinGEO_logo.png b/spring/views/src/main/webapp/static/images/funding/ConnectinGEO_logo.png new file mode 100644 index 0000000000..74d523c41f Binary files /dev/null and b/spring/views/src/main/webapp/static/images/funding/ConnectinGEO_logo.png differ diff --git a/spring/views/src/main/webapp/static/images/funding/bmbf_logo_en.png b/spring/views/src/main/webapp/static/images/funding/bmbf_logo_en.png new file mode 100644 index 0000000000..654eee21af Binary files /dev/null and b/spring/views/src/main/webapp/static/images/funding/bmbf_logo_en.png differ diff --git a/spring/views/src/main/webapp/static/images/funding/logo_fixo3.png b/spring/views/src/main/webapp/static/images/funding/logo_fixo3.png new file mode 100644 index 0000000000..25aeae7009 Binary files /dev/null and b/spring/views/src/main/webapp/static/images/funding/logo_fixo3.png differ diff --git a/spring/views/src/main/webapp/static/images/funding/logo_itzbund.png b/spring/views/src/main/webapp/static/images/funding/logo_itzbund.png new file mode 100644 index 0000000000..b6c36167d2 Binary files /dev/null and b/spring/views/src/main/webapp/static/images/funding/logo_itzbund.png differ diff --git a/spring/views/src/main/webapp/static/images/funding/logo_seadatanet.png b/spring/views/src/main/webapp/static/images/funding/logo_seadatanet.png new file mode 100644 index 0000000000..92ae96122a Binary files /dev/null and b/spring/views/src/main/webapp/static/images/funding/logo_seadatanet.png differ diff --git a/spring/views/src/main/webapp/static/images/funding/odip-logo.png b/spring/views/src/main/webapp/static/images/funding/odip-logo.png new file mode 100644 index 0000000000..db00422e3b Binary files /dev/null and b/spring/views/src/main/webapp/static/images/funding/odip-logo.png differ diff --git a/third-party/pom.xml b/third-party/pom.xml index 579b435035..3d667830f9 100644 --- a/third-party/pom.xml +++ b/third-party/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos 52n-sos - 4.4.0 + 4.4.1 52n-sos-third-party 52°North Aggregated Third Party modules diff --git a/third-party/third-party-ncname-resolver/pom.xml b/third-party/third-party-ncname-resolver/pom.xml index 137b821970..8a74ae8e4e 100644 --- a/third-party/third-party-ncname-resolver/pom.xml +++ b/third-party/third-party-ncname-resolver/pom.xml @@ -3,7 +3,7 @@ org.n52.sensorweb.sos 52n-sos-third-party - 4.4.0 + 4.4.1 third-party-ncname-resolver 52°North Third Party - NCName resolver diff --git a/webapp-bundle/pom.xml b/webapp-bundle/pom.xml index 5137018b3a..64e22a50cc 100644 --- a/webapp-bundle/pom.xml +++ b/webapp-bundle/pom.xml @@ -3,7 +3,7 @@ 52n-sos org.n52.sensorweb.sos - 4.4.0 + 4.4.1 4.0.0 webapp-bundle @@ -11,8 +11,8 @@ 52°North SOS - Webapp with Sensor Web REST API 52°North SOS webapp with Sensor Web REST API - 2.0.0-alpha.5 - 2.0.0-alpha.2 + 2.0.0-SNAPSHOT + 2.0.0-SNAPSHOT 1.0.0 diff --git a/webapp-bundle/src/main/resources/application.properties b/webapp-bundle/src/main/resources/application.properties index 4f3e77e9b3..ae2acd332b 100644 --- a/webapp-bundle/src/main/resources/application.properties +++ b/webapp-bundle/src/main/resources/application.properties @@ -3,7 +3,7 @@ ## ## Deployments behind a Proxy need to know the external URL -external.url=http://localhost:8080/ +external.url=nexos.demo.52north.org:80/52n-sos-nexos-test/api/ ## ## IO DEFAULTS diff --git a/webapp-bundle/src/main/resources/config-extension-resultTime.json b/webapp-bundle/src/main/resources/config-extension-resultTime.json index bc47a11694..c44dc44f37 100644 --- a/webapp-bundle/src/main/resources/config-extension-resultTime.json +++ b/webapp-bundle/src/main/resources/config-extension-resultTime.json @@ -1,3 +1,3 @@ [ - "1" + ] \ No newline at end of file diff --git a/webapp-bundle/src/main/resources/config-rendering-hints.json b/webapp-bundle/src/main/resources/config-rendering-hints.json index c0863a2ed4..7a73a41bfd 100644 --- a/webapp-bundle/src/main/resources/config-rendering-hints.json +++ b/webapp-bundle/src/main/resources/config-rendering-hints.json @@ -1,27 +1,2 @@ - { - "phenomenonStyles": { - "6": { - "style": { - "chartType": "bar", - "properties": { - "interval": "byHour", - "width": 0.8, - "color": "#0000ff" - } - } - } - }, - "timeseriesStyles": { - "1": { - "style": { - "chartType": "bar", - "properties": { - "interval": "byDay", - "width": 0.8, - "color": "#0000ff" - } - } - } - } } \ No newline at end of file diff --git a/webapp-bundle/src/main/resources/config-status-intervals.json b/webapp-bundle/src/main/resources/config-status-intervals.json index 6b17119e9a..7a73a41bfd 100644 --- a/webapp-bundle/src/main/resources/config-status-intervals.json +++ b/webapp-bundle/src/main/resources/config-status-intervals.json @@ -1,90 +1,2 @@ { - "phenomenonIntervals": { - "1": { - "statusIntervals": { - "90 - 100 Percent": { - "upper": 100.0, - "lower": 90.0, - "color": "#0000FF" - }, - "80 - 90 Percent": { - "upper": 90.0, - "lower": 80.0, - "color": "#1C00E2" - }, - "70 - 80 Percent": { - "upper": 80.0, - "lower": 70.0, - "color": "#3800C6" - }, - "60 - 70 Percent": { - "upper": 70.0, - "lower": 60.0, - "color": "#5500AA" - }, - "50 - 60 Percent": { - "upper": 60.0, - "lower": 50.0, - "color": "#71008D" - }, - "40 - 50 Percent": { - "upper": 50.0, - "lower": 40.0, - "color": "#8D0071" - }, - "30 - 40 Percent": { - "upper": 40.0, - "lower": 30.0, - "color": "#AA0055" - }, - "20 - 30 Percent": { - "upper": 30.0, - "lower": 20.0, - "color": "#C60038" - }, - "10 - 20 Percent": { - "upper": 20.0, - "lower": 10.0, - "color": "#E2001C" - }, - "0 - 10 Percent": { - "upper": 10.0, - "lower": 0.0, - "color": "#FF0000" - } - } - }, - "phe_1965ee24af8af96270002b4a434a4250": { - "statusIntervals": { - "over 20": { - "lower": 20.0, - "color": "#FF0000" - }, - "15 - 20": { - "upper": 20.0, - "lower": 15.0, - "color": "#BF003F" - }, - "10 - 15": { - "upper": 15.0, - "lower": 10.0, - "color": "#7F007F" - }, - "5 - 10": { - "upper": 10.0, - "lower": 5.0, - "color": "#3F00BF" - }, - "0 - 5": { - "upper": 5.0, - "lower": 0.0, - "color": "#0000FF" - } - } - } - }, - "timeseriesIntervals": { - "ts_123": { - } - } } \ No newline at end of file diff --git a/webapp-bundle/src/main/resources/config-task-prerendering.json b/webapp-bundle/src/main/resources/config-task-prerendering.json index af645193f4..0e0dcd235c 100644 --- a/webapp-bundle/src/main/resources/config-task-prerendering.json +++ b/webapp-bundle/src/main/resources/config-task-prerendering.json @@ -1,96 +1,3 @@ { - "generalConfig": { - "outputPath": "generated/prerendered/v1", - "width": "800", - "height": "500", - "language": "de", - "grid": true, - "generalize": false - }, - "phenomenonStyles": [ - { - "id": "3", - "title": "Title of a Timeseries (without legend)", - "chartQualifier": "without_legend", - "interval": [ - "lastWeek", - "lastMonth" - ], - "style": { - "chartType": "line", - "properties": { - "color": "#00ffff", - "lineType": "solid", - "width": 2 - } - } - }, - { - "id": "3", - "title": "Title of a Timeseries (with legend)", - "chartQualifier": "with_legend", - "interval": [ - "lastWeek", - "lastMonth" - ], - "config": { - "legend": true - }, - "style": { - "chartType": "line", - "properties": { - "color": "#00ffff", - "lineType": "solid", - "width": 2 - } - } - }, - { - "id": "9", - "interval": [ - "lastWeek", - "lastMonth" - ], - "style": { - "chartType": "line", - "properties": { - "color": "#0000ff", - "lineType": "solid", - "width": 2 - } - } - }, - { - "id": "4", - "interval": [ - "lastWeek", - "lastMonth" - ], - "style": { - "chartType": "bar", - "properties": { - "interval": "byDay", - "color": "#ff0000", - "width": 0.8 - } - } - } - ], - "timeseriesStyles": [ - { - "id": "16", - "interval": [ - "lastWeek", - "lastMonth" - ], - "style": { - "chartType": "bar", - "properties": { - "interval": "byDay", - "width": 0.8, - "color": "#0000ff" - } - } - } - ] + } \ No newline at end of file diff --git a/webapp-bundle/src/main/resources/dataset-io-factory.properties b/webapp-bundle/src/main/resources/dataset-io-factory.properties index 43731115d5..01462b7019 100644 --- a/webapp-bundle/src/main/resources/dataset-io-factory.properties +++ b/webapp-bundle/src/main/resources/dataset-io-factory.properties @@ -1,3 +1,4 @@ quantity=org.n52.io.quantity.QuantityIoFactory text=org.n52.io.text.TextIoFactory -count=org.n52.io.count.CountIoFactory \ No newline at end of file +count=org.n52.io.count.CountIoFactory +quantity-profile=org.n52.io.profile.ProfileIoFactory \ No newline at end of file diff --git a/webapp-bundle/src/main/resources/dataset-repository-factory.properties b/webapp-bundle/src/main/resources/dataset-repository-factory.properties index 374879c9a6..54a7ddf5ae 100644 --- a/webapp-bundle/src/main/resources/dataset-repository-factory.properties +++ b/webapp-bundle/src/main/resources/dataset-repository-factory.properties @@ -1,3 +1,4 @@ text=org.n52.series.db.da.TextDataRepository count=org.n52.series.db.da.CountDataRepository -quantity=org.n52.series.db.da.QuantityDataRepository \ No newline at end of file +quantity=org.n52.series.db.da.QuantityDataRepository +quantity-profile=org.n52.series.db.da.QuantityProfileDataRepository \ No newline at end of file diff --git a/webapp-bundle/src/main/webapp/WEB-INF/spring/api_v1_mvc.xml b/webapp-bundle/src/main/webapp/WEB-INF/spring/api_v1_mvc.xml index 32170032f9..ea019ca64f 100644 --- a/webapp-bundle/src/main/webapp/WEB-INF/spring/api_v1_mvc.xml +++ b/webapp-bundle/src/main/webapp/WEB-INF/spring/api_v1_mvc.xml @@ -110,6 +110,7 @@ + diff --git a/webapp-bundle/src/main/webapp/WEB-INF/spring/api_v1_mvc_legacy.xml b/webapp-bundle/src/main/webapp/WEB-INF/spring/api_v1_mvc_legacy.xml index 0350ad0bd0..0cb8f34f28 100644 --- a/webapp-bundle/src/main/webapp/WEB-INF/spring/api_v1_mvc_legacy.xml +++ b/webapp-bundle/src/main/webapp/WEB-INF/spring/api_v1_mvc_legacy.xml @@ -39,7 +39,6 @@ - diff --git a/webapp-bundle/src/main/webapp/WEB-INF/spring/application-context.xml b/webapp-bundle/src/main/webapp/WEB-INF/spring/application-context.xml index 13e7578940..f86d94a6f8 100644 --- a/webapp-bundle/src/main/webapp/WEB-INF/spring/application-context.xml +++ b/webapp-bundle/src/main/webapp/WEB-INF/spring/application-context.xml @@ -17,7 +17,7 @@ - + diff --git a/webapp-bundle/src/main/webapp/WEB-INF/spring/property-placeholder-config.xml b/webapp-bundle/src/main/webapp/WEB-INF/spring/property-placeholder-config.xml index a4546431f1..9caf853ae3 100644 --- a/webapp-bundle/src/main/webapp/WEB-INF/spring/property-placeholder-config.xml +++ b/webapp-bundle/src/main/webapp/WEB-INF/spring/property-placeholder-config.xml @@ -11,8 +11,7 @@ - +--> diff --git a/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_common.xml b/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_common.xml index 70b69f8ffa..484329f43b 100644 --- a/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_common.xml +++ b/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_common.xml @@ -16,11 +16,13 @@ - + - + + + diff --git a/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_tasks.xml b/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_tasks.xml index 0b407fd998..326298cf87 100644 --- a/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_tasks.xml +++ b/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_tasks.xml @@ -18,34 +18,27 @@ - + - + - + - + - + - + - - - diff --git a/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_v1_beans.xml b/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_v1_beans.xml index 09a24ecdf2..fe5de061f3 100644 --- a/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_v1_beans.xml +++ b/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_v1_beans.xml @@ -12,6 +12,7 @@ + @@ -20,9 +21,7 @@ - - - + diff --git a/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_v1_beans_legacy.xml b/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_v1_beans_legacy.xml index 00ad456306..3c800a4ef0 100644 --- a/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_v1_beans_legacy.xml +++ b/webapp-bundle/src/main/webapp/WEB-INF/spring/spi-impl-dao_v1_beans_legacy.xml @@ -15,9 +15,7 @@ - - - + diff --git a/webapp/pom.xml b/webapp/pom.xml index 6fce8bfc91..7ca5e0cb7d 100644 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -3,7 +3,7 @@ 52n-sos org.n52.sensorweb.sos - 4.4.0 + 4.4.1 4.0.0 webapp @@ -299,10 +299,14 @@ ${project.groupId} hibernate-datasource-mysql - + ${project.groupId} hibernate-datasource-h2 + + ${project.groupId} + hibernate-datasource-sqlserver + @@ -619,15 +623,6 @@ - - sqlserver - - - ${project.groupId} - hibernate-datasource-sqlserver - - - assembly @@ -655,10 +650,6 @@ ${project.groupId} hibernate-datasource-oracle - - ${project.groupId} - hibernate-datasource-sqlserver - diff --git a/webapp/src/main/webapp/static/conf/client-config.json b/webapp/src/main/webapp/static/conf/client-config.json index 9bb31c3762..6ee818c2a0 100644 --- a/webapp/src/main/webapp/static/conf/client-config.json +++ b/webapp/src/main/webapp/static/conf/client-config.json @@ -1640,6 +1640,19 @@ }, "method":"POST" }, + { + "request":"static/examples/sos_v20/requests_xml/Transactional/InsertObservation_Reference.xml", + "service":"SOS", + "version":"2.0.0", + "binding": "application/xml", + "operation":"InsertObservation", + "title":"ReferenceObservation", + "headers":{ + "Accept":"application/xml", + "Content-Type":"application/xml" + }, + "method":"POST" + }, { "request":"static/examples/sos_v20/requests_xml/Transactional/InsertObservation_Parameter.xml", "service":"SOS", @@ -2367,6 +2380,19 @@ }, "method":"POST" }, + { + "request":"static/examples/sos_v20/requests_soap/Transactional/InsertObservation_Reference.xml", + "service":"SOS", + "version":"2.0.0", + "binding": "application/soap+xml", + "operation":"InsertObservation", + "title":"ReferenceObservation", + "headers":{ + "Accept":"application/soap+xml", + "Content-Type":"application/soap+xml" + }, + "method":"POST" + }, { "request":"static/examples/sos_v20/requests_soap/Transactional/InsertObservation_Parameter.xml", "service":"SOS", @@ -3491,7 +3517,8 @@ "http://www.52north.org/test/observableProperty/9_3", "http://www.52north.org/test/observableProperty/9_4", "http://www.52north.org/test/observableProperty/9_5", - "http://www.52north.org/test/observableProperty/9_6" + "http://www.52north.org/test/observableProperty/9_6", + "http://www.52north.org/test/observableProperty/9_9" ], "observationType":[ "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement", @@ -3499,7 +3526,8 @@ "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_CountObservation", "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_TextObservation", "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_TruthObservation", - "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation" + "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation", + "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation" ], "featureOfInterestType":"http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint" } @@ -3521,14 +3549,15 @@ "service":"SOS", "version":"2.0.0", "procedureDescriptionFormat":"http://www.opengis.net/sensorml/2.0", - "procedureDescription":"http://www.52north.org/test/procedure/9longName52°North Initiative for Geospatial Open Source Software GmbH (http://52north.org) shortName52°North GmbHofferingIDhttp://www.52north.org/test/offering/9featuresOfInterest7.65196881225419451.93510110010491652.0", + "procedureDescription":"http://www.52north.org/test/procedure/9longName52°North Initiative for Geospatial Open Source Software GmbH (http://52north.org) shortName52°North GmbHhuman readable offering labelhttp://www.52north.org/test/offering/9featuresOfInterest7.65196881225419451.93510110010491652.0", "observableProperty":[ "http://www.52north.org/test/observableProperty/9_1", "http://www.52north.org/test/observableProperty/9_2", "http://www.52north.org/test/observableProperty/9_3", "http://www.52north.org/test/observableProperty/9_4", "http://www.52north.org/test/observableProperty/9_5", - "http://www.52north.org/test/observableProperty/9_6" + "http://www.52north.org/test/observableProperty/9_6", + "http://www.52north.org/test/observableProperty/9_9" ], "observationType":[ "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement", @@ -3536,7 +3565,8 @@ "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_CountObservation", "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_TextObservation", "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_TruthObservation", - "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation" + "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation", + "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation" ], "featureOfInterestType":"http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint" } @@ -3565,7 +3595,8 @@ "http://www.52north.org/test/observableProperty/9_3", "http://www.52north.org/test/observableProperty/9_4", "http://www.52north.org/test/observableProperty/9_5", - "http://www.52north.org/test/observableProperty/9_6" + "http://www.52north.org/test/observableProperty/9_6", + "http://www.52north.org/test/observableProperty/9_9" ], "observationType":[ "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement", @@ -3573,7 +3604,8 @@ "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_CountObservation", "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_TextObservation", "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_TruthObservation", - "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation" + "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation", + "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation" ], "featureOfInterestType":"http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint" } @@ -3647,7 +3679,7 @@ } }, - { + { "service":"SOS", "version":"2.0.0", "method":"POST", @@ -3728,6 +3760,65 @@ } }, + { + "service":"SOS", + "version":"2.0.0", + "method":"POST", + "binding": "application/json", + "headers":{ + "Accept":"application/json", + "Content-Type":"application/json" + }, + "operation":"InsertObservation", + "title": "ReferenceObservation", + "request":{ + "request":"InsertObservation", + "service":"SOS", + "version":"2.0.0", + "offering":"http://www.52north.org/test/offering/9", + "observation": + { + "type":"http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation", + "procedure":"http://www.52north.org/test/procedure/9", + "observedProperty":"http://www.52north.org/test/observableProperty/9_9", + "featureOfInterest":{ + "identifier":{ + "value":"http://www.52north.org/test/featureOfInterest/9", + "codespace":"http://www.opengis.net/def/nil/OGC/0/unknown" + }, + "name":[ + { + "value":"52°North", + "codespace":"http://www.opengis.net/def/nil/OGC/0/unknown" + } + ], + "sampledFeature":[ + "http://www.52north.org/test/featureOfInterest/world" + ], + "geometry":{ + "type":"Point", + "coordinates":[ + 51.935101100104916, + 7.651968812254194 + ], + "crs":{ + "type":"name", + "properties":{ + "name":"EPSG:4326" + } + } + } + }, + "phenomenonTime":"2012-11-19T17:45:15+00:00", + "resultTime":"2012-11-19T17:45:15+00:00", + "result":{ + "href":"test_reference", + "title":"test_title", + "role":"test_role" + } + } + } + }, { "service":"SOS", "version":"2.0.0", @@ -3745,7 +3836,6 @@ "offering":"http://www.52north.org/test/offering/6", "observedProperty":"http://www.52north.org/test/observableProperty/6" } - }, { "service":"SOS", @@ -3765,7 +3855,6 @@ "offering":"http://www.52north.org/test/offering/6", "observedProperty":"http://www.52north.org/test/observableProperty/6" } - }, { "service":"SOS", @@ -3985,7 +4074,7 @@ "version":"2.0.0", "procedure":"http://www.52north.org/test/procedure/9", "procedureDescriptionFormat":"http://www.opengis.net/sensorml/2.0", - "procedureDescription":"http://www.52north.org/test/procedure/9longName52°North Initiative for Geospatial Open Source Software GmbH (http://52north.org) shortName52°North GmbHofferingIDhttp://www.52north.org/test/offering/9featuresOfInterest7.65196881225419451.93510110010491652.0" + "procedureDescription":"http://www.52north.org/test/procedure/9longName52°North Initiative for Geospatial Open Source Software GmbH (http://52north.org) shortName52°North GmbHhuman readable offering labelhttp://www.52north.org/test/offering/9featuresOfInterest7.65196881225419451.93510110010491652.0" } }, { @@ -5715,4 +5804,4 @@ ] - } \ No newline at end of file + } diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertObservation_Reference.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertObservation_Reference.xml new file mode 100644 index 0000000000..71e909632b --- /dev/null +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertObservation_Reference.xml @@ -0,0 +1,49 @@ + + + + + + http://www.52north.org/test/offering/9 + + + + + + 2012-11-19T17:45:15.000+00:00 + + + + + + + + http://www.52north.org/test/featureOfInterest/9 + 52°North + + + + + 51.935101100104916 7.651968812254194 + + + + + + + + + + diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor.xml index 8eea6c8d51..165278d208 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor.xml @@ -217,6 +217,7 @@ http://www.52north.org/test/observableProperty/9_6 http://www.52north.org/test/observableProperty/9_7 http://www.52north.org/test/observableProperty/9_8 + http://www.52north.org/test/observableProperty/9_9 http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement @@ -227,6 +228,7 @@ http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ComplexObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation + http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20.xml index 9921bd566a..e8cdeaad3c 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20.xml @@ -41,7 +41,7 @@ - offeringID + Test Offering #9 http://www.52north.org/test/offering/9 @@ -189,6 +189,7 @@ http://www.52north.org/test/observableProperty/9_6 http://www.52north.org/test/observableProperty/9_7 http://www.52north.org/test/observableProperty/9_8 + http://www.52north.org/test/observableProperty/9_9 http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement @@ -199,6 +200,7 @@ http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ComplexObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation + http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20_Mobile.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20_Mobile.xml index 9deeff49cf..45c371c180 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20_Mobile.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20_Mobile.xml @@ -41,7 +41,7 @@ - offeringID + Test Offering #10 http://www.52north.org/test/offering/10 diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20_SystemInstance.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20_SystemInstance.xml index 5cc07160ca..6e501e8d23 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20_SystemInstance.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_SML20_SystemInstance.xml @@ -90,7 +90,7 @@ - offeringID + Example Hydrophone 1 Offering ExampleHydrophone1Offering @@ -504,4 +504,4 @@ - \ No newline at end of file + diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_WML20.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_WML20.xml index 76f8720830..30359aabe6 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_WML20.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/InsertSensor_WML20.xml @@ -46,6 +46,7 @@ http://www.52north.org/test/observableProperty/9_6 http://www.52north.org/test/observableProperty/9_7 http://www.52north.org/test/observableProperty/9_8 + http://www.52north.org/test/observableProperty/9_9 http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement @@ -56,6 +57,7 @@ http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ComplexObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation + http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/UpdateSensorDescription_SML20.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/UpdateSensorDescription_SML20.xml index 2538affd81..a707ab9133 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/UpdateSensorDescription_SML20.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_soap/Transactional/UpdateSensorDescription_SML20.xml @@ -45,7 +45,7 @@ - offeringID + Test Offering #9 http://www.52north.org/test/offering/9 diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertObservation_Reference.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertObservation_Reference.xml new file mode 100644 index 0000000000..99e1c0afe1 --- /dev/null +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertObservation_Reference.xml @@ -0,0 +1,45 @@ + + + + http://www.52north.org/test/offering/9 + + + + + + 2012-11-19T13:45:15.000+00:00 + + + + + + + + http://www.52north.org/test/featureOfInterest/9 + 52°North + + + + + 51.935101100104916 7.651968812254194 + + + + + + + + diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor.xml index 35e56e584f..ffd33044e3 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor.xml @@ -214,6 +214,7 @@ http://www.52north.org/test/observableProperty/9_6 http://www.52north.org/test/observableProperty/9_7 http://www.52north.org/test/observableProperty/9_8 + http://www.52north.org/test/observableProperty/9_9 http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement @@ -224,6 +225,7 @@ http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ComplexObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation + http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20.xml index d7cbb088cb..4a81d406f7 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20.xml @@ -38,7 +38,7 @@ - offeringID + Test Offering #9 http://www.52north.org/test/offering/9 @@ -188,6 +188,7 @@ http://www.52north.org/test/observableProperty/9_6 http://www.52north.org/test/observableProperty/9_7 http://www.52north.org/test/observableProperty/9_8 + http://www.52north.org/test/observableProperty/9_9 http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement @@ -198,6 +199,7 @@ http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ComplexObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation + http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20_Mobile.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20_Mobile.xml index 8cb8f1d2a8..d818799771 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20_Mobile.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20_Mobile.xml @@ -38,7 +38,7 @@ - offeringID + Test Offering #10 http://www.52north.org/test/offering/10 diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20_SystemInstance.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20_SystemInstance.xml index 8a32e9a7b9..9fcb5c6982 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20_SystemInstance.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_SML20_SystemInstance.xml @@ -85,7 +85,7 @@ - offeringID + Example Hydrophone 1 Offering ExampleHydrophone1Offering diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_WML20.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_WML20.xml index 7beea9d46d..ca88bdf48d 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_WML20.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/InsertSensor_WML20.xml @@ -41,6 +41,7 @@ http://www.52north.org/test/observableProperty/9_6 http://www.52north.org/test/observableProperty/9_7 http://www.52north.org/test/observableProperty/9_8 + http://www.52north.org/test/observableProperty/9_9 http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement @@ -51,6 +52,7 @@ http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_GeometryObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ComplexObservation http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_SWEArrayObservation + http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ReferenceObservation http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint diff --git a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/UpdateSensorDescription_SML20.xml b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/UpdateSensorDescription_SML20.xml index f1fe55e883..31afde2844 100644 --- a/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/UpdateSensorDescription_SML20.xml +++ b/webapp/src/main/webapp/static/examples/sos_v20/requests_xml/Transactional/UpdateSensorDescription_SML20.xml @@ -40,7 +40,7 @@ - offeringID + Test Offering #9 http://www.52north.org/test/offering/9