From 3d356cc9ef7b1055242256c00a2e6b93b5462880 Mon Sep 17 00:00:00 2001 From: Dimitar Misev Date: Sat, 5 Feb 2011 22:44:35 +0100 Subject: WCS 2.0 implementation in Petascope --- petascope/INSTALL | 29 +- petascope/Makefile.in | 2 +- petascope/README | 57 +- petascope/lib/junit-4.5-api.zip | Bin 184067 -> 0 bytes petascope/lib/junit-4.5-src.jar | Bin 109014 -> 0 bytes petascope/misc/petascopedb.sql | 550 --------- petascope/nbproject/build-impl.xml | 222 +++- petascope/nbproject/genfiles.properties | 6 +- petascope/nbproject/project.properties | 24 +- petascope/nbproject/project.xml | 21 +- petascope/settings.properties | 73 -- petascope/src/log4j.properties | 37 +- petascope/src/petascope/ConfigManager.java | 84 +- petascope/src/petascope/PetascopeInterface.java | 434 ++++---- .../src/petascope/PetascopeXmlNamespaceMapper.java | 9 +- .../src/petascope/wcps/grammar/AxisIterator.java | 61 +- .../petascope/wcps/grammar/AxisIteratorList.java | 5 +- .../src/petascope/wcps/grammar/BooleanExpr.java | 5 +- .../petascope/wcps/grammar/BooleanScalarExpr.java | 5 +- petascope/src/petascope/wcps/grammar/CastExpr.java | 5 +- .../src/petascope/wcps/grammar/ComplexConst.java | 5 +- .../src/petascope/wcps/grammar/CondenseExpr.java | 5 +- .../petascope/wcps/grammar/CondenseOperation.java | 5 +- .../src/petascope/wcps/grammar/ConstantList.java | 7 +- .../wcps/grammar/CoverageConstantExpr.java | 5 +- .../wcps/grammar/CoverageConstructorExpr.java | 5 +- .../src/petascope/wcps/grammar/CoverageExpr.java | 5 +- .../src/petascope/wcps/grammar/CoverageList.java | 5 +- petascope/src/petascope/wcps/grammar/CrsList.java | 7 +- .../petascope/wcps/grammar/CrsTransformExpr.java | 5 +- .../wcps/grammar/DimensionIntervalElement.java | 5 +- .../wcps/grammar/DimensionIntervalExpr.java | 5 +- .../wcps/grammar/DimensionIntervalList.java | 7 +- .../wcps/grammar/DimensionPointElement.java | 5 +- .../petascope/wcps/grammar/DimensionPointList.java | 7 +- .../src/petascope/wcps/grammar/DomainExpr.java | 5 +- .../wcps/grammar/EncodedCoverageExpr.java | 5 +- .../petascope/wcps/grammar/ExponentialExpr.java | 5 +- .../src/petascope/wcps/grammar/ExtendExpr.java | 5 +- .../wcps/grammar/FieldInterpolationElement.java | 5 +- .../wcps/grammar/FieldInterpolationList.java | 7 +- .../src/petascope/wcps/grammar/ForClause.java | 5 +- .../petascope/wcps/grammar/ForClauseElements.java | 5 +- .../wcps/grammar/GeneralCondenseExpr.java | 5 +- .../src/petascope/wcps/grammar/IParseTreeNode.java | 5 +- .../wcps/grammar/ImageCrsDomainMetadataExpr.java | 5 +- .../src/petascope/wcps/grammar/IndexExpr.java | 5 +- .../wcps/grammar/InterpolationMethod.java | 5 +- .../wcps/grammar/InterpolationMethodList.java | 7 +- .../src/petascope/wcps/grammar/IntervalExpr.java | 5 +- .../src/petascope/wcps/grammar/MetaDataExpr.java | 5 +- .../petascope/wcps/grammar/NumericScalarExpr.java | 5 +- .../src/petascope/wcps/grammar/ProcessingExpr.java | 5 +- .../wcps/grammar/RangeConstructorExpr.java | 7 +- .../wcps/grammar/RangeConstructorTerm.java | 5 +- .../src/petascope/wcps/grammar/RangeExpr.java | 5 +- .../src/petascope/wcps/grammar/RangeExprList.java | 7 +- .../src/petascope/wcps/grammar/ReduceExpr.java | 5 +- .../src/petascope/wcps/grammar/ReturnClause.java | 5 +- .../src/petascope/wcps/grammar/ScalarExpr.java | 5 +- .../src/petascope/wcps/grammar/ScaleExpr.java | 5 +- .../src/petascope/wcps/grammar/SelectExpr.java | 5 +- .../petascope/wcps/grammar/SetMetaDataExpr.java | 5 +- .../src/petascope/wcps/grammar/SliceExpr.java | 5 +- .../src/petascope/wcps/grammar/StoreExpr.java | 5 +- .../petascope/wcps/grammar/StringScalarExpr.java | 5 +- .../src/petascope/wcps/grammar/SubsetExpr.java | 5 +- .../petascope/wcps/grammar/TrigonometricExpr.java | 5 +- petascope/src/petascope/wcps/grammar/TrimExpr.java | 5 +- .../src/petascope/wcps/grammar/VariableList.java | 5 +- .../src/petascope/wcps/grammar/WCPSRequest.java | 5 +- .../src/petascope/wcps/grammar/WhereClause.java | 5 +- petascope/src/petascope/wcps/grammar/wcps.g | 4 +- .../src/petascope/wcps/grammar/wcpsParser.java | 1 - petascope/src/petascope/wcps/server/cli/xml.java | 269 +++-- .../petascope/wcps/server/core/AxisIterator.java | 183 ++- .../src/petascope/wcps/server/core/AxisName.java | 77 +- .../server/core/BinaryOperationCoverageExpr.java | 210 ++-- .../wcps/server/core/BooleanScalarExpr.java | 236 ++-- .../wcps/server/core/CellDomainElement.java | 35 +- .../wcps/server/core/ComplexConstant.java | 203 ++-- .../wcps/server/core/CondenseOperation.java | 107 +- .../wcps/server/core/CondenseScalarExpr.java | 156 ++- .../wcps/server/core/ConstantCoverageExpr.java | 288 +++-- .../petascope/wcps/server/core/ConstantList.java | 169 ++- .../wcps/server/core/ConstructCoverageExpr.java | 284 ++--- .../petascope/wcps/server/core/CoverageExpr.java | 321 +++--- .../wcps/server/core/CoverageExprPairType.java | 166 ++- .../petascope/wcps/server/core/CoverageInfo.java | 298 ++--- .../wcps/server/core/CoverageIterator.java | 144 ++- petascope/src/petascope/wcps/server/core/Crs.java | 210 ++-- .../wcps/server/core/CrsTransformCoverageExpr.java | 45 +- .../wcps/server/core/DbMetadataSource.java | 1175 -------------------- .../wcps/server/core/DimensionIntervalElement.java | 407 +++---- .../wcps/server/core/DimensionIntervalList.java | 70 +- .../wcps/server/core/DimensionPointElement.java | 220 ++-- .../petascope/wcps/server/core/DomainElement.java | 354 +++--- .../wcps/server/core/DynamicMetadataSource.java | 106 -- .../petascope/wcps/server/core/EncodeDataExpr.java | 152 ++- .../wcps/server/core/ExtendCoverageExpr.java | 224 ++-- .../server/core/FieldInterpolationElement.java | 118 +- .../src/petascope/wcps/server/core/FieldName.java | 65 +- .../petascope/wcps/server/core/ICoverageInfo.java | 5 +- .../wcps/server/core/IDynamicMetadataSource.java | 34 - .../wcps/server/core/IMetadataSource.java | 45 - .../src/petascope/wcps/server/core/IRasNode.java | 5 +- .../server/core/InducedOperationCoverageExpr.java | 136 ++- .../wcps/server/core/InterpolationMethod.java | 131 +-- .../src/petascope/wcps/server/core/Metadata.java | 705 ------------ .../wcps/server/core/MetadataScalarExpr.java | 35 +- .../wcps/server/core/NumericScalarExpr.java | 306 +++-- .../wcps/server/core/ProcessCoveragesRequest.java | 462 ++++---- .../petascope/wcps/server/core/RangeComponent.java | 133 ++- .../wcps/server/core/RangeCoverageExpr.java | 126 ++- .../petascope/wcps/server/core/RangeElement.java | 294 ++--- .../src/petascope/wcps/server/core/RangeField.java | 68 +- .../wcps/server/core/ReduceScalarExpr.java | 96 +- petascope/src/petascope/wcps/server/core/SDU.java | 20 +- .../src/petascope/wcps/server/core/ScalarExpr.java | 303 +++-- .../wcps/server/core/ScaleCoverageExpr.java | 250 ++--- .../wcps/server/core/SetMetadataCoverageExpr.java | 45 +- .../wcps/server/core/SliceCoverageExpr.java | 222 ++-- .../wcps/server/core/StringScalarExpr.java | 86 +- .../server/core/SubsetOperationCoverageExpr.java | 100 +- .../wcps/server/core/TrimCoverageExpr.java | 224 ++-- .../server/core/UnaryOperationCoverageExpr.java | 266 +++-- .../wcps/server/core/VariableReference.java | 73 +- petascope/src/petascope/wcps/server/core/WCPS.java | 327 +++--- .../src/petascope/wcps/server/core/Wgs84Crs.java | 207 ++-- .../src/petascope/wcps/server/core/XmlQuery.java | 13 +- .../server/exceptions/InvalidCrsException.java | 30 - .../exceptions/InvalidMetadataException.java | 37 - .../exceptions/InvalidWcpsRequestException.java | 39 - .../wcps/server/exceptions/ResourceException.java | 41 - .../wcps/server/exceptions/WCPSException.java | 40 - .../petascope/wcps/server/servlet/WCPSServlet.java | 468 ++++---- .../wcps/server/test/FullTestsOnline.java | 10 +- .../petascope/wcps/server/test/GrammarTest.java | 3 +- .../wcps/server/test/GrammarTestOnline.java | 3 +- .../petascope/wcps/server/test/XmlTestOnline.java | 3 +- petascope/src/petascope/wcs/server/WcsServer.java | 84 +- petascope/src/petascope/wcs/server/cli/CLI.java | 14 - .../src/petascope/wcs/server/core/TimeString.java | 15 +- .../wcs/server/core/convertGetCoverage.java | 138 ++- .../wcs/server/core/executeDescribeCoverage.java | 32 +- .../wcs/server/core/executeGetCapabilities.java | 33 +- .../exceptions/ActionNotSupportedException.java | 42 - .../exceptions/BadResponseHandlerException.java | 42 - .../server/exceptions/InputOutputException.java | 42 - .../exceptions/InternalComponentException.java | 42 - .../server/exceptions/InternalSqlException.java | 42 - .../exceptions/InvalidParameterValueException.java | 42 - .../exceptions/InvalidPropertyValueException.java | 42 - .../server/exceptions/InvalidRequestException.java | 42 - .../InvalidServiceConfigurationException.java | 42 - .../InvalidTemporalMetadataException.java | 42 - .../server/exceptions/MaliciousQueryException.java | 42 - .../exceptions/MissingParameterValueException.java | 42 - .../MultiBandImagesNotSupportedException.java | 42 - .../exceptions/NoApplicableCodeException.java | 42 - .../NodeParsingNotImplementedException.java | 42 - .../exceptions/NotEnoughStorageException.java | 42 - .../exceptions/RasdamanRequestFailedException.java | 42 - .../exceptions/RasdamanUnavailableException.java | 42 - .../exceptions/ServletConnectionException.java | 42 - .../UnsupportedCombinationException.java | 42 - .../wcs/server/exceptions/WCSException.java | 149 --- .../wcs/server/exceptions/WcsRuntimeException.java | 42 - .../server/exceptions/XmlNotValidException.java | 42 - .../server/exceptions/XmlStructuresException.java | 42 - .../schemas/Examples/requestDescribeCoverage.xml | 8 - .../schemas/Examples/requestGetCapabilities.xml | 10 - .../wcs2/schemas/Examples/requestGetCoverage.xml | 18 - .../schemas/Examples/responseDescribeCoverage.xml | 37 - .../schemas/Examples/responseGetCapabilities.xml | 60 - .../wcs2/schemas/Examples/responseGetCoverage.xml | 40 - .../wcs2/schemas/Examples/wcsDescribeCoverage.xml | 57 - .../wcs2/schemas/Examples/wcsGetCapabilities.xml | 125 --- .../wcs2/schemas/Examples/wcsGetCoverage.xml | 57 - .../src/petascope/wcs2/schemas/SchemaServlet.java | 97 -- .../schemas/gml/Examples/2dIdentityConversion.xml | 16 - .../wcs2/schemas/gml/Examples/2dIdentityMethod.xml | 22 - .../schemas/gml/Examples/exampleRangeStructure.xml | 35 - .../gml/Examples/exampleRectifiedGridCoverage.xml | 56 - .../Examples/exampleReferenceablGridCoverage.xml | 60 - .../src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd | 21 - .../src/petascope/wcs2/schemas/gml/wcsCoverage.xsd | 160 --- .../wcs2/schemas/gml/wcsDataTypeIdentifiers.xml | 111 -- .../src/petascope/wcs2/schemas/gml/wcsGrids.xsd | 156 --- petascope/src/petascope/wcs2/schemas/wcsAll.xsd | 21 - petascope/src/petascope/wcs2/schemas/wcsCommon.xsd | 87 -- .../petascope/wcs2/schemas/wcsDescribeCoverage.xsd | 73 -- .../src/petascope/wcs2/schemas/wcsExtensions.xml | 125 --- .../petascope/wcs2/schemas/wcsGetCapabilities.xsd | 56 - .../src/petascope/wcs2/schemas/wcsGetCoverage.xsd | 88 -- .../src/petascope/wcs2/server/Wcs2Server.java | 120 -- .../wcs2/server/ops/DescribeCoverage.java | 204 ---- .../petascope/wcs2/server/ops/GetCapabilities.java | 85 -- .../src/petascope/wcs2/server/ops/GetCoverage.java | 529 --------- .../petascope/wcs2/server/ops/WcsOperation.java | 36 - .../server/templates/DescribeCoverageTemplate.xml | 38 - .../server/templates/GetCapabilitiesTemplate.xml | 92 -- .../wcs2/server/templates/GetCoverageTemplate.xml | 38 - .../wcs2/server/templates/WcsNamespaceContext.java | 59 - .../src/petascope/wcst/server/WcstServer.java | 61 +- .../petascope/wcst/server/servlet/wcstServlet.java | 14 +- .../wcst/transaction/ServiceFirewall.java | 4 +- .../wcst/transaction/executeAsyncTransaction.java | 52 +- .../wcst/transaction/executeTransaction.java | 429 ++++--- .../wcst/transaction/tools/RasdamanUtils.java | 28 +- .../wcst/transaction/tools/TestRasdamanUtils.java | 12 +- petascope/src/petascope/wps/server/WpsServer.java | 24 +- petascope/web/WEB-INF/web.xml | 9 + 213 files changed, 5810 insertions(+), 12644 deletions(-) delete mode 100644 petascope/lib/junit-4.5-api.zip delete mode 100644 petascope/lib/junit-4.5-src.jar delete mode 100644 petascope/misc/petascopedb.sql delete mode 100644 petascope/settings.properties delete mode 100644 petascope/src/petascope/wcps/server/core/DbMetadataSource.java delete mode 100644 petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java delete mode 100644 petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java delete mode 100644 petascope/src/petascope/wcps/server/core/IMetadataSource.java delete mode 100644 petascope/src/petascope/wcps/server/core/Metadata.java delete mode 100644 petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java delete mode 100644 petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java delete mode 100644 petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java delete mode 100644 petascope/src/petascope/wcps/server/exceptions/ResourceException.java delete mode 100644 petascope/src/petascope/wcps/server/exceptions/WCPSException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/InputOutputException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/WCSException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java delete mode 100644 petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/SchemaServlet.java delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd delete mode 100644 petascope/src/petascope/wcs2/schemas/wcsAll.xsd delete mode 100644 petascope/src/petascope/wcs2/schemas/wcsCommon.xsd delete mode 100644 petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd delete mode 100644 petascope/src/petascope/wcs2/schemas/wcsExtensions.xml delete mode 100644 petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd delete mode 100644 petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd delete mode 100644 petascope/src/petascope/wcs2/server/Wcs2Server.java delete mode 100644 petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java delete mode 100644 petascope/src/petascope/wcs2/server/ops/GetCapabilities.java delete mode 100644 petascope/src/petascope/wcs2/server/ops/GetCoverage.java delete mode 100644 petascope/src/petascope/wcs2/server/ops/WcsOperation.java delete mode 100644 petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml delete mode 100644 petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml delete mode 100644 petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml delete mode 100644 petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java (limited to 'petascope') diff --git a/petascope/INSTALL b/petascope/INSTALL index 9ef074b..1ee10ad 100644 --- a/petascope/INSTALL +++ b/petascope/INSTALL @@ -1,25 +1,26 @@ -This file contains instructions on how to install PetaScope. +This file contains instructions on how to install PetaScope. BUILD AND INSTALL: -- download the PetaScope package from www.petascope.org/Download - and uncompress the tarball; alternatively, download from the - repository saying - $ git clone git://kahlua.eecs.jacobs-university.de/petascope.git -- compile the code and the servlet interface: - $ ant -- edit the settings.properties configuration file -- initialize the PostgreSQL database for PetaScope metadata saying - $ psql < misc/petascopedb.sql -- deploy the war file, dist/petascope.war, with Tomcat. +- PetaScope is part of the rasdaman distribution (www.rasdaman.org), to get it use + $ git clone git://kahlua.eecs.jacobs-university.de/rasdaman.git +- Setup the database (create database petascopedb in PostgreSQL, with user + petauser/petapasswd), or edit the db/settings.properties configuration file. + To insert initial metadata in petascopedb, run: + $ make setupdb +- Compile all in one step: + $ make all + This compiles the code, creates a war archive in build/dist and Javadoc in build/apidocs) +- Deploy the war file, build/dist/petascope.war, with Tomcat. If CATALINA_HOME + is properly set to the Tomcat's home directory, you can also do: + $ make install +- Run any tests (currently this runs only WCS 2.0 tests): + $ make test Please note that in order for PetaScope to run, you also need a rasdaman server available. You can download and install it from www.rasdaman.org/Download -For further details, refer to the documentation available at -www.petascope.org/Install and www.petascope.org/Support. - VERSION COMPATIBILITY STATEMENT: Petascope compiles successfully with Java 1.6. diff --git a/petascope/Makefile.in b/petascope/Makefile.in index 2c15aaa..35591c4 100644 --- a/petascope/Makefile.in +++ b/petascope/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff --git a/petascope/README b/petascope/README index f46ed45..095a090 100644 --- a/petascope/README +++ b/petascope/README @@ -1,42 +1,42 @@ -This file is part of PetaScope, a free implementation of the Open GeoSpatial Consortium (OGC, www.opengeospatial.org) Web Coverage Service (WCS) standards suite. As such, it implements the following interface standards: -- Web Coverage Service (WCS) 1.1.2 -- WCS Processing Extension 1.0.0, which grounds on Web Coverage Processing Service (WCPS) 1.0.0 -- WCS Transaction Extension (WCS-T) 1.4.0 - -In addition, you can find a demo implementation of the Web Coverage Service (WCS) 2.0, which is currently under development. +PetaScope +--------- -PetaScope is implemented as a Java servlet. As such, it relies on the following freely available components which are not part of the PetaScope distribution: -- rasdaman (www.rasdaman.org) as raster server -- Tomcat (tomcat.apache.org) as servlet container -- PostgreSQL (www.postgresql.org) as relational database system +This file is part of PetaScope, a free implementation of the Open GeoSpatial Consortium (OGC, +www.opengeospatial.org) Web Coverage Service (WCS) standards suite. As such, it implements the +following interface standards: + - Web Coverage Service (WCS) 2.0 + - Web Coverage Service (WCS) 1.1.2 + - Web Coverage Processing Service (WCPS) 1.0.0 + - WCS Transaction Extension (WCS-T) 1.4.0 -DISTRIBUTION -============ +PetaScope is implemented as a Java servlet. As such, it relies on the following +freely available components which are not part of the PetaScope distribution: + - rasdaman (www.rasdaman.org) as raster server + - Tomcat (tomcat.apache.org) as servlet container + - PostgreSQL (www.postgresql.org) as relational database system + + +Distribution +------------ A PetaScope distribution consists of the following directories and files: -doc/ Source code documentation, - generated by javadoc -examples/ Sample XML requests -lib/ External libraries required (+) -misc/ Additional scripts and files, e.g., for - initializing the metadata database -src/ PetaScope Java source code -test/ test source code and test files -nbproject/ Project build files and properties. -xml/ WC*S schema files used by PetaScope - (copies from schemas.opengis.net) -settings.properties Servlet initialization parameters, - such as database connections (*) +db/ Scripts to initialize and maintain the PetaScope database +db/settings.properties Servlet initialization parameters, such as database connections (*) +lib/ External libraries required +makefiles/ +nbproject/ NetBeans project build files and properties. +src/ Main source code +test/ Test source code and test files +xml/ WC*S schema files used by PetaScope (copies from schemas.opengis.net) web/WEB-INF/web.xml PetaScope servlet deployment file (*) LICENSE PetaScope license build.xml "Ant" rule file for building PetaScope +Makefile Standard Makefile for building PetaScope, see 'make help' for more details +INSTALL Installation guidelines README This file Notes: -(+) provided for convenience; it is recommended - to sustitute these by the resp. files of your - installation. (*) requires manual configuration See INSTALL for installation guidelines. @@ -48,4 +48,3 @@ PetaScope is licensed by Jacobs University Bremen (www.jacobs-university.de) and Peter Baumann (www.peter-baumann.org) under the GNU General Public License (GPL), see www.gnu.org or the LICENSE file. - diff --git a/petascope/lib/junit-4.5-api.zip b/petascope/lib/junit-4.5-api.zip deleted file mode 100644 index 5748c44..0000000 Binary files a/petascope/lib/junit-4.5-api.zip and /dev/null differ diff --git a/petascope/lib/junit-4.5-src.jar b/petascope/lib/junit-4.5-src.jar deleted file mode 100644 index 18774a5..0000000 Binary files a/petascope/lib/junit-4.5-src.jar and /dev/null differ diff --git a/petascope/misc/petascopedb.sql b/petascope/misc/petascopedb.sql deleted file mode 100644 index 771b641..0000000 --- a/petascope/misc/petascopedb.sql +++ /dev/null @@ -1,550 +0,0 @@ --- These SQL statements will create the metadata database required by WCPS. Each coverage defined here must have a rasdaman collection by the same name in order to work. - - --- There are three types of tables. --- The "static" fixed tables are the ones for which you see "insert" statements in this file. They should generally never be modified. Any modifications of these tables will require to be reflected in the WCPS source code, so a code review must be done if anything is inserted or deleted there. The values of these tables are specified by the WCPS standard. --- The "service" tables contain various things that are not per-coverage. These are modifiable, but see the comments for each before you change them. --- The "coverage" tables contain information for each coverage. They can be modified freely, as long as the end result makes sense, as described below. - ------------------------------------------------------------------------------------------ --- STATIC TABLES. Once again, modifying any of these will break WCPS. ------------------------------------------------------------------------------------------ - --- This is a static table, describing the type of axes WCPS knows about. Don't touch it. -CREATE TABLE ps_axistype ( - id serial NOT NULL, - axistype character varying(9) UNIQUE NOT NULL, - primary key (id) -); - -INSERT INTO ps_axistype VALUES (1, 'x'); -INSERT INTO ps_axistype VALUES (2, 'y'); -INSERT INTO ps_axistype VALUES (3, 'temporal'); -INSERT INTO ps_axistype VALUES (4, 'elevation'); -INSERT INTO ps_axistype VALUES (5, 'other'); -INSERT INTO ps_axistype VALUES (6, 't'); -SELECT pg_catalog.setval('ps_axistype_id_seq', 6, true); - --- This is a static table, describing the range datatypes WCPS knows about. Don't touch it. -CREATE TABLE ps_datatype ( - id serial NOT NULL, - datatype text NOT NULL, - primary key (id) -); - -INSERT INTO ps_datatype (id, datatype) VALUES (1, 'boolean'); -INSERT INTO ps_datatype (id, datatype) VALUES (2, 'char'); -INSERT INTO ps_datatype (id, datatype) VALUES (3, 'unsigned char'); -INSERT INTO ps_datatype (id, datatype) VALUES (4, 'short'); -INSERT INTO ps_datatype (id, datatype) VALUES (5, 'unsigned short'); -INSERT INTO ps_datatype (id, datatype) VALUES (6, 'int'); -INSERT INTO ps_datatype (id, datatype) VALUES (7, 'unsigned int'); -INSERT INTO ps_datatype (id, datatype) VALUES (8, 'long'); -INSERT INTO ps_datatype (id, datatype) VALUES (9, 'unsigned long'); -INSERT INTO ps_datatype (id, datatype) VALUES (10, 'float'); -INSERT INTO ps_datatype (id, datatype) VALUES (11, 'double'); -INSERT INTO ps_datatype (id, datatype) VALUES (12, 'complex'); -INSERT INTO ps_datatype (id, datatype) VALUES (13, 'complex2'); -SELECT pg_catalog.setval('ps_datatype_id_seq', 13, true); - --- This is a static table, describing the interpolation types WCPS knows about. Don't touch it. -CREATE TABLE ps_interpolationtype ( - id serial NOT NULL, - interpolationtype text NOT NULL, - primary key (id) -); - -INSERT INTO ps_interpolationtype (id, interpolationtype) VALUES (1, 'nearest'); -INSERT INTO ps_interpolationtype (id, interpolationtype) VALUES (2, 'linear'); -INSERT INTO ps_interpolationtype (id, interpolationtype) VALUES (3, 'cubic'); -INSERT INTO ps_interpolationtype (id, interpolationtype) VALUES (4, 'quadratic'); -INSERT INTO ps_interpolationtype (id, interpolationtype) VALUES (5, 'none'); -SELECT pg_catalog.setval('ps_interpolationtype_id_seq', 5, true); - --- This is a static table, describing the null resistances WCPS knows about. Don't touch it. -CREATE TABLE ps_nullresistance ( - id serial NOT NULL, - nullresistance text NOT NULL, - primary key (id) -); - -INSERT INTO ps_nullresistance (id, nullresistance) VALUES (1, 'full'); -INSERT INTO ps_nullresistance (id, nullresistance) VALUES (2, 'none'); -INSERT INTO ps_nullresistance (id, nullresistance) VALUES (3, 'half'); -INSERT INTO ps_nullresistance (id, nullresistance) VALUES (4, 'other'); -SELECT pg_catalog.setval('ps_nullresistance_id_seq', 4, true); - --- This is a static table, describing the coordinate reference systems known by WCPS. Don't touch it. --- Whether it's actually present in the table or not, the CRS called "CRS:1" is always supported. CRS:1 is the image CRS, i.e. addressable by pixels. --- The current implementation does not support CRSs other than CRS:1, and does not use the contents of the table. -CREATE TABLE ps_crs ( - id serial NOT NULL, - name text NOT NULL, - primary key (id) -); - -INSERT INTO ps_crs VALUES (9, 'urn:ogc:def:crs:OGC:1.3:CRS84'); -INSERT INTO ps_crs VALUES (8, 'CRS:1'); -SELECT pg_catalog.setval('ps_crs_id_seq', 9, true); - - ------------------------------------------------------------------------------------------ --- SERVICE TABLES. ------------------------------------------------------------------------------------------ - --- This table describes the encoding formats known to WCPS, as well as their mappings to mimetypes. WCPS doesn't care about these, but if you add any, make sure that rasdaman can encode in the format specified by 'name', or encoding to that format won't work. -CREATE TABLE ps_format ( - id serial NOT NULL, - name character varying(64) NOT NULL, - mimetype character varying(128) NOT NULL, - primary key (id) -); - -INSERT INTO ps_format VALUES (1, 'csv', 'text/plain'); -INSERT INTO ps_format VALUES (2, 'jpg', 'image/jpeg'); -INSERT INTO ps_format VALUES (3, 'jpeg', 'image/jpeg'); -INSERT INTO ps_format VALUES (4, 'png', 'image/png'); -INSERT INTO ps_format VALUES (5, 'tif', 'image/tiff'); -INSERT INTO ps_format VALUES (6, 'tiff', 'image/tiff'); -INSERT INTO ps_format VALUES (7, 'raw', 'application/x-octet-stream'); - -SELECT pg_catalog.setval('ps_format_id_seq', 7, true); - - ------------------------------------------------------------------------------------------ --- COVERAGE TABLES. At this point, you need to have read the beginning of the WCPS standard, which describes the different metadata a coverage may have. --- When entering a new coverage, it's best to fill the tables in the order listed here, to satisfy foreign key constraints. ------------------------------------------------------------------------------------------ - --- A coverage must be introduced here. --- The name must correspond to the rasdaman collection for that data. It must also be present in PS_NullSet below. --- The nullDefault must be the default null value for the coverage. It must match the range type. If the range type is a structure, it must look like this: {c1,c2,c3...} where cn is the nth component of the value. --- The interpolationTypeDefault is the default interpolation type used in operations that require one, but don't have one specified. It must point to an entry in the static table above. --- The nullResistanceDefault is the default null resistance used in operations that require one, but don't have one specified. It must point to an entry in the static table above. -CREATE TABLE ps_coverage ( - id serial NOT NULL, - name text NOT NULL, - nullvalue text, - crs text, - nulldefault text, - interpolationtypedefault integer, - nullresistancedefault integer, - primary key (id), - foreign key (interpolationTypeDefault) references ps_interpolationType (id), - foreign key (nullResistanceDefault) references ps_nullResistance (id) -); - -INSERT INTO ps_coverage VALUES (30, 'climate_clouds', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (31, 'climate_earth', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (8, 'Modis', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (29, 'TP', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (27, 'NN3_10', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (2, 'nrg', NULL, '', '{0,0,0}', 5, 2); -INSERT INTO ps_coverage VALUES (28, 'NN3_11', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (32, 'NIR', NULL, NULL, '{0,0,0}', 5, 2); -INSERT INTO ps_coverage VALUES (7, 'Waha_SEGY', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (3, 'mr', NULL, '', '{0,0}', 5, 2); -INSERT INTO ps_coverage VALUES (1, 'rgb', NULL, NULL, '{0,0,0}', 5, 2); -INSERT INTO ps_coverage VALUES (17, 'climate_temperature', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (16, 'whatevereeeee', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (6, 'Boonsville_SEGY', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (4, 'mowglie', NULL, '', '{0,0,0}', 5, 2); -INSERT INTO ps_coverage VALUES (19, 'NN3_2', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (20, 'NN3_3', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (18, 'NN3_1', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (23, 'NN3_6', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (24, 'NN3_7', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (21, 'NN3_4', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (22, 'NN3_5', NULL, NULL, '0', 5, 2); -INSERT INTO ps_coverage VALUES (25, 'NN3_8', NULL, '', '0', 5, 2); -INSERT INTO ps_coverage VALUES (26, 'NN3_9', NULL, NULL, '0', 5, 2); - -SELECT pg_catalog.setval('ps_coverage_id_seq', 32, true); - - --- Each coverage has a number of axes, called its dimension. Each axis must have an entry here. --- The coverage is the id of the coverage a given entry describes. --- The i is the number of axis for that coverage. Axes are ordered, so be careful. --- The lo is the lowest addressable pixel, usually 0. --- The hi is the highest addressable pixel, usually the total number of pixels on the axis minus 1. -CREATE TABLE ps_celldomain ( - id serial NOT NULL, - coverage integer NOT NULL, - i integer NOT NULL, - lo integer NOT NULL, - hi integer NOT NULL, - primary key (id), - unique (coverage, i), - foreign key (coverage) references ps_coverage (id) on delete cascade -); - -INSERT INTO ps_celldomain VALUES (147, 30, 0, 0, 719); -INSERT INTO ps_celldomain VALUES (148, 30, 1, 0, 360); -INSERT INTO ps_celldomain VALUES (149, 30, 2, 0, 59); -INSERT INTO ps_celldomain VALUES (152, 31, 0, 0, 719); -INSERT INTO ps_celldomain VALUES (153, 31, 1, 0, 360); -INSERT INTO ps_celldomain VALUES (154, 31, 2, 0, 60); -INSERT INTO ps_celldomain VALUES (155, 8, 0, 0, 7); -INSERT INTO ps_celldomain VALUES (156, 8, 1, 0, 1199); -INSERT INTO ps_celldomain VALUES (157, 8, 2, 0, 1199); -INSERT INTO ps_celldomain VALUES (158, 29, 0, 0, 719); -INSERT INTO ps_celldomain VALUES (159, 29, 1, 0, 369); -INSERT INTO ps_celldomain VALUES (160, 29, 2, 0, 30); -INSERT INTO ps_celldomain VALUES (161, 29, 3, 0, 25); -INSERT INTO ps_celldomain VALUES (162, 27, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (163, 2, 0, 0, 1959); -INSERT INTO ps_celldomain VALUES (164, 2, 1, 0, 1075); -INSERT INTO ps_celldomain VALUES (165, 28, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (166, 32, 0, 0, 1915); -INSERT INTO ps_celldomain VALUES (167, 32, 1, 0, 1075); -INSERT INTO ps_celldomain VALUES (168, 7, 0, 0, 201); -INSERT INTO ps_celldomain VALUES (169, 7, 1, 0, 258); -INSERT INTO ps_celldomain VALUES (170, 7, 2, 0, 1000); -INSERT INTO ps_celldomain VALUES (171, 3, 0, 0, 255); -INSERT INTO ps_celldomain VALUES (172, 3, 1, 0, 210); -INSERT INTO ps_celldomain VALUES (173, 1, 0, 0, 399); -INSERT INTO ps_celldomain VALUES (174, 1, 1, 0, 343); -INSERT INTO ps_celldomain VALUES (175, 17, 0, 0, 719); -INSERT INTO ps_celldomain VALUES (176, 17, 1, 0, 360); -INSERT INTO ps_celldomain VALUES (177, 17, 2, 0, 60); -INSERT INTO ps_celldomain VALUES (178, 16, 0, 0, 699); -INSERT INTO ps_celldomain VALUES (179, 6, 0, 0, 134); -INSERT INTO ps_celldomain VALUES (180, 6, 1, 0, 94); -INSERT INTO ps_celldomain VALUES (181, 6, 2, 0, 2000); -INSERT INTO ps_celldomain VALUES (182, 4, 0, 0, 119); -INSERT INTO ps_celldomain VALUES (183, 4, 1, 0, 158); -INSERT INTO ps_celldomain VALUES (184, 4, 2, 0, 118); -INSERT INTO ps_celldomain VALUES (185, 19, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (186, 20, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (187, 18, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (188, 23, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (189, 24, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (190, 21, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (191, 22, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (192, 25, 0, 0, 125); -INSERT INTO ps_celldomain VALUES (193, 26, 0, 0, 125); - -SELECT pg_catalog.setval('ps_celldomain_id_seq', 193, true); - --- Addressing by pixels is good enough for some things, but sometimes you need to address a coverage via its geo coordinates. The geographic extent of each coverage is similar to the cell domain, but in geo coordinates. --- For each coverage, the number of entries must be the same as in the CellDomain table. --- The coverage is the id of the coverage a given entry describes. --- The i is the number of axis for that coverage. Axes are ordered, so be careful. --- The name is the name of a given axis. For example, a horizontal axis could have the name "x", and the a vertical one could have "y". You can then ask WCPS to scale x by 2, etc. --- The type is one of the axes types in the static table above. --- If the type is not temporal, numLo and numHi must be the lowest and highest addressable points in geo coordinates, and strLo and strHi must be left null. --- If the type is temporal, numLo and numHi must be left null, and strLo and strHi must be timestamps, specifying the extent. --- Because WCPS currently does not support geo coordinates, you can use dummy values for numLo and numHi, e.g. 0 and 1. --- Because the current implementation does not currently support temporal axes, you can use "other" as the type and specify dummy values for numLo and numHi. --- Fanally, geocoordinates are dependent on the CRS, so this table doesn't currently make much sense. An entry should be per coverage, axis, and CRS, rather than just per coverage and axis as it is now. -CREATE TABLE ps_domain ( - id serial NOT NULL, - coverage integer NOT NULL, - i integer NOT NULL, - name text NOT NULL, - type integer NOT NULL, - numlo double precision, - numhi double precision, - strlo text, - strhi text, - primary key (id), - unique (coverage, i), - foreign key (coverage) references ps_coverage (id) on delete cascade, - foreign key (type) references ps_axisType (id) on delete cascade -); - -INSERT INTO ps_domain VALUES (104, 30, 0, 'x', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (105, 30, 1, 'y', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (106, 30, 2, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (109, 31, 0, 'x', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (110, 31, 1, 'y', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (111, 31, 2, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (112, 8, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (113, 8, 1, 'x', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (114, 8, 2, 'y', 2, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (115, 29, 0, 'x', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (116, 29, 1, 'y', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (117, 29, 2, 'z', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (118, 29, 3, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (119, 27, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (120, 2, 0, 'x', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (121, 2, 1, 'y', 2, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (122, 28, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (123, 32, 0, 'x', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (124, 32, 1, 'y', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (125, 7, 0, 'x', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (126, 7, 1, 'y', 2, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (127, 7, 2, 'z', 4, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (128, 3, 0, 'x', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (129, 3, 1, 'y', 2, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (130, 1, 0, 'x', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (131, 1, 1, 'y', 2, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (132, 17, 0, 'x', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (133, 17, 1, 'y', 2, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (134, 17, 2, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (135, 16, 0, 'd0', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (136, 6, 0, 'x', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (137, 6, 1, 'y', 2, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (138, 6, 2, 'z', 4, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (139, 4, 0, 'x', 1, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (140, 4, 1, 'y', 2, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (141, 4, 2, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (142, 19, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (143, 20, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (144, 18, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (145, 23, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (146, 24, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (147, 21, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (148, 22, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (149, 25, 0, 't', 5, 0, 1, NULL, NULL); -INSERT INTO ps_domain VALUES (150, 26, 0, 't', 5, 0, 1, NULL, NULL); - -SELECT pg_catalog.setval('ps_domain_id_seq', 55, true); - --- The range is the datatype of the coverage cell values. --- The coverage is the id of the coverage a given entry describes. --- The i is the number of the structure component. Because cells can have composite types, you could have multiple entries for each coverage. Entries are ordered. --- The name is a handle for that component. Names for the components for a RGB coverage, for example, could be "red", "green", and "blue". You can then ask WCPS for the blue channel of a coverage, and it will know what you're talking about. --- The type is the datatype of the given component. Note that while in principle each component could have a different datatype, having that might cause problems. -CREATE TABLE ps_range ( - id serial NOT NULL, - coverage integer NOT NULL, - i integer NOT NULL, - name text NOT NULL, - type integer NOT NULL, - primary key (id), - unique (coverage, i), - foreign key (coverage) references ps_coverage (id) on delete cascade, - foreign key (type) references ps_dataType (id) on delete cascade -); - -INSERT INTO ps_range VALUES (165, 30, 0, 'value', 10); -INSERT INTO ps_range VALUES (169, 31, 0, 'value', 10); -INSERT INTO ps_range VALUES (170, 8, 0, 'fire', 2); -INSERT INTO ps_range VALUES (171, 29, 0, 'value', 10); -INSERT INTO ps_range VALUES (172, 27, 0, 'value', 5); -INSERT INTO ps_range VALUES (173, 2, 0, 'nir', 7); -INSERT INTO ps_range VALUES (174, 2, 1, 'red', 7); -INSERT INTO ps_range VALUES (175, 2, 2, 'green', 7); -INSERT INTO ps_range VALUES (176, 28, 0, 'value', 5); -INSERT INTO ps_range VALUES (177, 32, 0, 'red', 7); -INSERT INTO ps_range VALUES (178, 32, 1, 'green', 7); -INSERT INTO ps_range VALUES (179, 32, 2, 'blue', 7); -INSERT INTO ps_range VALUES (180, 7, 0, 'density', 4); -INSERT INTO ps_range VALUES (181, 3, 0, 'green', 7); -INSERT INTO ps_range VALUES (182, 3, 1, 'grey', 7); -INSERT INTO ps_range VALUES (183, 1, 0, 'red', 7); -INSERT INTO ps_range VALUES (184, 1, 1, 'green', 7); -INSERT INTO ps_range VALUES (185, 1, 2, 'blue', 7); -INSERT INTO ps_range VALUES (186, 17, 0, 'temperature', 10); -INSERT INTO ps_range VALUES (187, 16, 0, 'r0', 7); -INSERT INTO ps_range VALUES (188, 6, 0, 'density', 10); -INSERT INTO ps_range VALUES (189, 4, 0, 'red', 7); -INSERT INTO ps_range VALUES (190, 4, 1, 'green', 7); -INSERT INTO ps_range VALUES (191, 4, 2, 'blue', 7); -INSERT INTO ps_range VALUES (192, 19, 0, 'value', 5); -INSERT INTO ps_range VALUES (193, 20, 0, 'value', 5); -INSERT INTO ps_range VALUES (194, 18, 0, 'value', 5); -INSERT INTO ps_range VALUES (195, 23, 0, 'value', 5); -INSERT INTO ps_range VALUES (196, 24, 0, 'value', 5); -INSERT INTO ps_range VALUES (197, 21, 0, 'value', 5); -INSERT INTO ps_range VALUES (198, 22, 0, 'value', 5); -INSERT INTO ps_range VALUES (199, 25, 0, 'value', 5); -INSERT INTO ps_range VALUES (200, 26, 0, 'value', 5); - -SELECT pg_catalog.setval('ps_range_id_seq', 49, true); - - --- Each coverage allows a set of interpolation methods. An interpolation method is a pair of an interpolation type and a null resistance. Each coverage is required to have at least one entry in that table, and the defaults in PS_Coverage must be present here. --- The current implementation does not use the contents of this table, but it does ensure that the above constraints are met. -CREATE TABLE ps_interpolationset ( - id serial NOT NULL, - coverage integer NOT NULL, - interpolationtype integer NOT NULL, - nullresistance integer NOT NULL, - primary key (id), - unique (coverage, interpolationType, nullResistance), - foreign key (coverage) references ps_coverage (id) on delete cascade, - foreign key (interpolationType) references ps_interpolationType (id) on delete cascade, - foreign key (nullResistance) references ps_nullResistance (id) on delete cascade -); - -INSERT INTO ps_interpolationset VALUES (69, 30, 5, 2); -INSERT INTO ps_interpolationset VALUES (71, 31, 5, 2); -INSERT INTO ps_interpolationset VALUES (72, 8, 5, 2); -INSERT INTO ps_interpolationset VALUES (73, 29, 5, 2); -INSERT INTO ps_interpolationset VALUES (74, 27, 5, 2); -INSERT INTO ps_interpolationset VALUES (75, 2, 5, 2); -INSERT INTO ps_interpolationset VALUES (76, 28, 5, 2); -INSERT INTO ps_interpolationset VALUES (77, 32, 5, 2); -INSERT INTO ps_interpolationset VALUES (78, 7, 5, 2); -INSERT INTO ps_interpolationset VALUES (79, 3, 5, 2); -INSERT INTO ps_interpolationset VALUES (80, 1, 5, 2); -INSERT INTO ps_interpolationset VALUES (81, 17, 5, 2); -INSERT INTO ps_interpolationset VALUES (82, 16, 5, 2); -INSERT INTO ps_interpolationset VALUES (83, 6, 5, 2); -INSERT INTO ps_interpolationset VALUES (84, 4, 5, 2); -INSERT INTO ps_interpolationset VALUES (85, 19, 5, 2); -INSERT INTO ps_interpolationset VALUES (86, 20, 5, 2); -INSERT INTO ps_interpolationset VALUES (87, 18, 5, 2); -INSERT INTO ps_interpolationset VALUES (88, 23, 5, 2); -INSERT INTO ps_interpolationset VALUES (89, 24, 5, 2); -INSERT INTO ps_interpolationset VALUES (90, 21, 5, 2); -INSERT INTO ps_interpolationset VALUES (91, 22, 5, 2); -INSERT INTO ps_interpolationset VALUES (92, 25, 5, 2); -INSERT INTO ps_interpolationset VALUES (93, 26, 5, 2); - -SELECT pg_catalog.setval('ps_interpolationset_id_seq', 26, true); - - --- Each coverage allows a set of null values. If the range is non-composite, a null value is the value of the single component, e.g. "0". If the range is composite, a null value is of the form "{c1,c2,c3}", e.g. "{0,0,0}" for a RGB coverage. Each coverage is required to have at least one entry in that table, and the defaults in PS_Coverage must be present here. --- The current implementation does not use the contents of this table, but it does ensure that the above constraints are met. -CREATE TABLE ps_nullset ( - id serial NOT NULL, - coverage integer NOT NULL, - nullvalue text NOT NULL, - primary key (id), - unique (coverage, nullValue), - foreign key (coverage) references ps_coverage (id) on delete cascade -); - -INSERT INTO ps_nullset VALUES (69, 30, '0'); -INSERT INTO ps_nullset VALUES (71, 31, '0'); -INSERT INTO ps_nullset VALUES (72, 8, '0'); -INSERT INTO ps_nullset VALUES (73, 29, '0'); -INSERT INTO ps_nullset VALUES (74, 27, '0'); -INSERT INTO ps_nullset VALUES (75, 2, '{0,0,0}'); -INSERT INTO ps_nullset VALUES (76, 28, '0'); -INSERT INTO ps_nullset VALUES (77, 32, '{0,0,0}'); -INSERT INTO ps_nullset VALUES (78, 7, '0'); -INSERT INTO ps_nullset VALUES (79, 3, '{0,0}'); -INSERT INTO ps_nullset VALUES (80, 1, '{0,0,0}'); -INSERT INTO ps_nullset VALUES (81, 17, '0'); -INSERT INTO ps_nullset VALUES (82, 16, '0'); -INSERT INTO ps_nullset VALUES (83, 6, '0'); -INSERT INTO ps_nullset VALUES (84, 4, '{0,0,0}'); -INSERT INTO ps_nullset VALUES (85, 19, '0'); -INSERT INTO ps_nullset VALUES (86, 20, '0'); -INSERT INTO ps_nullset VALUES (87, 18, '0'); -INSERT INTO ps_nullset VALUES (88, 23, '0'); -INSERT INTO ps_nullset VALUES (89, 24, '0'); -INSERT INTO ps_nullset VALUES (90, 21, '0'); -INSERT INTO ps_nullset VALUES (91, 22, '0'); -INSERT INTO ps_nullset VALUES (92, 25, '0'); -INSERT INTO ps_nullset VALUES (93, 26, '0'); - -SELECT pg_catalog.setval('ps_nullset_id_seq', 27, true); - - --- Each axis of a coverage has a set of allowed coordinate reference systems. Here, "CRS:1" is once again assumed for each axis, whether present or not. --- The current implementation does not use the contents of this table, but it does ensure that the above constraints are met. Because of this, if the PS_CrsSet is left empty, this one should be empty too. -CREATE TABLE ps_crsset ( - id serial NOT NULL, - axis integer NOT NULL, - crs integer NOT NULL, - primary key (id), - unique (axis, crs), - foreign key (axis) references ps_domain (id) on delete cascade, - foreign key (crs) references ps_crs (id) on delete cascade -); - -INSERT INTO ps_crsset VALUES (40, 104, 8); -INSERT INTO ps_crsset VALUES (41, 105, 8); -INSERT INTO ps_crsset VALUES (42, 106, 8); -INSERT INTO ps_crsset VALUES (45, 109, 8); -INSERT INTO ps_crsset VALUES (46, 110, 8); -INSERT INTO ps_crsset VALUES (47, 111, 8); -INSERT INTO ps_crsset VALUES (48, 112, 8); -INSERT INTO ps_crsset VALUES (49, 113, 8); -INSERT INTO ps_crsset VALUES (50, 114, 8); -INSERT INTO ps_crsset VALUES (51, 115, 8); -INSERT INTO ps_crsset VALUES (52, 116, 8); -INSERT INTO ps_crsset VALUES (53, 117, 8); -INSERT INTO ps_crsset VALUES (54, 118, 8); -INSERT INTO ps_crsset VALUES (55, 119, 8); -INSERT INTO ps_crsset VALUES (56, 120, 8); -INSERT INTO ps_crsset VALUES (57, 121, 8); -INSERT INTO ps_crsset VALUES (58, 122, 8); -INSERT INTO ps_crsset VALUES (59, 123, 8); -INSERT INTO ps_crsset VALUES (60, 124, 8); -INSERT INTO ps_crsset VALUES (61, 125, 8); -INSERT INTO ps_crsset VALUES (62, 126, 8); -INSERT INTO ps_crsset VALUES (63, 127, 8); -INSERT INTO ps_crsset VALUES (64, 128, 8); -INSERT INTO ps_crsset VALUES (65, 129, 8); -INSERT INTO ps_crsset VALUES (66, 130, 8); -INSERT INTO ps_crsset VALUES (67, 131, 8); -INSERT INTO ps_crsset VALUES (68, 132, 8); -INSERT INTO ps_crsset VALUES (69, 133, 8); -INSERT INTO ps_crsset VALUES (70, 134, 8); -INSERT INTO ps_crsset VALUES (71, 135, 8); -INSERT INTO ps_crsset VALUES (72, 136, 8); -INSERT INTO ps_crsset VALUES (73, 137, 8); -INSERT INTO ps_crsset VALUES (74, 138, 8); -INSERT INTO ps_crsset VALUES (75, 139, 8); -INSERT INTO ps_crsset VALUES (76, 140, 8); -INSERT INTO ps_crsset VALUES (77, 141, 8); -INSERT INTO ps_crsset VALUES (78, 142, 8); -INSERT INTO ps_crsset VALUES (79, 143, 8); -INSERT INTO ps_crsset VALUES (80, 144, 8); -INSERT INTO ps_crsset VALUES (81, 145, 8); -INSERT INTO ps_crsset VALUES (82, 146, 8); -INSERT INTO ps_crsset VALUES (83, 147, 8); -INSERT INTO ps_crsset VALUES (84, 148, 8); -INSERT INTO ps_crsset VALUES (85, 149, 8); -INSERT INTO ps_crsset VALUES (86, 150, 8); - -SELECT pg_catalog.setval('ps_crsset_id_seq', 2, true); - --- This table contains textual descriptions of the available coverages. -CREATE TABLE ps_descriptions ( - id serial NOT NULL, - coverage integer NOT NULL, - title text NOT NULL, - abstract text, - keywords text, - primary key (id), - unique (coverage), - foreign key (coverage) references ps_coverage (id) on delete cascade -); - -INSERT INTO ps_descriptions VALUES (10, 30, '', '', ''); -INSERT INTO ps_descriptions VALUES (12, 31, '', '', ''); -INSERT INTO ps_descriptions VALUES (13, 8, '', '', ''); -INSERT INTO ps_descriptions VALUES (14, 29, '', '', ''); -INSERT INTO ps_descriptions VALUES (15, 27, '', '', ''); -INSERT INTO ps_descriptions VALUES (16, 2, '', '', ''); -INSERT INTO ps_descriptions VALUES (17, 28, '', '', ''); -INSERT INTO ps_descriptions VALUES (18, 32, '', '', ''); -INSERT INTO ps_descriptions VALUES (19, 7, '', '', ''); -INSERT INTO ps_descriptions VALUES (20, 3, '', '', ''); -INSERT INTO ps_descriptions VALUES (22, 17, '', '', ''); -INSERT INTO ps_descriptions VALUES (23, 16, '', '', ''); -INSERT INTO ps_descriptions VALUES (24, 6, '', '', ''); -INSERT INTO ps_descriptions VALUES (25, 4, '', '', ''); -INSERT INTO ps_descriptions VALUES (26, 19, '', '', ''); -INSERT INTO ps_descriptions VALUES (27, 20, '', '', ''); -INSERT INTO ps_descriptions VALUES (28, 18, '', '', ''); -INSERT INTO ps_descriptions VALUES (29, 23, '', '', ''); -INSERT INTO ps_descriptions VALUES (30, 24, '', '', ''); -INSERT INTO ps_descriptions VALUES (31, 21, '', '', ''); -INSERT INTO ps_descriptions VALUES (32, 22, '', '', ''); -INSERT INTO ps_descriptions VALUES (33, 25, '', '', ''); -INSERT INTO ps_descriptions VALUES (34, 26, '', '', ''); -INSERT INTO ps_descriptions VALUES (21, 1, 'Coverage "rgb"', 'Abstract for coverage "rgb"', '{red,green,blue}'); - --- This table contains metadata for CRS transformations: WGS84 bounding box limits and offsets for the X and Y axis. -CREATE TABLE ps_crsdetails ( - id serial NOT NULL, - coverage integer NOT NULL, - low1 float NOT NULL, - high1 float NOT NULL, - low2 float NOT NULL, - high2 float NOT NULL, - offset1 float, - offset2 float, - unique (coverage), - foreign key (coverage) references ps_coverage (id) on delete cascade -); - -INSERT INTO ps_crsdetails VALUES (2, 1, -30.0, 65.0, -35.0, 80.0, NULL, NULL); diff --git a/petascope/nbproject/build-impl.xml b/petascope/nbproject/build-impl.xml index bf62a50..de3a4f5 100644 --- a/petascope/nbproject/build-impl.xml +++ b/petascope/nbproject/build-impl.xml @@ -198,7 +198,10 @@ - + + + + @@ -223,13 +226,27 @@ Must set build.test.results.dir Must set build.classes.excludes Must set dist.war - + @@ -240,11 +257,51 @@ or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties f - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -269,6 +326,38 @@ or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties f + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + @@ -291,6 +380,7 @@ or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties f + @@ -411,7 +501,43 @@ exists or setup the property manually. For example like this: - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + @@ -483,10 +609,10 @@ exists or setup the property manually. For example like this: - + - + Must select some files in the IDE or set javac.jsp.includes @@ -502,10 +628,10 @@ exists or setup the property manually. For example like this: - + - + @@ -570,8 +696,11 @@ exists or setup the property manually. For example like this: - + + + + @@ -598,8 +727,11 @@ exists or setup the property manually. For example like this: - + + + + @@ -783,10 +915,39 @@ exists or setup the property manually. For example like this: + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -799,6 +960,14 @@ exists or setup the property manually. For example like this: + + + + + + + + @@ -896,6 +1065,35 @@ exists or setup the property manually. For example like this: + + + + + + + + + + + + + + + + + + + + + + + + + - 1 1 - 5 3 - - - xAxis yAxis - - - - - - - band1 - urn:ogc:def:dataType:OGC:1.1:unsignedByte - 000 255 - - - - - - - application/xml - - - diff --git a/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml deleted file mode 100644 index c5485e9..0000000 --- a/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - petascope - WCS Server developed at jacobs University - OGC WCS - 2.0.0 - urn:ogc:def:extension:OGC-WCS:2.0:protocol:post - urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:netcdf - urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0 - urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0 - - - Jacobs University Bremen - - - Mr. X - Developer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml deleted file mode 100644 index a4c6fd3..0000000 --- a/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - 1 1 - 5 3 - - - xAxis yAxis - - - - - - - 1 2 3 4 5 - 6 7 8 9 10 - 11 12 13 14 15 - - - - - - - - band1 - urn:ogc:def:dataType:OGC:1.1:unsignedByte - 000 255 - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml deleted file mode 100644 index 047caed..0000000 --- a/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - 0 0 - 399 343 - - - - x y - - - - - - - - red - urn:ogc:def:dataType:OGC:1.1:unsigned int - - - - - - green - - urn:ogc:def:dataType:OGC:1.1:unsigned int - - - - - - blue - urn:ogc:def:dataType:OGC:1.1:unsigned int - - - - - - - - - - application/xml - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml deleted file mode 100644 index 3d33e03..0000000 --- a/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - WCS 2.0 Coverage Server @ Jacobs University - WCS 2.0 Server developed at jacobs University - OGC WCS - 2.0.0 - urn:ogc:def:extension:OGC-WCS:2.0:protocol:post - - urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0 - urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0 - - - Jacobs University Bremen - - - - Prof. Dr. Peter Baumann - - - Bremen - 28717 - Germany - p.baumann@jacobs-university.de - - - - Project Leader - - - - - - - - - - - - - text/xml - - - - - - XML - - - - - - - - - - - - - text/xml - - - - - - XML - - - - - - - - - - - - - text/xml - - - - - - XML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml deleted file mode 100644 index 371a714..0000000 --- a/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - 200 200 - 219 209 - - - - x y - - - - - - - - 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 242,27,103 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 242,27,103 204,0,88 204,0,88 242,27,103 242,27,103 242,27,10 - - - - - - - - red - - urn:ogc:def:dataType:OGC:1.1:unsigned int - 0 - - - - - green - urn:ogc:def:dataType:OGC:1.1:unsigned int - - 0 - - - - - blue - urn:ogc:def:dataType:OGC:1.1:unsigned int - 0 - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/SchemaServlet.java b/petascope/src/petascope/wcs2/schemas/SchemaServlet.java deleted file mode 100644 index f2c874f..0000000 --- a/petascope/src/petascope/wcs2/schemas/SchemaServlet.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community 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. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see . - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see - * or contact Peter Baumann via . - */ -package petascope.wcs2.schemas; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.commons.io.IOUtils; - -/** Servlet that handles GET requests for the WCS 2.0 schema files. - * - * @author Andrei Aiordachioaie - */ -public class SchemaServlet extends HttpServlet { - - /** - * Processes requests for both HTTP GET and POST methods. - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - protected void processRequest(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - response.setContentType("application/xml;charset=UTF-8"); - PrintWriter out = response.getWriter(); - try { - String schemaFile = request.getPathInfo(); - String pathPrefix = "/xml/ogc/wcs/2.0.0/"; - File file = new File(getServletContext().getRealPath(pathPrefix + schemaFile)); - String fileContents = IOUtils.toString(new FileReader(file)); - out.write(fileContents); - } finally { - out.close(); - } - } - - /** - * Handles the HTTP GET method. - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - processRequest(request, response); - } - - /** - * Handles the HTTP POST method. - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - processRequest(request, response); - } - - /** - * Returns a short description of the servlet. - * @return a String containing servlet description - */ - @Override - public String getServletInfo() { - return "Short description"; - } -} diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml deleted file mode 100644 index 994917e..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - IdentityConversion2D - Identity Conversion 2D - none provided - not known - - diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml deleted file mode 100644 index 949036f..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - IdentityMethod2D - Identity Method 2D - Method for use by a Coordinate Conversion for the identity transformation of two coordinates - This coordinate converion shall be as specified by the equations: - BaseX = DerivedX - BaseY = DerivedY -where - DerivedX, DerivedY are position coordinates in the derived 2D CRS - BaseX, BaseY are position coordinates in the 2D base CRS - - 2 - 2 - diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml deleted file mode 100644 index 519a5a5..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - red - UnsignedChar - 000 255 - - - - - green - UnsignedChar - 000 255 - - - - - blue - UnsignedChar - 000 255 - - - - diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml deleted file mode 100644 index 9514ae7..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - 0 0 - 9999 9999 - - - column row - - - 99.9 99.9 - - - 1 0 - 0 1 - - - - - - TBDurlOfFile - TBD - - - - - - - white - UnsignedChar - 000 255 - - - - - - - Linear - 0 0 - - - - diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml deleted file mode 100644 index bc9de96..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - 0 0 - 9999 9999 - - - Column Row - - - InternalCRS1 - not known - - - image - - - - - - - - - - TBDurlOfFile - TBD - - - - - - - white - unsignedInteger - 000 255 - - - - - - - Linear - 0 0 - - - - diff --git a/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd b/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd deleted file mode 100644 index ae0d949..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd +++ /dev/null @@ -1,21 +0,0 @@ - - - - gmlwcsAll.xsd - This is the XML Schema for the GML 3.2.1 Application schema for WCS 2.0. - This XML Schema Document includes, directly and indirectly, all the XML Schema Documents defined by the GML 3.2.1 Application schema for WCS 2.0. - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd b/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd deleted file mode 100644 index 5643a1d..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd +++ /dev/null @@ -1,160 +0,0 @@ - - - - coverage.xsd - Part of GML 3.2.1 Application schema for WCS 2.0. - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - - - - - - - - - - - Extends gml:AbstractCoverage as needed for WCS 2.0, by adding a rangeStructure property. - - - - - - The gml:coverageFunction property is included here, because it is included in both discrete and continuous coverages. This permits coverages in the gmlwcs:AbstractCoverage substitutionGroup to be used for either discrete and continuous coverages, in preparation for expected future elimination of this distinction. - - - - - - - - - - - - - - A GridCoverage is a discrete point coverage in which the domain is a geometric grid of points. -Note that this is the same as the MultiPointCoverage except that we have a gml:Grid to describe the domain. -This simple grid coverage is not geometrically referenced to the earth, and hence no geometric positions are assignable to the points in the grid. Such geometric positioning is introduced in the RectifiedGridCoverage. -Redefinition needed in order to benefit from the changes to the abstract ancestor AbstractCoverage. - - Since this GridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. - - - - - - A RectifiedGridCoverage is a discrete point coverage based on a rectified grid. It is similar to the grid coverage except that the points of the grid are geometrically referenced. The rectified grid coverage has a domain that is a gml:RectifiedGrid geometry. - Redefinition needed in order to benefit from the changes to the abstract ancestor AbstractCoverage. - - Since this RectifiedGridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. - - - - - - A ReferenceableGridCoverage is an implementation of ISO 19123 CV_DiscreteGridPointCoverage for a CV_ReferenceableGrid domain. It is a coverage based on a referenceable grid and has a domain geometry that is in the substitution group of AbstractReferenceableGrid. - This equivalent of this element is being added to GML 3.2.1 by approved Change Request 07-112r3. - Since this ReferenceableGridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. - - - - - - The rangeStructure property includes or references the RangeStructure, introduced for coverage definitions used by WCS 2.0. - - - - - - - - - - - - - - The RangeStructure element describes the structure of a coverage's range, introduced for coverage definitions used by WCS 2.0. - - - - - - - - - - - - - - - - The RangeField property includes or references one RangeField element. - - - - - - - - - - - - - - The RangeField element describes the structure of one Field of a coverage's range. - - - - - - - - The gml:name should be used for the unique identifier of this RangeField. - - - - - - - - Identifier of the Unit of Measure applicable to values of this RangeField. - - - - - - - - - - - - This element will contain an URN that identifies the datatype of this field. The default gml:Dictionary of allowed values of this dataType is wcsDataTypeIdentifiers.xml. - - - - - - - - - List of the specific values of this RangeField that are used to designate non-valid values. - - - - diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml b/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml deleted file mode 100644 index bf10663..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - This dictionary specifies the standard values for dataType, specified in the WCS 2.0 GML 3.2.1 application schema. This dataType is for values of a RangeField. In addition, this dictionary specifies definition URNs in the "ogc" URN namespace for these values. This dictionary uses a currently unspecified simple dictionary profile of GML 3.2.1. - Definitions are compatible with XML Schema as of 28 October 2004 [http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/]. - Identifiers do not have an associated unit of measure. - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - DataTypeIdentifiers - - - - Logical value; admissible values are "true" and "false" (in whatever case), as well as 0 (which shall represent "false") and 1 (which shall represent "true"). - boolean - - - - - - - Positive or negative integer number without any limitation on maximum and minimum values. For expressing certain value range limitations the specialized types byte, shortInteger, int, and LongInteger are available. - long - - - - - - Non-negative integer number without any limitation on minimum values. For expressing certain value range limitations the specialized types unsignedByte, unsignedShort, unsignedInt, and unsignedLong are available. - unsignedInteger - - - - - - - Positive or negative integer number with values between -128 anf 127. - byte - - - - - - Non-negative integer number with values between 0 and 255. - unsignedByte - - - - - - Positive or negative integer number with values between -32768 and 32767, which allows for a representation with 16 bits. - short - - - - - - Non-negative integer number with values between 0 and 65535, which allows for a representation with 16 bits. - unsignedShort - - - - - - Positive or negative integer number with values between -2147483648 and 2147483647, which allows for a representation with 32 bits. - int - - - - - - Non-negative integer number with values between 0 and 4294967295, which allows for a representation with 32 bits. - unsignedInt - - - - - - Positive or negative integer number with values between -9223372036854775808 and 9223372036854775807, which allows for a representation with 64 bits. - long - - - - - - Non-negative integer number with values between 0 and 18446744073709551616, which allows for a representation with 64 bits. - unsignedLong - - - - - - - Single-precision floating point number according to IEEE 754-1985. - double - - - - - - Double-precision floating point number according to IEEE 754-1985. - double - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd b/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd deleted file mode 100644 index 587e25d..0000000 --- a/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd +++ /dev/null @@ -1,156 +0,0 @@ - - - - wcsGrids.xsd - This XML Schema Document encodes extensions to GML 3.2.1 for grids that are referenced by a Transformation, named "ReferencedGridByTransformation". This document also extends the alternatives allowed in gml:ParameterValueType as expected to be needed by such Transformations. - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - - - - - - - - - - - AbstractReferenceableGrid is an encoding of CV_ReferenceableGrid in ISO 19123. AbstractReferenceableGrid is the head of a substitution group that may include multiple concrete implementations. - -A referenceable grid is a grid associated with a transformation that can be used to convert grid coordinate values to values of coordinates referenced to an external coordinate reference system [ISO 19123]. The transformation between grid coordinates and ‘external’ coordinates is usually non-affine, and may take different forms. It may be described analytically (e.g., through parametrised mathematical image rectification models); or it may provided in a table, for instance, relating the grid points to coordinates in the external coordinate reference system [ISO 19123, §8.2.1]. - -The inherited attribute group gml:SRSReferenceGroup shall link the referenceable grid to the internal coordinate reference system of the grid. - - This element and its type are copied from approved Change Request 07-112r3, which adds them to GML 3.2.1. - - - - - - - - - - - - This element and its type are copied from approved Change Request 07-112r3, which adds them to GML 3.2.1. - - - - - - - - - - - - - - ReferencedGridByTransformation encodes one type of CV_ReferenceableGrid as defined in ISO 19123, using a gml:Transformation or gml:ConcatenatedOperation to specify the relationship between positions in the grid and corresponding positions in another CRS. This encoding also generalises CV_ReferenceableGrid to allow including more than one referencing Transformation. - This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. - - - - - - - - - - The gridCRS is a composition association to the definition of the internal CRS for this extended gml:Grid. This definition shall be the one referenced by the gml:srsName attribute in the gml:GridType. This CRS definition shall be included here if its definition is needed by some data receivers and is not otherwise available using that gml:srsName value. - - - - - This choice encodes an unordered list of associations to coordinate Transformations or Concatenated Operations that each (geo)reference this ReferenceableGrid. Each of these Transformations or Concatenated Operations shall reference the internal CRS for this extended gml:Grid, as either its sourceCRS or targetCRS. This transformation association may be repeated when this ReferencedGridByTransformation is referenced to more than one other CRS, and/or is referenced to the same other CRS by multiple Transformation versions. - - - - - - - - - - - - The gridCRS is a composition association to the definition of the internal CRS for this extended gml:Grid. This internal CRS may be a DerivedCRS, EngineeringCRS, ImageCRS, or CompoundCRS. However, proposed OGC Best Practices Paper 09-085r1 recommends that this internal CRS always be a DerivedCRS. - This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. - - - - - - - - - - - - - Extends gml:ParameterValue to also allow values that are a gml:Geometry or a gml:vector. - This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. - - - - - - - - - - - - - - - - - - - - - - - - - - - - A geometry used as a coordinate operation parameter value, which contains any type of geometry element, with a reference to its associated coordinate reference system. - This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. - - - - - - Vector value of a coordinate operation parameter. A vectorValue can represent a distance in a direction (when the magnitude of the vector is significant) or just a direction (when the magnitude of the vector is not considered significant). This vectorValue shall use the coordinate axes directions and units of the coordinate system in the referenced coordinate reference system. This coordinate reference system will often be the same as referenced by an associated geometryValue coordinate operation parameter. - - - - - - - gml:SimpleMultiPoint implements, and provides a simplified encoding for, ISO 19107 GM_MultiPoint (see ISO 19107:2003, 6.5.4). A gml:SimpleMultiPoint consists of a list of DirectPositions. - - - - - - - - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/wcsAll.xsd b/petascope/src/petascope/wcs2/schemas/wcsAll.xsd deleted file mode 100644 index 21f0e83..0000000 --- a/petascope/src/petascope/wcs2/schemas/wcsAll.xsd +++ /dev/null @@ -1,21 +0,0 @@ - - - - wcsAll.xsd - This XML Schema Document includes, directly and indirectly, all the XML Schema Documents defined by the OGC Web Coverage Service (WCS). - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - - - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd b/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd deleted file mode 100644 index c1d5b33..0000000 --- a/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd +++ /dev/null @@ -1,87 +0,0 @@ - - - - wcsContents.xsd - - http://schemas.opengis.net/wcs/2.0/gml/gmlwcsAll.xsd - - This XML Schema Document encodes the elements and types that are shared by multiple WCS operations. - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - - - - - - - - - - - - XML encoded WCS operation request base, for all operations except GetCapabilities. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. - - - - - Service type identifier, where the value is the OWS type abbreviation. For WCS operation requests, the value is "WCS". - - - - - Specification version for WCS version and operation. See Version parameter Subclause 7.3.1 of OWS Common for more information. - - - - - - - - - - - - This element is a wrapper for the gml:id attribute. Needed to allow lists of identifiers. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd b/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd deleted file mode 100644 index c3c4ec3..0000000 --- a/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd +++ /dev/null @@ -1,73 +0,0 @@ - - - - wcsDescribeCoverage.xsd - - http://schemas.opengis.net/wcs/2.0/gml/gmlwcsAll.xsd - - This XML Schema Document defines the DescribeCoverage operation request and response XML elements and types, used by the OGC Web Coverage Service (WCS). - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - - - - - - - - - - - - - Request to a WCS to perform the DescribeCoverage operation. This operation allows a client to retrieve descriptions of one or more coverages. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. - - - - - - - - - Unordered list of identifiers of desired coverages. A client can obtain identifiers by a prior GetCapabilities request, or from a third-party source. - - - - - - - - - - - Response from a WCS DescribeCoverage operation, containing one or more coverage descriptions. - - - - - - - - - - - Full description of coverages available from a WCS server. This description shall include sufficient information to allow all valid GetCoverage operation requests to be prepared by a WCS client. - - - - - - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml b/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml deleted file mode 100644 index eff982d..0000000 --- a/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - This dictionary specifies URNs and identifiers for WCS 2.0 extensions, to be communicated as part of a WCS GetCapabilities response. The dictionary is situated in the "ogc" namespace and uses a currently unspecified simple dictionary profile of GML 3.2.1. - - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - WcsExtensions - - - - - - WCS 2.0 extension defining handling of nil values in a coverage. - 1.0 - - - - - - WCS 2.0 extension defining handling of uncertainty in a coverage. - 1.0 - - - - - - - - WCS 2.0 extension defining advanced service metadata concepts. - 1.0 - - - - - - WCS 2.0 extension defining scaling and interpolation of coverages. - 1.0 - - - - - - WCS 2.0 extension defining coordinate reference system (CRS) handling within coverages. - 1.0 - - - - - - WCS 2.0 extension defining transactional (ie, update) services. - 1.0 - - - - - - WCS 2.0 extension defining coverage processing services. - 1.0 - - - - - - - - WCS 2.0 extension defining the HTTP GET / KVP protocol encoding. - 1.0 - - - - - - WCS 2.0 extension defining the HTTP POST / XML protocol encoding. - 1.0 - - - - - - WCS 2.0 extension defining the SOAP protocol encoding. - 1.0 - - - - - - - - WCS 2.0 extension defining use of the GML coverage encoding format. - 1.0 - - - - - - WCS 2.0 extension defining use of the GeoTIFF coverage encoding format. - 1.0 - - - - - - WCS 2.0 extension defining use of the NetCDF coverage encoding format. - 1.0 - - - - - - - - WCS 2.0 extension defining multilingual access to a WCS. - 1.0 - - - diff --git a/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd b/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd deleted file mode 100644 index 9996063..0000000 --- a/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd +++ /dev/null @@ -1,56 +0,0 @@ - - - - wcsGetCapabilities.xsd - This XML Schema Document encodes the GetCapabilities operation request and response used by the OGC Web Coverage Service (WCS). - Last updated: 2010-jan-11 - Copyright (c) 2010 Open Geospatial Consortium, Inc, All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - - - - - - - - - - - - - Request to a WCS server to perform the GetCapabilities operation. This operation allows a client to retrieve a Capabilities XML document providing metadata for the specific WCS server. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. - - - - - - - - - - - - - - - - XML encoded WCS GetCapabilities operation response. The Capabilities document provides clients with service metadata about a specific service instance, including metadata about the coverages served. If the server does not implement the updateSequence parameter, the server shall always return the Capabilities document, without the updateSequence parameter. When the server implements the updateSequence parameter and the GetCapabilities operation request included the updateSequence parameter with the current value, the server shall return this element with only the "version" and "updateSequence" attributes. Otherwise, all optional sections shall be included or not depending on the actual value of the Contents parameter in the GetCapabilities operation request. - - - - - - - - - - - - - diff --git a/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd b/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd deleted file mode 100644 index 57ef8ed..0000000 --- a/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd +++ /dev/null @@ -1,88 +0,0 @@ - - - - wcsGetCoverage.xsd - This XML Schema Document defines the GetCoverage operation request elements and types, for the OGC Web Coverage Service (WCS). - The GetCoverage request element is GetCoverage. The GetCoverage response element is a specialization of gmlwcs:AbstractCoverage. - Last updated: 2010-jan-11 - Copyright (c) 2007 Open Geospatial Consortium, Inc. All Rights Reserved. - To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. - - - - - - - - - - - - - Request to a WCS to perform the GetCoverage operation. This operation allows a client to retrieve a subset of one coverage. - - - - - - - - - Identifier of the coverage that this GetCoverage operation request shall draw from. - - - - - - - - - - - - - - - - - Definition of the desired subset of the domain of the coverage. This is either a Trim operation, or a Slice operation. - - - - - - - - - Describes the trimming of a coverage's domain axis, between two values. - - - - - - - - - - - - - - Describes the slicing of a coverage's domain axis at a particular point. - - - - - - - - - - - - diff --git a/petascope/src/petascope/wcs2/server/Wcs2Server.java b/petascope/src/petascope/wcs2/server/Wcs2Server.java deleted file mode 100644 index cb5f6f9..0000000 --- a/petascope/src/petascope/wcs2/server/Wcs2Server.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community 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. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see . - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see - * or contact Peter Baumann via . - */ -package petascope.wcs2.server; - -//~--- non-JDK imports -------------------------------------------------------- -import javax.servlet.ServletException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import petascope.ConfigManager; - -import petascope.wcps.server.core.DbMetadataSource; - -import petascope.wcs.server.exceptions.WCSException; - -import petascope.wcs2.server.ops.DescribeCoverage; -import petascope.wcs2.server.ops.GetCapabilities; -import petascope.wcs2.server.ops.GetCoverage; - -//~--- JDK imports ------------------------------------------------------------ -/** - * The Web Coverage Service (WcsServer) - * This class provides methods for each of the WCS operations: - * - GetCapabilities - * - DescribeCoverage - * - GetCoverage - * - * @author Andrei Aiordachioaie - */ -public class Wcs2Server { - - private static Logger LOG = LoggerFactory.getLogger(Wcs2Server.class); - - /* The Operations to delegate to */ - private GetCapabilities capa; - private DescribeCoverage desc; - private GetCoverage getcov; - - /* Globals */ - private DbMetadataSource meta; - - /** - * constructor - * @param settingsPath path to the "settings.properties" file - */ - public Wcs2Server(String settingsPath, DbMetadataSource source) throws ServletException { - ConfigManager.getInstance(settingsPath, null); - meta = source; - - try { - capa = new GetCapabilities(meta); - desc = new DescribeCoverage(meta); - getcov = new GetCoverage(meta); - } catch (Exception e) { - LOG.error("Could not init WCS 2.0"); - - throw new RuntimeException("Could not initialize WCS 2.0", e); - } - } - - /** - * WcsServer GetCapabilities operation - */ - public String GetCapabilities(String stringXml) throws WCSException { - LOG.trace("Received input:\n{}", stringXml); - LOG.info("Executing operation GetCapabilities..."); - String result = capa.execute(stringXml); - - LOG.info("GetCapabilities finished"); - - return result; - } - - /** - * WcsServer DescribeCoverage operation - */ - public String DescribeCoverage(String stringXml) throws WCSException { - LOG.trace("Received input:\n{}", stringXml); - LOG.info("Executing operation DescribeCoverage..."); - String result = desc.execute(stringXml); - - LOG.info("DescribeCoverage finished"); - - return result; - } - - /** - * WcsServer GetCoverage operation - */ - public String GetCoverage(String stringXml) throws WCSException { - LOG.trace("Received input:\n{}", stringXml); - LOG.info("Executing operation GetCoverage..."); - String result = getcov.execute(stringXml); - - LOG.info("GetCoverage finished"); - - return result; - } -} diff --git a/petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java b/petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java deleted file mode 100644 index 6f4e752..0000000 --- a/petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community 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. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see . - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see - * or contact Peter Baumann via . - */ -package petascope.wcs2.server.ops; - -//~--- non-JDK imports -------------------------------------------------------- -import java.util.HashSet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import petascope.ConfigManager; - -import petascope.wcps.server.core.CellDomainElement; -import petascope.wcps.server.core.DbMetadataSource; -import petascope.wcps.server.core.DomainElement; -import petascope.wcps.server.core.Metadata; -import petascope.wcps.server.core.RangeElement; - -import petascope.wcs.server.exceptions.WCSException; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import petascope.wcps.server.core.SDU; -import petascope.wcs.server.exceptions.InvalidParameterValueException; -import petascope.wcs.server.exceptions.InvalidServiceConfigurationException; -import petascope.wcs.server.exceptions.NoApplicableCodeException; - -/** - * Describe Coverage operation for WCS 2.0 - * - * @author Andrei Aiordachioaie - */ -public class DescribeCoverage implements WcsOperation { - - public static String DATATYPE_URN_PREFIX = "urn:ogc:def:dataType:OGC:1.1:"; - private static Logger LOG = LoggerFactory.getLogger(DescribeCoverage.class); - /* Template XMLs for response types */ - private String DescribeCoverageResponse; - /* Other useful stuff */ - private String coverageDescriptionTemplate; - private String listOfFormats; - private String low, high, axisLabels; - private DbMetadataSource meta; - private String rangeComponentTemplate; - private String rangeComponents, gridDimension, gridId; - - public DescribeCoverage(DbMetadataSource metadata) throws InvalidServiceConfigurationException { - meta = metadata; - - DescribeCoverageResponse = ConfigManager.WCS2_DESCRIBE_COVERAGE_TEMPLATE; - if (DescribeCoverageResponse == null) { - throw new InvalidServiceConfigurationException("Could not find template file."); - } - listOfFormats = "application/xml"; - - /* Find the CoverageDescription template string */ - String starttag = " it = cov.getDomainIterator(); - Iterator it2 = cov.getCellDomainIterator(); - - low = ""; - high = ""; - axisLabels = ""; - while (it.hasNext() && it2.hasNext()) { - DomainElement dom = it.next(); - CellDomainElement cell = it2.next(); - - axisLabels += dom.getName() + " "; - low += cell.getLo() + " "; - high += cell.getHi() + " "; - } - - // Build the range components data structure - Iterator it3 = cov.getRangeIterator(); - Iterator nilIterator = cov.getNullSetIterator(); - - - rangeComponents = ""; - int i = -1; - while (it3.hasNext()) { - String component = rangeComponentTemplate; - RangeElement range = it3.next(); - i++; - String rangeId = "range-" + cov.getCoverageId() + "-" + range.getName(); - - component = component.replaceAll("\\{rangeFieldId\\}", rangeId); - component = component.replaceAll("\\{fieldName\\}", range.getName()); - component = component.replaceAll("\\{datatype\\}", DATATYPE_URN_PREFIX + range.getType()); - - // Compute the null values for this range field - Set nullVals = new HashSet(); - Iterator it4 = cov.getNullSetIterator(); - while (it4.hasNext()) { - List nilVal = SDU.str2string(it4.next()); - nullVals.add(nilVal.get(i)); - } - StringBuffer nullValsString = new StringBuffer(); - it4 = nullVals.iterator(); - while (it4.hasNext()) { - nullValsString.append(" " + it4.next()); - } - component = component.replaceAll("\\{nilValues\\}", nullValsString.toString().substring(1)); - - // And add this range field to the range structure - rangeComponents += component; - } - - desc = coverageDescriptionTemplate.replaceAll("\\{coverageId\\}", coverageId); - gridId = "grid" + coverageId; - desc = desc.replaceAll("\\{gridId\\}", gridId); - gridDimension = String.valueOf(cov.getDimension()); - desc = desc.replaceAll("\\{gridDimension\\}", gridDimension); - desc = desc.replaceAll("\\{low\\}", low); - desc = desc.replaceAll("\\{high\\}", high); - desc = desc.replaceAll("\\{axisLabels\\}", axisLabels); - desc = desc.replaceAll("\\{rangeFields\\}", rangeComponents); - desc = desc.replaceAll("\\{rangeStructureId\\}", "rangeStructure-" + coverageId); - desc = desc.replaceAll("\\{supportedFormats\\}", listOfFormats); - - listOfCoverageDescriptions += desc; - } else { - throw new InvalidParameterValueException("gml:id"); - } - } - - output = DescribeCoverageResponse.replaceAll("\\{listOfCoverageDescriptions\\}", - listOfCoverageDescriptions); - - output = output.replaceAll("\\{wcsSchemaUrl\\}", ConfigManager.WCS2_SCHEMA_URL); - - return output; - } -} diff --git a/petascope/src/petascope/wcs2/server/ops/GetCapabilities.java b/petascope/src/petascope/wcs2/server/ops/GetCapabilities.java deleted file mode 100644 index b64d3f2..0000000 --- a/petascope/src/petascope/wcs2/server/ops/GetCapabilities.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community 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. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see . - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see - * or contact Peter Baumann via . - */ -package petascope.wcs2.server.ops; - -//~--- non-JDK imports -------------------------------------------------------- -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import petascope.ConfigManager; - -import petascope.wcps.server.core.DbMetadataSource; -import petascope.wcps.server.exceptions.ResourceException; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Iterator; -import petascope.wcs.server.exceptions.InvalidServiceConfigurationException; - -/** - * GetCapabilities operation for The Web Coverage Service 2.0 - * - * @author Andrei Aiordachioaie - */ -public class GetCapabilities implements WcsOperation { - - private static Logger LOG = LoggerFactory.getLogger(GetCapabilities.class); - /* Template XMLs for response types */ - private String GetCapabilitiesResponse; - private DbMetadataSource meta; - /* Other useful vars */ - private String xmlListOfCoverages; - - public GetCapabilities(DbMetadataSource metadata) throws InvalidServiceConfigurationException { - meta = metadata; - - GetCapabilitiesResponse = ConfigManager.WCS2_GET_CAPABILITIES_TEMPLATE; - if (GetCapabilitiesResponse == null) { - throw new InvalidServiceConfigurationException("Could not find template file."); - } - } - - @Override - public String execute(String input) { - String output; - - // Create the output by replacing placeholders - output = GetCapabilitiesResponse.replaceAll("\\{URL\\}", - ConfigManager.PETASCOPE_SERVLET_URL); - Iterator it; - - try { - it = meta.coverages().iterator(); - xmlListOfCoverages = ""; - while (it.hasNext()) { - xmlListOfCoverages += ""; - } - } catch (ResourceException ex) { - ex.printStackTrace(); - } - output = output.replaceAll("\\{Coverages\\}", xmlListOfCoverages); - output = output.replaceAll("\\{wcsSchemaUrl\\}", ConfigManager.WCS2_SCHEMA_URL); - - return output; - } -} diff --git a/petascope/src/petascope/wcs2/server/ops/GetCoverage.java b/petascope/src/petascope/wcs2/server/ops/GetCoverage.java deleted file mode 100644 index a6ddcff..0000000 --- a/petascope/src/petascope/wcs2/server/ops/GetCoverage.java +++ /dev/null @@ -1,529 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community 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. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see . - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see - * or contact Peter Baumann via . - */ -package petascope.wcs2.server.ops; - -//~--- non-JDK imports -------------------------------------------------------- -import org.apache.commons.io.IOUtils; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import org.xml.sax.SAXException; - -import petascope.ConfigManager; - -import petascope.wcps.server.core.DbMetadataSource; -import petascope.wcps.server.core.Metadata; - -import petascope.wcs.server.exceptions.WCSException; - -//~--- JDK imports ------------------------------------------------------------ - -import java.io.IOException; - -import java.math.BigInteger; -import java.util.HashSet; -import java.util.Iterator; - -import java.util.List; -import java.util.Set; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; -import org.odmg.DBag; -import org.odmg.Database; -import org.odmg.Implementation; -import org.odmg.ODMGException; -import org.odmg.OQLQuery; -import org.odmg.QueryException; -import org.odmg.Transaction; -import rasj.RasGMArray; -import rasj.RasImplementation; -import petascope.wcps.server.core.CellDomainElement; -import petascope.wcps.server.core.DomainElement; -import petascope.wcps.server.core.RangeElement; -import petascope.wcps.server.core.SDU; -import petascope.wcs.server.exceptions.InputOutputException; -import petascope.wcs.server.exceptions.InternalComponentException; -import petascope.wcs.server.exceptions.InvalidParameterValueException; -import petascope.wcs.server.exceptions.InvalidServiceConfigurationException; -import petascope.wcs.server.exceptions.NoApplicableCodeException; -import petascope.wcs.server.exceptions.WcsRuntimeException; -import petascope.wcs.server.exceptions.XmlNotValidException; -import petascope.wcs2.server.templates.WcsNamespaceContext; - -/** - * Get Coverage operation for WCS 2.0 - * - * @author Andrei Aiordachioaie - */ -public class GetCoverage implements WcsOperation { - - private static Logger LOG = LoggerFactory.getLogger(GetCoverage.class); - private DocumentBuilder builder = null; - private XPathFactory xpathFactory = XPathFactory.newInstance(); - /* Template XMLs for response types */ - private String GetCoverageResponse; - private String rangeComponentTemplate; - /* Xml request */ - private Document doc; - /* for Metadata */ - private DbMetadataSource meta; - /* The new coverage domain */ - private String lowPoint, highPoint, newAxesLabels; - - public GetCoverage(DbMetadataSource metadata) throws WCSException { - meta = metadata; - GetCoverageResponse = ConfigManager.WCS2_GET_COVERAGE_TEMPLATE; - if (GetCoverageResponse == null) { - throw new InvalidServiceConfigurationException("Could not find template file."); - } - - /* Find the RangeField template string */ - String starttag = " it = coverage.getCellDomainIterator(); - Iterator it2 = coverage.getDomainIterator(); - i = 0; - while (it.hasNext() && it2.hasNext()) { - CellDomainElement cell = it.next(); - DomainElement dom = it2.next(); - LOG.trace(cell.toString()); - LOG.trace(dom.toString()); - high[i] = cell.getHi(); - low[i] = cell.getLo(); - axesLabels[i] = dom.getName(); - limits[i] = low[i] + ":" + high[i]; - sliced[i] = false; - trimmed[i] = false; - i++; - } - - NodeList list = null; - int axisIndex; - String axis, root; - NodeList trims, slices; - - trims = evalXPathList("//wcs:trimDimension", doc); - for (i = 0; i < trims.getLength(); i++) { - Node trim = trims.item(i); - - list = evalXPathList("wcs:dimension/text()", trim); - axis = list.item(0).getNodeValue(); - axisIndex = coverage.getDomainIndexByName(axis); - if (axisIndex == -1) { - throw new InvalidParameterValueException("dimension. Explanation: Unknown axis: " + axis); - } - if (trimmed[axisIndex] || sliced[axisIndex]) { - throw new NoApplicableCodeException("Already performed one subsetting operation on axis: " + axis); - } - - list = evalXPathList("wcs:trimLow/text()", trim); - if (list.getLength() > 0) { - try { - long val = Long.parseLong(list.item(0).getNodeValue()); - low[axisIndex] = BigInteger.valueOf(val); - } catch (NumberFormatException e) { - throw new InvalidParameterValueException("trimLow. Explanation: invalid integer number: " + list.item(0).getNodeValue()); - } - } - list = evalXPathList("wcs:trimHigh/text()", trim); - if (list.getLength() > 0) { - try { - long val = Long.parseLong(list.item(0).getNodeValue()); - high[axisIndex] = BigInteger.valueOf(val); - } catch (NumberFormatException e) { - throw new InvalidParameterValueException("trimHigh. Explanation: invalid integer number: " + list.item(0).getNodeValue()); - } - } - - trimmed[axisIndex] = true; - limits[axisIndex] = low[axisIndex] + ":" + high[axisIndex]; - LOG.debug("New limits for axis {}: {}", axis, limits[axisIndex]); - } - - slices = evalXPathList("//wcs:sliceDimension", doc); - for (i = 0; i < slices.getLength(); i++) { - Node slice = slices.item(i); - - list = evalXPathList("wcs:dimension/text()", slice); - axis = list.item(0).getNodeValue(); - axisIndex = coverage.getDomainIndexByName(axis); - if (axisIndex == -1) { - throw new InvalidParameterValueException("dimension. Explanation: Unknown axis name: " + axis); - } - if (trimmed[axisIndex] || sliced[axisIndex]) { - throw new NoApplicableCodeException("Already performed one subsetting operation on axis: " + axis); - } - - list = evalXPathList("wcs:slicePoint/text()", slice); - if (list.getLength() > 0) { - try { - long point = Long.parseLong(list.item(0).getNodeValue()); - low[axisIndex] = BigInteger.valueOf(point); - } catch (NumberFormatException e) { - throw new InvalidParameterValueException("slicePoint. Explanation: invalid integer number: " + list.item(0).getNodeValue()); - } - high[axisIndex] = low[axisIndex]; - limits[axisIndex] = list.item(0).getNodeValue(); - } - - sliced[axisIndex] = true; - LOG.debug("New limits for axis {}: {}", axis, limits[axisIndex]); - } - - // Compute the lowest, highest point and the labels - lowPoint = ""; - highPoint = ""; - newAxesLabels = ""; - int first = 0; - for (i = 0; i < dims; i++) { - if (sliced[i] == false) { - if (first == 0) { - lowPoint = low[i].toString(); - highPoint = high[i].toString(); - newAxesLabels = axesLabels[i]; - first++; - } else { - lowPoint += " " + low[i]; - highPoint += " " + high[i]; - newAxesLabels += " " + axesLabels[i]; - } - } - } - - // Concatenate all limits into a single string - String result = limits[0]; - - for (i = 1; i < dims; i++) { - result += ", " + limits[i]; - } - - return result; - } - - public String executeRasqlQuery(String query) throws WCSException { - byte[] result = null; - - Implementation impl = new RasImplementation(ConfigManager.RASDAMAN_URL); - Database db = impl.newDatabase(); - - try { - db.open(ConfigManager.RASDAMAN_DATABASE, Database.OPEN_READ_ONLY); - } catch (ODMGException odmge) { - try { - db.close(); - } catch (ODMGException e) { - } - - throw new InternalComponentException("Could not connect to rasdaman server at " + ConfigManager.RASDAMAN_URL + ", database " + ConfigManager.RASDAMAN_DATABASE, odmge); - } - - Transaction tr = impl.newTransaction(); - - tr.begin(); - OQLQuery q = impl.newOQLQuery(); - DBag resultSet; - - try { - q.create(query); - resultSet = (DBag) q.execute(); - - if (resultSet != null) { - Iterator resultIterator = resultSet.iterator(); - - if (resultIterator.hasNext()) { - Object current = resultIterator.next(); - - try { - RasGMArray resultArray = (RasGMArray) current; - result = resultArray.getArray(); - } catch (ClassCastException e) { - LOG.error("result=" + current.toString()); - result = current.toString().getBytes(); - } - } - } - } catch (QueryException qe) { - tr.commit(); - - try { - db.close(); - } catch (ODMGException odmge) { - } - - throw new InternalComponentException("Could not evaluate rasdaman query: '" + query + "'. Cause: " + qe.getMessage(), qe); - } - - tr.commit(); - - try { - db.close(); - } catch (ODMGException odmge) { - } - - return new String(result); - } - - /** Creates a string with the contents of the GetCoverage response XML */ - private String buildOutputXml(String coverageData, Metadata coverage) { - String xml = GetCoverageResponse; - xml = xml.replaceAll("\\{coverageId\\}", coverage.getCoverageName() + Math.random()); - xml = xml.replaceAll("\\{gridDimension\\}", String.valueOf(coverage.getDimension())); - xml = xml.replaceAll("\\{gridId\\}", "grid-" + coverage.getCoverageName()); - // low - xml = xml.replaceAll("\\{low\\}", lowPoint); - // high - xml = xml.replaceAll("\\{high\\}", highPoint); - // axisLabels - xml = xml.replaceAll("\\{axisLabels\\}", newAxesLabels); - // coverageData - xml = xml.replaceAll("\\{coverageData\\}", coverageData); - - - - // Build the range structure - Iterator it3 = coverage.getRangeIterator(); - int i = -1; - String rangeComponents = ""; - while (it3.hasNext()) { - String component = rangeComponentTemplate; - RangeElement range = it3.next(); - i++; - String rangeId = "range-" + coverage.getCoverageId() + "-" + range.getName(); - LOG.trace(range.toString()); - - component = component.replaceAll("\\{rangeFieldId\\}", rangeId); - component = component.replaceAll("\\{fieldName\\}", range.getName()); - component = component.replaceAll("\\{datatype\\}", DescribeCoverage.DATATYPE_URN_PREFIX + range.getType()); - - // Compute the null values for this range field - Set nullVals = new HashSet(); - Iterator it = coverage.getNullSetIterator(); - while (it.hasNext()) { - List nilVal = SDU.str2string(it.next()); - nullVals.add(nilVal.get(i)); - } - StringBuffer nullValsString = new StringBuffer(); - it = nullVals.iterator(); - while (it.hasNext()) { - nullValsString.append(" " + it.next()); - } - component = component.replaceAll("\\{nilValues\\}", nullValsString.toString().substring(1)); - - // And add this range field to the range structure - rangeComponents += component; - } - - xml = xml.replaceAll("\\{rangeFields\\}", rangeComponents); - xml = xml.replaceAll("\\{rangeStructureId\\}", "rangeStructure-" + coverage.getCoverageId()); - - xml = xml.replaceAll("\\{wcsSchemaUrl\\}", ConfigManager.WCS2_SCHEMA_URL); - - return xml; - } - - /** - * Retrieve the coverage data for a multi-band coverage, - * with particular subsetting parameters. - * @param coverage metadata for the coverage we want - * @param subsetting subsetting string, to be used in the RasQL query - * @return a string of space-separated values, where various bands of one - * pixel are comma-separated. For example, the string "1,2 3,4 5,6" can - * be the coverage data of a 1-by-3 coverage, with two bands - */ - private String buildCoverageData(Metadata coverage, String subsetting) throws WCSException { - String coverageName = coverage.getCoverageName(); - Iterator it = coverage.getRangeIterator(); - int bandcount = 0; - while (it.hasNext()) { - it.next(); - bandcount++; - } - LOG.debug("Coverage {} has {} bands", coverageName, bandcount); - String[][] pixels = new String[bandcount][]; - String currentBand = ""; - /* For all bands of the coverage, execute a rasql query */ - for (int band = 0; band < bandcount; band++) { - LOG.trace("Processing band {}", band); - // Construct rasql query - currentBand = "." + band; - // If this is a one-band image, then band-subsetting would result in an error - if (bandcount == 1) { - currentBand = ""; - } - String rasqlQuery = "select csv(cov[" + subsetting + "]" + currentBand + ") " - + "from " + coverageName + " as cov"; - - // Execute RasQl query => coverage data - LOG.trace("Executing query {}", rasqlQuery); - String output = executeRasqlQuery(rasqlQuery); - - // Remove the curly braces from the rasql output - LOG.trace("Removing curly braces..."); - output = output.replaceAll("\\{", ""); - output = output.replaceAll("\\}", ""); - - // Tokenize the input to get the pixel values of the current band - LOG.trace("Splitting values with comma..."); - pixels[band] = output.split(","); - - LOG.trace("Done processing band {}.", band); - } - - /* Combine all bands into one single string */ - int pixelcount = pixels[0].length; - StringBuilder data = new StringBuilder(pixelcount * bandcount); - LOG.debug("Going to combine {} pixels with {} bands...", pixelcount, bandcount); - for (int pix = 0; pix < pixelcount; pix++) { - if (pixelcount > 20 && pix % (pixelcount / 20) == 0) { - LOG.debug("Processing Pixel {} of " + pixelcount + " - {}%", pix, pix * 100 / (pixelcount - 1)); - } - for (int b = 0; b < bandcount - 1; b++) { - data.append(pixels[b][pix] + ","); - } - data.append(pixels[bandcount - 1][pix]); - data.append(" "); - } - return data.substring(0, data.length() - 2); - } -} diff --git a/petascope/src/petascope/wcs2/server/ops/WcsOperation.java b/petascope/src/petascope/wcs2/server/ops/WcsOperation.java deleted file mode 100644 index 1ad8eae..0000000 --- a/petascope/src/petascope/wcs2/server/ops/WcsOperation.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community 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. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see . - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see - * or contact Peter Baumann via . - */ -package petascope.wcs2.server.ops; - -//~--- non-JDK imports -------------------------------------------------------- -import petascope.wcs.server.exceptions.WCSException; - -/** - * Interface for all WCS Operations. - * @author Andrei Aiordachioaie - */ -public interface WcsOperation { - - /** Execute the operation */ - public String execute(String input) throws WCSException; -} diff --git a/petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml b/petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml deleted file mode 100644 index c431723..0000000 --- a/petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - {listOfCoverageDescriptions} - - - - - - {low} - {high} - - - {axisLabels} - - - - - {rangeFields} - - - {fieldName} - {datatype} - {nilValues} - - - - - - - {supportedFormats} - - - diff --git a/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml b/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml deleted file mode 100644 index 86631bf..0000000 --- a/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - WCS 2.0 Coverage Server @ Jacobs University - WCS 2.0 Server developed at jacobs University - OGC WCS - 2.0.0 - urn:ogc:def:extension:OGC-WCS:2.0:protocol:post - urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0 - urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0 - - - Jacobs University Bremen - - - Prof. Dr. Peter Baumann - - - Bremen - 28717 - Germany - p.baumann@jacobs-university.de - - - Project Leader - - - - - - - - - - - - text/xml - - - - - XML - - - - - - - - - - - - text/xml - - - - - XML - - - - - - - - - - - - text/xml - - - - - XML - - - - - - {Coverages} - - - - diff --git a/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml b/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml deleted file mode 100644 index 9b76cc9..0000000 --- a/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - {low} - {high} - - - {axisLabels} - - - - - - - {coverageData} - - - - - - {rangeFields} - - - {fieldName} - {datatype} - {nilValues} - - - - - diff --git a/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java b/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java deleted file mode 100644 index 1f713e4..0000000 --- a/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community 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. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see . - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see - * or contact Peter Baumann via . - */ -package petascope.wcs2.server.templates; - -import java.util.Iterator; -import javax.xml.XMLConstants; -import javax.xml.namespace.NamespaceContext; - -/** - * - * @author Andrei Aiordachioaie - */ -public class WcsNamespaceContext implements NamespaceContext { - - @Override - public String getNamespaceURI(String prefix) { - if (prefix == null) { - throw new NullPointerException("Null prefix"); - } else if ("wcs".equals(prefix)) { - return "http://www.opengis.net/wcs/2.0"; - } else if ("gml".equals(prefix)) { - return "http://www.opengis.net/gml/3.2"; - } - - return XMLConstants.NULL_NS_URI; - } - - // This method isn't necessary for XPath processing. - @Override - public String getPrefix(String uri) { - throw new UnsupportedOperationException(); - } - - // This method isn't necessary for XPath processing either. - @Override - public Iterator getPrefixes(String uri) { - throw new UnsupportedOperationException(); - } -} diff --git a/petascope/src/petascope/wcst/server/WcstServer.java b/petascope/src/petascope/wcst/server/WcstServer.java index fc2cb9e..13a5ff7 100644 --- a/petascope/src/petascope/wcst/server/WcstServer.java +++ b/petascope/src/petascope/wcst/server/WcstServer.java @@ -14,33 +14,29 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . */ package petascope.wcst.server; -//~--- non-JDK imports -------------------------------------------------------- import petascope.ConfigManager; import net.opengis.ows.v_1_0_0.ExceptionReport; - +import petascope.exceptions.PetascopeException; +import petascope.exceptions.RasdamanException; +import petascope.exceptions.WCPSException; +import petascope.exceptions.WCSTException; import petascope.wcst.transaction.ServiceFirewall; import petascope.wcst.transaction.executeAsyncTransaction; import petascope.wcst.transaction.executeTransaction; import wcst.transaction.schema.AcknowledgementType; import wcst.transaction.schema.TransactionResponseType; import wcst.transaction.schema.TransactionType; - -//~--- JDK imports ------------------------------------------------------------ - import java.io.StringReader; import java.io.StringWriter; - import java.util.Date; import java.util.GregorianCalendar; - import javax.xml.XMLConstants; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; @@ -56,11 +52,9 @@ import javax.xml.stream.XMLStreamWriter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import petascope.PetascopeXmlNamespaceMapper; -import petascope.wcps.server.core.DbMetadataSource; -import petascope.wcs.server.exceptions.InvalidPropertyValueException; -import petascope.wcs.server.exceptions.MaliciousQueryException; -import petascope.wcs.server.exceptions.WCSException; -import petascope.wcs.server.exceptions.XmlStructuresException; +import petascope.core.DbMetadataSource; +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; /** * The Web Coverage Service, with the Transactional extension (WcstServer) @@ -69,7 +63,7 @@ import petascope.wcs.server.exceptions.XmlStructuresException; */ public class WcstServer { - private static Logger LOG = LoggerFactory.getLogger(WcstServer.class); + private static Logger log = LoggerFactory.getLogger(WcstServer.class); private static Boolean finished; private boolean synchronous = true; private String responseHandler; @@ -85,22 +79,22 @@ public class WcstServer { /* Check user settings */ String cfg = ConfigManager.WCST_DEFAULT_DATATYPE; if (source.getDataTypes().contains(cfg) == false) { - throw new InvalidPropertyValueException("The following setting is not a valid datatype: " + cfg); + throw new WCSException(ExceptionCode.InvalidPropertyValue, "The following setting is not a valid datatype: " + cfg); } cfg = ConfigManager.WCST_DEFAULT_INTERPOLATION; if (source.getInterpolationTypes().contains(cfg) == false) { - throw new InvalidPropertyValueException("The following setting is not a valid interpolation method: " + cfg); + throw new WCSException(ExceptionCode.InvalidPropertyValue, "The following setting is not a valid interpolation method: " + cfg); } cfg = ConfigManager.WCST_DEFAULT_NULL_RESISTANCE; if (source.getNullResistances().contains(cfg) == false) { - throw new InvalidPropertyValueException("The following setting is not a valid null resistance: " + cfg); + throw new WCSException(ExceptionCode.InvalidPropertyValue, "The following setting is not a valid null resistance: " + cfg); } } /** * Web service operation */ - public String Transaction(String stringXml) { + public String Transaction(String stringXml) throws WCSTException, RasdamanException, WCPSException, PetascopeException { // Actual contents of these two strings do not matter String output = "Default output. "; String errmsg = "No error. "; @@ -110,12 +104,12 @@ public class WcstServer { try { // Check if Firewall allows the query if (ServiceFirewall.reject(stringXml)) { - throw new MaliciousQueryException("WCS-T Service Firewall " + throw new WCSException(ExceptionCode.MaliciousQuery, "WCS-T Service Firewall " + "refused to run possibly malitious query."); } // read the input XML - LOG.debug("Reading the input XML file ... "); + log.debug("Reading the input XML file ... "); JAXBContext context = JAXBContext.newInstance( TransactionType.class.getPackage().getName()); Unmarshaller unmarshaller = context.createUnmarshaller(); @@ -149,7 +143,8 @@ public class WcstServer { /** Synchronous operation */ if (synchronous == true) { - TransactionResponseType response = exec.get(); + TransactionResponseType response = null; + exec.get(); JAXBElement jaxbOutput = new JAXBElement( new QName("http://www.opengis.net/wcs/1.1/wcst", @@ -157,7 +152,7 @@ public class WcstServer { TransactionResponseType.class, response); // Write the output xml to a string - LOG.debug("Marshalling with context: " + response.getClass().getPackage().getName()); + log.debug("Marshalling with context: " + response.getClass().getPackage().getName()); final StringWriter writer = new StringWriter(); try { context = JAXBContext.newInstance(response.getClass()); @@ -173,7 +168,7 @@ public class WcstServer { throw new RuntimeException(e.getMessage(), e); } output = writer.toString(); - LOG.debug("Done! User has the TransactionResponse result !"); + log.debug("Done! User has the TransactionResponse result !"); } else /** Asynchronous operation */ { /* (1) Create acknowledgement that we received the request */ @@ -200,8 +195,8 @@ public class WcstServer { marshaller.marshal(jaxbOutput, strWriter); output = strWriter.toString(); - LOG.debug("Created the acknowledgement of the request !"); - LOG.debug("Now starting to asynchronously execute the transaction..."); + log.debug("Created the acknowledgement of the request !"); + log.debug("Now starting to asynchronously execute the transaction..."); /* (3) Start asynchronous processing */ executeAsyncTransaction execAsync = new executeAsyncTransaction(exec, @@ -212,12 +207,12 @@ public class WcstServer { finished = true; } catch (JAXBException e) { - throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", e); + throw new WCSException(ExceptionCode.XmlStructuresError, "Could not marshall/unmarshall XML structures.", e); } catch (DatatypeConfigurationException e) { - throw new XmlStructuresException("Could not build request acknowledgement. ", e); + throw new WCSException(ExceptionCode.XmlStructuresError, "Could not build request acknowledgement. ", e); } } catch (WCSException e) { - LOG.info("Caught WCST Exception"); + log.info("Caught WCST Exception"); ExceptionReport report = e.getReport(); try { @@ -232,12 +227,12 @@ public class WcstServer { marshaller.marshal(report, strWriter); output = strWriter.toString(); finished = true; - LOG.error("WCS-T Exception: " + e.getErrorCode() + ", with message '" - + e.getErrorDetail() + "'"); - LOG.debug("Done with the Error Report !"); + log.error("WCS-T Exception: " + e.getExceptionCode() + ", with message '" + + e.getExceptionText() + "'"); + log.debug("Done with the Error Report !"); } catch (JAXBException e2) { errmsg = e2.getMessage(); - LOG.error("Could not build XML error report. Stack trace: " + e2); + log.error("Could not build XML error report. Stack trace: " + e2); } } diff --git a/petascope/src/petascope/wcst/server/servlet/wcstServlet.java b/petascope/src/petascope/wcst/server/servlet/wcstServlet.java index 17850a0..fbef25e 100644 --- a/petascope/src/petascope/wcst/server/servlet/wcstServlet.java +++ b/petascope/src/petascope/wcst/server/servlet/wcstServlet.java @@ -14,32 +14,26 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . */ package petascope.wcst.server.servlet; -//~--- non-JDK imports -------------------------------------------------------- import petascope.wcst.server.*; import petascope.ConfigManager; import org.apache.commons.io.FileUtils; - -//~--- JDK imports ------------------------------------------------------------ - import java.io.File; import java.io.IOException; import java.io.PrintWriter; - - import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import petascope.wcps.server.core.DbMetadataSource; -import petascope.wcs.server.exceptions.WCSException; +import petascope.core.DbMetadataSource; +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; /** Servlet interface for the WCS-Transactional server. * diff --git a/petascope/src/petascope/wcst/transaction/ServiceFirewall.java b/petascope/src/petascope/wcst/transaction/ServiceFirewall.java index f8cd6aa..28d64e3 100644 --- a/petascope/src/petascope/wcst/transaction/ServiceFirewall.java +++ b/petascope/src/petascope/wcst/transaction/ServiceFirewall.java @@ -14,14 +14,14 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . */ package petascope.wcst.transaction; + /** Firewall class for WCS-T. It's job is to detect malitious queries and reject them. * Currently, it only checks that queries do not occur too often. * diff --git a/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java b/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java index b1f2766..6583208 100644 --- a/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java +++ b/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java @@ -14,8 +14,7 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . @@ -29,6 +28,7 @@ import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLEncoder; +import java.util.logging.Level; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; @@ -37,10 +37,11 @@ import javax.xml.namespace.QName; import net.opengis.ows.v_1_0_0.ExceptionReport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import petascope.wcs.server.exceptions.BadResponseHandlerException; -import petascope.wcs.server.exceptions.InputOutputException; -import petascope.wcs.server.exceptions.WCSException; -import petascope.wcs.server.exceptions.XmlStructuresException; +import petascope.exceptions.PetascopeException; +import petascope.exceptions.WCPSException; +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; +import petascope.exceptions.WCSTException; import wcst.transaction.schema.TransactionResponseType; /** @@ -50,7 +51,7 @@ import wcst.transaction.schema.TransactionResponseType; */ public class executeAsyncTransaction extends Thread { - private static Logger LOG = LoggerFactory.getLogger(executeAsyncTransaction.class); + private static Logger log = LoggerFactory.getLogger(executeAsyncTransaction.class); private String responseHandler; private executeTransaction exec; @@ -66,18 +67,23 @@ public class executeAsyncTransaction extends Thread { /** Run the current thread. */ public void run() { - LOG.info("Started async thread..."); + log.info("Started async thread..."); String outString = null; try // only for WCSException { try { /* (1) Do the actual processing of the Transaction */ - LOG.debug("Starting async execution ..."); - TransactionResponseType output = exec.get(); + log.debug("Starting async execution ..."); + TransactionResponseType output; + try { + output = exec.get(); + } catch (Exception ex) { + throw new RuntimeException("Error executing transaction", ex); + } JAXBElement jaxbOutput = new JAXBElement(new QName("", "TransactionResponse"), TransactionResponseType.class, output); /* (2) Marshall the output XML into a String */ - LOG.debug("Marshalling transaction response into a string ..."); + log.debug("Marshalling transaction response into a string ..."); JAXBContext jaxbCtx = JAXBContext.newInstance(output.getClass().getPackage().getName()); Marshaller marshaller = jaxbCtx.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N @@ -90,17 +96,17 @@ public class executeAsyncTransaction extends Thread { /* (3) Send the output to the destination response handler */ sendPostRequest(outString, responseHandler); } catch (MalformedURLException ex) { - LOG.error("Stack trace: " + ex); - throw new BadResponseHandlerException("Response Handler URL is malformed."); + log.error("Stack trace: " + ex); + throw new WCSException(ExceptionCode.BadResponseHandler, "Response Handler URL is malformed.", ex); } catch (IOException ex) { - LOG.error("Stack trace: " + ex); - throw new InputOutputException("Could not send asynchronous response to URL: " + responseHandler); + log.error("Stack trace: " + ex); + throw new WCSException(ExceptionCode.IOConnectionError, "Could not send asynchronous response to URL: " + responseHandler); } catch (JAXBException ex) { - LOG.error("Stack trace: " + ex); - throw new XmlStructuresException("Could not marshall the XML to a string !"); + log.error("Stack trace: " + ex); + throw new WCSException(ExceptionCode.XmlStructuresError, "Could not marshall the XML to a string !"); } } catch (WCSException e) { - LOG.error("Caught WCS Exception: " + e); + log.error("Caught WCS Exception: " + e); ExceptionReport report = e.getReport(); try { /* Build the error report */ @@ -111,14 +117,14 @@ public class executeAsyncTransaction extends Thread { StringWriter strWriter = new StringWriter(); marshaller.marshal(report, strWriter); outString = strWriter.toString(); - LOG.trace("Done with the Error Report !"); + log.trace("Done with the Error Report !"); /* Send the error report to the responseHandler */ sendPostRequest(outString, responseHandler); } catch (JAXBException e2) { - LOG.error("Stack trace: " + e2); + log.error("Stack trace: " + e2); } catch (IOException e2) { - LOG.error("Stack trace: " + e2); + log.error("Stack trace: " + e2); } } } @@ -131,7 +137,7 @@ public class executeAsyncTransaction extends Thread { * @throws IOException */ private void sendPostRequest(String content, String destinationUrl) throws MalformedURLException, IOException { - LOG.debug("sendPostRequest() ... to URL: " + destinationUrl); + log.debug("sendPostRequest() ... to URL: " + destinationUrl); // connect to the destination URL servlet = new URL(destinationUrl); @@ -158,6 +164,6 @@ public class executeAsyncTransaction extends Thread { out.flush(); out.close(); - LOG.debug("Sent request to URL."); + log.debug("Sent request to URL."); } } diff --git a/petascope/src/petascope/wcst/transaction/executeTransaction.java b/petascope/src/petascope/wcst/transaction/executeTransaction.java index 7b42442..7c4fc63 100644 --- a/petascope/src/petascope/wcst/transaction/executeTransaction.java +++ b/petascope/src/petascope/wcst/transaction/executeTransaction.java @@ -14,15 +14,13 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . */ package petascope.wcst.transaction; -//~--- non-JDK imports -------------------------------------------------------- import java.sql.SQLException; import net.opengis.ows.v_1_0_0.BoundingBoxType; import net.opengis.wcs.ows.v_1_1_0.InterpolationMethodType; @@ -31,25 +29,20 @@ import net.opengis.wcs.v_1_1_0.CoverageDescriptions; import net.opengis.wcs.v_1_1_0.CoverageSummaryType; import net.opengis.wcs.v_1_1_0.FieldType; import net.opengis.wcs.v_1_1_0.RangeType; - import org.apache.commons.io.IOUtils; - +import petascope.exceptions.PetascopeException; +import petascope.exceptions.RasdamanException; +import petascope.exceptions.WCPSException; import petascope.wcps.server.core.SDU; - -//~--- JDK imports ------------------------------------------------------------ - import java.awt.image.BufferedImage; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.StringReader; - import java.math.BigInteger; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; - import java.security.InvalidParameterException; import java.util.ArrayList; import java.util.HashSet; @@ -58,10 +51,7 @@ import java.util.List; import java.util.Random; import java.util.Set; import java.util.UUID; - import javax.imageio.ImageIO; - - import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.Unmarshaller; @@ -69,29 +59,15 @@ import net.opengis.wcs.ows.v_1_1_0.InterpolationMethods; import org.odmg.ODMGException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import petascope.wcps.server.core.DbMetadataSource; -import petascope.wcps.server.core.Metadata; -import petascope.wcs.server.exceptions.WCSException; +import petascope.core.DbMetadataSource; +import petascope.core.Metadata; +import petascope.exceptions.ExceptionCode; import petascope.ConfigManager; import petascope.wcps.server.core.CellDomainElement; import petascope.wcps.server.core.DomainElement; import petascope.wcps.server.core.InterpolationMethod; -import petascope.wcps.server.exceptions.InvalidMetadataException; -import petascope.wcps.server.exceptions.InvalidWcpsRequestException; import petascope.wcps.server.core.RangeElement; -import petascope.wcps.server.exceptions.ResourceException; -import petascope.wcs.server.exceptions.ActionNotSupportedException; -import petascope.wcs.server.exceptions.InputOutputException; -import petascope.wcs.server.exceptions.InternalComponentException; -import petascope.wcs.server.exceptions.InternalSqlException; -import petascope.wcs.server.exceptions.InvalidParameterValueException; -import petascope.wcs.server.exceptions.InvalidRequestException; -import petascope.wcs.server.exceptions.MissingParameterValueException; -import petascope.wcs.server.exceptions.MultiBandImagesNotSupportedException; -import petascope.wcs.server.exceptions.NoApplicableCodeException; -import petascope.wcs.server.exceptions.NodeParsingNotImplementedException; -import petascope.wcs.server.exceptions.XmlNotValidException; -import petascope.wcs.server.exceptions.XmlStructuresException; +import petascope.exceptions.WCSTException; import wcst.transaction.schema.CodeType; import wcst.transaction.schema.CoverageType; import wcst.transaction.schema.KeywordsType; @@ -110,7 +86,7 @@ import petascope.wcst.transaction.tools.RasdamanUtils; */ public class executeTransaction { - private static Logger LOG = LoggerFactory.getLogger(executeTransaction.class); + private static Logger log = LoggerFactory.getLogger(executeTransaction.class); // private static boolean printLog = true; private boolean finished; private TransactionType input; @@ -125,7 +101,7 @@ public class executeTransaction { * @param tr Transaction object, a WCS-T request * @param metadataDbPath Path to the "dbparams.properties" file */ - public executeTransaction(TransactionType tr, DbMetadataSource source) throws WCSException { + public executeTransaction(TransactionType tr, DbMetadataSource source) throws WCSTException, RasdamanException { input = tr; output = new TransactionResponseType(); finished = false; @@ -156,19 +132,19 @@ public class executeTransaction { * Main method of this class: Computes the response to the TransactionResponse * request given to the constructor. If needed, it also calls process() * @return a TransactionResponse object. - * @throws WCSException + * @throws WCSTException */ - public TransactionResponseType get() throws WCSException { + public TransactionResponseType get() throws WCSTException, WCPSException, PetascopeException { try { if (finished == false) { metaDb.ensureConnection(); process(); } } catch (SQLException e) { - throw new InternalSqlException("Could not ensure connection to database is valid", e); + throw new WCSTException(ExceptionCode.InternalSqlError, "Could not ensure connection to database is valid", e); } if (finished == false) { - throw new NoApplicableCodeException("Could not execute the Transaction request! " + throw new WCSTException(ExceptionCode.NoApplicableCode, "Could not execute the Transaction request! " + "Please see the other errors..."); } @@ -178,12 +154,12 @@ public class executeTransaction { /** * Computes the response to the Transaction request given to the constructor. */ - public void process() throws WCSException { + public void process() throws WCSTException, WCPSException, PetascopeException { if (!input.getService().equalsIgnoreCase("WCS")) { - throw new InvalidParameterValueException("Service. Explanation: Service must be \"WCS\" !"); + throw new WCSTException(ExceptionCode.InvalidParameterValue, "Service. Explanation: Service must be \"WCS\" !"); } if (!input.getVersion().equalsIgnoreCase("1.1")) { - throw new InvalidParameterValueException("Service. Explanation: Service Version must be \"1.1\" !"); + throw new WCSTException(ExceptionCode.InvalidParameterValue, "Service. Explanation: Service Version must be \"1.1\" !"); } // Set the output request ID @@ -212,43 +188,43 @@ public class executeTransaction { /* Commit rasdaman changes */ try { - LOG.debug("Commit rasdaman changes ..."); + log.debug("Commit rasdaman changes ..."); rasUtils.commitAndClose(); - LOG.debug("Rasdaman coverages saved successfully !"); + log.debug("Rasdaman coverages saved successfully !"); } catch (ODMGException e) { - throw new InternalComponentException("Could not commit Rasdaman changes !", e); + throw new WCSTException(ExceptionCode.InternalComponentError, "Could not commit Rasdaman changes !", e); } /* Commit metadata changes */ try { - LOG.debug("Commit metadata changes ..."); + log.debug("Commit metadata changes ..."); metaDb.commitAndClose(); - LOG.debug("Metadata has been saved !"); + log.debug("Metadata has been saved !"); } catch (SQLException e) { - throw new InternalSqlException("Could not commit metadata changes", e); + throw new WCSTException(ExceptionCode.InternalSqlError, "Could not commit metadata changes", e); } - } catch (WCSException e) { + } catch (WCSTException e) { // One action failed, therefore all actions have failed /* Abort metadata changes */ finished = false; try { - LOG.debug("Rolling back metadata database changes ..."); + log.debug("Rolling back metadata database changes ..."); metaDb.abortAndClose(); - LOG.debug("Metadata rollback completed!"); + log.debug("Metadata rollback completed!"); } catch (SQLException ex) { - LOG.error("Could not rollback metadata changes."); - e.appendErrorDetail(" Could not rollback metadata changes!"); + log.error("Could not rollback metadata changes."); + e.appendExceptionText(" Could not rollback metadata changes!"); } /* Abort rasdaman changes */ try { - LOG.debug("Aborting rasdaman changes ..."); + log.debug("Aborting rasdaman changes ..."); rasUtils.abortAndClose(); - LOG.debug("Rasdaman changes aborted !"); + log.debug("Rasdaman changes aborted !"); } catch (ODMGException ex) { - LOG.error("Could not abort rasdaman changes."); - e.appendErrorDetail(" Could not rollback rasdaman changes!"); + log.error("Could not abort rasdaman changes."); + e.appendExceptionText(" Could not rollback rasdaman changes!"); } throw e; @@ -262,12 +238,12 @@ public class executeTransaction { */ private void deleteCoverageFromRasdaman(String identifier) throws Exception { try { - LOG.trace("Deleting coverage from Rasdaman ..."); + log.trace("Deleting coverage from Rasdaman ..."); rasUtils.deleteCollection(identifier); - LOG.trace("Rasdaman Collection '" + identifier + "' is now deleted !"); + log.trace("Rasdaman Collection '" + identifier + "' is now deleted !"); } catch (ODMGException e) { - LOG.error("Failed to delete rasdaman collection " + identifier); - throw new InternalComponentException("Failed to delete collection from Rasdaman !", e); + log.error("Failed to delete rasdaman collection " + identifier); + throw new WCSTException(ExceptionCode.InternalComponentError, "Failed to delete collection from Rasdaman !", e); } } @@ -278,14 +254,14 @@ public class executeTransaction { * @param href The location of the pixels for the new image */ private void insertImageIntoRasdaman(String identifier, BufferedImage img) - throws WCSException { - LOG.trace("Inserting image into Rasdaman raster server..."); + throws WCSTException, RasdamanException { + log.trace("Inserting image into Rasdaman raster server..."); try { rasUtils.insertGrayImageAsArray(identifier, img); - LOG.debug("Inserted image into Rasdaman !"); + log.debug("Inserted image into Rasdaman !"); } catch (ODMGException e) { - LOG.error("Could not insert image into Rasdaman !"); - throw new InternalComponentException("Could not insert image into Rasdaman.", e); + log.error("Could not insert image into Rasdaman !"); + throw new WCSTException(ExceptionCode.InternalComponentError, "Could not insert image into Rasdaman.", e); } } @@ -293,17 +269,17 @@ public class executeTransaction { * * @param pixels Reference object * @return available image - * @throws WCSException + * @throws WCSTException */ - private BufferedImage loadPixelsReference(ReferenceType pixels) throws WCSException { + private BufferedImage loadPixelsReference(ReferenceType pixels) throws WCSTException { URL url = null; BufferedImage img = null; try { url = new URL(pixels.getHref()); } catch (MalformedURLException e) { - LOG.error("URL " + url.toString() + " is not valid."); - throw new InvalidParameterValueException("Reference pixels. " + log.error("URL " + url.toString() + " is not valid."); + throw new WCSTException(ExceptionCode.InvalidParameterValue, "Reference pixels. " + "Explanation: URL " + url.toString() + " is not valid."); } @@ -313,8 +289,8 @@ public class executeTransaction { throw new IOException("Empty stream while reading image."); } } catch (IOException e) { - LOG.error(e.getMessage()); - throw new InputOutputException("Reference Pixels. Explanation: " + log.error(e.getMessage()); + throw new WCSTException(ExceptionCode.IOConnectionError, "Reference Pixels. Explanation: " + "Could not read image from URL '" + url, e); } @@ -327,10 +303,10 @@ public class executeTransaction { * @param identifier Name of coverage * @param desc Reference to a CoverageDescriptions xml * @return coverage description - * @throws WCSException + * @throws WCSTException */ private CoverageDescriptionType loadDescriptionReference(String identifier, - ReferenceType desc) throws WCSException { + ReferenceType desc) throws WCSTException, WCSTException { URL url = null; String xmlString = null; CoverageDescriptions descs = null; @@ -340,8 +316,8 @@ public class executeTransaction { try { url = new URL(desc.getHref()); } catch (MalformedURLException e) { - LOG.error("URL " + url.toString() + " is not valid !"); - throw new InvalidParameterValueException("Reference pixels. Explanation: " + log.error("URL " + url.toString() + " is not valid !"); + throw new WCSTException(ExceptionCode.InvalidParameterValue, "Reference pixels. Explanation: " + "URL " + url.toString() + " is not valid."); } @@ -352,7 +328,7 @@ public class executeTransaction { xmlString = IOUtils.toString(in); } catch (IOException ex) { - throw new InputOutputException("Description Reference. Explanation: error loading the " + throw new WCSTException(ExceptionCode.IOConnectionError, "Description Reference. Explanation: error loading the " + "coverage description from URL " + url.toString(), ex); } @@ -367,13 +343,13 @@ public class executeTransaction { } else if (obj instanceof CoverageDescriptions) { descs = (CoverageDescriptions) obj; } else { - LOG.error("Coverage description metadata is not a valid xml document."); - throw new XmlNotValidException("Coverage " + log.error("Coverage description metadata is not a valid xml document."); + throw new WCSTException(ExceptionCode.XmlNotValid, "Coverage " + "description metadata is not a valid xml document."); } } catch (javax.xml.bind.JAXBException ex) { - throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex); + throw new WCSTException(ExceptionCode.XmlStructuresError, "Could not marshall/unmarshall XML structures.", ex); } // Filter by coverage name @@ -390,13 +366,13 @@ public class executeTransaction { } if (desc0 == null) { - throw new InvalidRequestException("Could not find a CoverageDescription for coverage: " + identifier); + throw new WCSTException(ExceptionCode.InvalidRequest, "Could not find a CoverageDescription for coverage: " + identifier); } return desc0; } - private CoverageSummaryType loadSummaryReference(ReferenceType pixels) throws WCSException { + private CoverageSummaryType loadSummaryReference(ReferenceType pixels) throws WCSTException { URL url = null; String xmlString = null; CoverageSummaryType xml = null; @@ -404,7 +380,7 @@ public class executeTransaction { try { url = new URL(pixels.getHref()); } catch (MalformedURLException e) { - throw new InvalidParameterValueException("Reference summary. Explanation: URL is not valid.", e); + throw new WCSTException(ExceptionCode.InvalidParameterValue, "Reference summary. Explanation: URL is not valid.", e); } // Read the contents of the URL @@ -414,7 +390,7 @@ public class executeTransaction { xmlString = IOUtils.toString(in); } catch (IOException ex) { - throw new InputOutputException("Summary Reference. Explanation: " + throw new WCSTException(ExceptionCode.IOConnectionError, "Summary Reference. Explanation: " + "Error loading the " + "coverage summary from URL " + url.toString(), ex); } @@ -429,10 +405,10 @@ public class executeTransaction { } else if (obj instanceof CoverageSummaryType) { xml = (CoverageSummaryType) obj; } else { - throw new XmlNotValidException("Coverage Summary metadata is not a valid xml document."); + throw new WCSTException(ExceptionCode.XmlNotValid, "Coverage Summary metadata is not a valid xml document."); } } catch (javax.xml.bind.JAXBException ex) { - throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex); + throw new WCSTException(ExceptionCode.XmlStructuresError, "Could not marshall/unmarshall XML structures.", ex); } return xml; @@ -447,8 +423,8 @@ public class executeTransaction { * @return modified metadata object */ private Metadata updateMetadataWithSummary(Metadata meta, - CoverageSummaryType summary) throws WCSException { - LOG.debug("Updating metadata with values from Coverage Summary..."); + CoverageSummaryType summary) throws WCSTException { + log.debug("Updating metadata with values from Coverage Summary..."); String title = null, abstr = null, keywords = null; @@ -504,7 +480,7 @@ public class executeTransaction { */ private void insertSomePixelsIntoRasdaman(String identifier, String pixHref, String descHref) { // TODO: Implement ! - LOG.error("Partial update is not yet implemented"); + log.error("Partial update is not yet implemented"); throw new UnsupportedOperationException("Partial Rasdaman update is not yet implemented."); } @@ -513,12 +489,11 @@ public class executeTransaction { * * @param identifier ID of the coverage * @param img The image, fetched from external reference - * @throws WCSException on error + * @throws WCSTException on error */ - private Metadata createNewCoverageMetadata(String identifier, BufferedImage img) - throws InvalidMetadataException { + private Metadata createNewCoverageMetadata(String identifier, BufferedImage img) throws WCPSException, PetascopeException { Metadata m = null; - LOG.debug("Creating metadata with default values..."); + log.debug("Creating metadata with default values..."); // TODO: When we accept multi-band images, update nullDefault String nullDefault = "0"; @@ -539,15 +514,15 @@ public class executeTransaction { crsSet.add(DomainElement.IMAGE_CRS); String str1 = null, str2 = null; /* Since we currently do not use the Domain sizes, we can set them to 0 and 1 */ - DomainElement domX = new DomainElement("x", "x", 0.0, 1.0, str1, str2, crsSet, metaDb.getAxisNames()); - DomainElement domY = new DomainElement("y", "y", 0.0, 1.0, str1, str2, crsSet, metaDb.getAxisNames()); + DomainElement domX = new DomainElement("x", "x", 0.0, 1.0, str1, str2, crsSet, metaDb.getAxisNames(), null); + DomainElement domY = new DomainElement("y", "y", 0.0, 1.0, str1, str2, crsSet, metaDb.getAxisNames(), null); List domList = new ArrayList(2); domList.add(domX); domList.add(domY); // Ranges /* TODO: When multiple-field images are supported, update ranges */ - RangeElement range = new RangeElement("intensity", ConfigManager.WCST_DEFAULT_DATATYPE); + RangeElement range = new RangeElement("intensity", ConfigManager.WCST_DEFAULT_DATATYPE, null); List rList = new ArrayList(1); rList.add(range); @@ -567,14 +542,14 @@ public class executeTransaction { // Descriptions String abstr = null; String title = "Coverage " + identifier; + String type = "GridCoverage"; // FIXME String keywords = null; - m = - new Metadata(cellList, rList, nullSet, nullDefault, interpList, - interp, identifier, domList, null, title, abstr, keywords); + m = new Metadata(cellList, rList, nullSet, nullDefault, interpList, + interp, identifier, type, domList, null, title, abstr, keywords); - LOG.debug("Done creating default metadata"); + log.debug("Done creating default metadata"); return m; } @@ -583,9 +558,9 @@ public class executeTransaction { * * @param elem the JAXB node equivalent to the node */ - private void processInputCoverageNode(CoverageType elem) throws WCSException { + private void processInputCoverageNode(CoverageType elem) throws WCSTException, WCPSException, PetascopeException { if (elem.getAction() == null) { - throw new InvalidParameterValueException("Action. Explanation: " + throw new WCSTException(ExceptionCode.InvalidParameterValue, "Action. Explanation: " + "Every node must contain an child node."); } @@ -609,7 +584,7 @@ public class executeTransaction { } else if (action.equalsIgnoreCase("UpdateAll")) { actionUpdateAll(identifier, references); } else if (action.equalsIgnoreCase("UpdateDataPart")) { - throw new ActionNotSupportedException("Action \"UpdateDataPart\" is not supported yet."); + throw new WCSTException(ExceptionCode.OperationNotSupported, "\"UpdateDataPart\" is not supported yet."); /* TODO: UpdateDataPart is not yet functional. The Rasdaman server * returns with an unexpected internal error (code: 10000) when * a partial update query is sent. */ @@ -623,11 +598,11 @@ public class executeTransaction { * @param identifier Name of coverage to update * @param references List of references with data for update */ - private void actionUpdateAll(String identifier, List references) throws WCSException { - LOG.trace("Executing action Update All ..."); + private void actionUpdateAll(String identifier, List references) throws WCSTException, PetascopeException { + log.trace("Executing action Update All ..."); actionUpdateDataPart(identifier, references); actionUpdateMetadata(identifier, references); - LOG.trace("Finished action Update All!"); + log.trace("Finished action Update All!"); } /** @@ -636,8 +611,8 @@ public class executeTransaction { * @param identifier ID of the coverage * @param desc object that contains the coverage description. */ - private Metadata updateMetadataWithDescription(Metadata meta, CoverageDescriptionType desc) throws WCSException { - LOG.debug("Updating metadata with values from CoverageDescription..."); + private Metadata updateMetadataWithDescription(Metadata meta, CoverageDescriptionType desc) throws WCPSException, WCSTException { + log.debug("Updating metadata with values from CoverageDescription..."); /* (B) Table ps_descriptions: Update coverage title, abstract, keywords */ String title = desc.getTitle(); @@ -654,38 +629,34 @@ public class executeTransaction { Set interpSet = new HashSet(); RangeType range = desc.getRange(); List fields = range.getField(); - try { - LOG.debug("Updating range information..."); - Iterator i = fields.iterator(); - ArrayList rangeList = new ArrayList(); - - while (i.hasNext()) { - FieldType field = i.next(); - - String name = field.getIdentifier(); - String datatype = field.getDefinition().getDataType().getValue(); - RangeElement fieldRange = new RangeElement(name, datatype); - rangeList.add(fieldRange); - - InterpolationMethods methods = field.getInterpolationMethods(); - String interpType = methods.getDefaultMethod().getValue(); - String nullResist = methods.getDefaultMethod().getNullResistance(); - InterpolationMethod interp = new InterpolationMethod(interpType, nullResist); + log.debug("Updating range information..."); + Iterator i = fields.iterator(); + ArrayList rangeList = new ArrayList(); + + while (i.hasNext()) { + FieldType field = i.next(); + + String name = field.getIdentifier(); + String datatype = field.getDefinition().getDataType().getValue(); + RangeElement fieldRange = new RangeElement(name, datatype, null); // FIXME uom = null + rangeList.add(fieldRange); + + InterpolationMethods methods = field.getInterpolationMethods(); + String interpType = methods.getDefaultMethod().getValue(); + String nullResist = methods.getDefaultMethod().getNullResistance(); + InterpolationMethod interp = new InterpolationMethod(interpType, nullResist); + interpSet.add(interp); + + Iterator it = methods.getOtherMethod().iterator(); + while (it.hasNext()) { + InterpolationMethodType imt = it.next(); + String type = imt.getValue(); + String resis = imt.getNullResistance(); + interp = new InterpolationMethod(type, resis); interpSet.add(interp); - - Iterator it = methods.getOtherMethod().iterator(); - while (it.hasNext()) { - InterpolationMethodType imt = it.next(); - String type = imt.getValue(); - String resis = imt.getNullResistance(); - interp = new InterpolationMethod(type, resis); - interpSet.add(interp); - } } - meta.setRange(rangeList); - } catch (InvalidMetadataException e) { - throw new InternalComponentException("Invalid metadata.", e); } + meta.setRange(rangeList); meta.setInterpolationSet(interpSet); } @@ -697,53 +668,45 @@ public class executeTransaction { * and use it on the whole coverage */ if (desc.isSetRange()) { - try { - LOG.debug("Updating default interpolation method..."); - InterpolationMethodType def1 = desc.getRange().getField().get(0).getInterpolationMethods().getDefaultMethod(); - String method = def1.getValue(); - String resist = def1.getNullResistance(); - - InterpolationMethod meth = new InterpolationMethod(method, resist); - meta.setDefaultInterpolation(meth); - } catch (InvalidMetadataException e) { - throw new InternalComponentException("Invalid metadata.", e); - } + log.debug("Updating default interpolation method..."); + InterpolationMethodType def1 = desc.getRange().getField().get(0).getInterpolationMethods().getDefaultMethod(); + String method = def1.getValue(); + String resist = def1.getNullResistance(); + + InterpolationMethod meth = new InterpolationMethod(method, resist); + meta.setDefaultInterpolation(meth); } /* (E) Table ps_celldomain: Update cell domain of the coverage. */ /* NOTE: Only works for 2-D (x/y) or 3-D (x/y/t) coverages */ if (desc.isSetDomain()) { - LOG.debug("Updating spatial bounding box of coverage ..."); - try { - List> list = - desc.getDomain().getSpatialDomain().getBoundingBox(); - if (list.size() == 1) { - BoundingBoxType bbox = (BoundingBoxType) list.get(0).getValue(); - if (bbox.getCrs() == null || bbox.getCrs().equals(DomainElement.IMAGE_CRS)) { - meta = updateImageCrsBoundingBox(meta, bbox); - } else { - throw new InvalidParameterValueException("crs. Explanation: Unknown CRS " + bbox.getCrs()); - } + log.debug("Updating spatial bounding box of coverage ..."); + List> list = + desc.getDomain().getSpatialDomain().getBoundingBox(); + if (list.size() == 1) { + BoundingBoxType bbox = (BoundingBoxType) list.get(0).getValue(); + if (bbox.getCrs() == null || bbox.getCrs().equals(DomainElement.IMAGE_CRS)) { + meta = updateImageCrsBoundingBox(meta, bbox); } else { - Iterator i = list.iterator(); - while (i.hasNext()) { - BoundingBoxType bbox = (BoundingBoxType) i.next(); - if (bbox.getCrs().equals(DomainElement.IMAGE_CRS)) { - meta = updateImageCrsBoundingBox(meta, bbox); - } - // TODO: Implement WGS84 update - // if (bbox.getCrs().equals(DomainElement.WGS84_CRS)) - // updateWgs84CrsBoundingBox(meta, bbox); + throw new WCSTException(ExceptionCode.InvalidParameterValue, "crs. Explanation: Unknown CRS " + bbox.getCrs()); + } + } else { + Iterator i = list.iterator(); + while (i.hasNext()) { + BoundingBoxType bbox = (BoundingBoxType) i.next(); + if (bbox.getCrs().equals(DomainElement.IMAGE_CRS)) { + meta = updateImageCrsBoundingBox(meta, bbox); } + // TODO: Implement WGS84 update + // if (bbox.getCrs().equals(DomainElement.WGS84_CRS)) + // updateWgs84CrsBoundingBox(meta, bbox); } - } catch (InvalidMetadataException e) { - throw new InternalComponentException("Invalid metadata.", e); } } if (desc.getDomain().isSetTemporalDomain()) { - LOG.debug("Updating temporal bounding box of coverage ..."); + log.debug("Updating temporal bounding box of coverage ..."); /* try { @@ -761,18 +724,19 @@ public class executeTransaction { } else { - throw new WCSException("InvalidParameterValue", "TemporalDomain", + throw new WCSTException("InvalidParameterValue", "TemporalDomain", "Exactly one time-period should be present in the " + "Temporal Domain of coverage: " + meta.getCoverageName()); } } catch (InvalidMetadataException e) { - throw new WCSException("InvalidParameterValue", "Unknown, please look at the root cause exception.", e); + throw new WCSTException("InvalidParameterValue", "Unknown, please look at the root cause exception.", e); } */ - LOG.error("This server did not implement the parsing of 'TimePeriod' nodes."); - throw new NodeParsingNotImplementedException("This server did not implement the parsing of 'TimePeriod' nodes."); + log.error("This server did not implement the parsing of 'TimePeriod' nodes."); + throw new WCSTException(ExceptionCode.NodeParsingNotImplemented, + "This server did not implement the parsing of 'TimePeriod' nodes."); } /* (F) Table ps_crss: Update supported CRS */ @@ -787,19 +751,12 @@ public class executeTransaction { * @param identifier * @param references */ - private void actionUpdateDataPart(String identifier, List references) throws WCSException { - LOG.trace("Executing action UpdateDataPart ..."); + private void actionUpdateDataPart(String identifier, List references) throws WCSTException, PetascopeException { + log.trace("Executing action UpdateDataPart ..."); // Error checking // Only change the metadata for an existing coverage - Metadata m = null; - try { - m = metaDb.read(identifier); - } catch (ResourceException e) { - throw new InternalComponentException("Invalid metadata for coverage: " + identifier, e); - } catch (InvalidWcpsRequestException e) { - throw new InternalComponentException("Could not read metadata for coverage: " + identifier, e); - } + Metadata m = metaDb.read(identifier); // Obtain the references ReferenceType pixels, desc; @@ -809,17 +766,17 @@ public class executeTransaction { // References check. We are updating a coverage values, mandatory are: pixels, description if (pixels == null) { - throw new MissingParameterValueException("Reference role='" + getUrnCode("pixels") + "'"); + throw new WCSTException(ExceptionCode.MissingParameterValue, "Reference role='" + getUrnCode("pixels") + "'"); } if (desc == null) { - throw new MissingParameterValueException("Reference role='" + getUrnCode("description") + "'"); + throw new WCSTException(ExceptionCode.MissingParameterValue, "Reference role='" + getUrnCode("description") + "'"); } // (2) Do the actual processing try { insertSomePixelsIntoRasdaman(identifier, pixels.getHref(), desc.getHref()); } catch (Exception e) { - throw new NoApplicableCodeException(e.getMessage(), e); + throw new WCSTException(ExceptionCode.NoApplicableCode, e.getMessage(), e); } } @@ -828,17 +785,17 @@ public class executeTransaction { * * @param identifier * @param references - * @throws wcs.server.core.WCSException + * @throws wcs.server.core.WCSTException */ - private void actionUpdateMetadata(String identifier, List references) throws WCSException { - LOG.trace("Executing action Update Metadata..."); + private void actionUpdateMetadata(String identifier, List references) throws WCSTException { + log.trace("Executing action Update Metadata..."); // Only change the metadata for an existing coverage Metadata m = null; try { m = metaDb.read(identifier); } catch (Exception e) { - throw new InternalComponentException("Invalid metadata for coverage: " + identifier, e); + throw new WCSTException(ExceptionCode.InternalComponentError, "Invalid metadata for coverage: " + identifier, e); } // Obtain the references @@ -849,20 +806,20 @@ public class executeTransaction { // References check. We are updating metadata, mandatory is only the description if (descRef == null) { - throw new MissingParameterValueException("Reference role='" + getUrnCode("description") + "'"); + throw new WCSTException(ExceptionCode.MissingParameterValue, "Reference role='" + getUrnCode("description") + "'"); } - LOG.trace("Loading reference: coverage description ..."); + log.trace("Loading reference: coverage description ..."); CoverageDescriptionType desc = loadDescriptionReference(identifier, descRef); CoverageSummaryType summ = null; if (summRef != null) { - LOG.trace("Loading reference: coverage summary ..."); + log.trace("Loading reference: coverage summary ..."); summ = loadSummaryReference(summRef); } - LOG.trace("Done loading references !"); + log.trace("Done loading references !"); // (2) Do the actual processing try { @@ -875,10 +832,10 @@ public class executeTransaction { metaDb.updateCoverageMetadata(m, false); } catch (Exception e) { - throw new NoApplicableCodeException("Error while updating metadata.", e); + throw new WCSTException(ExceptionCode.NoApplicableCode, "Error while updating metadata.", e); } - LOG.trace("Finished action Update Metadata !"); + log.trace("Finished action Update Metadata !"); } /** @@ -886,10 +843,10 @@ public class executeTransaction { * * @param identifier * @param references - * @throws wcs.server.core.WCSException + * @throws wcs.server.core.WCSTException */ - private void actionAddCoverage(String identifier, List references) throws WCSException { - LOG.trace("Executing action AddCoverage ..."); + private void actionAddCoverage(String identifier, List references) throws WCSTException, WCPSException, PetascopeException { + log.trace("Executing action AddCoverage ..."); // Obtain the references ReferenceType pixelsRef, descRef, summRef; @@ -900,26 +857,26 @@ public class executeTransaction { // References check. We are adding a coverage, mandatory are: pixels, description if (pixelsRef == null) { - throw new MissingParameterValueException("Reference role='" + getUrnCode("pixels") + "'"); + throw new WCSTException(ExceptionCode.MissingParameterValue, "Reference role='" + getUrnCode("pixels") + "'"); } if (descRef == null) { - throw new MissingParameterValueException("Reference role='" + getUrnCode("description") + "'"); + throw new WCSTException(ExceptionCode.MissingParameterValue, "Reference role='" + getUrnCode("description") + "'"); } - LOG.trace("Loading reference: coverage pixels ..."); + log.trace("Loading reference: coverage pixels ..."); BufferedImage img = loadPixelsReference(pixelsRef); - LOG.trace("Loading reference: coverage description ..."); + log.trace("Loading reference: coverage description ..."); CoverageDescriptionType desc = loadDescriptionReference(identifier, descRef); CoverageSummaryType summ = null; if (summRef != null) { - LOG.trace("Loading reference: coverage summary ..."); + log.trace("Loading reference: coverage summary ..."); summ = loadSummaryReference(summRef); } - LOG.trace("Done loading references !"); + log.trace("Done loading references !"); /** * (1) Check coverage name @@ -927,12 +884,12 @@ public class executeTransaction { boolean changeId = false; if (newCoverages.contains(identifier)) { - throw new InvalidParameterValueException("Identifier: You cannot use the same identifier twice."); + throw new WCSTException(ExceptionCode.InvalidParameterValue, "Identifier: You cannot use the same identifier twice."); } if (metaDb.existsCoverageName(identifier)) { changeId = true; - LOG.warn("Changing coverage identifier since coverage '" + identifier + "' already exists !"); + log.warn("Changing coverage identifier since coverage '" + identifier + "' already exists !"); } // Generate new coverage name ? @@ -947,40 +904,34 @@ public class executeTransaction { try { /* Currently we only support one-band (gray-scale) images. */ if (img.getColorModel().getNumComponents() != 1) { - throw new MultiBandImagesNotSupportedException( + throw new WCSTException(ExceptionCode.MultiBandImagesNotSupported, "This server currently only supports one-band images (grayscale). " + "This coverage has " + img.getColorModel().getNumComponents() + " bands."); } insertImageIntoRasdaman(identifier, img); } catch (Exception e) { - throw new InternalComponentException("Error while inserting image in rasdaman.", e); + throw new WCSTException(ExceptionCode.InternalComponentError, "Error while inserting image in rasdaman.", e); } /** * (3) Build the metadata object and store it in the db. */ - try { - Metadata m = createNewCoverageMetadata(identifier, img); - m = updateMetadataWithDescription(m, desc); - /* Top level descriptions overwrite other metadata sources */ - if (summ != null) { - m = updateMetadataWithSummary(m, summ); - } - - metaDb.insertNewCoverageMetadata(m, false); - } catch (InvalidMetadataException e) { - throw new InternalComponentException("Metadata to be inserted is invalid.", e); - } catch (ResourceException e) { - throw new InternalComponentException("Could not insert metadata into database.", e); + Metadata m = createNewCoverageMetadata(identifier, img); + m = updateMetadataWithDescription(m, desc); + /* Top level descriptions overwrite other metadata sources */ + if (summ != null) { + m = updateMetadataWithSummary(m, summ); } + metaDb.insertNewCoverageMetadata(m, false); + /** * (4) Indicate success: Add this ID to the output XML document */ CodeType id = new CodeType(); id.setValue(identifier); output.getIdentifier().add(id); - LOG.trace("Finished action Add !"); + log.trace("Finished action Add !"); } /** @@ -988,13 +939,13 @@ public class executeTransaction { * * @param identifier * @param references - * @throws wcs.server.core.WCSException + * @throws wcs.server.core.WCSTException */ - private void actionDeleteCoverage(String identifier, List references) throws WCSException { - LOG.trace("Executing action Delete Coverage ..."); + private void actionDeleteCoverage(String identifier, List references) throws WCSTException { + log.trace("Executing action Delete Coverage ..."); if (metaDb.existsCoverageName(identifier) == false) { - throw new InvalidParameterValueException("Identifier"); + throw new WCSTException(ExceptionCode.InvalidParameterValue, "Identifier"); } // (2) Do the actual processing @@ -1003,7 +954,7 @@ public class executeTransaction { deleteCoverageFromRasdaman(identifier); metaDb.delete(m, false); } catch (Exception e) { - throw new NoApplicableCodeException("Error while deleting coverage.", e); + throw new WCSTException(ExceptionCode.NoApplicableCode, "Error while deleting coverage.", e); } // Indicate success: Add this ID to the output XML document @@ -1012,7 +963,7 @@ public class executeTransaction { id.setValue(identifier); output.getIdentifier().add(id); - LOG.trace("Finished action Delete !"); + log.trace("Finished action Delete !"); } /** @@ -1021,7 +972,7 @@ public class executeTransaction { * @param key Internal representation of a URN code * @return the URN code */ - private String getUrnCode(String key) throws WCSException { + private String getUrnCode(String key) throws WCSTException { if (key.equalsIgnoreCase("pixels")) { return "urn:ogc:def:role:WCS:1.1:Pixels"; } @@ -1038,7 +989,7 @@ public class executeTransaction { return "urn:ogc:def:role:WCS:1.1:OtherSource"; } - throw new InternalComponentException("Unknown URN key '" + key + "'"); + throw new WCSTException(ExceptionCode.InternalComponentError, "Unknown URN key '" + key + "'"); } /** @@ -1047,7 +998,7 @@ public class executeTransaction { * @param references List of References * @return the Pixels Reference */ - private ReferenceType getPixelsRef(List references) throws WCSException { + private ReferenceType getPixelsRef(List references) throws WCSTException { ReferenceType result = searchReferenceList("pixels", references); return result; @@ -1059,7 +1010,7 @@ public class executeTransaction { * @param references List of References * @return the Coverage Description Reference */ - private ReferenceType getDescriptionRef(List references) throws WCSException { + private ReferenceType getDescriptionRef(List references) throws WCSTException { ReferenceType result = searchReferenceList("description", references); return result; @@ -1071,7 +1022,7 @@ public class executeTransaction { * @param references List of References * @return the Coverage Summary Reference */ - private ReferenceType getSummaryRef(List references) throws WCSException { + private ReferenceType getSummaryRef(List references) throws WCSTException { ReferenceType result = searchReferenceList("summary", references); return result; @@ -1083,7 +1034,7 @@ public class executeTransaction { * @param references List of References * @return the Georeferencing Transform Reference */ - private ReferenceType getTransformRef(List references) throws WCSException { + private ReferenceType getTransformRef(List references) throws WCSTException { ReferenceType result = searchReferenceList("transform", references); return result; @@ -1095,7 +1046,7 @@ public class executeTransaction { * @param references List of References * @return the "Other" Reference */ - private ReferenceType getOtherRef(List references) throws WCSException { + private ReferenceType getOtherRef(List references) throws WCSTException { ReferenceType result = searchReferenceList("other", references); return result; @@ -1107,7 +1058,7 @@ public class executeTransaction { * @param references List of references * @return a Reference object */ - private ReferenceType searchReferenceList(String key, List references) throws WCSException { + private ReferenceType searchReferenceList(String key, List references) throws WCSTException { String urn = getUrnCode(key); Iterator i = references.iterator(); @@ -1125,7 +1076,7 @@ public class executeTransaction { return null; } - private Metadata updateImageCrsBoundingBox(Metadata meta, BoundingBoxType bbox) throws WCSException, InvalidMetadataException { + private Metadata updateImageCrsBoundingBox(Metadata meta, BoundingBoxType bbox) throws WCPSException { List lower = bbox.getLowerCorner(); List upper = bbox.getUpperCorner(); diff --git a/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java b/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java index 1836987..401b213 100644 --- a/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java +++ b/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java @@ -14,40 +14,31 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . */ package petascope.wcst.transaction.tools; -//~--- non-JDK imports -------------------------------------------------------- import org.odmg.DBag; import org.odmg.Database; import org.odmg.Implementation; import org.odmg.ODMGException; import org.odmg.OQLQuery; import org.odmg.Transaction; - import rasj.RasGMArray; import rasj.RasImplementation; import rasj.RasMInterval; import rasj.RasResultIsNoIntervalException; - -import petascope.wcs.server.exceptions.WCSException; - -//~--- JDK imports ------------------------------------------------------------ - +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; - import java.io.ByteArrayInputStream; - import java.util.Iterator; -import org.odmg.QueryException; -import petascope.wcs.server.exceptions.InternalComponentException; +import petascope.exceptions.RasdamanException; /** * Utility class for doing various tasks that involve the Rasdaman server. @@ -83,7 +74,7 @@ public class RasdamanUtils { * Opens a new connection to the Rasdaman server, and starts a new transaction. * @throws WCSException on connection error */ - public void init() throws WCSException { + public void init() throws RasdamanException { try { if (myApp == null) { myApp = new RasImplementation(server); @@ -99,7 +90,8 @@ public class RasdamanUtils { myTa.begin(); } } catch (ODMGException e) { - throw new InternalComponentException("Could not connect to the Rasdaman server !", e); + throw new RasdamanException(ExceptionCode.InternalComponentError, + "Could not connect to the Rasdaman server !", e); } } @@ -257,7 +249,7 @@ public class RasdamanUtils { } } - public void insertGrayImageAsArray(String name, BufferedImage img) throws ODMGException, InternalComponentException { + public void insertGrayImageAsArray(String name, BufferedImage img) throws ODMGException, RasdamanException { log("Creating grey image ..."); RasGMArray myMDD = createMddFromImage(img); // set up query object for collection creation: @@ -422,7 +414,7 @@ public class RasdamanUtils { // commitAndClose(); } - public RasGMArray createMddFromImage(BufferedImage img) throws InternalComponentException { + public RasGMArray createMddFromImage(BufferedImage img) throws RasdamanException { String interval = null; try { int cols = img.getWidth(); @@ -456,7 +448,7 @@ public class RasdamanUtils { return myMDD; } catch (RasResultIsNoIntervalException e) { - throw new InternalComponentException("Illegal Interval String: " + interval, e); + throw new RasdamanException(ExceptionCode.InternalComponentError, "Illegal Interval String: " + interval, e); } } diff --git a/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java b/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java index 0b6d794..f40bedd 100644 --- a/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java +++ b/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java @@ -14,31 +14,21 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . */ package petascope.wcst.transaction.tools; -//~--- non-JDK imports -------------------------------------------------------- import java.awt.Graphics; import java.awt.Panel; import org.odmg.*; - import rasj.*; - -//~--- JDK imports ------------------------------------------------------------ - import java.awt.image.BufferedImage; - import java.io.IOException; - import java.net.URL; - import javax.imageio.ImageIO; - import javax.swing.JFrame; /** Test class for various Rasdaman tasks. Comment/uncomment the lines in the diff --git a/petascope/src/petascope/wps/server/WpsServer.java b/petascope/src/petascope/wps/server/WpsServer.java index 854b983..313ec16 100644 --- a/petascope/src/petascope/wps/server/WpsServer.java +++ b/petascope/src/petascope/wps/server/WpsServer.java @@ -14,8 +14,7 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see . * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see * or contact Peter Baumann via . @@ -36,7 +35,8 @@ import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import petascope.wcps.server.core.ProcessCoveragesRequest; -import petascope.wcs.server.exceptions.InputOutputException; +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; /** * @@ -44,10 +44,10 @@ import petascope.wcs.server.exceptions.InputOutputException; */ public class WpsServer { - private static Logger LOG = LoggerFactory.getLogger(WpsServer.class); + private static Logger log = LoggerFactory.getLogger(WpsServer.class); public String request = null; - public WpsServer(HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws URISyntaxException, IOException, InputOutputException, RecognitionException { + public WpsServer(HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws URISyntaxException, IOException, WCSException, RecognitionException { if ((httpRequest.getParameter("Request") != null) && httpRequest.getParameter("Request").equalsIgnoreCase("GetCapabilities")) { GetCapabilities(httpResponse); @@ -74,10 +74,10 @@ public class WpsServer { } } - public void GetCapabilities(HttpServletResponse httpResponse) throws URISyntaxException, IOException, InputOutputException { + public void GetCapabilities(HttpServletResponse httpResponse) throws URISyntaxException, IOException, WCSException { URI GetCapabilitiesURI = this.getClass().getResource("../templates/GetCapabilities.xml").toURI(); String GetCapabilitiesResponse = loadFile(GetCapabilitiesURI); - LOG.info("Executing operation GetCapabilities..."); + log.info("Executing operation GetCapabilities..."); System.out.println("GetCapabilities Response is " + GetCapabilitiesResponse); PrintWriter out; try { @@ -87,14 +87,14 @@ public class WpsServer { out.flush(); out.close(); } catch (IOException e) { - throw new InputOutputException(e.getMessage(), e); + throw new WCSException(ExceptionCode.IOConnectionError, e.getMessage(), e); } } - public void DescribeProcess(HttpServletResponse httpResponse) throws URISyntaxException, IOException, InputOutputException { + public void DescribeProcess(HttpServletResponse httpResponse) throws URISyntaxException, IOException, WCSException { URI DesribeProcessURI = this.getClass().getResource("../templates/DescribeProcess.xml").toURI(); String DescribeProcessResponse = loadFile(DesribeProcessURI); - LOG.info("Executing operation DescribeProcess..."); + log.info("Executing operation DescribeProcess..."); System.out.println("DescribeProcess Document is " + DescribeProcessResponse); PrintWriter out; try { @@ -104,7 +104,7 @@ public class WpsServer { out.flush(); out.close(); } catch (IOException e) { - throw new InputOutputException(e.getMessage(), e); + throw new WCSException(ExceptionCode.IOConnectionError, e.getMessage(), e); } } @@ -112,7 +112,7 @@ public class WpsServer { InputStream is = null; String contents = null; try { - LOG.debug("Loading file: " + fileUri); + log.debug("Loading file: " + fileUri); File f = new File(fileUri); is = new FileInputStream(f); contents = IOUtils.toString(is); diff --git a/petascope/web/WEB-INF/web.xml b/petascope/web/WEB-INF/web.xml index 5ea7948..4113edd 100644 --- a/petascope/web/WEB-INF/web.xml +++ b/petascope/web/WEB-INF/web.xml @@ -2,6 +2,11 @@ PetaScope project offers WCS, WCPS and WCS-T services. PetaScope + + WCS 2.0 Service + Wcs2Servlet + petascope.wcs2.Wcs2Servlet + WCPS Service wcpsServlet @@ -24,6 +29,10 @@ wcstServlet /wcst + + Wcs2Servlet + /wcs2 + PetaScope Interface /earthlook -- cgit