summaryrefslogtreecommitdiffstats
path: root/petascope
diff options
context:
space:
mode:
authorConstantin <jucovschi@gmail.com>2010-06-02 20:11:10 +0200
committerConstantin <jucovschi@gmail.com>2010-06-02 20:11:10 +0200
commit93b5abce94b65529df95670dd45260bc469e120b (patch)
treeb82ce43668fc6053e88d2ec4cc4a91e7527cbd4b /petascope
parent26c676d01aa3995556d83fbee6a84f87a51915a9 (diff)
parent40e12c6af9d05c3413efaf535c35c625b736cbb9 (diff)
downloadrasdaman-upstream-93b5abce94b65529df95670dd45260bc469e120b.tar.gz
rasdaman-upstream-93b5abce94b65529df95670dd45260bc469e120b.tar.xz
rasdaman-upstream-93b5abce94b65529df95670dd45260bc469e120b.zip
Merge branch 'master' of git://kahlua/petascope
Diffstat (limited to 'petascope')
-rw-r--r--petascope/.gitignore4
-rw-r--r--petascope/INSTALL25
-rw-r--r--petascope/LICENCE165
-rw-r--r--petascope/README51
-rw-r--r--petascope/build.xml132
-rw-r--r--petascope/lib/activation.jarbin0 -> 63886 bytes
-rw-r--r--petascope/lib/antlrworks-1.2.3.jarbin0 -> 3077508 bytes
-rw-r--r--petascope/lib/antlrworks-1.3.1.jarbin0 -> 3155789 bytes
-rw-r--r--petascope/lib/commons-fileupload-1.2.jarbin0 -> 53082 bytes
-rw-r--r--petascope/lib/commons-io-1.3.2.jarbin0 -> 87776 bytes
-rw-r--r--petascope/lib/commons-math-1.1.jarbin0 -> 174535 bytes
-rw-r--r--petascope/lib/gml-v_3_1_1-schema-1.0-SNAPSHOT.jarbin0 -> 586143 bytes
-rw-r--r--petascope/lib/jaxb-api.jarbin0 -> 89967 bytes
-rw-r--r--petascope/lib/jaxb-impl.jarbin0 -> 849481 bytes
-rw-r--r--petascope/lib/jaxb-xjc.jarbin0 -> 3126060 bytes
-rw-r--r--petascope/lib/joda-time-1.6.jarbin0 -> 534827 bytes
-rw-r--r--petascope/lib/jsr173_1.0_api.jarbin0 -> 46047 bytes
-rw-r--r--petascope/lib/junit-4.5-api.zipbin0 -> 184067 bytes
-rw-r--r--petascope/lib/junit-4.5-src.jarbin0 -> 109014 bytes
-rw-r--r--petascope/lib/junit-4.5.jarbin0 -> 196787 bytes
-rw-r--r--petascope/lib/log4j-1.2.15.jarbin0 -> 391834 bytes
-rw-r--r--petascope/lib/nblibraries-private.properties0
-rw-r--r--petascope/lib/nblibraries.properties12
-rw-r--r--petascope/lib/org-netbeans-modules-java-j2seproject-copylibstask.jarbin0 -> 14872 bytes
-rw-r--r--petascope/lib/ows-v_1_0_0-schema-1.0-SNAPSHOT.jarbin0 -> 50705 bytes
-rw-r--r--petascope/lib/postgresql-8.3-604.jdbc4.jarbin0 -> 475580 bytes
-rw-r--r--petascope/lib/rasj.jarbin0 -> 150852 bytes
-rw-r--r--petascope/lib/servlet-2_5-api.jarbin0 -> 105990 bytes
-rw-r--r--petascope/lib/slf4j-api-1.5.8.jarbin0 -> 23445 bytes
-rw-r--r--petascope/lib/slf4j-log4j12-1.5.8.jarbin0 -> 9679 bytes
-rw-r--r--petascope/lib/wcs-v_1_1_0-schema-1.0-SNAPSHOT.jarbin0 -> 210572 bytes
-rw-r--r--petascope/lib/wcst-schema.jarbin0 -> 51456 bytes
-rw-r--r--petascope/misc/petascopedb.sql550
-rw-r--r--petascope/nbproject/ant-deploy.xml28
-rw-r--r--petascope/nbproject/build-impl.xml929
-rw-r--r--petascope/nbproject/genfiles.properties11
-rw-r--r--petascope/nbproject/project.properties128
-rw-r--r--petascope/nbproject/project.xml125
-rw-r--r--petascope/settings.properties73
-rw-r--r--petascope/src/log4j.properties34
-rw-r--r--petascope/src/petascope/ConfigManager.java227
-rw-r--r--petascope/src/petascope/PetascopeInterface.java632
-rw-r--r--petascope/src/petascope/PetascopeXmlNamespaceMapper.java63
-rw-r--r--petascope/src/petascope/wcps/grammar/AxisIterator.java50
-rw-r--r--petascope/src/petascope/wcps/grammar/AxisIteratorList.java68
-rw-r--r--petascope/src/petascope/wcps/grammar/BooleanExpr.java57
-rw-r--r--petascope/src/petascope/wcps/grammar/BooleanScalarExpr.java105
-rw-r--r--petascope/src/petascope/wcps/grammar/CastExpr.java48
-rw-r--r--petascope/src/petascope/wcps/grammar/ComplexConst.java51
-rw-r--r--petascope/src/petascope/wcps/grammar/CondenseExpr.java41
-rw-r--r--petascope/src/petascope/wcps/grammar/CondenseOperation.java58
-rw-r--r--petascope/src/petascope/wcps/grammar/ConstantList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/CoverageConstantExpr.java52
-rw-r--r--petascope/src/petascope/wcps/grammar/CoverageConstructorExpr.java52
-rw-r--r--petascope/src/petascope/wcps/grammar/CoverageExpr.java121
-rw-r--r--petascope/src/petascope/wcps/grammar/CoverageList.java62
-rw-r--r--petascope/src/petascope/wcps/grammar/CrsList.java58
-rw-r--r--petascope/src/petascope/wcps/grammar/CrsTransformExpr.java50
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionIntervalElement.java60
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionIntervalExpr.java60
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionIntervalList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionPointElement.java59
-rw-r--r--petascope/src/petascope/wcps/grammar/DimensionPointList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/DomainExpr.java47
-rw-r--r--petascope/src/petascope/wcps/grammar/EncodedCoverageExpr.java77
-rw-r--r--petascope/src/petascope/wcps/grammar/ExponentialExpr.java47
-rw-r--r--petascope/src/petascope/wcps/grammar/ExtendExpr.java42
-rw-r--r--petascope/src/petascope/wcps/grammar/FieldInterpolationElement.java44
-rw-r--r--petascope/src/petascope/wcps/grammar/FieldInterpolationList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/ForClause.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/ForClauseElements.java60
-rw-r--r--petascope/src/petascope/wcps/grammar/GeneralCondenseExpr.java67
-rw-r--r--petascope/src/petascope/wcps/grammar/IParseTreeNode.java31
-rw-r--r--petascope/src/petascope/wcps/grammar/ImageCrsDomainMetadataExpr.java45
-rw-r--r--petascope/src/petascope/wcps/grammar/IndexExpr.java69
-rw-r--r--petascope/src/petascope/wcps/grammar/InterpolationMethod.java45
-rw-r--r--petascope/src/petascope/wcps/grammar/InterpolationMethodList.java53
-rw-r--r--petascope/src/petascope/wcps/grammar/IntervalExpr.java56
-rw-r--r--petascope/src/petascope/wcps/grammar/MetaDataExpr.java90
-rw-r--r--petascope/src/petascope/wcps/grammar/NumericScalarExpr.java121
-rw-r--r--petascope/src/petascope/wcps/grammar/ProcessingExpr.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/RangeConstructorExpr.java59
-rw-r--r--petascope/src/petascope/wcps/grammar/RangeConstructorTerm.java48
-rw-r--r--petascope/src/petascope/wcps/grammar/RangeExpr.java53
-rw-r--r--petascope/src/petascope/wcps/grammar/RangeExprList.java54
-rw-r--r--petascope/src/petascope/wcps/grammar/ReduceExpr.java44
-rw-r--r--petascope/src/petascope/wcps/grammar/ReturnClause.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/ScalarExpr.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/ScaleExpr.java57
-rw-r--r--petascope/src/petascope/wcps/grammar/SelectExpr.java52
-rw-r--r--petascope/src/petascope/wcps/grammar/SetMetaDataExpr.java118
-rw-r--r--petascope/src/petascope/wcps/grammar/SliceExpr.java42
-rw-r--r--petascope/src/petascope/wcps/grammar/StoreExpr.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/StringScalarExpr.java58
-rw-r--r--petascope/src/petascope/wcps/grammar/SubsetExpr.java40
-rw-r--r--petascope/src/petascope/wcps/grammar/TrigonometricExpr.java47
-rw-r--r--petascope/src/petascope/wcps/grammar/TrimExpr.java42
-rw-r--r--petascope/src/petascope/wcps/grammar/VariableList.java60
-rw-r--r--petascope/src/petascope/wcps/grammar/WCPSRequest.java76
-rw-r--r--petascope/src/petascope/wcps/grammar/WhereClause.java38
-rw-r--r--petascope/src/petascope/wcps/grammar/wcps.g500
-rw-r--r--petascope/src/petascope/wcps/grammar/wcpsLexer.java8464
-rw-r--r--petascope/src/petascope/wcps/grammar/wcpsParser.java18359
-rw-r--r--petascope/src/petascope/wcps/grammar/wcps_no_actions.g491
-rw-r--r--petascope/src/petascope/wcps/server/cli/f_grammar.java60
-rw-r--r--petascope/src/petascope/wcps/server/cli/grammar.java65
-rw-r--r--petascope/src/petascope/wcps/server/cli/xml.java155
-rw-r--r--petascope/src/petascope/wcps/server/core/AxisIterator.java111
-rw-r--r--petascope/src/petascope/wcps/server/core/AxisName.java57
-rw-r--r--petascope/src/petascope/wcps/server/core/BinaryOperationCoverageExpr.java125
-rw-r--r--petascope/src/petascope/wcps/server/core/BooleanScalarExpr.java138
-rw-r--r--petascope/src/petascope/wcps/server/core/CellDomainElement.java79
-rw-r--r--petascope/src/petascope/wcps/server/core/ComplexConstant.java121
-rw-r--r--petascope/src/petascope/wcps/server/core/CondenseOperation.java73
-rw-r--r--petascope/src/petascope/wcps/server/core/CondenseScalarExpr.java98
-rw-r--r--petascope/src/petascope/wcps/server/core/ConstantCoverageExpr.java164
-rw-r--r--petascope/src/petascope/wcps/server/core/ConstantList.java104
-rw-r--r--petascope/src/petascope/wcps/server/core/ConstructCoverageExpr.java161
-rw-r--r--petascope/src/petascope/wcps/server/core/CoverageExpr.java179
-rw-r--r--petascope/src/petascope/wcps/server/core/CoverageExprPairType.java103
-rw-r--r--petascope/src/petascope/wcps/server/core/CoverageInfo.java168
-rw-r--r--petascope/src/petascope/wcps/server/core/CoverageIterator.java94
-rw-r--r--petascope/src/petascope/wcps/server/core/Crs.java124
-rw-r--r--petascope/src/petascope/wcps/server/core/CrsTransformCoverageExpr.java42
-rw-r--r--petascope/src/petascope/wcps/server/core/DbMetadataSource.java1174
-rw-r--r--petascope/src/petascope/wcps/server/core/DimensionIntervalElement.java221
-rw-r--r--petascope/src/petascope/wcps/server/core/DimensionIntervalList.java55
-rw-r--r--petascope/src/petascope/wcps/server/core/DimensionPointElement.java130
-rw-r--r--petascope/src/petascope/wcps/server/core/DomainElement.java193
-rw-r--r--petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java105
-rw-r--r--petascope/src/petascope/wcps/server/core/EncodeDataExpr.java96
-rw-r--r--petascope/src/petascope/wcps/server/core/ExtendCoverageExpr.java132
-rw-r--r--petascope/src/petascope/wcps/server/core/FieldInterpolationElement.java79
-rw-r--r--petascope/src/petascope/wcps/server/core/FieldName.java52
-rw-r--r--petascope/src/petascope/wcps/server/core/ICoverageInfo.java27
-rw-r--r--petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java33
-rw-r--r--petascope/src/petascope/wcps/server/core/IMetadataSource.java44
-rw-r--r--petascope/src/petascope/wcps/server/core/IRasNode.java27
-rw-r--r--petascope/src/petascope/wcps/server/core/InducedOperationCoverageExpr.java88
-rw-r--r--petascope/src/petascope/wcps/server/core/InterpolationMethod.java84
-rw-r--r--petascope/src/petascope/wcps/server/core/Metadata.java704
-rw-r--r--petascope/src/petascope/wcps/server/core/MetadataScalarExpr.java37
-rw-r--r--petascope/src/petascope/wcps/server/core/NumericScalarExpr.java173
-rw-r--r--petascope/src/petascope/wcps/server/core/ProcessCoveragesRequest.java252
-rw-r--r--petascope/src/petascope/wcps/server/core/RangeComponent.java87
-rw-r--r--petascope/src/petascope/wcps/server/core/RangeCoverageExpr.java83
-rw-r--r--petascope/src/petascope/wcps/server/core/RangeElement.java163
-rw-r--r--petascope/src/petascope/wcps/server/core/RangeField.java54
-rw-r--r--petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java68
-rw-r--r--petascope/src/petascope/wcps/server/core/SDU.java191
-rw-r--r--petascope/src/petascope/wcps/server/core/ScalarExpr.java171
-rw-r--r--petascope/src/petascope/wcps/server/core/ScaleCoverageExpr.java149
-rw-r--r--petascope/src/petascope/wcps/server/core/SetMetadataCoverageExpr.java42
-rw-r--r--petascope/src/petascope/wcps/server/core/SliceCoverageExpr.java131
-rw-r--r--petascope/src/petascope/wcps/server/core/StringScalarExpr.java63
-rw-r--r--petascope/src/petascope/wcps/server/core/SubsetOperationCoverageExpr.java70
-rw-r--r--petascope/src/petascope/wcps/server/core/TrimCoverageExpr.java133
-rw-r--r--petascope/src/petascope/wcps/server/core/UnaryOperationCoverageExpr.java153
-rw-r--r--petascope/src/petascope/wcps/server/core/VariableReference.java56
-rw-r--r--petascope/src/petascope/wcps/server/core/WCPS.java184
-rw-r--r--petascope/src/petascope/wcps/server/core/Wgs84Crs.java123
-rw-r--r--petascope/src/petascope/wcps/server/core/XmlQuery.java236
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java29
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java36
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java38
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/ResourceException.java40
-rw-r--r--petascope/src/petascope/wcps/server/exceptions/WCPSException.java39
-rw-r--r--petascope/src/petascope/wcps/server/servlet/WCPSServlet.java257
-rw-r--r--petascope/src/petascope/wcps/server/test/FullTestsOnline.java380
-rw-r--r--petascope/src/petascope/wcps/server/test/GrammarTest.java123
-rw-r--r--petascope/src/petascope/wcps/server/test/GrammarTestOnline.java204
-rw-r--r--petascope/src/petascope/wcps/server/test/XmlTestOnline.java204
-rw-r--r--petascope/src/petascope/wcs/server/WcsServer.java249
-rw-r--r--petascope/src/petascope/wcs/server/cli/CLI.java179
-rw-r--r--petascope/src/petascope/wcs/server/core/TimeString.java223
-rw-r--r--petascope/src/petascope/wcs/server/core/convertGetCoverage.java498
-rw-r--r--petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java275
-rw-r--r--petascope/src/petascope/wcs/server/core/executeGetCapabilities.java295
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InputOutputException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/WCSException.java148
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java41
-rw-r--r--petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java41
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml8
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml10
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml18
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml37
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml60
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml40
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml57
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml125
-rw-r--r--petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml57
-rw-r--r--petascope/src/petascope/wcs2/schemas/SchemaServlet.java96
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml16
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml22
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml35
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml56
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml60
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd21
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd160
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml111
-rw-r--r--petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd156
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsAll.xsd21
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsCommon.xsd87
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd73
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsExtensions.xml125
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd56
-rw-r--r--petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd88
-rw-r--r--petascope/src/petascope/wcs2/server/Wcs2Server.java119
-rw-r--r--petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java203
-rw-r--r--petascope/src/petascope/wcs2/server/ops/GetCapabilities.java84
-rw-r--r--petascope/src/petascope/wcs2/server/ops/GetCoverage.java528
-rw-r--r--petascope/src/petascope/wcs2/server/ops/WcsOperation.java35
-rw-r--r--petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml38
-rw-r--r--petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml92
-rw-r--r--petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml38
-rw-r--r--petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java58
-rw-r--r--petascope/src/petascope/wcst/server/WcstServer.java249
-rw-r--r--petascope/src/petascope/wcst/server/servlet/wcstServlet.java161
-rw-r--r--petascope/src/petascope/wcst/transaction/ServiceFirewall.java52
-rw-r--r--petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java162
-rw-r--r--petascope/src/petascope/wcst/transaction/executeTransaction.java1152
-rw-r--r--petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java472
-rw-r--r--petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java202
-rw-r--r--petascope/src/petascope/wps/server/WpsServer.java126
-rw-r--r--petascope/src/petascope/wps/templates/DescribeProcess.xml77
-rw-r--r--petascope/src/petascope/wps/templates/GetCapabilities.xml65
-rw-r--r--petascope/templates/index.jsp27
-rw-r--r--petascope/templates/interface-servlet.html73
-rw-r--r--petascope/templates/wcps-servlet.html32
-rw-r--r--petascope/templates/wcst-servlet.html18
-rwxr-xr-xpetascope/test/antlr.sh5
-rwxr-xr-xpetascope/test/full-test-online.sh14
-rwxr-xr-xpetascope/test/test-grammar-remote.sh5
-rwxr-xr-xpetascope/test/test-xml-remote.sh5
-rw-r--r--petascope/test/testcases-wcps/01-just_trim.rasql1
-rw-r--r--petascope/test/testcases-wcps/01-just_trim.test1
-rw-r--r--petascope/test/testcases-wcps/01-just_trim.xml3
-rw-r--r--petascope/test/testcases-wcps/02-trim_field_difference.rasql1
-rw-r--r--petascope/test/testcases-wcps/02-trim_field_difference.test1
-rw-r--r--petascope/test/testcases-wcps/02-trim_field_difference.xml3
-rw-r--r--petascope/test/testcases-wcps/03-simple_count.rasql1
-rw-r--r--petascope/test/testcases-wcps/03-simple_count.test1
-rw-r--r--petascope/test/testcases-wcps/03-simple_count.xml3
-rw-r--r--petascope/test/testcases-wcps/04-vegetation_index.rasql1
-rw-r--r--petascope/test/testcases-wcps/04-vegetation_index.test1
-rw-r--r--petascope/test/testcases-wcps/04-vegetation_index.xml3
-rw-r--r--petascope/test/testcases-wcps/05-just_encode.rasql1
-rw-r--r--petascope/test/testcases-wcps/05-just_encode.test1
-rw-r--r--petascope/test/testcases-wcps/05-just_encode.xml3
-rw-r--r--petascope/test/testcases-wcps/06-just_cast_inverse.rasql1
-rw-r--r--petascope/test/testcases-wcps/06-just_cast_inverse.test1
-rw-r--r--petascope/test/testcases-wcps/06-just_cast_inverse.xml3
-rw-r--r--petascope/test/testcases-wcps/07-just_slice.rasql1
-rw-r--r--petascope/test/testcases-wcps/07-just_slice.test1
-rw-r--r--petascope/test/testcases-wcps/07-just_slice.xml3
-rw-r--r--petascope/test/testcases-wcps/08-just_encode_field.rasql1
-rw-r--r--petascope/test/testcases-wcps/08-just_encode_field.test1
-rw-r--r--petascope/test/testcases-wcps/08-just_encode_field.xml3
-rw-r--r--petascope/test/testcases-wcps/09-just_log.rasql1
-rw-r--r--petascope/test/testcases-wcps/09-just_log.test1
-rw-r--r--petascope/test/testcases-wcps/09-just_log.xml3
-rw-r--r--petascope/test/testcases-wcps/10-just_field_difference.rasql1
-rw-r--r--petascope/test/testcases-wcps/10-just_field_difference.test1
-rw-r--r--petascope/test/testcases-wcps/10-just_field_difference.xml3
-rw-r--r--petascope/test/testcases-wcps/11_vegetation_index_computation.rasql1
-rw-r--r--petascope/test/testcases-wcps/11_vegetation_index_computation.test1
-rw-r--r--petascope/test/testcases-wcps/11_vegetation_index_computation.xml3
-rw-r--r--petascope/test/testcases-wcps/12-vegetation_index.rasql1
-rw-r--r--petascope/test/testcases-wcps/12-vegetation_index.test1
-rw-r--r--petascope/test/testcases-wcps/12-vegetation_index.xml3
-rw-r--r--petascope/test/testcases-wcps/13-just_encode_three_coverages.rasql1
-rw-r--r--petascope/test/testcases-wcps/13-just_encode_three_coverages.test1
-rw-r--r--petascope/test/testcases-wcps/13-just_encode_three_coverages.xml3
-rw-r--r--petascope/test/testcases-wcps/14_count_vegetation_cells.rasql1
-rw-r--r--petascope/test/testcases-wcps/14_count_vegetation_cells.test2
-rw-r--r--petascope/test/testcases-wcps/14_count_vegetation_cells.xml3
-rw-r--r--petascope/test/testcases-wcps/15-construct_simple_gray_gradient.rasql1
-rw-r--r--petascope/test/testcases-wcps/15-construct_simple_gray_gradient.test8
-rw-r--r--petascope/test/testcases-wcps/15-construct_simple_gray_gradient.xml3
-rw-r--r--petascope/test/testcases-wcps/16-simple_histogram.rasql1
-rw-r--r--petascope/test/testcases-wcps/16-simple_histogram.test6
-rw-r--r--petascope/test/testcases-wcps/16-simple_histogram.xml3
-rw-r--r--petascope/test/testcases-wcps/17-climate_over_earth.rasql1
-rw-r--r--petascope/test/testcases-wcps/17-climate_over_earth.test5
-rw-r--r--petascope/test/testcases-wcps/17-climate_over_earth.xml3
-rw-r--r--petascope/test/testcases-wcps/18-climate_over_water.rasql1
-rw-r--r--petascope/test/testcases-wcps/18-climate_over_water.test5
-rw-r--r--petascope/test/testcases-wcps/18-climate_over_water.xml3
-rw-r--r--petascope/test/testcases-wcps/19-just_sinus.rasql1
-rw-r--r--petascope/test/testcases-wcps/19-just_sinus.test1
-rw-r--r--petascope/test/testcases-wcps/19-just_sinus.xml3
-rw-r--r--petascope/test/testcases-wcps/20-just_tangent.rasql1
-rw-r--r--petascope/test/testcases-wcps/20-just_tangent.test1
-rw-r--r--petascope/test/testcases-wcps/20-just_tangent.xml3
-rw-r--r--petascope/test/testcases-wcps/21-just_exponent.rasql1
-rw-r--r--petascope/test/testcases-wcps/21-just_exponent.test1
-rw-r--r--petascope/test/testcases-wcps/21-just_exponent.xml3
-rw-r--r--petascope/test/testcases-wcps/22-just_max_double.rasql1
-rw-r--r--petascope/test/testcases-wcps/22-just_max_double.test1
-rw-r--r--petascope/test/testcases-wcps/22-just_max_double.xml3
-rw-r--r--petascope/test/testcases-wcps/23_shown_only_green_areas.rasql1
-rw-r--r--petascope/test/testcases-wcps/23_shown_only_green_areas.test4
-rw-r--r--petascope/test/testcases-wcps/23_shown_only_green_areas.xml3
-rw-r--r--petascope/test/testcases-wcps/24-condense_coverage_one_var.rasql1
-rw-r--r--petascope/test/testcases-wcps/24-condense_coverage_one_var.test4
-rw-r--r--petascope/test/testcases-wcps/24-condense_coverage_one_var.xml3
-rw-r--r--petascope/test/testcases-wcps/25-condense_field_two_vars.rasql1
-rw-r--r--petascope/test/testcases-wcps/25-condense_field_two_vars.test5
-rw-r--r--petascope/test/testcases-wcps/25-condense_field_two_vars.xml3
-rw-r--r--petascope/test/testcases-wcps/26-constant_coverage.rasql1
-rw-r--r--petascope/test/testcases-wcps/26-constant_coverage.test6
-rw-r--r--petascope/test/testcases-wcps/26-constant_coverage.xml3
-rw-r--r--petascope/test/testcases-wcps/27-construct_boring_histogram.rasql1
-rw-r--r--petascope/test/testcases-wcps/27-construct_boring_histogram.test9
-rw-r--r--petascope/test/testcases-wcps/27-construct_boring_histogram.xml3
-rw-r--r--petascope/test/testcases-wcps/28-construct_histogram_range_condition.rasql1
-rw-r--r--petascope/test/testcases-wcps/28-construct_histogram_range_condition.test9
-rw-r--r--petascope/test/testcases-wcps/28-construct_histogram_range_condition.xml3
-rw-r--r--petascope/test/testcases-wcps/29-filter_image(lines).rasql1
-rw-r--r--petascope/test/testcases-wcps/29-filter_image(lines).test17
-rw-r--r--petascope/test/testcases-wcps/29-filter_image(lines).xml3
-rw-r--r--petascope/test/testcases-wcps/30-construct_count.rasql1
-rw-r--r--petascope/test/testcases-wcps/30-construct_count.test6
-rw-r--r--petascope/test/testcases-wcps/30-construct_count.xml3
-rw-r--r--petascope/test/testcases-wcps/31-Discrete_Fourier.rasql1
-rw-r--r--petascope/test/testcases-wcps/31-Discrete_Fourier.test23
-rw-r--r--petascope/test/testcases-wcps/31-Discrete_Fourier.xml3
-rw-r--r--petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.rasql1
-rw-r--r--petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.test9
-rw-r--r--petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.xml3
-rw-r--r--petascope/test/testcases-wcps/33-construct_condense_gray_image.rasql1
-rw-r--r--petascope/test/testcases-wcps/33-construct_condense_gray_image.test9
-rw-r--r--petascope/test/testcases-wcps/33-construct_condense_gray_image.xml3
-rw-r--r--petascope/test/testcases-wcps/34-where_clause.rasql1
-rw-r--r--petascope/test/testcases-wcps/34-where_clause.test4
-rw-r--r--petascope/test/testcases-wcps/34-where_clause.xml25
-rw-r--r--petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.rasql1
-rw-r--r--petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.test1
-rw-r--r--petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.xml33
-rw-r--r--petascope/test/testcases-wcps/36-simple_overlay.rasql1
-rw-r--r--petascope/test/testcases-wcps/36-simple_overlay.test1
-rw-r--r--petascope/test/testcases-wcps/36-simple_overlay.xml24
-rw-r--r--petascope/test/testcases-wcps/37-simple_extend.rasql1
-rw-r--r--petascope/test/testcases-wcps/37-simple_extend.test1
-rw-r--r--petascope/test/testcases-wcps/37-simple_extend.xml31
-rw-r--r--petascope/test/testcases-wcps/38-complex_extend.rasql1
-rw-r--r--petascope/test/testcases-wcps/38-complex_extend.test1
-rw-r--r--petascope/test/testcases-wcps/38-complex_extend.xml3
-rw-r--r--petascope/test/testcases-wcps/39-complex_extend-2.rasql1
-rw-r--r--petascope/test/testcases-wcps/39-complex_extend-2.test1
-rw-r--r--petascope/test/testcases-wcps/39-complex_extend-2.xml39
-rw-r--r--petascope/test/testcases-wcps/40-range_structure.rasql1
-rw-r--r--petascope/test/testcases-wcps/40-range_structure.test9
-rw-r--r--petascope/test/testcases-wcps/40-range_structure.xml45
-rw-r--r--petascope/test/testcases-wcps/41-filter_calculation_reloaded.rasql1
-rw-r--r--petascope/test/testcases-wcps/41-filter_calculation_reloaded.test17
-rw-r--r--petascope/test/testcases-wcps/41-filter_calculation_reloaded.xml113
-rw-r--r--petascope/test/testcases-wcps/42-filter_calculation.rasql1
-rw-r--r--petascope/test/testcases-wcps/42-filter_calculation.test17
-rw-r--r--petascope/test/testcases-wcps/42-filter_calculation.xml109
-rw-r--r--petascope/test/testcases-wcps/43-encoder_options.rasql1
-rw-r--r--petascope/test/testcases-wcps/43-encoder_options.test2
-rw-r--r--petascope/test/testcases-wcps/43-encoder_options.xml16
-rw-r--r--petascope/test/testcases-wcps/44-scaling_operation.rasql1
-rw-r--r--petascope/test/testcases-wcps/44-scaling_operation.test2
-rw-r--r--petascope/test/testcases-wcps/44-scaling_operation.xml30
-rw-r--r--petascope/test/testcases-wcps/abstract.xml8
-rw-r--r--petascope/test/testcases-wcs/input/DescribeCoverage1.xml4
-rw-r--r--petascope/test/testcases-wcs/input/DescribeCoverage2.xml7
-rw-r--r--petascope/test/testcases-wcs/input/GetCapabilitiesMax.xml15
-rw-r--r--petascope/test/testcases-wcs/input/GetCoverage1.xml11
-rw-r--r--petascope/test/testcases-wcs/input/GetCoverage2.xml17
-rw-r--r--petascope/test/testcases-wcs/input/GetCoverage3.xml23
-rw-r--r--petascope/test/testcases-wcs/input/GetCoverage4.xml35
-rw-r--r--petascope/test/testcases-wcs/output/Capabilities.xml181
-rw-r--r--petascope/test/testcases-wcs/output/CoverageDescriptions1.xml4
-rw-r--r--petascope/test/testcases-wcs/output/CoverageDescriptions2.xml126
-rw-r--r--petascope/test/testcases-wcs/output/ProcessCoverage1.xml25
-rw-r--r--petascope/test/testcases-wcs/output/ProcessCoverage2.xml35
-rw-r--r--petascope/test/testcases-wcs/output/ProcessCoverage3.xml46
-rw-r--r--petascope/test/testcases-wcs/output/ProcessCoverage4.xml4
-rw-r--r--petascope/test/testcases-wcs/working/DescribeCoverage.1.xml7
-rw-r--r--petascope/test/testcases-wcs/working/GetCapabilities.xml15
-rw-r--r--petascope/test/testcases-wcs/working/GetCoverage.1.xml11
-rw-r--r--petascope/test/testcases-wcst/CoverageDescriptions1.xml29
-rw-r--r--petascope/test/testcases-wcst/CoverageDescriptions2.xml38
-rw-r--r--petascope/test/testcases-wcst/CoverageSummary1.xml6
-rw-r--r--petascope/test/testcases-wcst/CoverageSummary2.xml6
-rw-r--r--petascope/test/testcases-wcst/Transaction1-async.xml30
-rw-r--r--petascope/test/testcases-wcst/Transaction1.xml27
-rw-r--r--petascope/test/testcases-wcst/Transaction2.xml37
-rw-r--r--petascope/test/testcases-wcst/Transaction3.xml21
-rwxr-xr-xpetascope/test/wcps_grammar.sh16
-rwxr-xr-xpetascope/test/wcps_xml.sh11
-rw-r--r--petascope/test/wcs/server/core/TimeStringTest.java140
-rw-r--r--petascope/web/META-INF/context.xml2
-rw-r--r--petascope/web/WEB-INF/web.xml36
-rw-r--r--petascope/web/index.jsp24
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/ReadMe.txt9
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/basicTypes.xsd276
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/coordinateOperations.xsd784
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/coordinateReferenceSystems.xsd425
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/coordinateSystems.xsd404
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/coverage.xsd448
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/dataQuality.xsd125
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/datums.xsd480
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/defaultStyle.xsd450
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/dictionary.xsd134
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/direction.xsd69
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/dynamicFeature.xsd112
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/feature.xsd196
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/geometryAggregates.xsd427
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/geometryBasic0d1d.xsd599
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/geometryBasic2d.xsd210
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/geometryComplexes.xsd138
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/geometryPrimitives.xsd1606
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/gml.xsd19
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/gmlBase.xsd290
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/grids.xsd74
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/measures.xsd196
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/observation.xsd93
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/referenceSystems.xsd207
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/temporal.xsd329
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/temporalReferenceSystems.xsd248
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/temporalTopology.xsd183
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/topology.xsd458
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/units.xsd167
-rw-r--r--petascope/xml/ogc/gml/3.1.1/base/valueObjects.xsd358
-rw-r--r--petascope/xml/ogc/gml/3.1.1/readme.txt50
-rw-r--r--petascope/xml/ogc/gml/3.1.1/smil/smil20-language.xsd117
-rw-r--r--petascope/xml/ogc/gml/3.1.1/smil/smil20.xsd234
-rw-r--r--petascope/xml/ogc/gml/3.1.1/smil/xml-mod.xsd39
-rw-r--r--petascope/xml/ogc/gml/ReadMe.txt27
-rw-r--r--petascope/xml/ogc/wcps/1.0.0/wcpsAll.xsd24
-rw-r--r--petascope/xml/ogc/wcps/1.0.0/wcpsProcessCoverages.xsd582
-rw-r--r--petascope/xml/ogc/wcs/1.1.0/wcsCommon.xsd83
-rw-r--r--petascope/xml/ogc/wcst/1.1.4/wcstActions.xml1
-rw-r--r--petascope/xml/ogc/wcst/1.1.4/wcstTransaction.xsd148
-rw-r--r--petascope/xml/ogc/xlink/1.0.0/ReadMe.txt6
-rw-r--r--petascope/xml/ogc/xlink/1.0.0/xlinks.xsd122
460 files changed, 64939 insertions, 0 deletions
diff --git a/petascope/.gitignore b/petascope/.gitignore
new file mode 100644
index 0000000..2f831d2
--- /dev/null
+++ b/petascope/.gitignore
@@ -0,0 +1,4 @@
+*.class
+*.war
+doc/
+dbparams.properties
diff --git a/petascope/INSTALL b/petascope/INSTALL
new file mode 100644
index 0000000..9ef074b
--- /dev/null
+++ b/petascope/INSTALL
@@ -0,0 +1,25 @@
+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.
+
+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/LICENCE b/petascope/LICENCE
new file mode 100644
index 0000000..fc8a5de
--- /dev/null
+++ b/petascope/LICENCE
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/petascope/README b/petascope/README
new file mode 100644
index 0000000..f46ed45
--- /dev/null
+++ b/petascope/README
@@ -0,0 +1,51 @@
+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 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 (*)
+web/WEB-INF/web.xml PetaScope servlet deployment file (*)
+LICENSE PetaScope license
+build.xml "Ant" rule file for building PetaScope
+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.
+
+LICENSE
+=======
+
+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/build.xml b/petascope/build.xml
new file mode 100644
index 0000000..20a0191
--- /dev/null
+++ b/petascope/build.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see "http://www.gnu.org/licenses/".
+ *
+ * For more information please see "http://www.PetaScope.org"
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+-->
+
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="PetaScope" default="default" basedir=".">
+ <description>Builds, tests, and runs the project PetaScope.</description>
+ <import file="nbproject/build-impl.xml"/>
+ <!--
+
+ There exist several targets which are by default empty and which can be
+ used for execution of your tasks. These targets are usually executed
+ before and after some main targets. They are:
+
+ -pre-init: called before initialization of project properties
+ -post-init: called after initialization of project properties
+ -pre-compile: called before javac compilation
+ -post-compile: called after javac compilation
+ -pre-compile-single: called before javac compilation of single file
+ -post-compile-single: called after javac compilation of single file
+ -pre-compile-test: called before javac compilation of JUnit tests
+ -post-compile-test: called after javac compilation of JUnit tests
+ -pre-compile-test-single: called before javac compilation of single JUnit test
+ -post-compile-test-single: called after javac compilation of single JUunit test
+ -pre-dist: called before archive building
+ -post-dist: called after archive building
+ -post-clean: called after cleaning build products
+ -pre-run-deploy: called before deploying
+ -post-run-deploy: called after deploying
+
+ Example of pluging an obfuscator after the compilation could look like
+
+ <target name="-post-compile">
+ <obfuscate>
+ <fileset dir="${build.classes.dir}"/>
+ </obfuscate>
+ </target>
+
+ For list of available properties check the imported
+ nbproject/build-impl.xml file.
+
+
+ Other way how to customize the build is by overriding existing main targets.
+ The target of interest are:
+
+ init-macrodef-javac: defines macro for javac compilation
+ init-macrodef-junit: defines macro for junit execution
+ init-macrodef-debug: defines macro for class debugging
+ do-dist: archive building
+ run: execution of project
+ javadoc-build: javadoc generation
+
+ Example of overriding the target for project execution could look like
+
+ <target name="run" depends="<PROJNAME>-impl.jar">
+ <exec dir="bin" executable="launcher.exe">
+ <arg file="${dist.jar}"/>
+ </exec>
+ </target>
+
+ Notice that overridden target depends on jar target and not only on
+ compile target as regular run target does. Again, for list of available
+ properties which you can use check the target you are overriding in
+ nbproject/build-impl.xml file.
+
+ -->
+
+ <!-- Builds the complete jar file -->
+ <target name="jar" depends="dist">
+ <jar basedir="${basedir}/build/web/WEB-INF/classes/" file="dist/petascope.jar" />
+ </target>
+
+ <path id="antlr.path">
+ <pathelement location="${basedir}/lib/antlrworks-1.3.1.jar" />
+ </path>
+
+ <!-- Antlr is called here to generate wcpsLexer.java and wcpsParser.java from wcps.g-->
+ <target name="antlr" depends="init">
+ <java classname="org.antlr.Tool" classpathref="antlr.path">
+ <arg value="${src.java.dir}/petascope/wcps/grammar/wcps.g" />
+ <arg value="-Xmx350m" />
+ <arg value="-Xms100m" />
+ </java>
+ <echo message="Successfully generated the WCPS grammar parser !" />
+ </target>
+
+ <!-- Antlr is called here to generate wcpsLexer.java and wcpsParser.java from
+ wcps.g, using debugging classes and symbols-->
+ <target name="antlr-debug" depends="init">
+ <java classname="org.antlr.Tool" classpathref="antlr.path">
+ <arg value="${src.java.dir}/petascope/wcps/grammar/wcps.g" />
+ <arg value="-debug" />
+ <arg value="-Xmx350m" />
+ <arg value="-Xms100m" />
+ </java>
+ <echo message="Successfully generated the WCPS grammar parser !" />
+ </target>
+
+ <!-- Assuming the grammar has changed, run the ANTLR grammar generation task
+ and then build the resulting jar file. -->
+ <target name="antlr-jar" depends="antlr, jar" />
+ <target name="antlr-jar-debug" depends="antlr-debug, jar" />
+
+ <!--target name="-pre-compile" depends="antlr" /-->
+
+</project>
diff --git a/petascope/lib/activation.jar b/petascope/lib/activation.jar
new file mode 100644
index 0000000..9769792
--- /dev/null
+++ b/petascope/lib/activation.jar
Binary files differ
diff --git a/petascope/lib/antlrworks-1.2.3.jar b/petascope/lib/antlrworks-1.2.3.jar
new file mode 100644
index 0000000..d5aee68
--- /dev/null
+++ b/petascope/lib/antlrworks-1.2.3.jar
Binary files differ
diff --git a/petascope/lib/antlrworks-1.3.1.jar b/petascope/lib/antlrworks-1.3.1.jar
new file mode 100644
index 0000000..c2e17c9
--- /dev/null
+++ b/petascope/lib/antlrworks-1.3.1.jar
Binary files differ
diff --git a/petascope/lib/commons-fileupload-1.2.jar b/petascope/lib/commons-fileupload-1.2.jar
new file mode 100644
index 0000000..12539f5
--- /dev/null
+++ b/petascope/lib/commons-fileupload-1.2.jar
Binary files differ
diff --git a/petascope/lib/commons-io-1.3.2.jar b/petascope/lib/commons-io-1.3.2.jar
new file mode 100644
index 0000000..865c9e4
--- /dev/null
+++ b/petascope/lib/commons-io-1.3.2.jar
Binary files differ
diff --git a/petascope/lib/commons-math-1.1.jar b/petascope/lib/commons-math-1.1.jar
new file mode 100644
index 0000000..6888813
--- /dev/null
+++ b/petascope/lib/commons-math-1.1.jar
Binary files differ
diff --git a/petascope/lib/gml-v_3_1_1-schema-1.0-SNAPSHOT.jar b/petascope/lib/gml-v_3_1_1-schema-1.0-SNAPSHOT.jar
new file mode 100644
index 0000000..04c6d62
--- /dev/null
+++ b/petascope/lib/gml-v_3_1_1-schema-1.0-SNAPSHOT.jar
Binary files differ
diff --git a/petascope/lib/jaxb-api.jar b/petascope/lib/jaxb-api.jar
new file mode 100644
index 0000000..be3d6dc
--- /dev/null
+++ b/petascope/lib/jaxb-api.jar
Binary files differ
diff --git a/petascope/lib/jaxb-impl.jar b/petascope/lib/jaxb-impl.jar
new file mode 100644
index 0000000..54444d2
--- /dev/null
+++ b/petascope/lib/jaxb-impl.jar
Binary files differ
diff --git a/petascope/lib/jaxb-xjc.jar b/petascope/lib/jaxb-xjc.jar
new file mode 100644
index 0000000..e7e510a
--- /dev/null
+++ b/petascope/lib/jaxb-xjc.jar
Binary files differ
diff --git a/petascope/lib/joda-time-1.6.jar b/petascope/lib/joda-time-1.6.jar
new file mode 100644
index 0000000..68068a4
--- /dev/null
+++ b/petascope/lib/joda-time-1.6.jar
Binary files differ
diff --git a/petascope/lib/jsr173_1.0_api.jar b/petascope/lib/jsr173_1.0_api.jar
new file mode 100644
index 0000000..87ff1c1
--- /dev/null
+++ b/petascope/lib/jsr173_1.0_api.jar
Binary files differ
diff --git a/petascope/lib/junit-4.5-api.zip b/petascope/lib/junit-4.5-api.zip
new file mode 100644
index 0000000..5748c44
--- /dev/null
+++ b/petascope/lib/junit-4.5-api.zip
Binary files differ
diff --git a/petascope/lib/junit-4.5-src.jar b/petascope/lib/junit-4.5-src.jar
new file mode 100644
index 0000000..18774a5
--- /dev/null
+++ b/petascope/lib/junit-4.5-src.jar
Binary files differ
diff --git a/petascope/lib/junit-4.5.jar b/petascope/lib/junit-4.5.jar
new file mode 100644
index 0000000..83f8bc7
--- /dev/null
+++ b/petascope/lib/junit-4.5.jar
Binary files differ
diff --git a/petascope/lib/log4j-1.2.15.jar b/petascope/lib/log4j-1.2.15.jar
new file mode 100644
index 0000000..c930a6a
--- /dev/null
+++ b/petascope/lib/log4j-1.2.15.jar
Binary files differ
diff --git a/petascope/lib/nblibraries-private.properties b/petascope/lib/nblibraries-private.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/petascope/lib/nblibraries-private.properties
diff --git a/petascope/lib/nblibraries.properties b/petascope/lib/nblibraries.properties
new file mode 100644
index 0000000..3dc79e4
--- /dev/null
+++ b/petascope/lib/nblibraries.properties
@@ -0,0 +1,12 @@
+#libs.junit.classpath=\
+# ${base}/junit-3.8.2.jar
+#libs.junit.javadoc=\
+# ${base}/junit-3.8.2-api.zip
+libs.junit_4.classpath=\
+ ${base}/junit-4.5.jar
+libs.junit_4.javadoc=\
+ ${base}/junit-4.5-api.zip
+libs.junit_4.src=\
+ ${base}/junit-4.5-src.jar
+libs.CopyLibs.classpath=\
+ ${base}/org-netbeans-modules-java-j2seproject-copylibstask.jar
diff --git a/petascope/lib/org-netbeans-modules-java-j2seproject-copylibstask.jar b/petascope/lib/org-netbeans-modules-java-j2seproject-copylibstask.jar
new file mode 100644
index 0000000..a2cfc45
--- /dev/null
+++ b/petascope/lib/org-netbeans-modules-java-j2seproject-copylibstask.jar
Binary files differ
diff --git a/petascope/lib/ows-v_1_0_0-schema-1.0-SNAPSHOT.jar b/petascope/lib/ows-v_1_0_0-schema-1.0-SNAPSHOT.jar
new file mode 100644
index 0000000..b9ee855
--- /dev/null
+++ b/petascope/lib/ows-v_1_0_0-schema-1.0-SNAPSHOT.jar
Binary files differ
diff --git a/petascope/lib/postgresql-8.3-604.jdbc4.jar b/petascope/lib/postgresql-8.3-604.jdbc4.jar
new file mode 100644
index 0000000..7caf51f
--- /dev/null
+++ b/petascope/lib/postgresql-8.3-604.jdbc4.jar
Binary files differ
diff --git a/petascope/lib/rasj.jar b/petascope/lib/rasj.jar
new file mode 100644
index 0000000..2673b94
--- /dev/null
+++ b/petascope/lib/rasj.jar
Binary files differ
diff --git a/petascope/lib/servlet-2_5-api.jar b/petascope/lib/servlet-2_5-api.jar
new file mode 100644
index 0000000..83e7e75
--- /dev/null
+++ b/petascope/lib/servlet-2_5-api.jar
Binary files differ
diff --git a/petascope/lib/slf4j-api-1.5.8.jar b/petascope/lib/slf4j-api-1.5.8.jar
new file mode 100644
index 0000000..35502ca
--- /dev/null
+++ b/petascope/lib/slf4j-api-1.5.8.jar
Binary files differ
diff --git a/petascope/lib/slf4j-log4j12-1.5.8.jar b/petascope/lib/slf4j-log4j12-1.5.8.jar
new file mode 100644
index 0000000..b63bcdc
--- /dev/null
+++ b/petascope/lib/slf4j-log4j12-1.5.8.jar
Binary files differ
diff --git a/petascope/lib/wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar b/petascope/lib/wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar
new file mode 100644
index 0000000..37c74d8
--- /dev/null
+++ b/petascope/lib/wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar
Binary files differ
diff --git a/petascope/lib/wcst-schema.jar b/petascope/lib/wcst-schema.jar
new file mode 100644
index 0000000..4160a68
--- /dev/null
+++ b/petascope/lib/wcst-schema.jar
Binary files differ
diff --git a/petascope/misc/petascopedb.sql b/petascope/misc/petascopedb.sql
new file mode 100644
index 0000000..771b641
--- /dev/null
+++ b/petascope/misc/petascopedb.sql
@@ -0,0 +1,550 @@
+-- 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/ant-deploy.xml b/petascope/nbproject/ant-deploy.xml
new file mode 100644
index 0000000..a6f1480
--- /dev/null
+++ b/petascope/nbproject/ant-deploy.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="-deploy-ant" basedir=".">
+ <target name="-init" if="deploy.ant.enabled">
+ <property file="${deploy.ant.properties.file}"/>
+ <tempfile property="temp.module.folder" prefix="tomcat" destdir="${java.io.tmpdir}"/>
+ <unwar src="${deploy.ant.archive}" dest="${temp.module.folder}">
+ <patternset includes="META-INF/context.xml"/>
+ </unwar>
+ <xmlproperty file="${temp.module.folder}/META-INF/context.xml"/>
+ <delete dir="${temp.module.folder}"/>
+ </target>
+ <target name="-deploy-ant" if="deploy.ant.enabled" depends="-init">
+ <echo message="Deploying ${deploy.ant.archive} to ${Context(path)}"/>
+ <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
+ classpath="${tomcat.home}/lib/catalina-ant.jar"/>
+ <deploy url="${tomcat.url}/manager" username="${tomcat.username}"
+ password="${tomcat.password}" path="${Context(path)}"
+ war="${deploy.ant.archive}"/>
+ <property name="deploy.ant.client.url" value="${tomcat.url}${Context(path)}"/>
+ </target>
+ <target name="-undeploy-ant" if="deploy.ant.enabled" depends="-init">
+ <echo message="Undeploying ${Context(path)}"/>
+ <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
+ classpath="${tomcat.home}/lib/catalina-ant.jar"/>
+ <undeploy url="${tomcat.url}/manager" username="${tomcat.username}"
+ password="${tomcat.password}" path="${Context(path)}"/>
+ </target>
+</project>
diff --git a/petascope/nbproject/build-impl.xml b/petascope/nbproject/build-impl.xml
new file mode 100644
index 0000000..bf62a50
--- /dev/null
+++ b/petascope/nbproject/build-impl.xml
@@ -0,0 +1,929 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *** GENERATED FROM project.xml - DO NOT EDIT ***
+ *** EDIT ../build.xml INSTEAD ***
+
+ For the purpose of easier reading the script
+ is divided into following sections:
+ - initialization
+ - compilation
+ - dist
+ - execution
+ - debugging
+ - javadoc
+ - junit compilation
+ - junit execution
+ - junit debugging
+ - cleanup
+
+ -->
+<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="PetaScope-impl">
+ <import file="ant-deploy.xml"/>
+ <fail message="Please build using Ant 1.7.1 or higher.">
+ <condition>
+ <not>
+ <antversion atleast="1.7.1"/>
+ </not>
+ </condition>
+ </fail>
+ <target depends="dist,javadoc" description="Build whole project." name="default"/>
+ <!--
+ INITIALIZATION SECTION
+ -->
+ <target name="-pre-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-pre-init" name="-init-private">
+ <property file="nbproject/private/private.properties"/>
+ </target>
+ <target name="-pre-init-libraries">
+ <property location="./lib/nblibraries.properties" name="libraries.path"/>
+ <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
+ <pathconvert dirsep="/" property="libraries.dir">
+ <path path="${libraries.dir.nativedirsep}"/>
+ </pathconvert>
+ <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
+ <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
+ </target>
+ <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
+ <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
+ <filterchain>
+ <replacestring from="$${base}" to="${libraries.dir}"/>
+ <escapeunicode/>
+ </filterchain>
+ </loadproperties>
+ </target>
+ <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
+ <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
+ <filterchain>
+ <replacestring from="$${base}" to="${libraries.dir}"/>
+ <escapeunicode/>
+ </filterchain>
+ </loadproperties>
+ </target>
+ <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
+ <property file="${user.properties.file}"/>
+ <!-- The two properties below are usually overridden -->
+ <!-- by the active platform. Just a fallback. -->
+ <property name="default.javac.source" value="1.4"/>
+ <property name="default.javac.target" value="1.4"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
+ <property file="nbproject/project.properties"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init"/>
+ <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+ <condition property="have.tests">
+ <or>
+ <available file="${test.test.dir}"/>
+ </or>
+ </condition>
+ <condition property="have.sources">
+ <or>
+ <available file="${src.java.dir}"/>
+ </or>
+ </condition>
+ <condition property="netbeans.home+have.tests">
+ <and>
+ <isset property="netbeans.home"/>
+ <isset property="have.tests"/>
+ </and>
+ </condition>
+ <condition property="no.javadoc.preview">
+ <isfalse value="${javadoc.preview}"/>
+ </condition>
+ <property name="javac.compilerargs" value=""/>
+ <condition property="no.deps">
+ <and>
+ <istrue value="${no.dependencies}"/>
+ </and>
+ </condition>
+ <condition property="no.dist.ear.dir">
+ <not>
+ <isset property="dist.ear.dir"/>
+ </not>
+ </condition>
+ <property name="build.web.excludes" value="${build.classes.excludes}"/>
+ <condition property="do.compile.jsps">
+ <istrue value="${compile.jsps}"/>
+ </condition>
+ <condition property="do.debug.server">
+ <or>
+ <not>
+ <isset property="debug.server"/>
+ </not>
+ <istrue value="${debug.server}"/>
+ <and>
+ <not>
+ <istrue value="${debug.server}"/>
+ </not>
+ <not>
+ <istrue value="${debug.client}"/>
+ </not>
+ </and>
+ </or>
+ </condition>
+ <condition property="do.debug.client">
+ <istrue value="${debug.client}"/>
+ </condition>
+ <condition property="do.display.browser">
+ <istrue value="${display.browser}"/>
+ </condition>
+ <condition property="do.display.browser.debug">
+ <and>
+ <isset property="do.display.browser"/>
+ <not>
+ <isset property="do.debug.client"/>
+ </not>
+ </and>
+ </condition>
+ <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
+ <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
+ <condition property="do.war.package.with.custom.manifest">
+ <isset property="has.custom.manifest"/>
+ </condition>
+ <condition property="do.war.package.without.custom.manifest">
+ <not>
+ <isset property="has.custom.manifest"/>
+ </not>
+ </condition>
+ <condition property="do.tmp.war.package.with.custom.manifest">
+ <and>
+ <isset property="has.custom.manifest"/>
+ <or>
+ <isfalse value="${directory.deployment.supported}"/>
+ <isset property="dist.ear.dir"/>
+ </or>
+ </and>
+ </condition>
+ <condition property="do.tmp.war.package.without.custom.manifest">
+ <and>
+ <not>
+ <isset property="has.custom.manifest"/>
+ </not>
+ <or>
+ <isfalse value="${directory.deployment.supported}"/>
+ <isset property="dist.ear.dir"/>
+ </or>
+ </and>
+ </condition>
+ <condition property="do.tmp.war.package">
+ <or>
+ <isfalse value="${directory.deployment.supported}"/>
+ <isset property="dist.ear.dir"/>
+ </or>
+ </condition>
+ <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
+ <condition else="" property="application.args.param" value="${application.args}">
+ <and>
+ <isset property="application.args"/>
+ <not>
+ <equals arg1="${application.args}" arg2="" trim="true"/>
+ </not>
+ </and>
+ </condition>
+ <property name="source.encoding" value="${file.encoding}"/>
+ <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+ <and>
+ <isset property="javadoc.encoding"/>
+ <not>
+ <equals arg1="${javadoc.encoding}" arg2=""/>
+ </not>
+ </and>
+ </condition>
+ <property name="javadoc.encoding.used" value="${source.encoding}"/>
+ <property name="includes" value="**"/>
+ <property name="excludes" value=""/>
+ <property name="runmain.jvmargs" value=""/>
+ <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+ <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+ <length length="0" string="${endorsed.classpath}" when="greater"/>
+ </condition>
+ </target>
+ <target depends="init" name="-init-cos" unless="deploy.on.save">
+ <condition property="deploy.on.save" value="true">
+ <istrue value="${j2ee.deploy.on.save}"/>
+ </condition>
+ </target>
+ <target name="-post-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
+ <fail unless="src.java.dir">Must set src.java.dir</fail>
+ <fail unless="test.test.dir">Must set test.test.dir</fail>
+ <fail unless="build.dir">Must set build.dir</fail>
+ <fail unless="build.web.dir">Must set build.web.dir</fail>
+ <fail unless="build.generated.dir">Must set build.generated.dir</fail>
+ <fail unless="dist.dir">Must set dist.dir</fail>
+ <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+ <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+ <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+ <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+ <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+ <fail unless="dist.war">Must set dist.war</fail>
+ <!--fail unless="j2ee.platform.classpath">
+The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
+Either open the project in the IDE and assign the server or setup the server classpath manually.
+For example like this:
+ ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property "j2ee.platform.classpath" in a .properties file)
+or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
+ </fail-->
+ </target>
+ <target name="-init-macrodef-property">
+ <macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1">
+ <attribute name="name"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{name}" value="${@{value}}"/>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-javac">
+ <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
+ <attribute default="${src.java.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="${javac.debug}" name="debug"/>
+ <attribute default="${empty.dir}" name="gensrcdir"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property location="${build.dir}/empty" name="empty.dir"/>
+ <mkdir dir="${empty.dir}"/>
+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
+ <src>
+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </src>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <compilerarg line="${javac.compilerargs}"/>
+ <customize/>
+ </javac>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-junit">
+ <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <sequential>
+ <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
+ <batchtest todir="${build.test.results.dir}">
+ <fileset dir="${test.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+ <filename name="@{testincludes}"/>
+ </fileset>
+ </batchtest>
+ <classpath>
+ <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <formatter type="brief" usefile="false"/>
+ <formatter type="xml"/>
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg line="${runmain.jvmargs}"/>
+ </junit>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-java">
+ <macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${debug.classpath}" name="classpath"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" fork="true">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg line="${runmain.jvmargs}"/>
+ <classpath>
+ <path path="@{classpath}:${j2ee.platform.classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-nbjsdebug">
+ <macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1">
+ <attribute default="${client.url}" name="webUrl"/>
+ <sequential>
+ <nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+ <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1">
+ <attribute default="${main.class}" name="name"/>
+ <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+ <sequential>
+ <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}">
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ </nbjpdastart>
+ </sequential>
+ </macrodef>
+ <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1">
+ <attribute default="${build.classes.dir}" name="dir"/>
+ <sequential>
+ <nbjpdareload>
+ <fileset dir="@{dir}" includes="${fix.classes}">
+ <include name="${fix.includes}*.class"/>
+ </fileset>
+ </nbjpdareload>
+ </sequential>
+ </macrodef>
+ <macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1">
+ <sequential>
+ <nbjpdaappreloaded/>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-debug-args">
+ <property name="version-output" value="java version &quot;${ant.java.version}"/>
+ <condition property="have-jdk-older-than-1.4">
+ <or>
+ <contains string="${version-output}" substring="java version &quot;1.0"/>
+ <contains string="${version-output}" substring="java version &quot;1.1"/>
+ <contains string="${version-output}" substring="java version &quot;1.2"/>
+ <contains string="${version-output}" substring="java version &quot;1.3"/>
+ </or>
+ </condition>
+ <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+ <istrue value="${have-jdk-older-than-1.4}"/>
+ </condition>
+ <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+ <os family="windows"/>
+ </condition>
+ <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+ <isset property="debug.transport"/>
+ </condition>
+ </target>
+ <target depends="-init-debug-args" name="-init-macrodef-debug">
+ <macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1">
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+ <attribute default="${application.args.param}" name="args"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" fork="true">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg line="${debug-args-line}"/>
+ <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+ <jvmarg line="${runmain.jvmargs}"/>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <arg line="@{args}"/>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-taskdefs">
+ <fail unless="libs.CopyLibs.classpath">
+The libs.CopyLibs.classpath property is not set up.
+This property must point to
+org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
+of NetBeans IDE installation and is usually located at
+&lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
+Either open the project in the IDE and make sure CopyLibs library
+exists or setup the property manually. For example like this:
+ ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
+ </fail>
+ <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs" name="init"/>
+ <!--
+ COMPILATION SECTION
+ -->
+ <target depends="init" if="no.dist.ear.dir" name="deps-module-jar" unless="no.deps"/>
+ <target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps"/>
+ <target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/>
+ <target depends="init,deps-jar" name="-pre-pre-compile">
+ <mkdir dir="${build.classes.dir}"/>
+ </target>
+ <target name="-pre-compile">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target name="-copy-webdir">
+ <copy todir="${build.web.dir}">
+ <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ <copy todir="${build.web.dir}/WEB-INF">
+ <fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/>
+ </copy>
+ </target>
+ <target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources" name="-do-compile">
+ <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
+ <copy todir="${build.classes.dir}">
+ <fileset dir="${src.java.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target if="has.custom.manifest" name="-copy-manifest">
+ <mkdir dir="${build.meta.inf.dir}"/>
+ <copy todir="${build.meta.inf.dir}">
+ <fileset dir="${conf.dir}" includes="MANIFEST.MF"/>
+ </copy>
+ </target>
+ <target if="has.persistence.xml" name="-copy-persistence-xml">
+ <mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/>
+ <copy todir="${build.web.dir}/WEB-INF/classes/META-INF">
+ <fileset dir="${persistence.xml.dir}" includes="persistence.xml"/>
+ </copy>
+ </target>
+ <target name="-post-compile">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+ <target name="-pre-compile-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+ <webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/>
+ <copy todir="${build.classes.dir}">
+ <fileset dir="${src.java.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+ <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
+ <mkdir dir="${build.generated.dir}/src"/>
+ <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
+ <arg value="-uriroot"/>
+ <arg file="${basedir}/${build.web.dir}"/>
+ <arg value="-d"/>
+ <arg file="${basedir}/${build.generated.dir}/src"/>
+ <arg value="-die1"/>
+ <arg value="-compilerSourceVM ${javac.source}"/>
+ <arg value="-compilerTargetVM ${javac.target}"/>
+ <arg value="-javaEncoding ${source.encoding}"/>
+ <classpath path="${java.home}/../lib/tools.jar:${jspctask.classpath}:${jspcompilation.classpath}"/>
+ </java>
+ <mkdir dir="${build.generated.dir}/classes"/>
+ <webproject2:javac classpath="${j2ee.platform.classpath}:${build.classes.dir}:${jspcompilation.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
+ </target>
+ <target depends="compile" if="jsp.includes" name="-do-compile-single-jsp">
+ <fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail>
+ <mkdir dir="${build.generated.dir}/src"/>
+ <java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true">
+ <arg value="-uriroot"/>
+ <arg file="${basedir}/${build.web.dir}"/>
+ <arg value="-d"/>
+ <arg file="${basedir}/${build.generated.dir}/src"/>
+ <arg value="-die1"/>
+ <arg value="-jspc.files"/>
+ <arg path="${jsp.includes}"/>
+ <arg value="-compilerSourceVM ${javac.source}"/>
+ <arg value="-compilerTargetVM ${javac.target}"/>
+ <arg value="-javaEncoding ${source.encoding}"/>
+ <classpath path="${java.home}/../lib/tools.jar:${jspctask.classpath}:${jspcompilation.classpath}"/>
+ </java>
+ <mkdir dir="${build.generated.dir}/classes"/>
+ <webproject2:javac classpath="${j2ee.platform.classpath}:${build.classes.dir}:${jspcompilation.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
+ <customize>
+ <patternset includes="${javac.jsp.includes}"/>
+ </customize>
+ </webproject2:javac>
+ </target>
+ <target name="compile-single-jsp">
+ <fail unless="jsp.includes">Must select a file in the IDE or set jsp.includes</fail>
+ <antcall target="-do-compile-single-jsp"/>
+ </target>
+ <!--
+ DIST BUILDING SECTION
+ -->
+ <target name="-pre-dist">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest" name="-do-dist-without-manifest">
+ <dirname file="${dist.war}" property="dist.jar.dir"/>
+ <mkdir dir="${dist.jar.dir}"/>
+ <jar compress="${jar.compress}" jarfile="${dist.war}">
+ <fileset dir="${build.web.dir}"/>
+ </jar>
+ </target>
+ <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
+ <dirname file="${dist.war}" property="dist.jar.dir"/>
+ <mkdir dir="${dist.jar.dir}"/>
+ <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
+ <fileset dir="${build.web.dir}"/>
+ </jar>
+ </target>
+ <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
+ <dirname file="${dist.war}" property="dist.jar.dir"/>
+ <mkdir dir="${dist.jar.dir}"/>
+ <jar compress="${jar.compress}" jarfile="${dist.war}">
+ <fileset dir="${build.web.dir}"/>
+ </jar>
+ </target>
+ <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
+ <dirname file="${dist.war}" property="dist.jar.dir"/>
+ <mkdir dir="${dist.jar.dir}"/>
+ <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
+ <fileset dir="${build.web.dir}"/>
+ </jar>
+ </target>
+ <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
+ <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
+ <copyfiles files="${file.reference.activation.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.commons-fileupload-1.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.commons-io-1.3.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.commons-math-1.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.jaxb-api.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.jaxb-impl.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.jsr173_1.0_api.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.postgresql-8.3-604.jdbc4.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.antlrworks-1.2.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.gml-v_3_1_1-schema-1.0-SNAPSHOT.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.wcst-schema.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.rasj.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.joda-time-1.6.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.ows-v_1_0_0-schema-1.0-SNAPSHOT.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.log4j-1.2.15.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.slf4j-api-1.5.8.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.slf4j-log4j12-1.5.8.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.settings.properties}" todir="${build.web.dir}//"/>
+ <copyfiles files="${file.reference.wcpsProcessCoverages.xsd}" todir="${build.web.dir}//xml/ogc/wcps/1.0.0/"/>
+ <copyfiles files="${file.reference.wcps-servlet.html}" todir="${build.web.dir}//templates/"/>
+ <copyfiles files="${file.reference.wcst-servlet.html}" todir="${build.web.dir}//templates/"/>
+ <copyfiles files="${file.reference.interface-servlet.html}" todir="${build.web.dir}//templates/"/>
+ <copyfiles files="${file.reference.log4j.properties}" todir="${build.web.dir}//"/>
+ <mkdir dir="${build.web.dir}/META-INF"/>
+ <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
+ </target>
+ <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
+ <copyfiles files="${file.reference.activation.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.commons-fileupload-1.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.commons-io-1.3.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.commons-math-1.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.jaxb-api.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.jaxb-impl.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.jsr173_1.0_api.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.postgresql-8.3-604.jdbc4.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.antlrworks-1.2.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.gml-v_3_1_1-schema-1.0-SNAPSHOT.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.wcst-schema.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.rasj.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.joda-time-1.6.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.ows-v_1_0_0-schema-1.0-SNAPSHOT.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.log4j-1.2.15.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.slf4j-api-1.5.8.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.slf4j-log4j12-1.5.8.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.settings.properties}" todir="${build.web.dir}//"/>
+ <copyfiles files="${file.reference.wcpsProcessCoverages.xsd}" todir="${build.web.dir}//xml/ogc/wcps/1.0.0/"/>
+ <copyfiles files="${file.reference.wcps-servlet.html}" todir="${build.web.dir}//templates/"/>
+ <copyfiles files="${file.reference.wcst-servlet.html}" todir="${build.web.dir}//templates/"/>
+ <copyfiles files="${file.reference.interface-servlet.html}" todir="${build.web.dir}//templates/"/>
+ <copyfiles files="${file.reference.log4j.properties}" todir="${build.web.dir}//"/>
+ </target>
+ <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
+ <delete dir="${build.web.dir}/WEB-INF/lib"/>
+ </target>
+ <target depends="init,-clean-webinf-lib,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
+ <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
+ <mkdir dir="${dist.jar.dir}"/>
+ <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
+ <fileset dir="${build.web.dir}"/>
+ </jar>
+ </target>
+ <target name="-post-dist">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
+ <target depends="init,-clean-webinf-lib,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
+ <!--
+ EXECUTION SECTION
+ -->
+ <target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/>
+ <target name="-pre-run-deploy">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target name="-post-run-deploy">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target name="-pre-nbmodule-run-deploy">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
+ </target>
+ <target name="-post-nbmodule-run-deploy">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
+ </target>
+ <target name="-run-deploy-am">
+ <!-- Task to deploy to the Access Manager runtime. -->
+ </target>
+ <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy" name="run-deploy">
+ <nbjpdaappreloaded/>
+ </target>
+ <target if="netbeans.home" name="-run-deploy-nb">
+ <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
+ </target>
+ <target name="-init-deploy-ant" unless="netbeans.home">
+ <property name="deploy.ant.archive" value="${dist.war}"/>
+ <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/>
+ <property name="deploy.ant.resource.dir" value="${resource.dir}"/>
+ <property name="deploy.ant.enabled" value="true"/>
+ </target>
+ <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
+ <target if="netbeans.home" name="-run-undeploy-nb">
+ <fail message="Undeploy is not supported from within the IDE"/>
+ </target>
+ <target depends="init,-pre-dist,dist,-post-dist" name="verify">
+ <nbverify file="${dist.war}"/>
+ </target>
+ <target depends="run-deploy,-init-display-browser,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
+ <target if="do.display.browser" name="-init-display-browser">
+ <condition property="do.display.browser.nb">
+ <isset property="netbeans.home"/>
+ </condition>
+ <condition property="do.display.browser.cl">
+ <isset property="deploy.ant.enabled"/>
+ </condition>
+ </target>
+ <target if="do.display.browser.nb" name="-display-browser-nb">
+ <nbbrowse url="${client.url}"/>
+ </target>
+ <target if="do.display.browser.cl" name="-get-browser" unless="browser">
+ <condition property="browser" value="rundll32">
+ <os family="windows"/>
+ </condition>
+ <condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
+ <os family="windows"/>
+ </condition>
+ <condition property="browser" value="/usr/bin/open">
+ <os family="mac"/>
+ </condition>
+ <property environment="env"/>
+ <condition property="browser" value="${env.BROWSER}">
+ <isset property="env.BROWSER"/>
+ </condition>
+ <condition property="browser" value="/usr/bin/firefox">
+ <available file="/usr/bin/firefox"/>
+ </condition>
+ <condition property="browser" value="/usr/local/firefox/firefox">
+ <available file="/usr/local/firefox/firefox"/>
+ </condition>
+ <condition property="browser" value="/usr/bin/mozilla">
+ <available file="/usr/bin/mozilla"/>
+ </condition>
+ <condition property="browser" value="/usr/local/mozilla/mozilla">
+ <available file="/usr/local/mozilla/mozilla"/>
+ </condition>
+ <condition property="browser" value="/usr/sfw/lib/firefox/firefox">
+ <available file="/usr/sfw/lib/firefox/firefox"/>
+ </condition>
+ <condition property="browser" value="/opt/csw/bin/firefox">
+ <available file="/opt/csw/bin/firefox"/>
+ </condition>
+ <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
+ <available file="/usr/sfw/lib/mozilla/mozilla"/>
+ </condition>
+ <condition property="browser" value="/opt/csw/bin/mozilla">
+ <available file="/opt/csw/bin/mozilla"/>
+ </condition>
+ </target>
+ <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
+ <fail unless="browser">
+ Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
+ </fail>
+ <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
+ <echo>Launching ${browse.url}</echo>
+ <exec executable="${browser}" spawn="true">
+ <arg line="${browser.args} ${browse.url}"/>
+ </exec>
+ </target>
+ <target depends="init,-init-cos,compile-single" name="run-main">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <webproject1:java classname="${run.class}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+ </target>
+ <!--
+ DEBUGGING SECTION
+ -->
+ <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug">
+ <nbstartserver debugmode="true"/>
+ <antcall target="connect-debugger"/>
+ <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
+ <antcall target="debug-display-browser"/>
+ <antcall target="connect-client-debugger"/>
+ </target>
+ <target if="do.debug.server" name="connect-debugger" unless="is.debugged">
+ <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" name="${name}" transport="${jpda.transport}">
+ <classpath>
+ <path path="${debug.classpath}:${j2ee.platform.classpath}"/>
+ </classpath>
+ <sourcepath>
+ <path path="${web.docbase.dir}"/>
+ </sourcepath>
+ </nbjpdaconnect>
+ </target>
+ <target if="do.display.browser.debug" name="debug-display-browser">
+ <nbbrowse url="${client.url}"/>
+ </target>
+ <target if="do.debug.client" name="connect-client-debugger">
+ <webproject1:nbjsdebugstart webUrl="${client.url}"/>
+ </target>
+ <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+ <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+ </target>
+ <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+ <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+ <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+ </target>
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+ <webproject1:nbjpdastart name="${debug.class}"/>
+ </target>
+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+ <webproject1:debug classname="${debug.class}"/>
+ </target>
+ <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/>
+ <target depends="init" name="-pre-debug-fix">
+ <fail unless="fix.includes">Must set fix.includes</fail>
+ <property name="javac.includes" value="${fix.includes}.java"/>
+ </target>
+ <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+ <webproject1:nbjpdareload/>
+ </target>
+ <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+ <!--
+ JAVADOC SECTION
+ -->
+ <target depends="init" name="javadoc-build">
+ <mkdir dir="${dist.javadoc.dir}"/>
+ <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+ <classpath>
+ <path path="${javac.classpath}:${j2ee.platform.classpath}"/>
+ </classpath>
+ <fileset dir="${src.java.dir}" excludes="${excludes}" includes="${includes}">
+ <filename name="**/*.java"/>
+ </fileset>
+ <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="**/*.java"/>
+ </fileset>
+ </javadoc>
+ </target>
+ <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
+ <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+ </target>
+ <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
+ <!--
+
+ JUNIT COMPILATION SECTION
+ -->
+ <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+ <mkdir dir="${build.test.classes.dir}"/>
+ <property name="j2ee.platform.embeddableejb.classpath" value=""/>
+ </target>
+ <target name="-pre-compile-test">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
+ <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.test.dir}"/>
+ <copy todir="${build.test.classes.dir}">
+ <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-test">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+ <target name="-pre-compile-test-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+ <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.test.dir}"/>
+ <copy todir="${build.test.classes.dir}">
+ <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-test-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+ <!--
+
+ JUNIT EXECUTION SECTION
+ -->
+ <target depends="init" if="have.tests" name="-pre-test-run">
+ <mkdir dir="${build.test.results.dir}"/>
+ </target>
+ <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+ <webproject2:junit testincludes="**/*Test.java"/>
+ </target>
+ <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init" if="have.tests" name="test-report"/>
+ <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+ <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+ <target depends="init" if="have.tests" name="-pre-test-run-single">
+ <mkdir dir="${build.test.results.dir}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+ <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+ <webproject2:junit excludes="" includes="${test.includes}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+ <!--
+
+ JUNIT DEBUGGING SECTION
+ -->
+ <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
+ <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+ <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
+ <delete file="${test.report.file}"/>
+ <!-- must exist, otherwise the XML formatter would fail -->
+ <mkdir dir="${build.test.results.dir}"/>
+ <webproject1:debug args="${test.class}" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}:${j2ee.platform.embeddableejb.classpath}">
+ <customize>
+ <arg value="showoutput=true"/>
+ <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
+ <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
+ </customize>
+ </webproject1:debug>
+ </target>
+ <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+ <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+ </target>
+ <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+ <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+ <webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+ </target>
+ <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+ <!--
+
+ CLEANUP SECTION
+ -->
+ <target depends="init" if="no.dist.ear.dir" name="deps-clean" unless="no.deps"/>
+ <target depends="init" name="do-clean">
+ <condition property="build.dir.to.clean" value="${build.web.dir}">
+ <isset property="dist.ear.dir"/>
+ </condition>
+ <property name="build.dir.to.clean" value="${build.web.dir}"/>
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
+ </delete>
+ <delete dir="${build.dir}"/>
+ <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
+ <delete dir="${dist.dir}"/>
+ </target>
+ <target depends="do-clean" if="status.clean-failed" name="check-clean">
+ <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
+ <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
+ </target>
+ <target depends="init" if="netbeans.home" name="undeploy-clean">
+ <nbundeploy failOnError="false" startServer="false"/>
+ </target>
+ <target name="-post-clean">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
+ <target depends="clean" description="Clean build products." name="clean-ear"/>
+</project>
diff --git a/petascope/nbproject/genfiles.properties b/petascope/nbproject/genfiles.properties
new file mode 100644
index 0000000..315ce61
--- /dev/null
+++ b/petascope/nbproject/genfiles.properties
@@ -0,0 +1,11 @@
+build.xml.data.CRC32=aad0949e
+build.xml.script.CRC32=a3483906
+build.xml.stylesheet.CRC32=c0ebde35
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=8bacb2b4
+nbproject/build-impl.xml.script.CRC32=b56242e3
+nbproject/build-impl.xml.stylesheet.CRC32=b139b33b@1.21.2.1
+nbproject/profiler-build-impl.xml.data.CRC32=08a10577
+nbproject/profiler-build-impl.xml.script.CRC32=a84d8f2e
+nbproject/profiler-build-impl.xml.stylesheet.CRC32=0bb5b37b
diff --git a/petascope/nbproject/project.properties b/petascope/nbproject/project.properties
new file mode 100644
index 0000000..4f2846b
--- /dev/null
+++ b/petascope/nbproject/project.properties
@@ -0,0 +1,128 @@
+build.classes.dir=${build.web.dir}/WEB-INF/classes
+build.classes.excludes=**/*.java,**/*.form
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+build.web.dir=${build.dir}/web
+build.web.excludes=${build.classes.excludes}
+client.urlPart=/earthlook
+compile.jsps=false
+conf.dir=${source.root}/conf
+debug.classpath=${build.classes.dir}:${javac.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+display.browser=false
+dist.dir=dist
+dist.ear.war=${dist.dir}/${war.ear.name}
+dist.javadoc.dir=${dist.dir}/javadoc
+dist.war=${dist.dir}/${war.name}
+endorsed.classpath=
+excludes=
+file.reference.activation.jar=lib/activation.jar
+file.reference.antlrworks-1.2.3.jar=lib/antlrworks-1.2.3.jar
+file.reference.commons-fileupload-1.2.jar=lib/commons-fileupload-1.2.jar
+file.reference.commons-io-1.3.2.jar=lib/commons-io-1.3.2.jar
+file.reference.commons-math-1.1.jar=lib/commons-math-1.1.jar
+file.reference.gml-v_3_1_1-schema-1.0-SNAPSHOT.jar=lib/gml-v_3_1_1-schema-1.0-SNAPSHOT.jar
+file.reference.interface-servlet.html=templates/interface-servlet.html
+file.reference.jaxb-api.jar=lib/jaxb-api.jar
+file.reference.jaxb-impl.jar=lib/jaxb-impl.jar
+file.reference.jaxb-xjc.jar=lib/jaxb-xjc.jar
+file.reference.joda-time-1.6.jar=lib/joda-time-1.6.jar
+file.reference.jsr173_1.0_api.jar=lib/jsr173_1.0_api.jar
+file.reference.log4j-1.2.15.jar=lib/log4j-1.2.15.jar
+file.reference.log4j.properties=src/log4j.properties
+file.reference.ows-v_1_0_0-schema-1.0-SNAPSHOT.jar=lib/ows-v_1_0_0-schema-1.0-SNAPSHOT.jar
+file.reference.petascope-src=../../Job/petascope/src
+file.reference.postgresql-8.3-604.jdbc4.jar=lib/postgresql-8.3-604.jdbc4.jar
+file.reference.rasj.jar=lib/rasj.jar
+file.reference.servlet-2_5-api.jar=lib/servlet-2_5-api.jar
+file.reference.settings.properties=settings.properties
+file.reference.slf4j-api-1.5.8.jar=lib/slf4j-api-1.5.8.jar
+file.reference.slf4j-log4j12-1.5.8.jar=lib/slf4j-log4j12-1.5.8.jar
+file.reference.wcps-servlet.html=templates/wcps-servlet.html
+file.reference.wcpsProcessCoverages.xsd=xml/ogc/wcps/1.0.0/wcpsProcessCoverages.xsd
+file.reference.wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar=lib/wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar
+file.reference.wcst-schema.jar=lib/wcst-schema.jar
+file.reference.wcst-servlet.html=templates/wcst-servlet.html
+includes=**
+j2ee.deploy.on.save=true
+j2ee.platform=1.5
+j2ee.server.type=Tomcat60
+jar.compress=false
+javac.classpath=\
+ ${file.reference.activation.jar}:\
+ ${file.reference.commons-fileupload-1.2.jar}:\
+ ${file.reference.commons-io-1.3.2.jar}:\
+ ${file.reference.commons-math-1.1.jar}:\
+ ${file.reference.jaxb-api.jar}:\
+ ${file.reference.jaxb-impl.jar}:\
+ ${file.reference.jaxb-xjc.jar}:\
+ ${file.reference.jsr173_1.0_api.jar}:\
+ ${file.reference.postgresql-8.3-604.jdbc4.jar}:\
+ ${file.reference.servlet-2_5-api.jar}:\
+ ${file.reference.antlrworks-1.2.3.jar}:\
+ ${file.reference.gml-v_3_1_1-schema-1.0-SNAPSHOT.jar}:\
+ ${file.reference.wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar}:\
+ ${file.reference.wcst-schema.jar}:\
+ ${file.reference.rasj.jar}:\
+ ${file.reference.joda-time-1.6.jar}:\
+ ${file.reference.ows-v_1_0_0-schema-1.0-SNAPSHOT.jar}:\
+ ${file.reference.log4j-1.2.15.jar}:\
+ ${file.reference.slf4j-api-1.5.8.jar}:\
+ ${file.reference.slf4j-log4j12-1.5.8.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.debug=true
+javac.deprecation=false
+javac.source=1.6
+javac.target=1.6
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.junit_4.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.preview=true
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+jaxbwiz.endorsed.dirs="${netbeans.home}/../ide9/modules/ext/jaxb/api"
+jaxbwiz.gensrc.classpath=${libs.jaxb.classpath}
+jaxbwiz.xjcdef.classpath=${libs.jaxb.classpath}
+jaxbwiz.xjcrun.classpath=${libs.jaxb.classpath}
+jspcompilation.classpath=${jspc.classpath}:${javac.classpath}
+lib.dir=${web.docbase.dir}/WEB-INF/lib
+persistence.xml.dir=${conf.dir}
+platform.active=default_platform
+resource.dir=setup
+run.jvmargs=-Djava.endorsed.dirs=${jaxbwiz.endorsed.dirs}
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+# Space-separated list of JVM arguments used when running a class with a main method or a unit test
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value):
+runmain.jvmargs=
+source.encoding=UTF-8
+source.root=src
+src.java.dir=src
+test.test.dir=test
+war.content.additional=\
+ ${file.reference.settings.properties}:\
+ ${file.reference.wcpsProcessCoverages.xsd}:\
+ ${file.reference.wcps-servlet.html}:\
+ ${file.reference.wcst-servlet.html}:\
+ ${file.reference.interface-servlet.html}:\
+ ${file.reference.log4j.properties}
+war.ear.name=petascope.war
+war.name=petascope.war
+web.docbase.dir=web
+webinf.dir=web/WEB-INF
diff --git a/petascope/nbproject/project.xml b/petascope/nbproject/project.xml
new file mode 100644
index 0000000..c40c16d
--- /dev/null
+++ b/petascope/nbproject/project.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.web.project</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/web-project/3">
+ <name>PetaScope</name>
+ <minimum-ant-version>1.6.5</minimum-ant-version>
+ <web-module-libraries>
+ <library dirs="200">
+ <file>${file.reference.activation.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.commons-fileupload-1.2.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.commons-io-1.3.2.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.commons-math-1.1.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jaxb-api.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jaxb-impl.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jaxb-xjc.jar}</file>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jsr173_1.0_api.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.postgresql-8.3-604.jdbc4.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.servlet-2_5-api.jar}</file>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.antlrworks-1.2.3.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.gml-v_3_1_1-schema-1.0-SNAPSHOT.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.wcs-v_1_1_0-schema-1.0-SNAPSHOT.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.wcst-schema.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.rasj.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.joda-time-1.6.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.ows-v_1_0_0-schema-1.0-SNAPSHOT.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.log4j-1.2.15.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.slf4j-api-1.5.8.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.slf4j-log4j12-1.5.8.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ </web-module-libraries>
+ <web-module-additional-libraries>
+ <library dirs="200">
+ <file>${file.reference.settings.properties}</file>
+ <path-in-war>/</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.wcpsProcessCoverages.xsd}</file>
+ <path-in-war>/xml/ogc/wcps/1.0.0/</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.wcps-servlet.html}</file>
+ <path-in-war>/templates/</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.wcst-servlet.html}</file>
+ <path-in-war>/templates/</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.interface-servlet.html}</file>
+ <path-in-war>/templates/</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.log4j.properties}</file>
+ <path-in-war>/</path-in-war>
+ </library>
+ </web-module-additional-libraries>
+ <source-roots>
+ <root id="src.java.dir" name="Source Packages (ln)"/>
+ </source-roots>
+ <test-roots>
+ <root id="test.test.dir" name="Test Files"/>
+ </test-roots>
+ </data>
+ <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
+ <definitions>./lib/nblibraries.properties</definitions>
+ </libraries>
+ </configuration>
+</project>
diff --git a/petascope/settings.properties b/petascope/settings.properties
new file mode 100644
index 0000000..6d5b40d
--- /dev/null
+++ b/petascope/settings.properties
@@ -0,0 +1,73 @@
+# ---------------------------------------------------------------------
+# settings.properties
+#
+# PetaScope configuration file
+#
+# Important note:
+# Parameters marked "yes" in item "need to adapt" MUST be configured
+# to meaningful values during installation, they CAN NOT be used as is!
+# ---------------------------------------------------------------------
+
+# parameter: metadata_driver
+# purpose: name of DBMS driver to be loaded
+# need to adapt: no
+metadata_driver=org.postgresql.Driver
+
+# parameter: metadata_url
+# purpose: JDBC URL of database serving PetaScope metadata
+# recommendation: use default values on a default Postgresql
+# installation, and DB name petascopedb
+# need to adapt: yes
+metadata_url=jdbc:postgresql://localhost:5432/petascopedb
+
+# parameter: metadata_user
+# purpose: DBMS login under which servlet has r/w access
+# to PetaScope metadata;
+# recommendation: establish a dedicated user
+# need to adapt: yes
+metadata_user=petauser
+
+# parameter: metadata_pass
+# purpose: password for DBMS login, as above
+# need to adapt: yes
+metadata_pass=petapasswd
+
+# parameter: rasdaman_url
+# purpose: URL of rasdaman database serving PetaScope raster data
+# need to adapt: yes
+rasdaman_url=http://localhost:7001
+
+# parameter: rasdaman_database
+# purpose: name of rasdaman database serving PetaScope raster data
+# recommendation: use rasdaman standard name, RASBASE
+# need to adapt: no
+rasdaman_database=RASBASE
+
+# parameter: servlet_info
+# purpose: description text about the servlet
+# need to adapt: no
+servlet_info=PetaScope (Developed at Jacobs University)
+
+# parameter: print_log
+# purpose: print log messages to the tomcat log files? "true" or "false"
+# need to adapt: no
+print_log=true
+
+# parameter: print_output
+# purpose: print status messages to standard out? "true" or "false"
+# need to adapt: no
+print_output=true
+
+# ---------------------------------------------------------------------
+# Settings for the WCS-T Server
+# ---------------------------------------------------------------------
+
+# parameter: wcst_version
+# purpose: version of WCS-T standard implemented
+# need to adapt: no
+wcst_version=1.1.4
+
+# parameter: wcst_language
+# purpose: language accepted by the server
+# need to adapt: no
+wcst_language=en
diff --git a/petascope/src/log4j.properties b/petascope/src/log4j.properties
new file mode 100644
index 0000000..b394c5f
--- /dev/null
+++ b/petascope/src/log4j.properties
@@ -0,0 +1,34 @@
+# =============================================================
+# ------------------- petascope log configuration ------------
+# =============================================================
+#
+# This is the configuration file for the log4j-based petascope logging.
+#
+# =============================================================
+# ------------------- log output configuration ---------------
+# =============================================================
+
+# The rootLogger option defines where the log output should go.
+# Log4j uses appender to direct the output to a specific target.
+# By default deegree logs to the console (appender: stdout)
+log4j.rootLogger=INFO, stdout
+# To also log into a logfile (example below):
+#log4j.rootLogger=INFO, logfile, stdout
+
+# Below is the configuration of the log appender. The format of
+# the log messages is configured with the ConversionPattern option.
+# see http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html
+
+# =============== console output appender =====================
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %5p: [%c{1}] %m%n
+
+# =================== common logging =========================
+# The log level for all classes that are not configured below.
+log4j.logger.petascope=INFO
+
+log4j.logger.petascope.wcps=DEBUG
+log4j.logger.petascope.wcst=DEBUG
+log4j.logger.petascope.wcs=DEBUG
+log4j.logger.petascope.wcs2=TRACE \ No newline at end of file
diff --git a/petascope/src/petascope/ConfigManager.java b/petascope/src/petascope/ConfigManager.java
new file mode 100644
index 0000000..01b0261
--- /dev/null
+++ b/petascope/src/petascope/ConfigManager.java
@@ -0,0 +1,227 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope;
+
+//~--- JDK imports ------------------------------------------------------------
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.util.Properties;
+import javax.servlet.ServletException;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcs2.server.templates.WcsNamespaceContext;
+
+/**
+ * Configuration Manager class: a single entry point for all server settings.
+ * Implements the singleton design pattern.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ConfigManager {
+
+ private static Logger LOG = LoggerFactory.getLogger(ConfigManager.class);
+
+ /* Major version number. This is the first release (1). */
+ private final static String MAJOR = "1";
+ /* Minor version number. v2 adds the reference implementation of WCS 2.0.
+ v3 adds WGS84 handling in WCPS requests, and v4 adds a WPS implementation. */
+ private final static String MINOR = "4";
+ /* Bug-fix count. We have a hack: every WCPS response is written to disk. */
+ private final static String BUGFIX = "11-hack";
+
+ /* Petascope 1.2.0 contains WCS 1.1.0, WCS 2.0, WCS-T 1.0.0 and WCPS 1.0.0 */
+ public final static String PETASCOPE_VERSION = MAJOR + "." + MINOR + "." + BUGFIX;
+ /* Settings variables */
+ public static String WCST_LANGUAGE;
+ public static String WCST_VERSION;
+ public static String RASDAMAN_URL;
+ public static String RASDAMAN_DATABASE;
+ public static String METADATA_DRIVER;
+ public static String METADATA_URL;
+ public static String METADATA_USER;
+ public static String METADATA_PASS;
+ public static boolean CCIP_HACK = false;
+
+ /* WCS 2.0 variables */
+ public static String WCS2_GET_CAPABILITIES_TEMPLATE;
+ public static String WCS2_DESCRIBE_COVERAGE_TEMPLATE;
+ public static String WCS2_GET_COVERAGE_TEMPLATE;
+ public static String WCS2_SCHEMA_URL;
+
+ /* This URL gets initialized automatically when the first request is received.
+ * Its value is used in the Capabilities response */
+ public static String PETASCOPE_SERVLET_URL;
+
+ /* WCS-T Settings. Overridden by user-preferences in <code>settings.properties</code> */
+ public static String WCST_DEFAULT_INTERPOLATION = "none";
+ public static String WCST_DEFAULT_NULL_RESISTANCE = "none";
+ public static String WCST_DEFAULT_DATATYPE = "unsigned char";
+ /* Singleton instance */
+ private static ConfigManager instance;
+ private static Properties props;
+
+ /**
+ * Private constructor. Use <i>getInstance()</i>.
+ *
+ * @param settingsPath Path to the settings properties file
+ * @param servletRoot Path to the root folder where the servlet is deployed
+ */
+ private ConfigManager(String settingsPath, String servletRoot) throws ServletException {
+ props = new Properties();
+ try {
+ LOG.info("Loading settings from file: " + settingsPath);
+ props.load(new FileInputStream(settingsPath));
+ initSettings(servletRoot);
+ } catch (IOException e) {
+ LOG.error("Failed to load settings. Stack trace: " + e);
+ throw new ServletException("Failed to load settings file.");
+ }
+ }
+
+ /**
+ * Returns the instance of the ConfigManager. If no such instance exists,
+ * it creates one with the specified settings file.
+ *
+ * @param settingsPath Path to the settings file
+ * @param servletRoot Path to the deployed servlet root
+ * @return instance of the ConfigManager class
+ */
+ public static ConfigManager getInstance(String settingsPath, String servletRoot) throws ServletException {
+ if (instance == null) {
+ instance = new ConfigManager(settingsPath, servletRoot);
+ }
+
+ return instance;
+ }
+
+ public static ConfigManager getInstance() {
+ if (instance == null) {
+ throw new RuntimeException("Could not initialize the ConfigManager "
+ + "because no settings file path was provided.");
+ }
+ return instance;
+ }
+
+ /**
+ * Return a setting value from the settings file
+ *
+ * @param key Key of the setting
+ * @return String value, or the empty string in case the key does not exist
+ */
+ private String get(String key) {
+ String result = "";
+
+ if (props.containsKey(key)) {
+ result = props.getProperty(key);
+ }
+
+ return result;
+ }
+
+ private void initSettings(String servletRoot) {
+ WCST_LANGUAGE = get("wcst_language");
+ WCST_VERSION = get("wcst_version");
+ RASDAMAN_DATABASE = get("rasdaman_database");
+ RASDAMAN_URL = get("rasdaman_url");
+ METADATA_DRIVER = get("metadata_driver");
+ METADATA_URL = get("metadata_url");
+ METADATA_USER = get("metadata_user");
+ METADATA_PASS = get("metadata_pass");
+
+ CCIP_HACK = Boolean.parseBoolean(get("ccip_version"));
+
+ try {
+ URI desc = WcsNamespaceContext.class.getResource("DescribeCoverageTemplate.xml").toURI();
+ URI getcov = WcsNamespaceContext.class.getResource("GetCoverageTemplate.xml").toURI();
+ URI getcap = WcsNamespaceContext.class.getResource("GetCapabilitiesTemplate.xml").toURI();
+ WCS2_GET_CAPABILITIES_TEMPLATE = loadFile(getcap);
+ WCS2_DESCRIBE_COVERAGE_TEMPLATE = loadFile(desc);
+ WCS2_GET_COVERAGE_TEMPLATE = loadFile(getcov);
+ WCS2_SCHEMA_URL = get("wcs2_schema_url");
+
+ } catch (Exception e) {
+ LOG.warn("Could not read XML template files for WCS 2.0. Therefore, WCS 2.0 will be unable to start.");
+ }
+
+ /* User preferences override default values for WCS-T */
+ String tmp = get("default_interpolation");
+ if (tmp.length() > 0) {
+ WCST_DEFAULT_INTERPOLATION = tmp;
+ }
+ tmp = get("default_null_resistance");
+ if (tmp.length() > 0) {
+ WCST_DEFAULT_NULL_RESISTANCE = tmp;
+ }
+ tmp = get("default_datatype");
+ if (tmp.length() > 0) {
+ WCST_DEFAULT_DATATYPE = tmp;
+ }
+
+ LOG.info("---------------------------");
+ if (CCIP_HACK) {
+ LOG.info("-----------CCIP------------");
+ }
+ LOG.info("---------------------------");
+
+// log("Print Log: " + PRINT_LOG);
+ LOG.info(" *** PETASCOPE *** ");
+ LOG.info("Rasdaman URL: " + RASDAMAN_URL);
+ LOG.info("Rasdaman DB: " + RASDAMAN_DATABASE);
+ LOG.info("Metadata Driver: " + METADATA_DRIVER);
+ LOG.info("Metadata URL: " + METADATA_URL);
+ LOG.info("Metadata Username: " + METADATA_USER);
+// LOG.info("Metadata Password: " + METADATA_PASS);
+ LOG.info(" *** WCS-T *** ");
+ LOG.info("WCS-T Language: " + WCST_LANGUAGE);
+ LOG.info("WCS-T Version: " + WCST_VERSION);
+ LOG.info("WCS-T Default Interpolation: " + WCST_DEFAULT_INTERPOLATION);
+ LOG.info("WCS-T Default Null Resistance: " + WCST_DEFAULT_NULL_RESISTANCE);
+ LOG.info("WCS-T Default Datatype: " + WCST_DEFAULT_DATATYPE);
+ LOG.info(" *** WCS 2.0 *** ");
+ LOG.trace("Get Capabilities Template: " + WCS2_GET_CAPABILITIES_TEMPLATE.substring(0, 100));
+ LOG.trace("Describe Coverage Template: " + WCS2_DESCRIBE_COVERAGE_TEMPLATE.substring(0, 100));
+ LOG.trace("Get Capabilities Template: " + WCS2_GET_COVERAGE_TEMPLATE.substring(0, 100));
+ LOG.info("---------------------------");
+ }
+
+ private String loadFile(URI fileUri) throws IOException {
+ InputStream is = null;
+ String contents = null;
+ try {
+ LOG.debug("Loading file: " + fileUri);
+ File f = new File(fileUri);
+ is = new FileInputStream(f);
+ contents = IOUtils.toString(is);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException ex) {
+ }
+ }
+ return contents;
+ }
+}
diff --git a/petascope/src/petascope/PetascopeInterface.java b/petascope/src/petascope/PetascopeInterface.java
new file mode 100644
index 0000000..5b2b2d0
--- /dev/null
+++ b/petascope/src/petascope/PetascopeInterface.java
@@ -0,0 +1,632 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.lang.String;
+import java.net.URISyntaxException;
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.bind.JAXBException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import org.antlr.runtime.RecognitionException;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.log4j.PropertyConfigurator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.core.WCPS;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.wcs.server.WcsServer;
+import petascope.wcs.server.exceptions.InputOutputException;
+import petascope.wcs.server.exceptions.InternalComponentException;
+import petascope.wcs.server.exceptions.InvalidRequestException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+import petascope.wcs.server.exceptions.ServletConnectionException;
+import petascope.wcs.server.exceptions.WcsRuntimeException;
+import petascope.wcs.server.exceptions.XmlNotValidException;
+import petascope.wcs2.server.Wcs2Server;
+import petascope.wcs2.server.templates.WcsNamespaceContext;
+import petascope.wcst.server.WcstServer;
+import petascope.wps.server.WpsServer;
+
+/** This servlet is a unified entry-point for all the PetaScope services.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class PetascopeInterface extends HttpServlet {
+
+ private static Logger LOG = LoggerFactory.getLogger(PetascopeInterface.class);
+ private DbMetadataSource metadataSource;
+
+ /* Xml documents utils */
+ DocumentBuilder builder = null;
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+ /* Path to the settings file, in the web archive */
+ private String relativeSettingsPath = "/settings.properties";
+ // path to the default HTML response of the interface servlet
+ private String usageFilePath = "/templates/interface-servlet.html";
+ // String containing the HTML code for the default response
+ private String usageMessage;
+ /* Instance of WcsServer-T service */
+ private WcstServer wcst;
+ /* Instance of WCPS service */
+ private WCPS wcps;
+ /* Instance of WcsServer service */
+ private WcsServer wcs;
+ private Wcs2Server wcs2;
+
+ /* Initialize the various services: WCPS, WcsServer and WcsServer-T */
+ @Override
+ public void init() throws ServletException {
+
+ LOG.info("-----------------------------------------------");
+ LOG.info(" PetaScope {} starting ...", ConfigManager.PETASCOPE_VERSION);
+ LOG.info("-----------------------------------------------");
+
+ // Initialize the singleton configuration manager. Now all classes can read the settings.
+ String settingsPath = getServletContext().getRealPath(relativeSettingsPath);
+ ConfigManager config = ConfigManager.getInstance(settingsPath, getServletContext().getRealPath("/"));
+
+ // Initialize the logging system
+ PropertyConfigurator.configure(getServletContext().getRealPath("/log4j.properties"));
+
+
+ // Read servlet HTML usage message from disk
+ try {
+ usageFilePath = getServletContext().getRealPath(usageFilePath);
+ usageMessage = FileUtils.readFileToString(new File(usageFilePath));
+ } catch (IOException e) {
+ LOG.error("Could not read default servlet HTML response. Stack trace: {}", e);
+ throw new ServletException("Could not read interface servlet HTML response", e);
+ }
+
+ /* Initialize WCPS Service */
+ try {
+ LOG.info("WCPS: initializing metadata database");
+ metadataSource =
+ new DbMetadataSource(ConfigManager.METADATA_DRIVER,
+ ConfigManager.METADATA_URL,
+ ConfigManager.METADATA_USER,
+ ConfigManager.METADATA_PASS, false);
+
+ LOG.debug("WCPS: initializing WCPS core");
+ wcps = new WCPS(metadataSource);
+
+ LOG.info("WCPS: initialization complete");
+ } catch (ParserConfigurationException e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCPS initialization error", e);
+ } catch (WCPSException e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCPS initialization error", e);
+ }
+
+ /* Initialize WCS Service */
+ try {
+ LOG.info("WCS Initialization ...");
+ wcs = new WcsServer(settingsPath, metadataSource);
+ LOG.info("WCS: Initialization complete.");
+ } catch (Exception e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCS initialization error", e);
+ }
+
+ /* Initialize WCS 2.0 Service */
+ try {
+ LOG.info("WCS 2.0 Initialization ...");
+ wcs2 = new Wcs2Server(settingsPath, metadataSource);
+ LOG.info("WCS 2.0: Initialization complete.");
+ } catch (Exception e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCS 2.0 initialization error", e);
+ }
+
+ /* Initialize WCS-T Service */
+ try {
+ LOG.info("WCS-T: Initializing ...");
+ wcst = new WcstServer(metadataSource);
+ LOG.info("WCS-T: Initialization complete.");
+ } catch (WCSException e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: WCS-T initialization error", e);
+ }
+
+ /* Initialize XML parsing for request redirection */
+ try {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true); // never forget this!
+ builder = domFactory.newDocumentBuilder();
+ } catch (Exception e) {
+ LOG.error("Stack trace: {}", e);
+ throw new ServletException("Fatal: Error initializing XML parser", e);
+ }
+
+ LOG.info("-----------------------------------------------");
+ LOG.info(" PetaScope {} successfully started ", ConfigManager.PETASCOPE_VERSION);
+ LOG.info("-----------------------------------------------");
+ }
+
+ /* Build a dictionary of parameter names and values, given a request string */
+ private Map<String, String> buildParameterDictionary(String request) {
+ HashMap<String, String> map = new HashMap<String, String>(3);
+ if (request == null) {
+ return map;
+ }
+
+ String[] pairs = request.split("&");
+ String key = null, val = null;
+ int pos = -1;
+ for (int i = 0; i < pairs.length; i++) {
+ pos = pairs[i].indexOf("=");
+ if (pos != -1) {
+ key = pairs[i].substring(0, pos);
+ val = pairs[i].substring(pos + 1, pairs[i].length());
+ map.put(key, val);
+ }
+ }
+
+ return map;
+ }
+
+ /* URL-decode a string, if needed */
+ private String urldecode(String encodedText, String contentType) throws UnsupportedEncodingException {
+ if (encodedText == null) {
+ return null;
+ }
+ String decoded = encodedText;
+ LOG.trace("Found URL encoded text: {}", encodedText);
+ if (contentType != null && contentType.equals("application/x-www-form-urlencoded") && encodedText.indexOf(" ") == -1) {
+ decoded = URLDecoder.decode(encodedText, "UTF-8");
+ }
+ LOG.trace("Returning decoded text: {}", decoded);
+ return decoded;
+ }
+
+ /* Respond to Post requests just like in the case of Get requests */
+ @Override
+ public void doPost(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
+ /* Init the Petascope URL automatically, for GetCapabilities response */
+ if (ConfigManager.PETASCOPE_SERVLET_URL == null) {
+ ConfigManager.PETASCOPE_SERVLET_URL = httpRequest.getRequestURL().toString();
+ }
+ /* Treat POST requests just like GET requests */
+ doGet(httpRequest, httpResponse);
+ }
+
+ /* Handle Get requests. This function delegates the request to the service
+ specified in the request by the "service" parameter. */
+ @Override
+ public void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
+ String request = null, requestBody = null;
+
+ /* Init the Petascope URL automatically, for GetCapabilities response */
+ if (ConfigManager.PETASCOPE_SERVLET_URL == null) {
+ ConfigManager.PETASCOPE_SERVLET_URL = httpRequest.getRequestURL().toString();
+ }
+
+ /* List all available coverages, to make sure metadata is available */
+ try {
+ LOG.debug("PetaScope coverages: " + metadataSource.coverages());
+ } catch (ResourceException e) {
+ }
+
+ /* Process the request */
+
+ try {
+ try {
+ requestBody = IOUtils.toString(httpRequest.getReader());
+
+ LOG.trace("POST Request length: " + httpRequest.getContentLength());
+ LOG.trace("POST request body: \n------START REQUEST--------\n"
+ + requestBody + "\n------END REQUEST------\n");
+
+ Map<String, String> params = buildParameterDictionary(requestBody);
+ LOG.trace("Request parameters: {}", params);
+ request = urldecode(params.get("request"), httpRequest.getContentType());
+
+ // WPS 1.0.0 GET interface processing
+ if ((httpRequest.getParameter("Service") != null) && (httpRequest.getParameter("Service").equalsIgnoreCase("WPS"))) {
+ WpsServer wpsServer = new WpsServer(httpResponse, httpRequest);
+ request = wpsServer.request;
+ }
+
+ // To preserve compatibility with previous client versions, we allow
+ // GET requests with parameter "query"
+ String request2 = null;
+ request2 = httpRequest.getParameter("query");
+ if (request2 == null) {
+ request2 = urldecode(params.get("query"), httpRequest.getContentType());
+ }
+ if (request2 != null) {
+ LOG.debug("Received Abstract Syntax Request via GET: \n\t\t{}", request2);
+ request2 = ProcessCoveragesRequest.abstractQueryToXmlQuery(request2);
+ }
+ if (request == null && request2 != null) {
+ request = request2;
+ }
+
+ // Empty request ?
+ if (request == null && (requestBody == null || requestBody.length() == 0)) {
+ printUsage(httpResponse, request);
+ return;
+ }
+
+ // No parameters, just XML in the request body
+ if (request == null && requestBody != null && requestBody.length() > 0) {
+ request = urldecode(requestBody, httpRequest.getContentType());
+
+// if (request.matches(" *<.*") == false)
+// {
+// handleUnknownRequest(request, httpResponse);
+// return;
+// }
+ }
+
+ LOG.debug("Petascope Request: \n------START REQUEST--------\n"
+ + request + "\n------END REQUEST------\n");
+
+ Document doc = builder.parse(IOUtils.toInputStream(request));
+ Element rootElem = doc.getDocumentElement();
+ String root = rootElem.getTagName();
+ LOG.debug("Root Element name: {}", root);
+
+ String version = "1.1.0";
+ try {
+ XPath xpath = xpathFactory.newXPath();
+ xpath.setNamespaceContext(new WcsNamespaceContext());
+ String query = "/*/@version";
+ version = (String) xpath.evaluate(query, doc, XPathConstants.STRING);
+ } catch (XPathExpressionException e) {
+ LOG.warn("The root XML node has no attribute called \"version\"");
+ }
+
+
+ /* The next request types are defined in the WcsServer standard, and
+ are common to all the PetaScope services. */
+ if (root.endsWith("GetCapabilities")) {
+ if (version.startsWith("2")) {
+ handleGetCapabilities2(request, httpResponse);
+ } else {
+ handleGetCapabilities(request, httpResponse);
+ }
+ } else if (root.endsWith("DescribeCoverage")) {
+ if (version.startsWith("2")) {
+ handleDescribeCoverage2(request, httpResponse);
+ } else {
+ handleDescribeCoverage(request, httpResponse);
+ }
+ } else if (root.endsWith("GetCoverage")) {
+ if (version.startsWith("2")) {
+ handleGetCoverage2(request, httpResponse);
+ } else {
+ handleGetCoverage(request, httpResponse);
+ }
+ } else /* ProcessCoverages is defined in the WCPS extension to WcsServer */
+ if (root.endsWith("ProcessCoveragesRequest")) {
+ handleProcessCoverages(request, httpResponse);
+ } else /* Transaction is defined in the WcsServer-T extension to WcsServer */
+ if (root.endsWith("Transaction")) {
+ handleTransaction(request, httpResponse);
+ } else /* Print Error Message */ {
+ handleUnknownRequest(request, httpResponse);
+ }
+ } catch (IOException e) {
+ throw new ServletConnectionException(e.getMessage(), e);
+ } catch (RecognitionException e) {
+ throw new InvalidRequestException(e.getMessage(), e);
+ } catch (SAXException e) {
+ throw new InvalidRequestException(e.getMessage(), e);
+ } catch (WCSException e) {
+ throw e;
+ } catch (Exception e) {
+ // Finally, cast all other exceptions into a WCSException
+ LOG.error("Runtime error : {}", e.getMessage());
+ throw new WcsRuntimeException(e.getMessage(), e);
+ }
+ } // And catch all WCSExceptions, to display to the client
+ catch (WCSException e) {
+ printError(httpResponse, request, e);
+ }
+ }
+
+ private void printUsage(HttpServletResponse httpResponse,
+ String request) throws IOException {
+ PrintWriter out = httpResponse.getWriter();
+ httpResponse.setContentType("text/html");
+ out.write(usageMessage);
+ out.flush();
+ }
+
+ private void printError(HttpServletResponse response,
+ String message, Exception e) {
+ PrintWriter out;
+ try {
+ out = new PrintWriter(response.getOutputStream());
+ } catch (IOException e1) {
+ LOG.error("Could not print exception because of IO error. Stack trace:", e1);
+ return;
+ }
+
+ LOG.error("Error stack trace:", e);
+ if (e instanceof WCSException) {
+ // We can send an error report
+ String output = exceptionToXml((WCSException) e);
+ response.setContentType("text/xml; charset=utf-8");
+ out.println(output);
+ out.close();
+ } else {
+ LOG.trace("setting response mimetype to text/html; charset=utf-8");
+ response.setContentType("text/html; charset=utf-8");
+ LOG.trace("returning the following error message.", e);
+ LOG.trace("end of error message");
+
+ out.println(
+ "<html><head><title>PetaScope</title></head><body>");
+ out.println("<h1>An error has occured</h1>");
+ out.println("<p>" + message + "</p>");
+ out.println("<p>Stack trace:<br/><small>");
+ e.printStackTrace(out);
+ out.println("</small></p></body></html>");
+ out.close();
+ LOG.trace("done with error");
+ }
+
+ }
+
+ private void handleUnknownRequest(String request, HttpServletResponse httpResponse) {
+ request = "'" + request + "'";
+ WCSException e = new NoApplicableCodeException("Could not understand request " + request);
+ printError(httpResponse, request, e);
+ }
+
+ private String exceptionReportToXml(ExceptionReport report) {
+ String output = null;
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(report.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.setProperty("jaxb.schemaLocation",
+ "http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd");
+ marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PetascopeXmlNamespaceMapper());
+ StringWriter strWriter = new StringWriter();
+ marshaller.marshal(report, strWriter);
+ output = strWriter.toString();
+ System.err.println(output);
+ LOG.debug("Done marshalling Error Report.");
+ } catch (JAXBException e2) {
+ LOG.error("Stack trace: {}", e2);
+ LOG.error("Error stack trace: " + e2);
+ }
+ return output;
+ }
+
+ private String exceptionToXml(WCSException e) {
+ return exceptionReportToXml(e.getReport());
+ }
+
+ /**
+ * GetCapabilities of WCS 1.1
+ * @param request
+ * @param httpResponse
+ * @throws WCSException
+ */
+ private void handleGetCapabilities(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs.GetCapabilities(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * GetCapabilities of WCS 2.0
+ * @param request
+ * @param httpResponse
+ * @throws WCSException
+ */
+ private void handleGetCapabilities2(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs2.GetCapabilities(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * DescribeCoverage for WCS 1.1
+ * @param request
+ * @param httpResponse
+ * @throws WCSException
+ */
+ private void handleDescribeCoverage(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs.DescribeCoverage(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Describe Coverage for WCS 2.0
+ * @param request
+ * @param httpResponse
+ * @throws WCSException
+ */
+ private void handleDescribeCoverage2(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs2.DescribeCoverage(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ private void handleGetCoverage(String request, HttpServletResponse httpResponse) throws WCSException, InvalidCrsException {
+ String xmlRequest = wcs.GetCoverage(request, wcps);
+ LOG.debug("Received GetCoverage Request: \n{}", xmlRequest);
+ // Redirect the request to WCPS
+ handleProcessCoverages(xmlRequest, httpResponse);
+ }
+
+ private void handleGetCoverage2(String request, HttpServletResponse httpResponse) throws WCSException {
+ String output = wcs2.GetCoverage(request);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(output);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ private void handleProcessCoverages(String xmlRequest, HttpServletResponse response) throws WCSException, InvalidCrsException {
+ OutputStream webOut = null;
+ try {
+ LOG.debug("Received a ProcessCoverages request: \n{}", xmlRequest);
+
+ LOG.debug("WCPS: preparing request");
+ ProcessCoveragesRequest processCoverageRequest =
+ wcps.pcPrepare(ConfigManager.RASDAMAN_URL, ConfigManager.RASDAMAN_DATABASE,
+ IOUtils.toInputStream(xmlRequest));
+
+ String query = processCoverageRequest.getRasqlQuery();
+ String mime = processCoverageRequest.getMime();
+
+ LOG.debug("Resulting RasQL query: [{}] {}", mime, query);
+
+ LOG.trace("WCPS: executing request");
+
+ List<byte[]> results = processCoverageRequest.execute();
+
+ LOG.debug("WCPS: setting response mimetype to " + mime);
+ response.setContentType(mime);
+ LOG.trace("WCPS: returning response");
+ webOut = response.getOutputStream();
+ if (results.size() > 0) {
+ webOut.write(results.get(0));
+
+ if (ConfigManager.CCIP_HACK == true) {
+ try {
+ String dir = getServletContext().getRealPath("/");
+ File f = new File(dir + "image.jpeg");
+
+ LOG.info("HACK: Writing image to: " + f.getAbsolutePath());
+ {
+ OutputStream os = new DataOutputStream(new FileOutputStream(f, false));
+ os.write(results.get(0));
+ os.close();
+ LOG.info("HACK: Wrote image successfully !");
+ }
+ } catch (Exception e) {
+ LOG.warn("Error while evaluating CCIP hack: '{}'", e.getMessage());
+ }
+ }
+ } else {
+ LOG.warn("WCPS: Warning! No result returned from rasql query.");
+ }
+
+ LOG.debug("WCPS: done");
+ } catch (WCPSException e) {
+ throw new InternalComponentException(e.getMessage(), e);
+ } catch (SAXException e) {
+ throw new XmlNotValidException(e.getMessage(), e);
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ } finally {
+ if (webOut != null) {
+ try {
+ webOut.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+
+ private void handleTransaction(String request, HttpServletResponse httpResponse) throws WCSException {
+ try {
+ String outputXml = wcst.Transaction(request);
+ PrintWriter out = new PrintWriter(httpResponse.getOutputStream());
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(outputXml);
+ out.flush();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+}
diff --git a/petascope/src/petascope/PetascopeXmlNamespaceMapper.java b/petascope/src/petascope/PetascopeXmlNamespaceMapper.java
new file mode 100644
index 0000000..ccda1cb
--- /dev/null
+++ b/petascope/src/petascope/PetascopeXmlNamespaceMapper.java
@@ -0,0 +1,63 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope;
+
+//~--- JDK imports ------------------------------------------------------------
+import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
+
+public class PetascopeXmlNamespaceMapper extends NamespacePrefixMapper {
+
+ @Override
+ public String getPreferredPrefix(String uri, String id, boolean req) {
+ if (uri.equals("") || uri.equals("http://www.opengis.net/wcs/1.1")) {
+ return "wcs";
+ }
+ if (uri.equals("http://www.w3.org/2001/SMIL20/Language")) {
+ return "smil1";
+ }
+ if (uri.equals("http://www.w3.org/2001/SMIL20/")) {
+ return "smil20";
+ }
+ if (uri.equals("http://www.opengis.net/gml")) {
+ return "gml";
+ }
+ if (uri.equals("http://www.w3.org/1999/xlink")) {
+ return "xlink";
+ }
+ if (uri.equals("http://www.opengis.net/wcs/1.1/ows")) {
+ return "owcs";
+ }
+ if (uri.equals("http://www.opengis.net/ows")
+ || uri.equals("http://www.opengis.net/ows/1.1")) {
+ return "ows";
+ }
+ if (uri.equals("http://www.w3.org/2001/XMLSchema-instance")) {
+ return "xsd";
+ }
+ if (uri.equals("http://www.opengis.net/wcs/1.1/wcst")) {
+ return "wcst";
+ }
+
+ return null;
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/AxisIterator.java b/petascope/src/petascope/wcps/grammar/AxisIterator.java
new file mode 100644
index 0000000..95c9f03
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/AxisIterator.java
@@ -0,0 +1,50 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * AxisIterator
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class AxisIterator implements IParseTreeNode {
+
+ String axis;
+ IntervalExpr interval;
+ String var;
+
+ public AxisIterator(String var, String axis, IntervalExpr interval) {
+ this.var = var;
+ this.axis = axis;
+ this.interval = interval;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<iteratorVar>" + var + "</iteratorVar>";
+ result += "<axis>" + axis + "</axis>";
+ result += interval.toXML();
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/AxisIteratorList.java b/petascope/src/petascope/wcps/grammar/AxisIteratorList.java
new file mode 100644
index 0000000..bc76560
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/AxisIteratorList.java
@@ -0,0 +1,68 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * AxisIteratorList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class AxisIteratorList implements IParseTreeNode {
+
+ private AxisIterator it;
+ private AxisIteratorList next;
+ private String tag;
+
+ public AxisIteratorList(AxisIterator it) {
+ this.it = it;
+ next = null;
+ tag = "";
+ }
+
+ public AxisIteratorList(AxisIterator it, AxisIteratorList n) {
+ this.it = it;
+ next = n;
+ tag = "";
+ }
+
+ public void setTag(String tag) {
+ this.tag = tag;
+ }
+
+ public String toXML() {
+ String result = "";
+ String tag1 = "<" + tag + ">";
+ String tag2 = "</" + tag + ">";
+
+ if (tag.equals("")) {
+ tag1 = tag2 = "";
+ }
+
+ if (next != null) {
+ next.setTag(tag);
+ result += next.toXML();
+ }
+ result += tag1 + it.toXML() + tag2;
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/BooleanExpr.java b/petascope/src/petascope/wcps/grammar/BooleanExpr.java
new file mode 100644
index 0000000..ee359f7
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/BooleanExpr.java
@@ -0,0 +1,57 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * BooleanExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class BooleanExpr implements IParseTreeNode {
+
+ IParseTreeNode e1, e2;
+ String op;
+
+ public BooleanExpr(String op, CoverageExpr cov) {
+ this.op = op;
+ e1 = cov;
+ }
+
+ public BooleanExpr(String op, CoverageExpr cov, IndexExpr i) {
+ this.op = op;
+ e1 = cov;
+ e2 = i;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (op.equalsIgnoreCase("not")) {
+ result = e1.toXML();
+ } else if (op.equalsIgnoreCase("bit")) {
+ result = e1.toXML() + e2.toXML();
+ }
+
+ result = "<" + op + ">" + result + "</" + op + ">";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/BooleanScalarExpr.java b/petascope/src/petascope/wcps/grammar/BooleanScalarExpr.java
new file mode 100644
index 0000000..641659a
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/BooleanScalarExpr.java
@@ -0,0 +1,105 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * BooleanScalarExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class BooleanScalarExpr implements IParseTreeNode {
+
+ String booleanConstant;
+ IParseTreeNode left, right;
+ BooleanScalarExpr leftBooleanScalarExpr, rightBooleanScalarExpr;
+ NumericScalarExpr leftNumericScalar, rightNumericScalar;
+ String node1, node2;
+ String op;
+
+ public BooleanScalarExpr(String bc) {
+ op = null;
+ booleanConstant = bc;
+ }
+
+ public BooleanScalarExpr(String op, BooleanScalarExpr be) {
+ this.op = op;
+ left = be;
+ }
+
+ public BooleanScalarExpr(String op, BooleanScalarExpr lbe, BooleanScalarExpr rbe) {
+ this.op = op;
+ left = lbe;
+ right = rbe;
+ }
+
+ public BooleanScalarExpr(String op, NumericScalarExpr left, NumericScalarExpr right) {
+ this.op = op;
+ this.left = left;
+ this.right = right;
+ }
+
+ public BooleanScalarExpr(String op, StringScalarExpr e1, StringScalarExpr e2) {
+ this.op = op;
+ left = e1;
+ right = e2;
+ }
+
+ public String toXML() {
+ if (op == null) {
+ return "<booleanConstant>" + booleanConstant + "</booleanConstant>";
+ } else if (op.equals("not")) {
+ return "<booleanNot>" + left.toXML() + "</booleanNot>";
+ } else {
+ if (this.left != null) {
+ node1 = this.left.toXML();
+ }
+
+ if (this.right != null) {
+ node2 = this.right.toXML();
+ }
+
+ if (op.equals("and")) {
+ op = "booleanAnd";
+ } else if (op.equals("or")) {
+ op = "booleanOr";
+ } else if (op.equals("xor")) {
+ op = "booleanXor";
+
+ } else if (op.equals("equals")) {
+ op = "booleanEqualNumeric";
+ } else if (op.equals("notEqual")) {
+ op = "booleanNotEqualNumeric";
+ } else if (op.equals("lessThan")) {
+ op = "booleanLessThan";
+ } else if (op.equals("greaterThan")) {
+ op = "booleanGreaterThan";
+ } else if (op.equals("lessOrEqual")) {
+ op = "booleanLessOrEqual";
+ } else if (op.equals("greaterOrEqual")) {
+ op = "booleanGreaterOrEqual";
+ }
+
+ return "<" + op + ">" + node1 + node2 + "</" + op + ">";
+ }
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CastExpr.java b/petascope/src/petascope/wcps/grammar/CastExpr.java
new file mode 100644
index 0000000..86bbf80
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CastExpr.java
@@ -0,0 +1,48 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CastExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class CastExpr implements IParseTreeNode {
+
+ String castType;
+ CoverageExpr coverageExpr;
+
+ public CastExpr(CoverageExpr ce, String ct) {
+ castType = ct;
+ coverageExpr = ce;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<cast>";
+ result += coverageExpr.toXML();
+ result += "<type>" + castType + "</type>";
+ result += "</cast>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ComplexConst.java b/petascope/src/petascope/wcps/grammar/ComplexConst.java
new file mode 100644
index 0000000..306aad4
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ComplexConst.java
@@ -0,0 +1,51 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ComplexConst
+ * @author: Andrei Aiordachioaie
+ */
+public class ComplexConst {
+
+ String re, im;
+
+ /**
+ * ComplexLit constructor comment.
+ */
+ public ComplexConst() {
+ super();
+ }
+
+ public ComplexConst(String val) {
+ int pos = val.indexOf("+i", 0);
+
+ if (pos != -1) {
+ re = val.substring(0, pos - 1);
+ im = val.substring(pos + 2, val.length());
+ }
+ }
+
+ public String toXML() {
+ return "<complexConstant><re>" + re + "</re><im>" + im + "</im></complexConstant";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CondenseExpr.java b/petascope/src/petascope/wcps/grammar/CondenseExpr.java
new file mode 100644
index 0000000..1abb422
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CondenseExpr.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CondenseExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class CondenseExpr implements IParseTreeNode {
+
+ IParseTreeNode expr;
+ String fun;
+
+ public CondenseExpr(IParseTreeNode re) {
+ expr = re;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CondenseOperation.java b/petascope/src/petascope/wcps/grammar/CondenseOperation.java
new file mode 100644
index 0000000..fd3f48e
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CondenseOperation.java
@@ -0,0 +1,58 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CondenseOperationType
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CondenseOperation implements IParseTreeNode {
+
+ String op;
+
+ public CondenseOperation(String op) {
+ this.op = op;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (op.equalsIgnoreCase("+")) {
+ result = "opPlus";
+ } else if (op.equalsIgnoreCase("*")) {
+ result = "opMult";
+ } else if (op.equalsIgnoreCase("max")) {
+ result = "opMax";
+ } else if (op.equalsIgnoreCase("min")) {
+ result = "opMin";
+ } else if (op.equalsIgnoreCase("and")) {
+ result = "opAnd";
+ } else if (op.equalsIgnoreCase("or")) {
+ result = "opOr";
+ }
+
+ result = "<" + result + "/>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ConstantList.java b/petascope/src/petascope/wcps/grammar/ConstantList.java
new file mode 100644
index 0000000..5f7bad5
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ConstantList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * ConstantList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ConstantList implements IParseTreeNode {
+
+ LinkedList<String> list;
+
+ public ConstantList(String val) {
+ list = new LinkedList<String>();
+ list.add(val);
+ }
+
+ public void add(String val) {
+ list.add(val);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<String> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += "<value>" + it.next() + "</value>";
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CoverageConstantExpr.java b/petascope/src/petascope/wcps/grammar/CoverageConstantExpr.java
new file mode 100644
index 0000000..0dd9f8c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CoverageConstantExpr.java
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CoverageConstantExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CoverageConstantExpr implements IParseTreeNode {
+
+ AxisIteratorList alist;
+ ConstantList clist;
+ String name;
+
+ public CoverageConstantExpr(String name, AxisIteratorList alist, ConstantList clist) {
+ this.name = name;
+ this.alist = alist;
+ alist.setTag("axisIterator");
+ this.clist = clist;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<name>" + name + "</name>";
+ result += alist.toXML();
+ result += clist.toXML();
+
+ result = "<const>" + result + "</const>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CoverageConstructorExpr.java b/petascope/src/petascope/wcps/grammar/CoverageConstructorExpr.java
new file mode 100644
index 0000000..6d45238
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CoverageConstructorExpr.java
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CoverageConstructorExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CoverageConstructorExpr implements IParseTreeNode {
+
+ AxisIteratorList alist;
+ ScalarExpr expr;
+ String name;
+
+ public CoverageConstructorExpr(String name, AxisIteratorList alist, ScalarExpr expr) {
+ this.name = name;
+ this.alist = alist;
+ alist.setTag("axisIterator");
+ this.expr = expr;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<name>" + name + "</name>";
+ result += alist.toXML();
+ result += expr.toXML();
+
+ result = "<construct>" + result + "</construct>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CoverageExpr.java b/petascope/src/petascope/wcps/grammar/CoverageExpr.java
new file mode 100644
index 0000000..6c38675
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CoverageExpr.java
@@ -0,0 +1,121 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CoverageExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class CoverageExpr implements IParseTreeNode {
+
+ String coverageName;
+ IParseTreeNode expr, e1, e2;
+ String function;
+ String op;
+
+ public CoverageExpr(IParseTreeNode n) {
+ expr = n;
+ function = "child";
+ }
+
+ public CoverageExpr(String n) {
+ coverageName = n;
+ function = "coverage";
+ }
+
+ /* Unary Induced Expressions */
+ public CoverageExpr(String op, CoverageExpr ce) {
+ expr = ce;
+ function = "unaryOp";
+ this.op = op;
+ }
+
+ public CoverageExpr(String op, CoverageExpr e1, CoverageExpr e2) {
+ function = "binaryOp";
+ this.op = op;
+ this.e1 = e1;
+ this.e2 = e2;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (function.equals("coverage")) {
+ result = "<coverage>" + coverageName + "</coverage>";
+ } else if (function.equals("binaryOp")) {
+ formatOperation();
+ result = "<" + op + ">" + e1.toXML() + e2.toXML() + "</" + op + ">";
+ } else if (function.equals("unaryOp")) {
+ formatOperation();
+ if (op.equals("plus")) {
+ op = "unaryPlus";
+ }
+ if (op.equals("minus")) {
+ op = "unaryMinus";
+ }
+ result = "<" + op + ">" + expr.toXML() + "</" + op + ">";
+ } else if (function.equals("child")) {
+ result = expr.toXML();
+ }
+
+ return result;
+ }
+
+ private void formatOperation() {
+ if (op.equals("+")) {
+ op = "plus";
+ }
+ if (op.equals("-")) {
+ op = "minus";
+ }
+ if (op.equals("*")) {
+ op = "mult";
+ }
+ if (op.equals("/")) {
+ op = "div";
+ }
+
+ // AND, OR, XOR stay the same
+
+ if (op.equals("=")) {
+ op = "equals";
+ }
+ if (op.equals("<")) {
+ op = "lessThan";
+ }
+ if (op.equals(">")) {
+ op = "greaterThan";
+ }
+ if (op.equals("<=")) {
+ op = "lessOrEqual";
+ }
+ if (op.equals(">=")) {
+ op = "greaterOrEqual";
+ }
+ if (op.equals("!=")) {
+ op = "notEqual";
+ }
+
+ // OVERLAY stays the same
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CoverageList.java b/petascope/src/petascope/wcps/grammar/CoverageList.java
new file mode 100644
index 0000000..18ae542
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CoverageList.java
@@ -0,0 +1,62 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CoverageList class represents a CoverageList.
+ * Creation date: (3/3/2003 2:52:55 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class CoverageList implements IParseTreeNode {
+
+ private String coverageName;
+ private CoverageList next;
+
+ public CoverageList(String c) {
+ coverageName = c;
+ next = null;
+ }
+
+ public CoverageList(String c, CoverageList l) {
+ coverageName = c;
+ next = l;
+ }
+
+ public String toXML() {
+ String result = "<coverageName>" + coverageName + "</coverageName>";
+
+ if (next != null) {
+ result += next.toXML();
+ }
+
+ return result;
+ }
+
+ public String toString() {
+ String result = coverageName;
+ if (next != null) {
+ result += next.toString();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CrsList.java b/petascope/src/petascope/wcps/grammar/CrsList.java
new file mode 100644
index 0000000..4af5903
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CrsList.java
@@ -0,0 +1,58 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * CrsList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CrsList implements IParseTreeNode {
+
+ LinkedList<String> list;
+
+ public CrsList() {
+ list = new LinkedList<String>();
+ }
+
+ public CrsList(String crs) {
+ list = new LinkedList<String>();
+ list.add(crs);
+ }
+
+ public void add(String crs) {
+ list.add(crs);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<String> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += "<crs>" + it.next() + "</crs>";
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/CrsTransformExpr.java b/petascope/src/petascope/wcps/grammar/CrsTransformExpr.java
new file mode 100644
index 0000000..f77c8a7
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/CrsTransformExpr.java
@@ -0,0 +1,50 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * CrsTransformExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CrsTransformExpr implements IParseTreeNode {
+
+ IParseTreeNode e1, e2, e3;
+
+ public CrsTransformExpr(CoverageExpr expr, DimensionIntervalList list1,
+ FieldInterpolationList list2) {
+ e1 = expr;
+ e2 = list1;
+ e3 = list2;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += e1.toXML();
+ result += e2.toXML();
+ result += e3.toXML();
+
+ result = "<crsTransform>" + result + "</crsTransform>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionIntervalElement.java b/petascope/src/petascope/wcps/grammar/DimensionIntervalElement.java
new file mode 100644
index 0000000..3037dc5
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionIntervalElement.java
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * DimensionIntervalElement
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionIntervalElement implements IParseTreeNode {
+
+ String axis;
+ String crs;
+ DimensionIntervalExpr expr;
+
+ public DimensionIntervalElement(String a) {
+ axis = a;
+ }
+
+ public void setCrs(String c) {
+ crs = c;
+ }
+
+ public void setIntervalExpr(DimensionIntervalExpr e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<axis>" + axis + "</axis>";
+
+ if (crs != null) {
+ result += "<srsName>" + crs + "</srsName>";
+ }
+
+ result += expr.toXML();
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionIntervalExpr.java b/petascope/src/petascope/wcps/grammar/DimensionIntervalExpr.java
new file mode 100644
index 0000000..2036041
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionIntervalExpr.java
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * DimensionIntervalExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionIntervalExpr implements IParseTreeNode {
+
+ IParseTreeNode e1, e2;
+ String fun;
+ String str;
+
+ public DimensionIntervalExpr(ScalarExpr exp1, ScalarExpr exp2) {
+ fun = "scalars";
+ e1 = exp1;
+ e2 = exp2;
+ }
+
+ public DimensionIntervalExpr(String cov, String axis, String crs) {
+ fun = "domain metadata";
+ str = "<coverage>" + cov + "</coverage>";
+ str += "<axis>" + axis + "</axis>";
+ str += "<crs>" + crs + "</crs>";
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (fun.equals("scalars")) {
+ result += "<lowerBound>" + e1.toXML() + "</lowerBound>";
+ result += "<upperBound>" + e2.toXML() + "</upperBound>";
+ } else if (fun.equals("domain metadata")) {
+ result = str;
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionIntervalList.java b/petascope/src/petascope/wcps/grammar/DimensionIntervalList.java
new file mode 100644
index 0000000..5a98f25
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionIntervalList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * DimensionIntervalList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionIntervalList implements IParseTreeNode {
+
+ LinkedList<DimensionIntervalElement> list;
+
+ public DimensionIntervalList(DimensionIntervalElement e) {
+ list = new LinkedList();
+ list.add(e);
+ }
+
+ public void add(DimensionIntervalElement meth) {
+ list.add(meth);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<DimensionIntervalElement> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionPointElement.java b/petascope/src/petascope/wcps/grammar/DimensionPointElement.java
new file mode 100644
index 0000000..70f9c57
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionPointElement.java
@@ -0,0 +1,59 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * DimensionPointElement
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionPointElement implements IParseTreeNode {
+
+ String axis;
+ String crs;
+ ScalarExpr point;
+
+ public DimensionPointElement(String a, ScalarExpr dp) {
+ axis = a;
+ point = dp;
+ }
+
+ public DimensionPointElement(String a, String c, ScalarExpr dp) {
+ axis = a;
+ crs = c;
+ point = dp;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<axis>" + axis + "</axis>";
+
+ if (crs != null) {
+ result += "<srsName>" + crs + "</srsName>";
+ }
+
+ result += "<slicingPosition>" + point.toXML() + "</slicingPosition>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DimensionPointList.java b/petascope/src/petascope/wcps/grammar/DimensionPointList.java
new file mode 100644
index 0000000..d07a233
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DimensionPointList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * DimensionPointList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DimensionPointList implements IParseTreeNode {
+
+ LinkedList<DimensionPointElement> list;
+
+ public DimensionPointList(DimensionPointElement e) {
+ list = new LinkedList();
+ list.add(e);
+ }
+
+ public void add(DimensionPointElement meth) {
+ list.add(meth);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<DimensionPointElement> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/DomainExpr.java b/petascope/src/petascope/wcps/grammar/DomainExpr.java
new file mode 100644
index 0000000..f8c6e91
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/DomainExpr.java
@@ -0,0 +1,47 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * DomainExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class DomainExpr implements IParseTreeNode {
+
+ String var, axis, crs;
+
+ public DomainExpr(String v, String a, String c) {
+ var = v;
+ axis = a;
+ crs = c;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<coverage>" + var + "</coverage>";
+ result += "<axis>" + axis + "</axis>";
+ result += "<crs>" + crs + "</crs>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/EncodedCoverageExpr.java b/petascope/src/petascope/wcps/grammar/EncodedCoverageExpr.java
new file mode 100644
index 0000000..7eb615f
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/EncodedCoverageExpr.java
@@ -0,0 +1,77 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * EncodedCoverageExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class EncodedCoverageExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String extraParams;
+ String format;
+ boolean store;
+
+ public EncodedCoverageExpr(CoverageExpr ce, String fn) {
+ expr = ce;
+ // remove double quotes
+ if (fn.getBytes()[0] == '"' && fn.getBytes()[fn.length() - 1] == '"') {
+ format = fn.substring(1, fn.length() - 1);
+ } else {
+ format = fn;
+ }
+
+ extraParams = null;
+ store = false;
+ }
+
+ public void setParams(String params) {
+ extraParams = params;
+ }
+
+ public void setStoreFlag() {
+ store = true;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (store) {
+ result = "<encode store=\"true\">";
+ } else {
+ result = "<encode store=\"false\">";
+ }
+
+ result += expr.toXML();
+ result += "<format>" + format + "</format>";
+
+ if (extraParams != null) {
+ result += "<extraParameters>" + extraParams + "</extraParameters>";
+ }
+
+ result += "</encode>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ExponentialExpr.java b/petascope/src/petascope/wcps/grammar/ExponentialExpr.java
new file mode 100644
index 0000000..e661624
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ExponentialExpr.java
@@ -0,0 +1,47 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ExponentialExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ExponentialExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ String expOperator;
+
+ public ExponentialExpr(String op, CoverageExpr ce) {
+ expOperator = op;
+ coverageExpr = ce;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<" + expOperator + ">";
+ result += coverageExpr.toXML();
+ result += "</" + expOperator + ">";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ExtendExpr.java b/petascope/src/petascope/wcps/grammar/ExtendExpr.java
new file mode 100644
index 0000000..ec94989
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ExtendExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ExtendExpr
+ * Creation date: (8/2/2008)
+ * @author: Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ExtendExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ DimensionIntervalList intervalList;
+
+ public ExtendExpr(CoverageExpr ce, DimensionIntervalList apl) {
+ coverageExpr = ce;
+ intervalList = apl;
+ }
+
+ public String toXML() {
+ return "<extend>" + coverageExpr.toXML() + intervalList.toXML() + "</extend>";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/FieldInterpolationElement.java b/petascope/src/petascope/wcps/grammar/FieldInterpolationElement.java
new file mode 100644
index 0000000..8499496
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/FieldInterpolationElement.java
@@ -0,0 +1,44 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * FieldInterpolationElement
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class FieldInterpolationElement implements IParseTreeNode {
+
+ String name;
+ IParseTreeNode node;
+
+ public FieldInterpolationElement(String name, InterpolationMethod method) {
+ this.name = name;
+ node = method;
+ }
+
+ public String toXML() {
+ String result = "<name>" + name + "</name>" + node.toXML();
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/FieldInterpolationList.java b/petascope/src/petascope/wcps/grammar/FieldInterpolationList.java
new file mode 100644
index 0000000..ea5f021
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/FieldInterpolationList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * FieldInterpolationList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class FieldInterpolationList implements IParseTreeNode {
+
+ LinkedList<FieldInterpolationElement> list;
+
+ public FieldInterpolationList(FieldInterpolationElement e) {
+ list = new LinkedList();
+ list.add(e);
+ }
+
+ public void add(FieldInterpolationElement meth) {
+ list.add(meth);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<FieldInterpolationElement> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ForClause.java b/petascope/src/petascope/wcps/grammar/ForClause.java
new file mode 100644
index 0000000..6cbdf8d
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ForClause.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ForClause
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ForClause implements IParseTreeNode {
+
+ ForClauseElements forClauseElements;
+
+ public ForClause(ForClauseElements fce) {
+ forClauseElements = fce;
+ }
+
+ public String toXML() {
+ return forClauseElements.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ForClauseElements.java b/petascope/src/petascope/wcps/grammar/ForClauseElements.java
new file mode 100644
index 0000000..a152348
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ForClauseElements.java
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ForClauseElements
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ForClauseElements implements IParseTreeNode {
+
+ CoverageList coverageList;
+ ForClauseElements next;
+ String var;
+
+ public ForClauseElements(String v, CoverageList c) {
+ var = v;
+ coverageList = c;
+ }
+
+ public ForClauseElements(String v, CoverageList c, ForClauseElements next) {
+ var = v;
+ coverageList = c;
+ this.next = next;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<coverageIterator>";
+ result += "<iteratorVar>" + var + "</iteratorVar>";
+ result += coverageList.toXML();
+ result += "</coverageIterator>";
+
+ if (next != null) {
+ result += next.toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/GeneralCondenseExpr.java b/petascope/src/petascope/wcps/grammar/GeneralCondenseExpr.java
new file mode 100644
index 0000000..a5d8dcd
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/GeneralCondenseExpr.java
@@ -0,0 +1,67 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * GeneralCondenseExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class GeneralCondenseExpr implements IParseTreeNode {
+
+ AxisIteratorList alist;
+ CondenseOperation op;
+ CoverageExpr using;
+ BooleanScalarExpr where;
+
+ public GeneralCondenseExpr(CondenseOperation op, AxisIteratorList al) {
+ this.op = op;
+ alist = al;
+ alist.setTag("iterator");
+ where = null;
+ using = null;
+ }
+
+ public void setWhere(BooleanScalarExpr bse) {
+ where = bse;
+ }
+
+ public void setUsing(CoverageExpr se) {
+ using = se;
+ }
+
+ public String toXML() {
+ String result = "<condense>";
+
+ result += op.toXML();
+ result += alist.toXML();
+
+ if (where != null) {
+ result += "<where>" + where.toXML() + "</where>";
+ }
+
+ result += using.toXML();
+ result += "</condense>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/IParseTreeNode.java b/petascope/src/petascope/wcps/grammar/IParseTreeNode.java
new file mode 100644
index 0000000..8dd44ad
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/IParseTreeNode.java
@@ -0,0 +1,31 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/* Author: Sorin Stancu-Mara
+Date: 7 FEB 2007
+Interface that all nodes implement to simplify some of the complex nodes
+ */
+public interface IParseTreeNode {
+
+ public String toXML();
+}
diff --git a/petascope/src/petascope/wcps/grammar/ImageCrsDomainMetadataExpr.java b/petascope/src/petascope/wcps/grammar/ImageCrsDomainMetadataExpr.java
new file mode 100644
index 0000000..9cb4e9c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ImageCrsDomainMetadataExpr.java
@@ -0,0 +1,45 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ImageCrsDomainMetadataExpr Group
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ImageCrsDomainMetadataExpr implements IParseTreeNode {
+
+ String axis;
+ CoverageExpr cov;
+ NumericScalarExpr n1, n2;
+
+ public ImageCrsDomainMetadataExpr(String covName, String axis) {
+ this.cov = new CoverageExpr(covName);
+ this.axis = axis;
+ }
+
+ public String toXML() {
+ String result = cov.toXML() + "<axis>" + axis + "</axis>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/IndexExpr.java b/petascope/src/petascope/wcps/grammar/IndexExpr.java
new file mode 100644
index 0000000..bb95b88
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/IndexExpr.java
@@ -0,0 +1,69 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * IndexExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class IndexExpr implements IParseTreeNode {
+
+ String constant;
+ IParseTreeNode e1, e2;
+ String function;
+ String op;
+
+ public IndexExpr(String constant) {
+ function = "constant";
+ this.constant = constant;
+ }
+
+ public IndexExpr(String op, NumericScalarExpr e1) {
+ this.op = op;
+ this.e1 = e1;
+ function = "op1";
+ }
+
+ public IndexExpr(String op, IndexExpr e1, IndexExpr e2) {
+ this.op = op;
+ this.e1 = e1;
+ this.e2 = e2;
+ function = "op2";
+ }
+
+ public String toXML() {
+ String result = "";
+ String tag1 = "<" + op + ">",
+ tag2 = "</" + op + ">";
+
+ if (function.equals("constant")) {
+ result = "<numericConstant>" + constant + "</numericConstant>";
+ } else if (function.equals("op1")) {
+ result = tag1 + e1.toXML() + tag2;
+ } else if (function.equals("op2")) {
+ result = tag1 + e1.toXML() + e2.toXML() + tag2;
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/InterpolationMethod.java b/petascope/src/petascope/wcps/grammar/InterpolationMethod.java
new file mode 100644
index 0000000..0377ed1
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/InterpolationMethod.java
@@ -0,0 +1,45 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * InterpolationMethod
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InterpolationMethod implements IParseTreeNode {
+
+ String interp, resistance;
+
+ public InterpolationMethod(String interp, String resist) {
+ this.interp = interp;
+ this.resistance = resist;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<interpolationMethod>" + interp + "</interpolationMethod>";
+ result += "<nullResistance>" + resistance + "</nullResistance>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/InterpolationMethodList.java b/petascope/src/petascope/wcps/grammar/InterpolationMethodList.java
new file mode 100644
index 0000000..2f0d6fe
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/InterpolationMethodList.java
@@ -0,0 +1,53 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * InterpolationMethodList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InterpolationMethodList implements IParseTreeNode {
+
+ LinkedList<InterpolationMethod> list;
+
+ public InterpolationMethodList() {
+ list = new LinkedList();
+ }
+
+ public void add(InterpolationMethod meth) {
+ list.add(meth);
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<InterpolationMethod> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/IntervalExpr.java b/petascope/src/petascope/wcps/grammar/IntervalExpr.java
new file mode 100644
index 0000000..9bd251a
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/IntervalExpr.java
@@ -0,0 +1,56 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * IntervalExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class IntervalExpr implements IParseTreeNode {
+
+ IParseTreeNode e1, e2;
+ String function;
+
+ public IntervalExpr(IndexExpr n1, IndexExpr n2) {
+ this.e1 = n1;
+ this.e2 = n2;
+ function = "two indexes";
+ }
+
+ public IntervalExpr(String coverage, String axis) {
+ function = "crs metadata";
+ this.e1 = new ImageCrsDomainMetadataExpr(coverage, axis);
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (function.equals("two indexes")) {
+ result = e1.toXML() + e2.toXML();
+ } else if (function.equals("crs metadata")) {
+ result = e1.toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/MetaDataExpr.java b/petascope/src/petascope/wcps/grammar/MetaDataExpr.java
new file mode 100644
index 0000000..7cd39a0
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/MetaDataExpr.java
@@ -0,0 +1,90 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * MetaDataExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class MetaDataExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String field;
+ String function;
+ IParseTreeNode param;
+
+ public MetaDataExpr(DomainExpr dom) {
+ function = "domain";
+ param = dom;
+ }
+
+ // Identifier, ImageCRS, ImageCRSDomain, CrsSet, NullSet
+ public MetaDataExpr(String op, CoverageExpr expr) {
+ function = op;
+ this.expr = expr;
+ }
+
+ // ImageCRSDomain, interpolationDefault, interpolationSet
+ public MetaDataExpr(String op, CoverageExpr expr, String str) {
+ function = op;
+ this.expr = expr;
+ this.field = str;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (function.equalsIgnoreCase("imageCrsDomain")) {
+ result += "<imageCrsDomain>";
+ result += expr.toXML();
+
+ if (field != null) {
+ result += "<axis>" + field + "</axis>";
+ }
+
+ result += "</imageCrsDomain>";
+ } else if (function.equalsIgnoreCase("domain")) {
+ result = "<DomainMetadata>" + param.toXML() + "</DomainMetadata>";
+ } else if (function.equalsIgnoreCase("interpolationDefault")) {
+ result += "<interpolationDefault>";
+ result += expr.toXML();
+ result += "<name>" + param + "</param>";
+ result += "</interpolationDefault>";
+ } else if (function.equalsIgnoreCase("interpolationSet")) {
+ result += "<interpolationSet>";
+ result += expr.toXML();
+ result += "<name>" + param + "</param>";
+ result += "</interpolationSet>";
+ } else if (function.equalsIgnoreCase("identifier")
+ || function.equalsIgnoreCase("imageCRS") || function.equalsIgnoreCase("crsSet")
+ || function.equalsIgnoreCase("nullSet")) {
+ result += "<" + function + ">";
+ result += expr.toXML();
+ result += "</" + function + ">";
+ } else {
+ System.err.println("Unknown MetadataExpr operation: " + function);
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/NumericScalarExpr.java b/petascope/src/petascope/wcps/grammar/NumericScalarExpr.java
new file mode 100644
index 0000000..731cf2c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/NumericScalarExpr.java
@@ -0,0 +1,121 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * NumericScalarExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class NumericScalarExpr implements IParseTreeNode {
+
+ CondenseExpr condense;
+ String constValue;
+ String function;
+ NumericScalarExpr leftNumericScalarExpr, rightNumericScalarExpr;
+
+ public NumericScalarExpr(CondenseExpr c) {
+ condense = c;
+ function = "condense";
+ }
+
+ public NumericScalarExpr(String val) {
+ if (val.contains("+i")) {
+ ComplexConst cc = new ComplexConst(val);
+
+ constValue = cc.toXML();
+ function = "complexConstant";
+ } else {
+ constValue = val;
+ function = "numericConstant";
+ }
+ }
+
+ public NumericScalarExpr(String op, NumericScalarExpr expr) {
+ leftNumericScalarExpr = expr;
+
+ if (op.equals("-")) {
+ function = "numericUnaryMinus";
+ } else
+ if (op.equals("sqrt")) {
+ function = "numericSqrt";
+ } else
+ if (op.equals("abs")) {
+ function = "numericAbs";
+ } else {
+ System.err.println("Unary Operator " + op + " is not recognized!");
+ }
+ }
+
+ public NumericScalarExpr(String varOp, String varName) {
+ if (varOp.equals("var")) {
+ function = "variableRef";
+ constValue = varName;
+ } else {
+ System.err.println("Internal error: this should have been a variable name:" + varName);
+ }
+ }
+
+ public NumericScalarExpr(String op, NumericScalarExpr lbe, NumericScalarExpr rbe) {
+ leftNumericScalarExpr = lbe;
+ rightNumericScalarExpr = rbe;
+
+ if (op.equals("+")) {
+ function = "numericAdd";
+ } else if (op.equals("-")) {
+ function = "numericMinus";
+ } else if (op.equals("*")) {
+ function = "numericMult";
+ } else if (op.equals("/")) {
+ function = "numericDiv";
+ } else {
+ System.err.println("Operator " + op + " is not recognized!");
+ }
+ }
+
+ public String toXML() {
+ String result;
+
+ if (function.equals("complexConstant")) {
+ return constValue;
+ }
+ if (function.equals("condense")) {
+ return condense.toXML();
+ }
+
+ result = "<" + function + ">";
+
+ if (function.equals("numericConstant") || function.equals("variableRef")) {
+ result += constValue;
+ } else {
+ result += leftNumericScalarExpr.toXML();
+
+ if (rightNumericScalarExpr != null) {
+ result += rightNumericScalarExpr.toXML();
+ }
+ }
+
+ result += "</" + function + ">";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ProcessingExpr.java b/petascope/src/petascope/wcps/grammar/ProcessingExpr.java
new file mode 100644
index 0000000..c7aacd3
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ProcessingExpr.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ProcessingExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ProcessingExpr implements IParseTreeNode {
+
+ IParseTreeNode expr;
+
+ public ProcessingExpr(IParseTreeNode e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/RangeConstructorExpr.java b/petascope/src/petascope/wcps/grammar/RangeConstructorExpr.java
new file mode 100644
index 0000000..9bd4612
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/RangeConstructorExpr.java
@@ -0,0 +1,59 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * RangeConstructorExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RangeConstructorExpr implements IParseTreeNode {
+
+ LinkedList<RangeConstructorTerm> list;
+
+ public RangeConstructorExpr() {
+ list = new LinkedList();
+ }
+
+ public RangeConstructorExpr(String field, CoverageExpr expr) {
+ this();
+ add(field, expr);
+ }
+
+ public void add(String field, CoverageExpr expr) {
+ list.add(new RangeConstructorTerm(field, expr));
+ }
+
+ public String toXML() {
+ String result = "";
+ Iterator<RangeConstructorTerm> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += it.next().toXML();
+ }
+
+ result = "<rangeConstructor>" + result + "</rangeConstructor>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/RangeConstructorTerm.java b/petascope/src/petascope/wcps/grammar/RangeConstructorTerm.java
new file mode 100644
index 0000000..3cc2a4a
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/RangeConstructorTerm.java
@@ -0,0 +1,48 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * RangeConstructorTerm, part of a RangeConstructorExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RangeConstructorTerm implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String field;
+
+ public RangeConstructorTerm(String f, CoverageExpr c) {
+ field = f;
+ expr = c;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<field>" + field + "</field>";
+ result += expr.toXML();
+
+ result = "<component>" + result + "</component>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/RangeExpr.java b/petascope/src/petascope/wcps/grammar/RangeExpr.java
new file mode 100644
index 0000000..227de44
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/RangeExpr.java
@@ -0,0 +1,53 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * RangeExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RangeExpr implements IParseTreeNode {
+
+ String xml;
+
+ public RangeExpr() {
+ this.xml = "";
+ }
+
+ public RangeExpr(String field, ScalarExpr expr) {
+ this();
+ add(field, expr);
+ }
+
+ public void add(String field, ScalarExpr expr) {
+ String tmp = "";
+
+ tmp += "<field>" + field + "</field>";
+ tmp += expr.toXML();
+ xml += "<component>" + tmp + "</component>";
+ }
+
+ public String toXML() {
+ return xml;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/RangeExprList.java b/petascope/src/petascope/wcps/grammar/RangeExprList.java
new file mode 100644
index 0000000..68046ca
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/RangeExprList.java
@@ -0,0 +1,54 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+import java.util.*;
+
+/**
+ * RangeExprList
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RangeExprList implements IParseTreeNode {
+
+ LinkedList<RangeExpr> list;
+
+ public RangeExprList() {
+ list = new LinkedList();
+ }
+
+ public void add(RangeExpr expr) {
+ list.add(expr);
+ }
+
+ public String toXML() {
+ String result = "";
+
+ Iterator<RangeExpr> it = list.iterator();
+
+ while (it.hasNext()) {
+ result += "<null>" + it.next().toXML() + "</null>";
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ReduceExpr.java b/petascope/src/petascope/wcps/grammar/ReduceExpr.java
new file mode 100644
index 0000000..3a14b75
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ReduceExpr.java
@@ -0,0 +1,44 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ReduceExpr
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ReduceExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String op;
+
+ public ReduceExpr(String op, CoverageExpr e) {
+ this.op = op;
+ this.expr = e;
+ }
+
+ public String toXML() {
+ String result = "<reduce><" + op + ">" + expr.toXML() + "</" + op + "></reduce>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ReturnClause.java b/petascope/src/petascope/wcps/grammar/ReturnClause.java
new file mode 100644
index 0000000..f2c1503
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ReturnClause.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ReturnClause
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ReturnClause implements IParseTreeNode {
+
+ IParseTreeNode expr;
+
+ public ReturnClause(IParseTreeNode e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ScalarExpr.java b/petascope/src/petascope/wcps/grammar/ScalarExpr.java
new file mode 100644
index 0000000..4ed4204
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ScalarExpr.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ScalarExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ScalarExpr implements IParseTreeNode {
+
+ IParseTreeNode expr;
+
+ public ScalarExpr(IParseTreeNode e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/ScaleExpr.java b/petascope/src/petascope/wcps/grammar/ScaleExpr.java
new file mode 100644
index 0000000..ce533dc
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/ScaleExpr.java
@@ -0,0 +1,57 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * ScaleExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class ScaleExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ FieldInterpolationList interpMethods;
+ DimensionIntervalList intervalList;
+
+ public ScaleExpr(CoverageExpr ce, DimensionIntervalList ail)
+ {
+ coverageExpr = ce;
+ intervalList = ail;
+ }
+
+ public void addInterpolationList(FieldInterpolationList iml)
+ {
+ interpMethods = iml;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += coverageExpr.toXML() + intervalList.toXML();
+ if (interpMethods != null)
+ result += interpMethods.toXML();
+
+ result = "<scale>" + result + "</scale>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/SelectExpr.java b/petascope/src/petascope/wcps/grammar/SelectExpr.java
new file mode 100644
index 0000000..4322eb3
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/SelectExpr.java
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * SelectExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class SelectExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ String field;
+
+ public SelectExpr(CoverageExpr ce, String se) {
+ coverageExpr = ce;
+ field = se;
+ }
+
+ public SelectExpr(CoverageExpr ce, int no) {
+ coverageExpr = ce;
+ field = String.valueOf(no);
+ }
+
+ public String toXML() {
+ String result = "<fieldSelect>";
+
+ result += coverageExpr.toXML();
+ result += "<field><name>" + field + "</name></field>";
+ result += "</fieldSelect>";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/SetMetaDataExpr.java b/petascope/src/petascope/wcps/grammar/SetMetaDataExpr.java
new file mode 100644
index 0000000..16dccdb
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/SetMetaDataExpr.java
@@ -0,0 +1,118 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * SetMetaDataExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class SetMetaDataExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ String field;
+ String function;
+ IParseTreeNode param;
+
+ // Set Crs Set
+ public SetMetaDataExpr(String op, CoverageExpr expr, CrsList clist) {
+ function = op;
+ this.expr = expr;
+ this.param = clist;
+ }
+
+ // Set Null Set
+ public SetMetaDataExpr(String op, CoverageExpr expr, RangeExprList param) {
+ function = op;
+ this.expr = expr;
+ this.param = param;
+ }
+
+ // Set Identifier
+ public SetMetaDataExpr(String op, CoverageExpr expr, String constant) {
+ function = op;
+ this.expr = expr;
+ this.field = constant;
+ }
+
+ // Set Interpolation Default
+ public SetMetaDataExpr(String op, CoverageExpr expr, InterpolationMethod param,
+ String field) {
+ function = op;
+ this.expr = expr;
+ this.param = param;
+ this.field = field;
+ }
+
+ // Set Interpolation Set
+ public SetMetaDataExpr(String op, CoverageExpr expr, InterpolationMethodList param,
+ String field) {
+ function = op;
+ this.expr = expr;
+ this.param = param;
+ this.field = field;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ if (function.equalsIgnoreCase("setIdentifier")) {
+ result += "<identifier>" + field + "</identifier>";
+ result += expr.toXML();
+
+ result = "<setIdentifier>" + result + "</setIdentifier>";
+ } else if (function.equalsIgnoreCase("setCrsSet")) {
+ result += expr.toXML();
+
+ if (param != null) {
+ result += param.toXML();
+ }
+
+ result = "<setCrsSet>" + result + "</setCrsSet>";
+ } else if (function.equalsIgnoreCase("setNullSet")) {
+ result += expr.toXML();
+
+ if (param != null) {
+ result += param.toXML();
+ }
+
+ result = "<setNullSet>" + result + "</setNullSet>";
+ } else if (function.equalsIgnoreCase("setInterpolationDefault")) {
+ result += expr.toXML();
+ result += "<field>" + field + "</field>";
+ result += param.toXML();
+
+ result = "<setInterpolationDefault>" + result
+ + "</setInterpolationDefault>";
+ } else if (function.equalsIgnoreCase("setInterpolationSet")) {
+ result += expr.toXML();
+ result += "<field>" + field + "</field>";
+ result += param.toXML();
+
+ result = "<setInterpolationSet>" + result + "</setInterpolationSet>";
+ } else {
+ System.err.println("Unknown SetMetadataExpr operation: " + function);
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/SliceExpr.java b/petascope/src/petascope/wcps/grammar/SliceExpr.java
new file mode 100644
index 0000000..72b1e08
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/SliceExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * SliceExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class SliceExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ DimensionPointList list;
+
+ public SliceExpr(CoverageExpr ce, DimensionPointList apl) {
+ expr = ce;
+ list = apl;
+ }
+
+ public String toXML() {
+ return "<slice>" + expr.toXML() + list.toXML() + "</slice>";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/StoreExpr.java b/petascope/src/petascope/wcps/grammar/StoreExpr.java
new file mode 100644
index 0000000..de86441
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/StoreExpr.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/*
+Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+Date: 7 Feb 2007
+ */
+public class StoreExpr implements IParseTreeNode {
+
+ private EncodedCoverageExpr expr;
+
+ public StoreExpr(EncodedCoverageExpr e) {
+ expr = e;
+ expr.setStoreFlag();
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/StringScalarExpr.java b/petascope/src/petascope/wcps/grammar/StringScalarExpr.java
new file mode 100644
index 0000000..2571c12
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/StringScalarExpr.java
@@ -0,0 +1,58 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * @author: Andrei Aiordachioaie
+ */
+public class StringScalarExpr implements IParseTreeNode {
+
+ CoverageExpr cov;
+ String function;
+ String op;
+ String val;
+
+ public StringScalarExpr(String val) {
+ this.val = val;
+ this.function = "stringConstant";
+ }
+
+ public StringScalarExpr(String op, CoverageExpr cov) {
+ this.cov = cov;
+ function = "stringIdentifier";
+ this.op = op;
+ }
+
+ public String toXML() {
+ String result = "<" + function + ">";
+
+ if (function.equals("stringConstant")) {
+ result += val;
+ } else if (function.equals("stringIdentifier")) {
+ result += cov.toXML();
+ }
+
+ result += "</" + function + ">";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/SubsetExpr.java b/petascope/src/petascope/wcps/grammar/SubsetExpr.java
new file mode 100644
index 0000000..8cc6a24
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/SubsetExpr.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * SubsetExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class SubsetExpr implements IParseTreeNode {
+
+ IParseTreeNode expr;
+
+ public SubsetExpr(IParseTreeNode e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return expr.toXML();
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/TrigonometricExpr.java b/petascope/src/petascope/wcps/grammar/TrigonometricExpr.java
new file mode 100644
index 0000000..5cdbb8c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/TrigonometricExpr.java
@@ -0,0 +1,47 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * TrigonometricExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara
+ */
+public class TrigonometricExpr implements IParseTreeNode {
+
+ CoverageExpr coverageExpr;
+ String trigOperator;
+
+ public TrigonometricExpr(String op, CoverageExpr ce) {
+ trigOperator = op;
+ coverageExpr = ce;
+ }
+
+ public String toXML() {
+ String result = "";
+
+ result += "<" + trigOperator + ">";
+ result += coverageExpr.toXML();
+ result += "</" + trigOperator + ">";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/TrimExpr.java b/petascope/src/petascope/wcps/grammar/TrimExpr.java
new file mode 100644
index 0000000..885f21e
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/TrimExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * TrimExpr
+ * Creation date: (3/3/2003 2:28:43 AM)
+ * @author: mattia parigiani, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class TrimExpr implements IParseTreeNode {
+
+ CoverageExpr expr;
+ DimensionIntervalList list;
+
+ public TrimExpr(CoverageExpr ce, DimensionIntervalList al) {
+ expr = ce;
+ list = al;
+ }
+
+ public String toXML() {
+ return "<trim>" + expr.toXML() + list.toXML() + "</trim>";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/VariableList.java b/petascope/src/petascope/wcps/grammar/VariableList.java
new file mode 100644
index 0000000..dd33fda
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/VariableList.java
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/*Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+ * Date: 8 Feb 2008
+ */
+public class VariableList implements IParseTreeNode {
+
+ String axisType, iteratorName;
+ String lo, hi;
+ VariableList next;
+
+ public VariableList(String type, String name, String lo, String hi) {
+ axisType = type;
+ iteratorName = name;
+ this.lo = lo;
+ this.hi = hi;
+ next = null;
+ }
+
+ public VariableList(String type, String name, String lo, String hi, VariableList next) {
+ axisType = type;
+ iteratorName = name;
+ this.lo = lo;
+ this.hi = hi;
+ this.next = next;
+ }
+
+ public String toXML() {
+ String result = "<axisIterator><axisType>" + axisType + "</axisType>"
+ + "<iteratorVar>" + iteratorName + "</iteratorVar>" + "<coord>"
+ + lo + "</coord>" + "<coord>" + hi + "</coord></axisIterator>";
+
+ if (next != null) {
+ result += next.toXML();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/WCPSRequest.java b/petascope/src/petascope/wcps/grammar/WCPSRequest.java
new file mode 100644
index 0000000..5e3fc63
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/WCPSRequest.java
@@ -0,0 +1,76 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/**
+ * WCPSRequest class represents a WCPSRequest.
+ * Creation date: (3/3/2003 2:52:55 AM)
+ * @author: *, Sorin Stancu-Mara, Andrei Aiordachioaie
+ */
+public class WCPSRequest implements IParseTreeNode {
+
+ private ForClause forClause;
+ private ReturnClause returnClause;
+ private WhereClause whereClause;
+
+ public WCPSRequest() {
+ super();
+ }
+
+ public WCPSRequest(ForClauseElements f) {
+ forClause = new ForClause(f);
+ whereClause = null;
+ returnClause = null;
+ }
+
+ public void setWhere(WhereClause w) {
+ whereClause = w;
+ }
+
+ public void setReturn(ReturnClause r) {
+ returnClause = r;
+ }
+
+ public String toXML() {
+ String result = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
+
+ result +=
+ "<ProcessCoveragesRequest xmlns=\"http://www.opengis.net/wcps/1.0\" service=\"WCPS\" "
+ + "version=\"1.0.0\">\n";
+ result += "<query><xmlSyntax>";
+
+ result += forClause.toXML();
+
+ if (whereClause != null) {
+ result += whereClause.toXML();
+ }
+
+ if (returnClause != null) {
+ result += returnClause.toXML();
+ }
+
+ result += "</xmlSyntax></query>";
+ result += "</ProcessCoveragesRequest>";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/WhereClause.java b/petascope/src/petascope/wcps/grammar/WhereClause.java
new file mode 100644
index 0000000..bc4c897
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/WhereClause.java
@@ -0,0 +1,38 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.grammar;
+
+/* Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+Date: 7 Feb 2007
+ */
+public class WhereClause implements IParseTreeNode {
+
+ private BooleanScalarExpr expr;
+
+ public WhereClause(BooleanScalarExpr e) {
+ expr = e;
+ }
+
+ public String toXML() {
+ return "<where>" + expr.toXML() + "</where>";
+ }
+}
diff --git a/petascope/src/petascope/wcps/grammar/wcps.g b/petascope/src/petascope/wcps/grammar/wcps.g
new file mode 100644
index 0000000..f00d1b5
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/wcps.g
@@ -0,0 +1,500 @@
+/*
+Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+History:
+07 02 2007 smsorin Updated to WCPS 1.0.0
+27 01 2009 smsorin Moved to ANTLR
+11 02 2009 andreia Updated to new grammar (spec 08-068r2)
+13 02 2009 andreia Fixed small bugs in grammar. Now it can fully compile.
+21 04 2009 andreia Removed comments.
+04 05 2009 andreia Fixed bugs in integer declaration.
+19 05 2009 andreia Fixed some other weird bugs. Grammar passes all tests now.
+28 05 2009 andreia Updated class actions names.
+02 06 2009 andreia Removed brackets around "and" binary operator in CoverageExpr
+03 06 2009 andreia Complex expressions introduced in the "using" clause of general condense operations
+05 08 2009 andreia Fixed definition of integer and floating-point numbers.
+31 03 2010 andreia Added "sqrt" operation for scalar expressions
+*/
+grammar wcps;
+options{
+backtrack=true;
+memoize=true;
+k=2;
+language=Java;
+output=AST;
+}
+@header
+{package petascope.wcps.grammar;}
+@lexer::header
+{package petascope.wcps.grammar;}
+
+/* Parser Rules */
+
+wcpsRequest returns[WCPSRequest value]
+ : e1=forClause { $value= new WCPSRequest($e1.value); }
+ (e2=whereClause { $value.setWhere($e2.value); } )?
+ e3=returnClause { $value.setReturn($e3.value); }
+ ;
+forClause returns[ForClauseElements value]
+ : FOR v=coverageVariable IN LPAREN list=coverageList RPAREN
+ { $value = new ForClauseElements($v.value, $list.value); }
+ (COMMA v=coverageVariable IN LPAREN list=coverageList RPAREN
+ { $value = new ForClauseElements($v.value, $list.value, $value); })*
+ ;
+whereClause returns[WhereClause value]
+ : WHERE e1=booleanScalarExpr { $value = new WhereClause($e1.value); }
+ ;
+returnClause returns[ReturnClause value]
+ : RETURN e1=processingExpr { $value = new ReturnClause($e1.value); }
+ ;
+coverageList returns[CoverageList value]
+ : cname=coverageName { $value = new CoverageList($cname.value); }
+ (COMMA next=coverageName { $value = new CoverageList($next.value, $value); })*
+ ;
+processingExpr returns[ProcessingExpr value]
+ : e1=encodedCoverageExpr { $value = new ProcessingExpr($e1.value); }
+ | e2=storeExpr { $value = new ProcessingExpr($e2.value); }
+ | e3=scalarExpr { $value = new ProcessingExpr($e3.value); }
+ ;
+encodedCoverageExpr returns[EncodedCoverageExpr value]
+ : ENCODE LPAREN cov=coverageExpr COMMA format=stringConstant { $value = new EncodedCoverageExpr($cov.value, $format.text); }
+ (COMMA params=stringConstant { $value.setParams($params.text); })? RPAREN
+ ;
+storeExpr returns[StoreExpr value]
+ : STORE LPAREN e1=encodedCoverageExpr RPAREN { $value = new StoreExpr($e1.value); }
+ ;
+coverageExpr returns[CoverageExpr value]
+ : e1=coverageLogicTerm { $value = $e1.value; }
+ (op=(OR|XOR) e2=coverageLogicTerm { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageLogicTerm returns[CoverageExpr value]
+ : e1=coverageLogicFactor { $value = $e1.value; }
+ (op=AND e2=coverageLogicFactor { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageLogicFactor returns[CoverageExpr value]
+ : e1=coverageArithmeticExpr {$value = $e1.value;}
+ (op=(EQUALS|NOTEQUALS|LT|GT|LTE|GTE) e2=coverageArithmeticExpr { $value = new CoverageExpr($op.text, $e1.value, $e2.value); } )?
+ ;
+coverageArithmeticExpr returns[CoverageExpr value]
+ : e1=coverageArithmeticTerm {$value = $e1.value; }
+ (op=(PLUS|MINUS) e2=coverageArithmeticTerm { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageArithmeticTerm returns[CoverageExpr value]
+ : e1=coverageArithmeticFactor {$value = $e1.value; }
+ (op=(MULT|DIVIDE) e2=coverageArithmeticFactor { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageArithmeticFactor returns[CoverageExpr value]
+ : e1=coverageValue { $value = $e1.value; }
+ (op=OVERLAY e2=coverageValue { $value = new CoverageExpr($op.text, $value, $e2.value); } )*
+ ;
+coverageValue returns[CoverageExpr value]
+ : e5=subsetExpr { $value = new CoverageExpr($e5.value); }
+ | e2=unaryInducedExpr { $value = $e2.value; }
+ | e4=scaleExpr { $value = new CoverageExpr($e4.value); }
+ | e3=crsTransformExpr { $value = new CoverageExpr($e3.value); }
+ | e1=coverageAtom { $value = $e1.value; }
+ ;
+coverageAtom returns[CoverageExpr value]
+ : e2=scalarExpr { $value = new CoverageExpr($e2.value); }
+ | e1=coverageVariable { $value = new CoverageExpr($e1.value); }
+ | LPAREN e7=coverageExpr RPAREN { $value = new CoverageExpr($e7.value); }
+ | e3=coverageConstantExpr { $value = new CoverageExpr($e3.value); }
+ | e4=coverageConstructorExpr { $value = new CoverageExpr($e4.value); }
+ | e5=setMetaDataExpr { $value = new CoverageExpr($e5.value); }
+ | e6=rangeConstructorExpr { $value = new CoverageExpr($e6.value); }
+ ;
+scalarExpr returns[ScalarExpr value]
+ : e1=metaDataExpr { $value = new ScalarExpr($e1.value); }
+ | e2=condenseExpr { $value = new ScalarExpr($e2.value); }
+ | e3=booleanScalarExpr { $value = new ScalarExpr($e3.value); }
+ | e4=numericScalarExpr { $value = new ScalarExpr($e4.value); }
+ | e5=stringScalarExpr { $value = new ScalarExpr($e5.value); }
+ | LPAREN e6=scalarExpr RPAREN { $value = $e6.value; }
+ ;
+metaDataExpr returns[MetaDataExpr value]
+ : op=IDENTIFIER LPAREN e1=coverageExpr RPAREN { $value = new MetaDataExpr($op.text, $e1.value); }
+ | op=IMAGECRS LPAREN e1=coverageExpr RPAREN { $value = new MetaDataExpr($op.text, $e1.value); }
+ | op=IMAGECRSDOMAIN LPAREN e1=coverageExpr (COMMA e2=axisName)? RPAREN { $value = new MetaDataExpr($op.text, $e1.value, $e2.value); }
+ | op=CRSSET LPAREN e1=coverageExpr RPAREN { $value = new MetaDataExpr($op.text, $e1.value); }
+ | de=domainExpr { $value = new MetaDataExpr($de.value); }
+ | op=NULLSET LPAREN e1=coverageExpr RPAREN { $value = new MetaDataExpr($op.text,$e1.value); }
+ | op=INTERPOLATIONDEFAULT LPAREN e1=coverageExpr COMMA f1=fieldName RPAREN { $value = new MetaDataExpr($op.text, $e1.value, $f1.value); }
+ | op=INTERPOLATIONSET LPAREN e1=coverageExpr COMMA f1=fieldName RPAREN { $value = new MetaDataExpr($op.text, $e1.value, $f1.value); }
+ ;
+domainExpr returns[DomainExpr value]
+ : DOMAIN LPAREN var=coverageVariable COMMA axis=axisName COMMA crs=crsName RPAREN { $value = new DomainExpr($var.value, $axis.value, $crs.value); }
+ ;
+condenseExpr returns[CondenseExpr value]
+ : e1=reduceExpr { $value = new CondenseExpr($e1.value); }
+ | e2=generalCondenseExpr { $value = new CondenseExpr($e2.value); }
+ ;
+reduceExpr returns[ReduceExpr value]
+ : op=(ALL|SOME|COUNT|ADD|AVG|MIN|MAX) LPAREN e1=coverageExpr RPAREN { $value = new ReduceExpr($op.text, $e1.value); }
+ ;
+generalCondenseExpr returns[GeneralCondenseExpr value]
+ : CONDENSE op=condenseOpType OVER ail=axisIteratorList { $value = new GeneralCondenseExpr($op.value, $ail.value); }
+ (WHERE cond=booleanScalarExpr { $value.setWhere($cond.value); })?
+ USING ce=coverageExpr { $value.setUsing($ce.value); }
+ ;
+axisIteratorList returns[AxisIteratorList value]
+ : vn=variableName an=axisName LPAREN ie=intervalExpr RPAREN
+ { $value = new AxisIteratorList(new AxisIterator($vn.value, $an.value, $ie.value)); }
+ (COMMA vn2=variableName an2=axisName LPAREN ie2=intervalExpr RPAREN
+ { $value = new AxisIteratorList(new AxisIterator($vn2.value, $an2.value, $ie2.value), $value); })*
+ ;
+intervalExpr returns[IntervalExpr value]
+ : lo=indexExpr COLON hi=indexExpr
+ { $value = new IntervalExpr($lo.value, $hi.value); }
+ | IMAGECRSDOMAIN LPAREN e1=coverageName COMMA e2=axisName RPAREN
+ { $value = new IntervalExpr($e1.value, $e2.value); }
+ ;
+coverageConstantExpr returns[CoverageConstantExpr value]
+ : COVERAGE aname=coverageName OVER iter=axisIteratorList VALUE LIST LT values=constantList GT
+ { $value = new CoverageConstantExpr($aname.value, $iter.value, $values.value); }
+ ;
+constantList returns[ConstantList value]
+ : c=constant { $value = new ConstantList($c.value); } (SEMICOLON c=constant { $value.add($c.value); })*
+ ;
+coverageConstructorExpr returns[CoverageConstructorExpr value]
+ : COVERAGE coverage=coverageName OVER ail=axisIteratorList VALUES se=scalarExpr
+ { $value = new CoverageConstructorExpr($coverage.value, $ail.value, $se.value); }
+ ;
+setMetaDataExpr returns[SetMetaDataExpr value]
+ : op=SETIDENTIFIER LPAREN s=stringConstant COMMA e1=coverageExpr RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $s.value); }
+ | op=SETCRSSET LPAREN e1=coverageExpr COMMA crs=crsList RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $crs.value); }
+ | op=SETNULLSET LPAREN e1=coverageExpr COMMA rel=rangeExprList RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $rel.value); }
+ | op=SETINTERPOLATIONDEFAULT LPAREN e1=coverageExpr COMMA fn=fieldName COMMA im=interpolationMethod RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $im.value, $fn.value); }
+ | op=SETINTERPOLATIONSET LPAREN e1=coverageExpr COMMA fn=fieldName COMMA iml=interpolationMethodList RPAREN
+ { $value = new SetMetaDataExpr($op.text, $e1.value, $iml.value, $fn.value); }
+ ;
+crsList returns[CrsList value]
+ : LBRACE {$value = new CrsList();} (crs=crsName { $value.add($crs.value); } (COMMA crs=crsName { $value.add($crs.value); })* )? RBRACE
+ ;
+rangeExprList returns[RangeExprList value]
+ : LBRACE { $value = new RangeExprList(); } (re1=rangeExpr { $value.add($re1.value); } (COMMA re2=rangeExpr { $value.add($re2.value); })* )? RBRACE
+ ;
+interpolationMethodList returns[InterpolationMethodList value]
+ : LBRACE {$value = new InterpolationMethodList();} (e=interpolationMethod { $value.add($e.value); } (COMMA e=interpolationMethod { $value.add($e.value); })*)? RBRACE
+ ;
+rangeExpr returns[RangeExpr value]
+ : STRUCT LBRACE { $value=new RangeExpr(); }
+ (field=fieldName COLON expr=scalarExpr { $value.add($field.value, $expr.value); }
+ (COMMA field=fieldName COLON expr=scalarExpr { $value.add($field.value, $expr.value); })*
+ )? RBRACE
+ ;
+rangeConstructorExpr returns[RangeConstructorExpr value]
+ : (STRUCT)? LBRACE field=fieldName COLON expr=coverageExpr { $value = new RangeConstructorExpr($field.value, $expr.value); }
+ (SEMICOLON field=fieldName COLON expr=coverageExpr { $value.add($field.value, $expr.value); })* RBRACE
+ ;
+crsTransformExpr returns[CrsTransformExpr value]
+ : CRSTRANSFORM LPAREN e1=coverageExpr COMMA dcl=dimensionIntervalList COMMA fil=fieldInterpolationList RPAREN
+ { $value = new CrsTransformExpr($e1.value, $dcl.value, $fil.value); }
+ ;
+fieldInterpolationList returns[FieldInterpolationList value]
+ : LBRACE elem=fieldInterpolationElement { $value = new FieldInterpolationList($elem.value); }
+ (COMMA elem=fieldInterpolationElement { $value.add($elem.value); }) * RBRACE
+ ;
+fieldInterpolationElement returns[FieldInterpolationElement value]
+ : aname=fieldName method=interpolationMethod { $value = new FieldInterpolationElement($aname.value, $method.value); }
+ ;
+unaryInducedExpr returns[CoverageExpr value]
+ : e6=fieldExpr { $value = new CoverageExpr($e6.value); }
+ | e1=unaryArithmeticExpr { $value = $e1.value; }
+ | e2=exponentialExpr { $value = new CoverageExpr($e2.value); }
+ | e3=trigonometricExpr { $value = new CoverageExpr($e3.value); }
+ | e4=booleanExpr { $value = new CoverageExpr($e4.value); }
+ | e5=castExpr { $value = new CoverageExpr($e5.value); }
+ | e7=rangeConstructorExpr { $value = new CoverageExpr($e7.value); }
+ ;
+unaryArithmeticExpr returns[CoverageExpr value]
+ : op=(MINUS|PLUS) e1=coverageAtom { $value = new CoverageExpr($op.text, $e1.value); }
+ | op=(SQRT|ABS|RE|IM) LPAREN e2=coverageExpr RPAREN { $value = new CoverageExpr($op.text, $e2.value); }
+ ;
+exponentialExpr returns[ExponentialExpr value]
+ : op=(EXP|LOG|LN) LPAREN e1=coverageExpr RPAREN { $value = new ExponentialExpr($op.text, $e1.value); }
+ ;
+trigonometricExpr returns[TrigonometricExpr value]
+ : op=(SIN|COS|TAN|SINH|COSH|TANH|ARCSIN|ARCCOS|ARCTAN) LPAREN e1=coverageExpr RPAREN { $value = new TrigonometricExpr($op.text, $e1.value); }
+ ;
+booleanExpr returns[BooleanExpr value]
+ : op=NOT e1=coverageExpr { $value = new BooleanExpr($op.text, $e1.value); }
+ | op=BIT LPAREN e1=coverageExpr COMMA e2=indexExpr RPAREN { $value = new BooleanExpr($op.text, $e1.value, $e2.value); }
+ ;
+indexExpr returns[IndexExpr value]
+ : e1=indexTerm { $value = $e1.value; }
+ (op=(PLUS|MINUS) e2=indexTerm { $value = new IndexExpr($op.text, $value, $e2.value); })*
+ ;
+indexTerm returns[IndexExpr value]
+ : e1=indexFactor { $value = $e1.value; }
+ ((op=(MULT|DIVIDE) e2=indexFactor { $value = new IndexExpr($op.text, $value, $e2.value); } ))*
+ ;
+indexFactor returns[IndexExpr value]
+ : e=INTEGERCONSTANT { $value = new IndexExpr($e.text); }
+ | op=ROUND LPAREN e1=numericScalarExpr RPAREN { $value = new IndexExpr($op.text, $e1.value); }
+ | (LPAREN e2=indexExpr RPAREN { $value = $e2.value; } )
+ ;
+stringScalarExpr returns[StringScalarExpr value]
+// The first rule should be "metaDataExpr", but currently only a variable "identifier" is allowed.
+ : op=IDENTIFIER LPAREN e1=coverageExpr RPAREN { $value = new StringScalarExpr($op.text, $e1.value); }
+ | e=STRING { $value = new StringScalarExpr($e.text); }
+ ;
+scaleExpr returns[ScaleExpr value]
+ : SCALE LPAREN e1=coverageExpr COMMA dil=dimensionIntervalList { $value = new ScaleExpr($e1.value, $dil.value); }
+ (COMMA fil=fieldInterpolationList {$value.addInterpolationList($fil.value); } )?
+ RPAREN
+
+ ;
+subsetExpr returns[SubsetExpr value]
+ : e1=trimExpr { $value = new SubsetExpr($e1.value); }
+ | e2=sliceExpr { $value = new SubsetExpr($e2.value); }
+ | e3=extendExpr { $value = new SubsetExpr($e3.value); }
+ ;
+trimExpr returns[TrimExpr value]
+ : e1=coverageAtom LBRACKET dil=dimensionIntervalList RBRACKET { $value = new TrimExpr($e1.value, $dil.value); }
+ | TRIM LPAREN e2=coverageExpr COMMA LBRACE dil=dimensionIntervalList RBRACE RPAREN { $value = new TrimExpr($e2.value, $dil.value); }
+ ;
+sliceExpr returns[SliceExpr value]
+ : e1=coverageAtom LBRACKET dpl=dimensionPointList RBRACKET { $value = new SliceExpr($e1.value, $dpl.value); }
+ | SLICE LPAREN e2=coverageExpr COMMA LBRACE dpl=dimensionPointList RBRACE RPAREN { $value = new SliceExpr($e2.value, $dpl.value); }
+ ;
+extendExpr returns[ExtendExpr value]
+ : EXTEND LPAREN e1=coverageExpr COMMA dil=dimensionIntervalList RPAREN { $value = new ExtendExpr($e1.value, $dil.value); }
+ ;
+castExpr returns[CastExpr value]
+ : LPAREN e1=rangeType RPAREN e2=coverageExpr { $value = new CastExpr($e2.value, $e1.value); }
+ ;
+rangeType returns[String value]
+ : type=(BOOLEAN|CHAR|SHORT|LONG|FLOAT|DOUBLE|COMPLEX|COMPLEX2) { $value = new String($type.text); }
+ | UNSIGNED type=(CHAR|SHORT|LONG) { $value = new String("unsigned " + $type.text); }
+ ;
+fieldExpr returns[SelectExpr value]
+ : e1=coverageAtom DOT e2=fieldName { $value = new SelectExpr($e1.value, $e2.value); }
+ ;
+// NOTE: The following boolean rules are equivalent to the grammar rules in document 08-068r2
+// They have been rewritten in order to prioritize the boolean operators
+booleanScalarExpr returns[BooleanScalarExpr value]
+ : e1=booleanScalarTerm { $value = $e1.value; }
+ (op=(OR|XOR) e2=booleanScalarTerm { $value = new BooleanScalarExpr($op.text, $value, $e2.value);})*
+ ;
+booleanScalarTerm returns[BooleanScalarExpr value]
+ : e1=booleanScalarNegation { $value = $e1.value; }
+ (op=AND e2=booleanScalarNegation { $value = new BooleanScalarExpr($op.text, $value, $e2.value); } )*
+ ;
+booleanScalarNegation returns[BooleanScalarExpr value]
+ : e1=booleanScalarAtom { $value = $e1.value; }
+ | op=NOT e1=booleanScalarAtom { $value = new BooleanScalarExpr($op.text, $e1.value); }
+ ;
+booleanScalarAtom returns[BooleanScalarExpr value]
+ : LPAREN e1=booleanScalarExpr RPAREN { $value = $e1.value; }
+ | s1=stringScalarExpr cop=compOp s2=stringScalarExpr { $value = new BooleanScalarExpr($cop.value, $s1.value, $s2.value); }
+ | n1=numericScalarExpr cop=compOp n2=numericScalarExpr { $value = new BooleanScalarExpr($cop.value, $n1.value, $n2.value); }
+ | e=BOOLEANCONSTANT { $value = new BooleanScalarExpr($e.text); }
+ ;
+numericScalarExpr returns[NumericScalarExpr value]
+ : e1=numericScalarTerm {$value = $e1.value; }
+ (op=(PLUS|MINUS) e2=numericScalarTerm { $value = new NumericScalarExpr($op.text, $value, $e2.value); })*
+ ;
+numericScalarTerm returns[NumericScalarExpr value]
+ : e1=numericScalarFactor { $value = $e1.value; }
+ (op=(MULT|DIVIDE) e2=numericScalarFactor { $value = new NumericScalarExpr($op.text, $value, $e2.value); })*
+ ;
+numericScalarFactor returns[NumericScalarExpr value]
+ : LPAREN e1=numericScalarExpr RPAREN { $value = $e1.value; }
+ | op=MINUS e10=numericScalarFactor { $value = new NumericScalarExpr($op.text, $e10.value); }
+ | op=ABS LPAREN e12=numericScalarExpr RPAREN { $value = new NumericScalarExpr($op.text, $e12.value); }
+ | op=SQRT LPAREN e11=numericScalarExpr RPAREN { $value = new NumericScalarExpr($op.text, $e11.value); }
+ | op=ROUND LPAREN e1=numericScalarExpr RPAREN { $value = new NumericScalarExpr($op.text, $e1.value); }
+ | e=INTEGERCONSTANT { $value = new NumericScalarExpr($e.text); }
+ | e=FLOATCONSTANT { $value = new NumericScalarExpr($e.text); }
+ | e2=complexConstant { $value = new NumericScalarExpr($e2.value); }
+ | e3=condenseExpr { $value = new NumericScalarExpr($e3.value); }
+ | e4=variableName { $value = new NumericScalarExpr("var", $e4.value); }
+ ;
+compOp returns[String value]
+ : EQUALS { $value = new String("equals"); }
+ | NOTEQUALS { $value = new String("notEqual"); }
+ | LT { $value = new String("lessThan"); }
+ | GT { $value = new String("greaterThan"); }
+ | LTE { $value = new String("lessOrEqual"); }
+ | GTE { $value = new String("greaterOrEqual"); }
+ ;
+dimensionIntervalList returns[DimensionIntervalList value]
+ : elem=dimensionIntervalElement { $value = new DimensionIntervalList($elem.value); }
+ (COMMA elem=dimensionIntervalElement { $value.add($elem.value); })*
+ ;
+dimensionIntervalElement returns[DimensionIntervalElement value]
+ : aname=axisName { $value = new DimensionIntervalElement($aname.value); } (COLON crs=crsName {$value.setCrs($crs.value); })?
+ LPAREN die=dimensionIntervalExpr RPAREN { $value.setIntervalExpr($die.value); }
+ ;
+dimensionIntervalExpr returns[DimensionIntervalExpr value]
+ : e1=scalarExpr COLON e2=scalarExpr { $value = new DimensionIntervalExpr($e1.value, $e2.value); }
+ | DOMAIN LPAREN e3=coverageName COLON e4=axisName COLON e5=crsName RPAREN { $value = new DimensionIntervalExpr($e3.value, $e4.value, $e5.value); }
+ ;
+dimensionPointList returns[DimensionPointList value]
+ : elem1=dimensionPointElement { $value = new DimensionPointList($elem1.value); }
+ (COMMA elem2=dimensionPointElement { $value.add($elem2.value); })*
+ ;
+dimensionPointElement returns[DimensionPointElement value]
+ : aname=axisName LPAREN dpe=dimensionPoint RPAREN { $value = new DimensionPointElement($aname.value, $dpe.value); }
+ | aname=axisName COLON crs=crsName LPAREN dpe=dimensionPoint RPAREN { $value = new DimensionPointElement($aname.value, $crs.value, $dpe.value); }
+ ;
+dimensionPoint returns[ScalarExpr value]
+ : e1=scalarExpr { $value = $e1.value; }
+ ;
+interpolationMethod returns[InterpolationMethod value]
+ : LPAREN type=interpolationType COLON res=nullResistence RPAREN { $value = new InterpolationMethod($type.value, $res.value); }
+ ;
+interpolationType returns[String value]
+ : type=(NEAREST|LINEAR|QUADRATIC|CUBIC) { $value = new String($type.text); }
+ ;
+nullResistence returns[String value]
+ : resistance=(FULL|NONE|HALF|OTHER) { $value = new String($resistance.text); }
+ ;
+condenseOpType returns[CondenseOperation value]
+ : op=(PLUS|MULT|MAX|MIN|AND|OR) { $value = new CondenseOperation($op.text); }
+ ;
+fieldName returns[String value]
+ : name { $value = new String($name.value);}
+ ;
+constant returns[String value]
+ : e=(STRING|BOOLEANCONSTANT|INTEGERCONSTANT|FLOATCONSTANT) { $value = $e.text; }
+ | e1=complexConstant { $value = $e1.value; }
+ ;
+complexConstant returns[String value]
+ : LPAREN re1=FLOATCONSTANT COMMA im1=FLOATCONSTANT RPAREN { $value = new String($re1.text +"+i"+$im1.text); }
+ ;
+stringConstant returns[String value]
+ : s=STRING { $value = $s.text; }
+ ;
+name returns[String value]
+ : var=(NAME | STRING | INTEGERCONSTANT) { $value = $var.text; }
+ ;
+crsName returns[String value]
+ : s=stringConstant { $value = $s.value; }
+ ;
+axisName returns[String value]
+ : type1=name { $value = new String($type1.value); }
+ ;
+variableName returns[String value]
+ : var=VARIABLE_DOLLAR { $value = new String($var.text); }
+ ;
+coverageVariable returns[String value]
+ : var=NAME { $value = $var.text; }
+ ;
+coverageName returns[String value]
+ : name { $value = $name.value; }
+ ;
+
+
+/* Lexer rules */
+PLUS: '+';
+MINUS: '-';
+DIVIDE: '/';
+MULT: '*';
+EQUALS: '=';
+NOTEQUALS: '!=';
+LT: '<';
+GT: '>';
+LTE: '<=';
+GTE: '>=';
+DOT: '.';
+LPAREN: '(';
+RPAREN: ')';
+LBRACKET: '[';
+RBRACKET: ']';
+LBRACE: '{';
+RBRACE: '}';
+COMMA: ',';
+COLON: ':';
+SEMICOLON: ';';
+FOR: ('f'|'F')('o'|'O')('r'|'R');
+IN: ('i'|'I')('n'|'N');
+WHERE: ('w'|'W')('h'|'H')('e'|'E')('r'|'R')('e'|'E');
+RETURN: ('r'|'R')('e'|'E')('t'|'T')('u'|'U')('r'|'R')('n'|'N');
+STORE: ('s'|'S')('t'|'T')('o'|'O')('r'|'R')('e'|'E');
+ENCODE: ('e'|'E')('n'|'N')('c'|'C')('o'|'O')('d'|'D')('e'|'E');
+SQRT: ('s'|'S')('q'|'Q')('r'|'R')('t'|'T');
+SIN: ('s'|'S')('i'|'I')('n'|'N');
+COS: ('c'|'C')('o'|'O')('s'|'S');
+TAN: ('t'|'T')('a'|'A')('n'|'N');
+SINH: ('s'|'S')('i'|'I')('n'|'N')('h'|'H');
+COSH: ('c'|'C')('o'|'O')('s'|'S')('h'|'H');
+TANH: ('t'|'T')('a'|'A')('n'|'N')('h'|'H');
+ARCSIN: ('a'|'A')('r'|'R')('c'|'C')('s'|'S')('i'|'I')('n'|'N');
+ARCCOS: ('a'|'A')('r'|'R')('c'|'C')('c'|'C')('o'|'O')('s'|'S');
+ARCTAN: ('a'|'A')('r'|'R')('c'|'C')('t'|'T')('a'|'A')('n'|'N');
+EXP: ('e'|'E')('x'|'X')('p'|'P');
+LN: ('l'|'L')('n'|'N');
+LOG: ('l'|'L')('o'|'O')('g'|'G');
+ROUND: ('r'|'R')('o'|'O')('u'|'U')('n'|'N')('d'|'D');
+ABS: ('a'|'A')('b'|'B')('s'|'S');
+OVERLAY: ('o'|'O')('v'|'V')('e'|'E')('r'|'R')('l'|'L')('a'|'A')('y'|'Y');
+STRUCT: ('s'|'S')('t'|'T')('r'|'R')('u'|'U')('c'|'C')('t'|'T');
+RE: ('r'|'R')('e'|'E');
+IM: ('i'|'I')('m'|'M');
+AND: ('a'|'A')('n'|'N')('d'|'D');
+OR: ('o'|'O')('r'|'R');
+XOR: ('x'|'X')('o'|'O')('r'|'R');
+NOT: ('n'|'N')('o'|'O')('t'|'T');
+IDENTIFIER: ('i'|'I')('d'|'D')('e'|'E')('n'|'N')('t'|'T')('i'|'I')('f'|'F')('i'|'I')('e'|'E')('r'|'R');
+IMAGECRS: ('i'|'I')('m'|'M')('a'|'A')('g'|'G')('e'|'E')('c'|'C')('r'|'R')('s'|'S');
+IMAGECRSDOMAIN: ('i'|'I')('m'|'M')('a'|'A')('g'|'G')('e'|'E')('c'|'C')('r'|'R')('s'|'S')('d'|'D')('o'|'O')('m'|'M')('a'|'A')('i'|'I')('n'|'N');
+CRSSET: ('c'|'C')('r'|'R')('s'|'S')('s'|'S')('e'|'E')('t'|'T');
+DOMAIN: ('d'|'D')('o'|'O')('m'|'M')('a'|'A')('i'|'I')('n'|'N');
+NULLSET: ('n'|'N')('u'|'U')('l'|'L')('l'|'L')('s'|'S')('e'|'E')('t'|'T');
+NULLDEFAULT: ('n'|'N')('u'|'U')('l'|'L')('l'|'L')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+INTERPOLATIONDEFAULT: ('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+INTERPOLATIONSET: ('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('s'|'S')('e'|'E')('t'|'T');
+SETIDENTIFIER: ('s'|'S')('e'|'E')('t'|'T')('i'|'I')('d'|'D')('e'|'E')('n'|'N')('t'|'T')('i'|'I')('f'|'F')('i'|'I')('e'|'E')('r'|'R');
+SETNULLSET: ('s'|'S')('e'|'E')('t'|'T')('n'|'N')('u'|'U')('l'|'L')('l'|'L')('s'|'S')('e'|'E')('t'|'T');
+SETINTERPOLATIONDEFAULT: ('s'|'S')('e'|'E')('t'|'T')('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+SETINTERPOLATIONSET:('s'|'S')('e'|'E')('t'|'T')('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('s'|'S')('e'|'E')('t'|'T');
+SETCRSSET: ('s'|'S')('e'|'E')('t'|'T')('c'|'C')('r'|'R')('s'|'S')('s'|'S')('e'|'E')('t'|'T');
+TRIM: ('t'|'T')('r'|'R')('i'|'I')('m'|'M');
+SLICE: ('s'|'S')('l'|'L')('i'|'I')('c'|'C')('e'|'E');
+EXTEND: ('e'|'E')('x'|'X')('t'|'T')('e'|'E')('n'|'N')('d'|'D');
+SCALE: ('s'|'S')('c'|'C')('a'|'A')('l'|'L')('e'|'E');
+CRSTRANSFORM: ('c'|'C')('r'|'R')('s'|'S')('t'|'T')('r'|'R')('a'|'A')('n'|'N')('s'|'S')('f'|'F')('o'|'O')('r'|'R')('m'|'M');
+COUNT: ('c'|'C')('o'|'O')('u'|'U')('n'|'N')('t'|'T');
+ADD: ('a'|'A')('d'|'D')('d'|'D');
+AVG: ('a'|'A')('v'|'V')('g'|'G');
+MAX: ('m'|'M')('a'|'A')('x'|'X');
+MIN: ('m'|'M')('i'|'I')('n'|'N');
+SOME: ('s'|'S')('o'|'O')('m'|'M')('e'|'E');
+ALL: ('a'|'A')('l'|'L')('l'|'L');
+COVERAGE: ('c'|'C')('o'|'O')('v'|'V')('e'|'E')('r'|'R')('a'|'A')('g'|'G')('e'|'E');
+OVER: ('o'|'O')('v'|'V')('e'|'E')('r'|'R');
+VALUE: ('v'|'V')('a'|'A')('l'|'L')('u'|'U')('e'|'E');
+VALUES: ('v'|'V')('a'|'A')('l'|'L')('u'|'U')('e'|'E')('s'|'S');
+LIST: ('l'|'L')('i'|'I')('s'|'S')('t'|'T');
+CONDENSE: ('c'|'C')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('n'|'N')('s'|'S')('e'|'E');
+USING: ('u'|'U')('s'|'S')('i'|'I')('n'|'N')('g'|'G');
+NEAREST: ('n'|'N')('e'|'E')('a'|'A')('r'|'R')('e'|'E')('s'|'S')('t'|'T');
+LINEAR: ('l'|'L')('i'|'I')('n'|'N')('e'|'E')('a'|'A')('r'|'R');
+QUADRATIC: ('q'|'Q')('u'|'U')('a'|'A')('d'|'D')('r'|'R')('a'|'A')('t'|'T')('i'|'I')('c'|'C');
+CUBIC: ('c'|'C')('u'|'U')('b'|'B')('i'|'I')('c'|'C');
+FULL: ('f'|'F')('u'|'U')('l'|'L')('l'|'L');
+NONE: ('n'|'N')('o'|'O')('n'|'N')('e'|'E');
+HALF: ('h'|'H')('a'|'A')('l'|'L')('f'|'F');
+OTHER: ('o'|'O')('t'|'T')('h'|'H')('e'|'E')('r'|'R');
+PHI: ('p'|'P')('h'|'H')('i'|'I');
+BIT: ('b'|'B')('i'|'I')('t'|'T');
+UNSIGNED: ('u'|'U')('n'|'N')('s'|'S')('i'|'I')('g'|'G')('n'|'N')('e'|'E')('d'|'D');
+BOOLEAN: ('b'|'B')('o'|'O')('o'|'O')('l'|'L')('e'|'E')('a'|'A')('n'|'N');
+CHAR: ('c'|'C')('h'|'H')('a'|'A')('r'|'R');
+SHORT: ('s'|'S')('h'|'H')('o'|'O')('r'|'R')('t'|'T');
+LONG: ('l'|'L')('o'|'O')('n'|'N')('g'|'G');
+FLOAT: ('f'|'F')('l'|'L')('o'|'O')('a'|'A')('t'|'T');
+DOUBLE: ('d'|'D')('o'|'O')('u'|'U')('b'|'B')('l'|'L')('e'|'E');
+COMPLEX: ('c'|'C')('o'|'O')('m'|'M')('p'|'P')('l'|'L')('e'|'E')('x'|'X');
+COMPLEX2: ('c'|'C')('o'|'O')('m'|'M')('p'|'P')('l'|'L')('e'|'E')('x'|'X')'2';
+BOOLEANCONSTANT: (('t'|'T')('r'|'R')('u'|'U')('e'|'E'))|(('f'|'F')('a'|'A')('l'|'L')('s'|'S')('e'|'E'));
+INTEGERCONSTANT: (PLUS|MINUS)? ('0'..'9')+;
+FLOATCONSTANT: INTEGERCONSTANT ('.')('0'..'9'+)(('e'|'E')(('-'|'+')?)('0'..'9'+))?;
+STRING: '"' ( options {greedy=false;} : . )* '"' {setText(getText().substring(1, getText().length()-1));};
+NAME: ('a'..'z'|'A'..'Z'|'_')(('a'..'z'|'A'..'Z'|'0'..'9'|'_')*);
+VARIABLE_DOLLAR: '$'(('a'..'z'|'A'..'Z'|'0'..'9'|'_')*) {setText(getText().substring(1, getText().length())); } ;
+WHITESPACE: (' ' | '\t' | '\r' | '\n' | '\u000C')+ { skip(); } ;
diff --git a/petascope/src/petascope/wcps/grammar/wcpsLexer.java b/petascope/src/petascope/wcps/grammar/wcpsLexer.java
new file mode 100644
index 0000000..317089c
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/wcpsLexer.java
@@ -0,0 +1,8464 @@
+// $ANTLR 3.2 Sep 23, 2009 12:02:23 src/petascope/wcps/grammar/wcps.g 2010-04-29 23:04:42
+package petascope.wcps.grammar;
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class wcpsLexer extends Lexer {
+ public static final int IMAGECRS=28;
+ public static final int LT=18;
+ public static final int LN=66;
+ public static final int LOG=65;
+ public static final int CHAR=88;
+ public static final int COMPLEX=93;
+ public static final int SETINTERPOLATIONDEFAULT=54;
+ public static final int COUNT=37;
+ public static final int EQUALS=16;
+ public static final int COSH=71;
+ public static final int NOT=76;
+ public static final int INTEGERCONSTANT=78;
+ public static final int EOF=-1;
+ public static final int SINH=70;
+ public static final int LBRACKET=82;
+ public static final int RPAREN=7;
+ public static final int TANH=72;
+ public static final int LINEAR=100;
+ public static final int NAME=107;
+ public static final int FULL=103;
+ public static final int SIN=67;
+ public static final int USING=44;
+ public static final int EXP=64;
+ public static final int COS=68;
+ public static final int TAN=69;
+ public static final int RETURN=10;
+ public static final int DOUBLE=92;
+ public static final int NULLDEFAULT=109;
+ public static final int STORE=12;
+ public static final int DIVIDE=25;
+ public static final int BOOLEANCONSTANT=97;
+ public static final int RBRACE=57;
+ public static final int SETNULLSET=53;
+ public static final int CONDENSE=42;
+ public static final int WHITESPACE=111;
+ public static final int SEMICOLON=49;
+ public static final int VALUE=47;
+ public static final int MULT=24;
+ public static final int LIST=48;
+ public static final int COMPLEX2=94;
+ public static final int ABS=61;
+ public static final int CRSSET=30;
+ public static final int SCALE=81;
+ public static final int VARIABLE_DOLLAR=108;
+ public static final int FLOATCONSTANT=98;
+ public static final int IMAGECRSDOMAIN=29;
+ public static final int NONE=104;
+ public static final int OR=13;
+ public static final int TRIM=84;
+ public static final int GT=19;
+ public static final int ROUND=79;
+ public static final int QUADRATIC=101;
+ public static final int ENCODE=11;
+ public static final int PHI=110;
+ public static final int OVER=43;
+ public static final int COVERAGE=46;
+ public static final int WHERE=9;
+ public static final int RE=62;
+ public static final int OVERLAY=26;
+ public static final int GTE=21;
+ public static final int LBRACE=56;
+ public static final int MAX=41;
+ public static final int INTERPOLATIONDEFAULT=32;
+ public static final int FOR=4;
+ public static final int FLOAT=91;
+ public static final int SLICE=85;
+ public static final int AND=15;
+ public static final int LTE=20;
+ public static final int LPAREN=6;
+ public static final int EXTEND=86;
+ public static final int IM=63;
+ public static final int BOOLEAN=87;
+ public static final int IN=5;
+ public static final int COMMA=8;
+ public static final int AVG=39;
+ public static final int IDENTIFIER=27;
+ public static final int SOME=36;
+ public static final int ALL=35;
+ public static final int ARCSIN=73;
+ public static final int PLUS=22;
+ public static final int ARCCOS=74;
+ public static final int RBRACKET=83;
+ public static final int DOT=96;
+ public static final int ADD=38;
+ public static final int SETIDENTIFIER=51;
+ public static final int XOR=14;
+ public static final int SETINTERPOLATIONSET=55;
+ public static final int OTHER=106;
+ public static final int VALUES=50;
+ public static final int ARCTAN=75;
+ public static final int NOTEQUALS=17;
+ public static final int SHORT=89;
+ public static final int STRUCT=58;
+ public static final int MIN=40;
+ public static final int SQRT=60;
+ public static final int MINUS=23;
+ public static final int CRSTRANSFORM=59;
+ public static final int DOMAIN=34;
+ public static final int COLON=45;
+ public static final int CUBIC=102;
+ public static final int UNSIGNED=95;
+ public static final int NULLSET=31;
+ public static final int BIT=77;
+ public static final int LONG=90;
+ public static final int INTERPOLATIONSET=33;
+ public static final int SETCRSSET=52;
+ public static final int HALF=105;
+ public static final int STRING=80;
+ public static final int NEAREST=99;
+
+ // delegates
+ // delegators
+
+ public wcpsLexer() {;}
+ public wcpsLexer(CharStream input) {
+ this(input, new RecognizerSharedState());
+ }
+ public wcpsLexer(CharStream input, RecognizerSharedState state) {
+ super(input,state);
+
+ }
+ public String getGrammarFileName() { return "src/petascope/wcps/grammar/wcps.g"; }
+
+ // $ANTLR start "PLUS"
+ public final void mPLUS() throws RecognitionException {
+ try {
+ int _type = PLUS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:393:5: ( '+' )
+ // src/petascope/wcps/grammar/wcps.g:393:8: '+'
+ {
+ match('+');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "PLUS"
+
+ // $ANTLR start "MINUS"
+ public final void mMINUS() throws RecognitionException {
+ try {
+ int _type = MINUS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:394:6: ( '-' )
+ // src/petascope/wcps/grammar/wcps.g:394:9: '-'
+ {
+ match('-');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "MINUS"
+
+ // $ANTLR start "DIVIDE"
+ public final void mDIVIDE() throws RecognitionException {
+ try {
+ int _type = DIVIDE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:395:7: ( '/' )
+ // src/petascope/wcps/grammar/wcps.g:395:9: '/'
+ {
+ match('/');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "DIVIDE"
+
+ // $ANTLR start "MULT"
+ public final void mMULT() throws RecognitionException {
+ try {
+ int _type = MULT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:396:5: ( '*' )
+ // src/petascope/wcps/grammar/wcps.g:396:7: '*'
+ {
+ match('*');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "MULT"
+
+ // $ANTLR start "EQUALS"
+ public final void mEQUALS() throws RecognitionException {
+ try {
+ int _type = EQUALS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:397:7: ( '=' )
+ // src/petascope/wcps/grammar/wcps.g:397:9: '='
+ {
+ match('=');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "EQUALS"
+
+ // $ANTLR start "NOTEQUALS"
+ public final void mNOTEQUALS() throws RecognitionException {
+ try {
+ int _type = NOTEQUALS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:398:10: ( '!=' )
+ // src/petascope/wcps/grammar/wcps.g:398:12: '!='
+ {
+ match("!=");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NOTEQUALS"
+
+ // $ANTLR start "LT"
+ public final void mLT() throws RecognitionException {
+ try {
+ int _type = LT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:399:3: ( '<' )
+ // src/petascope/wcps/grammar/wcps.g:399:5: '<'
+ {
+ match('<');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LT"
+
+ // $ANTLR start "GT"
+ public final void mGT() throws RecognitionException {
+ try {
+ int _type = GT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:400:3: ( '>' )
+ // src/petascope/wcps/grammar/wcps.g:400:5: '>'
+ {
+ match('>');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "GT"
+
+ // $ANTLR start "LTE"
+ public final void mLTE() throws RecognitionException {
+ try {
+ int _type = LTE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:401:4: ( '<=' )
+ // src/petascope/wcps/grammar/wcps.g:401:6: '<='
+ {
+ match("<=");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LTE"
+
+ // $ANTLR start "GTE"
+ public final void mGTE() throws RecognitionException {
+ try {
+ int _type = GTE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:402:4: ( '>=' )
+ // src/petascope/wcps/grammar/wcps.g:402:6: '>='
+ {
+ match(">=");
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "GTE"
+
+ // $ANTLR start "DOT"
+ public final void mDOT() throws RecognitionException {
+ try {
+ int _type = DOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:403:4: ( '.' )
+ // src/petascope/wcps/grammar/wcps.g:403:6: '.'
+ {
+ match('.');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "DOT"
+
+ // $ANTLR start "LPAREN"
+ public final void mLPAREN() throws RecognitionException {
+ try {
+ int _type = LPAREN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:404:7: ( '(' )
+ // src/petascope/wcps/grammar/wcps.g:404:9: '('
+ {
+ match('(');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LPAREN"
+
+ // $ANTLR start "RPAREN"
+ public final void mRPAREN() throws RecognitionException {
+ try {
+ int _type = RPAREN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:405:7: ( ')' )
+ // src/petascope/wcps/grammar/wcps.g:405:9: ')'
+ {
+ match(')');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "RPAREN"
+
+ // $ANTLR start "LBRACKET"
+ public final void mLBRACKET() throws RecognitionException {
+ try {
+ int _type = LBRACKET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:406:9: ( '[' )
+ // src/petascope/wcps/grammar/wcps.g:406:11: '['
+ {
+ match('[');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LBRACKET"
+
+ // $ANTLR start "RBRACKET"
+ public final void mRBRACKET() throws RecognitionException {
+ try {
+ int _type = RBRACKET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:407:9: ( ']' )
+ // src/petascope/wcps/grammar/wcps.g:407:11: ']'
+ {
+ match(']');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "RBRACKET"
+
+ // $ANTLR start "LBRACE"
+ public final void mLBRACE() throws RecognitionException {
+ try {
+ int _type = LBRACE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:408:7: ( '{' )
+ // src/petascope/wcps/grammar/wcps.g:408:9: '{'
+ {
+ match('{');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LBRACE"
+
+ // $ANTLR start "RBRACE"
+ public final void mRBRACE() throws RecognitionException {
+ try {
+ int _type = RBRACE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:409:7: ( '}' )
+ // src/petascope/wcps/grammar/wcps.g:409:9: '}'
+ {
+ match('}');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "RBRACE"
+
+ // $ANTLR start "COMMA"
+ public final void mCOMMA() throws RecognitionException {
+ try {
+ int _type = COMMA;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:410:6: ( ',' )
+ // src/petascope/wcps/grammar/wcps.g:410:8: ','
+ {
+ match(',');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COMMA"
+
+ // $ANTLR start "COLON"
+ public final void mCOLON() throws RecognitionException {
+ try {
+ int _type = COLON;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:411:6: ( ':' )
+ // src/petascope/wcps/grammar/wcps.g:411:8: ':'
+ {
+ match(':');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COLON"
+
+ // $ANTLR start "SEMICOLON"
+ public final void mSEMICOLON() throws RecognitionException {
+ try {
+ int _type = SEMICOLON;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:412:10: ( ';' )
+ // src/petascope/wcps/grammar/wcps.g:412:12: ';'
+ {
+ match(';');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SEMICOLON"
+
+ // $ANTLR start "FOR"
+ public final void mFOR() throws RecognitionException {
+ try {
+ int _type = FOR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:413:4: ( ( 'f' | 'F' ) ( 'o' | 'O' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:413:6: ( 'f' | 'F' ) ( 'o' | 'O' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "FOR"
+
+ // $ANTLR start "IN"
+ public final void mIN() throws RecognitionException {
+ try {
+ int _type = IN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:414:3: ( ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:414:5: ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "IN"
+
+ // $ANTLR start "WHERE"
+ public final void mWHERE() throws RecognitionException {
+ try {
+ int _type = WHERE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:415:6: ( ( 'w' | 'W' ) ( 'h' | 'H' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:415:8: ( 'w' | 'W' ) ( 'h' | 'H' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='W'||input.LA(1)=='w' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "WHERE"
+
+ // $ANTLR start "RETURN"
+ public final void mRETURN() throws RecognitionException {
+ try {
+ int _type = RETURN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:416:7: ( ( 'r' | 'R' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'u' | 'U' ) ( 'r' | 'R' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:416:9: ( 'r' | 'R' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'u' | 'U' ) ( 'r' | 'R' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "RETURN"
+
+ // $ANTLR start "STORE"
+ public final void mSTORE() throws RecognitionException {
+ try {
+ int _type = STORE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:417:6: ( ( 's' | 'S' ) ( 't' | 'T' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:417:8: ( 's' | 'S' ) ( 't' | 'T' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "STORE"
+
+ // $ANTLR start "ENCODE"
+ public final void mENCODE() throws RecognitionException {
+ try {
+ int _type = ENCODE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:418:7: ( ( 'e' | 'E' ) ( 'n' | 'N' ) ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'd' | 'D' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:418:9: ( 'e' | 'E' ) ( 'n' | 'N' ) ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'd' | 'D' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ENCODE"
+
+ // $ANTLR start "SQRT"
+ public final void mSQRT() throws RecognitionException {
+ try {
+ int _type = SQRT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:419:5: ( ( 's' | 'S' ) ( 'q' | 'Q' ) ( 'r' | 'R' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:419:7: ( 's' | 'S' ) ( 'q' | 'Q' ) ( 'r' | 'R' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='Q'||input.LA(1)=='q' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SQRT"
+
+ // $ANTLR start "SIN"
+ public final void mSIN() throws RecognitionException {
+ try {
+ int _type = SIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:420:4: ( ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:420:6: ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SIN"
+
+ // $ANTLR start "COS"
+ public final void mCOS() throws RecognitionException {
+ try {
+ int _type = COS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:421:4: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:421:6: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COS"
+
+ // $ANTLR start "TAN"
+ public final void mTAN() throws RecognitionException {
+ try {
+ int _type = TAN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:422:4: ( ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:422:6: ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "TAN"
+
+ // $ANTLR start "SINH"
+ public final void mSINH() throws RecognitionException {
+ try {
+ int _type = SINH;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:423:5: ( ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'h' | 'H' ) )
+ // src/petascope/wcps/grammar/wcps.g:423:7: ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'h' | 'H' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SINH"
+
+ // $ANTLR start "COSH"
+ public final void mCOSH() throws RecognitionException {
+ try {
+ int _type = COSH;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:424:5: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' ) ( 'h' | 'H' ) )
+ // src/petascope/wcps/grammar/wcps.g:424:7: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' ) ( 'h' | 'H' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COSH"
+
+ // $ANTLR start "TANH"
+ public final void mTANH() throws RecognitionException {
+ try {
+ int _type = TANH;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:425:5: ( ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' ) ( 'h' | 'H' ) )
+ // src/petascope/wcps/grammar/wcps.g:425:7: ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' ) ( 'h' | 'H' )
+ {
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "TANH"
+
+ // $ANTLR start "ARCSIN"
+ public final void mARCSIN() throws RecognitionException {
+ try {
+ int _type = ARCSIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:426:7: ( ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:426:9: ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ARCSIN"
+
+ // $ANTLR start "ARCCOS"
+ public final void mARCCOS() throws RecognitionException {
+ try {
+ int _type = ARCCOS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:427:7: ( ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:427:9: ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 'c' | 'C' ) ( 'o' | 'O' ) ( 's' | 'S' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ARCCOS"
+
+ // $ANTLR start "ARCTAN"
+ public final void mARCTAN() throws RecognitionException {
+ try {
+ int _type = ARCTAN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:428:7: ( ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:428:9: ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'c' | 'C' ) ( 't' | 'T' ) ( 'a' | 'A' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ARCTAN"
+
+ // $ANTLR start "EXP"
+ public final void mEXP() throws RecognitionException {
+ try {
+ int _type = EXP;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:429:4: ( ( 'e' | 'E' ) ( 'x' | 'X' ) ( 'p' | 'P' ) )
+ // src/petascope/wcps/grammar/wcps.g:429:6: ( 'e' | 'E' ) ( 'x' | 'X' ) ( 'p' | 'P' )
+ {
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "EXP"
+
+ // $ANTLR start "LN"
+ public final void mLN() throws RecognitionException {
+ try {
+ int _type = LN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:430:3: ( ( 'l' | 'L' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:430:5: ( 'l' | 'L' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LN"
+
+ // $ANTLR start "LOG"
+ public final void mLOG() throws RecognitionException {
+ try {
+ int _type = LOG;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:431:4: ( ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'g' | 'G' ) )
+ // src/petascope/wcps/grammar/wcps.g:431:6: ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'g' | 'G' )
+ {
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LOG"
+
+ // $ANTLR start "ROUND"
+ public final void mROUND() throws RecognitionException {
+ try {
+ int _type = ROUND;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:432:6: ( ( 'r' | 'R' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'n' | 'N' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:432:8: ( 'r' | 'R' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'n' | 'N' ) ( 'd' | 'D' )
+ {
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ROUND"
+
+ // $ANTLR start "ABS"
+ public final void mABS() throws RecognitionException {
+ try {
+ int _type = ABS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:433:4: ( ( 'a' | 'A' ) ( 'b' | 'B' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:433:6: ( 'a' | 'A' ) ( 'b' | 'B' ) ( 's' | 'S' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='B'||input.LA(1)=='b' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ABS"
+
+ // $ANTLR start "OVERLAY"
+ public final void mOVERLAY() throws RecognitionException {
+ try {
+ int _type = OVERLAY;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:434:8: ( ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 'y' | 'Y' ) )
+ // src/petascope/wcps/grammar/wcps.g:434:10: ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 'y' | 'Y' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='V'||input.LA(1)=='v' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='Y'||input.LA(1)=='y' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "OVERLAY"
+
+ // $ANTLR start "STRUCT"
+ public final void mSTRUCT() throws RecognitionException {
+ try {
+ int _type = STRUCT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:435:7: ( ( 's' | 'S' ) ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'c' | 'C' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:435:9: ( 's' | 'S' ) ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'c' | 'C' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "STRUCT"
+
+ // $ANTLR start "RE"
+ public final void mRE() throws RecognitionException {
+ try {
+ int _type = RE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:436:3: ( ( 'r' | 'R' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:436:5: ( 'r' | 'R' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "RE"
+
+ // $ANTLR start "IM"
+ public final void mIM() throws RecognitionException {
+ try {
+ int _type = IM;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:437:3: ( ( 'i' | 'I' ) ( 'm' | 'M' ) )
+ // src/petascope/wcps/grammar/wcps.g:437:5: ( 'i' | 'I' ) ( 'm' | 'M' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "IM"
+
+ // $ANTLR start "AND"
+ public final void mAND() throws RecognitionException {
+ try {
+ int _type = AND;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:438:4: ( ( 'a' | 'A' ) ( 'n' | 'N' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:438:6: ( 'a' | 'A' ) ( 'n' | 'N' ) ( 'd' | 'D' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "AND"
+
+ // $ANTLR start "OR"
+ public final void mOR() throws RecognitionException {
+ try {
+ int _type = OR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:439:3: ( ( 'o' | 'O' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:439:5: ( 'o' | 'O' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "OR"
+
+ // $ANTLR start "XOR"
+ public final void mXOR() throws RecognitionException {
+ try {
+ int _type = XOR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:440:4: ( ( 'x' | 'X' ) ( 'o' | 'O' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:440:6: ( 'x' | 'X' ) ( 'o' | 'O' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "XOR"
+
+ // $ANTLR start "NOT"
+ public final void mNOT() throws RecognitionException {
+ try {
+ int _type = NOT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:441:4: ( ( 'n' | 'N' ) ( 'o' | 'O' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:441:6: ( 'n' | 'N' ) ( 'o' | 'O' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NOT"
+
+ // $ANTLR start "IDENTIFIER"
+ public final void mIDENTIFIER() throws RecognitionException {
+ try {
+ int _type = IDENTIFIER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:442:11: ( ( 'i' | 'I' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'f' | 'F' ) ( 'i' | 'I' ) ( 'e' | 'E' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:442:13: ( 'i' | 'I' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'f' | 'F' ) ( 'i' | 'I' ) ( 'e' | 'E' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "IDENTIFIER"
+
+ // $ANTLR start "IMAGECRS"
+ public final void mIMAGECRS() throws RecognitionException {
+ try {
+ int _type = IMAGECRS;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:443:9: ( ( 'i' | 'I' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:443:11: ( 'i' | 'I' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "IMAGECRS"
+
+ // $ANTLR start "IMAGECRSDOMAIN"
+ public final void mIMAGECRSDOMAIN() throws RecognitionException {
+ try {
+ int _type = IMAGECRSDOMAIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:444:15: ( ( 'i' | 'I' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:444:17: ( 'i' | 'I' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "IMAGECRSDOMAIN"
+
+ // $ANTLR start "CRSSET"
+ public final void mCRSSET() throws RecognitionException {
+ try {
+ int _type = CRSSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:445:7: ( ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:445:9: ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "CRSSET"
+
+ // $ANTLR start "DOMAIN"
+ public final void mDOMAIN() throws RecognitionException {
+ try {
+ int _type = DOMAIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:446:7: ( ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:446:9: ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "DOMAIN"
+
+ // $ANTLR start "NULLSET"
+ public final void mNULLSET() throws RecognitionException {
+ try {
+ int _type = NULLSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:447:8: ( ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:447:10: ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NULLSET"
+
+ // $ANTLR start "NULLDEFAULT"
+ public final void mNULLDEFAULT() throws RecognitionException {
+ try {
+ int _type = NULLDEFAULT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:448:12: ( ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:448:14: ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NULLDEFAULT"
+
+ // $ANTLR start "INTERPOLATIONDEFAULT"
+ public final void mINTERPOLATIONDEFAULT() throws RecognitionException {
+ try {
+ int _type = INTERPOLATIONDEFAULT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:449:21: ( ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:449:23: ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "INTERPOLATIONDEFAULT"
+
+ // $ANTLR start "INTERPOLATIONSET"
+ public final void mINTERPOLATIONSET() throws RecognitionException {
+ try {
+ int _type = INTERPOLATIONSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:450:17: ( ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:450:19: ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "INTERPOLATIONSET"
+
+ // $ANTLR start "SETIDENTIFIER"
+ public final void mSETIDENTIFIER() throws RecognitionException {
+ try {
+ int _type = SETIDENTIFIER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:451:14: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'f' | 'F' ) ( 'i' | 'I' ) ( 'e' | 'E' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:451:16: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'f' | 'F' ) ( 'i' | 'I' ) ( 'e' | 'E' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SETIDENTIFIER"
+
+ // $ANTLR start "SETNULLSET"
+ public final void mSETNULLSET() throws RecognitionException {
+ try {
+ int _type = SETNULLSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:452:11: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:452:13: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'n' | 'N' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SETNULLSET"
+
+ // $ANTLR start "SETINTERPOLATIONDEFAULT"
+ public final void mSETINTERPOLATIONDEFAULT() throws RecognitionException {
+ try {
+ int _type = SETINTERPOLATIONDEFAULT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:453:24: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:453:26: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SETINTERPOLATIONDEFAULT"
+
+ // $ANTLR start "SETINTERPOLATIONSET"
+ public final void mSETINTERPOLATIONSET() throws RecognitionException {
+ try {
+ int _type = SETINTERPOLATIONSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:454:20: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:454:21: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'p' | 'P' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SETINTERPOLATIONSET"
+
+ // $ANTLR start "SETCRSSET"
+ public final void mSETCRSSET() throws RecognitionException {
+ try {
+ int _type = SETCRSSET;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:455:10: ( ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:455:12: ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' ) ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 's' | 'S' ) ( 'e' | 'E' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SETCRSSET"
+
+ // $ANTLR start "TRIM"
+ public final void mTRIM() throws RecognitionException {
+ try {
+ int _type = TRIM;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:456:5: ( ( 't' | 'T' ) ( 'r' | 'R' ) ( 'i' | 'I' ) ( 'm' | 'M' ) )
+ // src/petascope/wcps/grammar/wcps.g:456:7: ( 't' | 'T' ) ( 'r' | 'R' ) ( 'i' | 'I' ) ( 'm' | 'M' )
+ {
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "TRIM"
+
+ // $ANTLR start "SLICE"
+ public final void mSLICE() throws RecognitionException {
+ try {
+ int _type = SLICE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:457:6: ( ( 's' | 'S' ) ( 'l' | 'L' ) ( 'i' | 'I' ) ( 'c' | 'C' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:457:8: ( 's' | 'S' ) ( 'l' | 'L' ) ( 'i' | 'I' ) ( 'c' | 'C' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SLICE"
+
+ // $ANTLR start "EXTEND"
+ public final void mEXTEND() throws RecognitionException {
+ try {
+ int _type = EXTEND;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:458:7: ( ( 'e' | 'E' ) ( 'x' | 'X' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:458:9: ( 'e' | 'E' ) ( 'x' | 'X' ) ( 't' | 'T' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 'd' | 'D' )
+ {
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "EXTEND"
+
+ // $ANTLR start "SCALE"
+ public final void mSCALE() throws RecognitionException {
+ try {
+ int _type = SCALE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:459:6: ( ( 's' | 'S' ) ( 'c' | 'C' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:459:8: ( 's' | 'S' ) ( 'c' | 'C' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SCALE"
+
+ // $ANTLR start "CRSTRANSFORM"
+ public final void mCRSTRANSFORM() throws RecognitionException {
+ try {
+ int _type = CRSTRANSFORM;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:460:13: ( ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 't' | 'T' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'f' | 'F' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 'm' | 'M' ) )
+ // src/petascope/wcps/grammar/wcps.g:460:15: ( 'c' | 'C' ) ( 'r' | 'R' ) ( 's' | 'S' ) ( 't' | 'T' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'f' | 'F' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 'm' | 'M' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "CRSTRANSFORM"
+
+ // $ANTLR start "COUNT"
+ public final void mCOUNT() throws RecognitionException {
+ try {
+ int _type = COUNT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:461:6: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'n' | 'N' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:461:8: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'n' | 'N' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COUNT"
+
+ // $ANTLR start "ADD"
+ public final void mADD() throws RecognitionException {
+ try {
+ int _type = ADD;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:462:4: ( ( 'a' | 'A' ) ( 'd' | 'D' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:462:6: ( 'a' | 'A' ) ( 'd' | 'D' ) ( 'd' | 'D' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ADD"
+
+ // $ANTLR start "AVG"
+ public final void mAVG() throws RecognitionException {
+ try {
+ int _type = AVG;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:463:4: ( ( 'a' | 'A' ) ( 'v' | 'V' ) ( 'g' | 'G' ) )
+ // src/petascope/wcps/grammar/wcps.g:463:6: ( 'a' | 'A' ) ( 'v' | 'V' ) ( 'g' | 'G' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='V'||input.LA(1)=='v' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "AVG"
+
+ // $ANTLR start "MAX"
+ public final void mMAX() throws RecognitionException {
+ try {
+ int _type = MAX;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:464:4: ( ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'x' | 'X' ) )
+ // src/petascope/wcps/grammar/wcps.g:464:6: ( 'm' | 'M' ) ( 'a' | 'A' ) ( 'x' | 'X' )
+ {
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "MAX"
+
+ // $ANTLR start "MIN"
+ public final void mMIN() throws RecognitionException {
+ try {
+ int _type = MIN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:465:4: ( ( 'm' | 'M' ) ( 'i' | 'I' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:465:6: ( 'm' | 'M' ) ( 'i' | 'I' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "MIN"
+
+ // $ANTLR start "SOME"
+ public final void mSOME() throws RecognitionException {
+ try {
+ int _type = SOME;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:466:5: ( ( 's' | 'S' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:466:7: ( 's' | 'S' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SOME"
+
+ // $ANTLR start "ALL"
+ public final void mALL() throws RecognitionException {
+ try {
+ int _type = ALL;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:467:4: ( ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'l' | 'L' ) )
+ // src/petascope/wcps/grammar/wcps.g:467:6: ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'l' | 'L' )
+ {
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "ALL"
+
+ // $ANTLR start "COVERAGE"
+ public final void mCOVERAGE() throws RecognitionException {
+ try {
+ int _type = COVERAGE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:468:9: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:468:11: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 'g' | 'G' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='V'||input.LA(1)=='v' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COVERAGE"
+
+ // $ANTLR start "OVER"
+ public final void mOVER() throws RecognitionException {
+ try {
+ int _type = OVER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:469:5: ( ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:469:7: ( 'o' | 'O' ) ( 'v' | 'V' ) ( 'e' | 'E' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='V'||input.LA(1)=='v' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "OVER"
+
+ // $ANTLR start "VALUE"
+ public final void mVALUE() throws RecognitionException {
+ try {
+ int _type = VALUE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:470:6: ( ( 'v' | 'V' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'u' | 'U' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:470:8: ( 'v' | 'V' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'u' | 'U' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='V'||input.LA(1)=='v' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "VALUE"
+
+ // $ANTLR start "VALUES"
+ public final void mVALUES() throws RecognitionException {
+ try {
+ int _type = VALUES;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:471:7: ( ( 'v' | 'V' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'u' | 'U' ) ( 'e' | 'E' ) ( 's' | 'S' ) )
+ // src/petascope/wcps/grammar/wcps.g:471:9: ( 'v' | 'V' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'u' | 'U' ) ( 'e' | 'E' ) ( 's' | 'S' )
+ {
+ if ( input.LA(1)=='V'||input.LA(1)=='v' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "VALUES"
+
+ // $ANTLR start "LIST"
+ public final void mLIST() throws RecognitionException {
+ try {
+ int _type = LIST;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:472:5: ( ( 'l' | 'L' ) ( 'i' | 'I' ) ( 's' | 'S' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:472:7: ( 'l' | 'L' ) ( 'i' | 'I' ) ( 's' | 'S' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LIST"
+
+ // $ANTLR start "CONDENSE"
+ public final void mCONDENSE() throws RecognitionException {
+ try {
+ int _type = CONDENSE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:473:9: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:473:11: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'd' | 'D' ) ( 'e' | 'E' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "CONDENSE"
+
+ // $ANTLR start "USING"
+ public final void mUSING() throws RecognitionException {
+ try {
+ int _type = USING;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:474:6: ( ( 'u' | 'U' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'g' | 'G' ) )
+ // src/petascope/wcps/grammar/wcps.g:474:8: ( 'u' | 'U' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'g' | 'G' )
+ {
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "USING"
+
+ // $ANTLR start "NEAREST"
+ public final void mNEAREST() throws RecognitionException {
+ try {
+ int _type = NEAREST;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:475:8: ( ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'e' | 'E' ) ( 's' | 'S' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:475:10: ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'r' | 'R' ) ( 'e' | 'E' ) ( 's' | 'S' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NEAREST"
+
+ // $ANTLR start "LINEAR"
+ public final void mLINEAR() throws RecognitionException {
+ try {
+ int _type = LINEAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:476:7: ( ( 'l' | 'L' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:476:9: ( 'l' | 'L' ) ( 'i' | 'I' ) ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LINEAR"
+
+ // $ANTLR start "QUADRATIC"
+ public final void mQUADRATIC() throws RecognitionException {
+ try {
+ int _type = QUADRATIC;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:477:10: ( ( 'q' | 'Q' ) ( 'u' | 'U' ) ( 'a' | 'A' ) ( 'd' | 'D' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'c' | 'C' ) )
+ // src/petascope/wcps/grammar/wcps.g:477:12: ( 'q' | 'Q' ) ( 'u' | 'U' ) ( 'a' | 'A' ) ( 'd' | 'D' ) ( 'r' | 'R' ) ( 'a' | 'A' ) ( 't' | 'T' ) ( 'i' | 'I' ) ( 'c' | 'C' )
+ {
+ if ( input.LA(1)=='Q'||input.LA(1)=='q' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "QUADRATIC"
+
+ // $ANTLR start "CUBIC"
+ public final void mCUBIC() throws RecognitionException {
+ try {
+ int _type = CUBIC;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:478:6: ( ( 'c' | 'C' ) ( 'u' | 'U' ) ( 'b' | 'B' ) ( 'i' | 'I' ) ( 'c' | 'C' ) )
+ // src/petascope/wcps/grammar/wcps.g:478:8: ( 'c' | 'C' ) ( 'u' | 'U' ) ( 'b' | 'B' ) ( 'i' | 'I' ) ( 'c' | 'C' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='B'||input.LA(1)=='b' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "CUBIC"
+
+ // $ANTLR start "FULL"
+ public final void mFULL() throws RecognitionException {
+ try {
+ int _type = FULL;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:479:5: ( ( 'f' | 'F' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) )
+ // src/petascope/wcps/grammar/wcps.g:479:7: ( 'f' | 'F' ) ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' )
+ {
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "FULL"
+
+ // $ANTLR start "NONE"
+ public final void mNONE() throws RecognitionException {
+ try {
+ int _type = NONE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:480:5: ( ( 'n' | 'N' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:480:7: ( 'n' | 'N' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NONE"
+
+ // $ANTLR start "HALF"
+ public final void mHALF() throws RecognitionException {
+ try {
+ int _type = HALF;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:481:5: ( ( 'h' | 'H' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'f' | 'F' ) )
+ // src/petascope/wcps/grammar/wcps.g:481:7: ( 'h' | 'H' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 'f' | 'F' )
+ {
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "HALF"
+
+ // $ANTLR start "OTHER"
+ public final void mOTHER() throws RecognitionException {
+ try {
+ int _type = OTHER;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:482:6: ( ( 'o' | 'O' ) ( 't' | 'T' ) ( 'h' | 'H' ) ( 'e' | 'E' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:482:8: ( 'o' | 'O' ) ( 't' | 'T' ) ( 'h' | 'H' ) ( 'e' | 'E' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "OTHER"
+
+ // $ANTLR start "PHI"
+ public final void mPHI() throws RecognitionException {
+ try {
+ int _type = PHI;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:483:4: ( ( 'p' | 'P' ) ( 'h' | 'H' ) ( 'i' | 'I' ) )
+ // src/petascope/wcps/grammar/wcps.g:483:6: ( 'p' | 'P' ) ( 'h' | 'H' ) ( 'i' | 'I' )
+ {
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "PHI"
+
+ // $ANTLR start "BIT"
+ public final void mBIT() throws RecognitionException {
+ try {
+ int _type = BIT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:484:4: ( ( 'b' | 'B' ) ( 'i' | 'I' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:484:6: ( 'b' | 'B' ) ( 'i' | 'I' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='B'||input.LA(1)=='b' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "BIT"
+
+ // $ANTLR start "UNSIGNED"
+ public final void mUNSIGNED() throws RecognitionException {
+ try {
+ int _type = UNSIGNED;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:485:9: ( ( 'u' | 'U' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'g' | 'G' ) ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'd' | 'D' ) )
+ // src/petascope/wcps/grammar/wcps.g:485:11: ( 'u' | 'U' ) ( 'n' | 'N' ) ( 's' | 'S' ) ( 'i' | 'I' ) ( 'g' | 'G' ) ( 'n' | 'N' ) ( 'e' | 'E' ) ( 'd' | 'D' )
+ {
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "UNSIGNED"
+
+ // $ANTLR start "BOOLEAN"
+ public final void mBOOLEAN() throws RecognitionException {
+ try {
+ int _type = BOOLEAN;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:486:8: ( ( 'b' | 'B' ) ( 'o' | 'O' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'n' | 'N' ) )
+ // src/petascope/wcps/grammar/wcps.g:486:10: ( 'b' | 'B' ) ( 'o' | 'O' ) ( 'o' | 'O' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'a' | 'A' ) ( 'n' | 'N' )
+ {
+ if ( input.LA(1)=='B'||input.LA(1)=='b' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "BOOLEAN"
+
+ // $ANTLR start "CHAR"
+ public final void mCHAR() throws RecognitionException {
+ try {
+ int _type = CHAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:487:5: ( ( 'c' | 'C' ) ( 'h' | 'H' ) ( 'a' | 'A' ) ( 'r' | 'R' ) )
+ // src/petascope/wcps/grammar/wcps.g:487:7: ( 'c' | 'C' ) ( 'h' | 'H' ) ( 'a' | 'A' ) ( 'r' | 'R' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "CHAR"
+
+ // $ANTLR start "SHORT"
+ public final void mSHORT() throws RecognitionException {
+ try {
+ int _type = SHORT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:488:6: ( ( 's' | 'S' ) ( 'h' | 'H' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:488:8: ( 's' | 'S' ) ( 'h' | 'H' ) ( 'o' | 'O' ) ( 'r' | 'R' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "SHORT"
+
+ // $ANTLR start "LONG"
+ public final void mLONG() throws RecognitionException {
+ try {
+ int _type = LONG;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:489:5: ( ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'g' | 'G' ) )
+ // src/petascope/wcps/grammar/wcps.g:489:7: ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'n' | 'N' ) ( 'g' | 'G' )
+ {
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='G'||input.LA(1)=='g' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "LONG"
+
+ // $ANTLR start "FLOAT"
+ public final void mFLOAT() throws RecognitionException {
+ try {
+ int _type = FLOAT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:490:6: ( ( 'f' | 'F' ) ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'a' | 'A' ) ( 't' | 'T' ) )
+ // src/petascope/wcps/grammar/wcps.g:490:8: ( 'f' | 'F' ) ( 'l' | 'L' ) ( 'o' | 'O' ) ( 'a' | 'A' ) ( 't' | 'T' )
+ {
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "FLOAT"
+
+ // $ANTLR start "DOUBLE"
+ public final void mDOUBLE() throws RecognitionException {
+ try {
+ int _type = DOUBLE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:491:7: ( ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'b' | 'B' ) ( 'l' | 'L' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:491:9: ( 'd' | 'D' ) ( 'o' | 'O' ) ( 'u' | 'U' ) ( 'b' | 'B' ) ( 'l' | 'L' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='B'||input.LA(1)=='b' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "DOUBLE"
+
+ // $ANTLR start "COMPLEX"
+ public final void mCOMPLEX() throws RecognitionException {
+ try {
+ int _type = COMPLEX;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:492:8: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'p' | 'P' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'x' | 'X' ) )
+ // src/petascope/wcps/grammar/wcps.g:492:10: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'p' | 'P' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'x' | 'X' )
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COMPLEX"
+
+ // $ANTLR start "COMPLEX2"
+ public final void mCOMPLEX2() throws RecognitionException {
+ try {
+ int _type = COMPLEX2;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:493:9: ( ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'p' | 'P' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'x' | 'X' ) '2' )
+ // src/petascope/wcps/grammar/wcps.g:493:11: ( 'c' | 'C' ) ( 'o' | 'O' ) ( 'm' | 'M' ) ( 'p' | 'P' ) ( 'l' | 'L' ) ( 'e' | 'E' ) ( 'x' | 'X' ) '2'
+ {
+ if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='M'||input.LA(1)=='m' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='P'||input.LA(1)=='p' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ match('2');
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "COMPLEX2"
+
+ // $ANTLR start "BOOLEANCONSTANT"
+ public final void mBOOLEANCONSTANT() throws RecognitionException {
+ try {
+ int _type = BOOLEANCONSTANT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:494:16: ( ( ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'e' | 'E' ) ) | ( ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) ) )
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0=='T'||LA1_0=='t') ) {
+ alt1=1;
+ }
+ else if ( (LA1_0=='F'||LA1_0=='f') ) {
+ alt1=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("", 1, 0, input);
+
+ throw nvae;
+ }
+ switch (alt1) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:494:18: ( ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'e' | 'E' ) )
+ {
+ // src/petascope/wcps/grammar/wcps.g:494:18: ( ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:494:19: ( 't' | 'T' ) ( 'r' | 'R' ) ( 'u' | 'U' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:494:57: ( ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) )
+ {
+ // src/petascope/wcps/grammar/wcps.g:494:57: ( ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' ) )
+ // src/petascope/wcps/grammar/wcps.g:494:58: ( 'f' | 'F' ) ( 'a' | 'A' ) ( 'l' | 'L' ) ( 's' | 'S' ) ( 'e' | 'E' )
+ {
+ if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+
+
+ }
+ break;
+
+ }
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "BOOLEANCONSTANT"
+
+ // $ANTLR start "INTEGERCONSTANT"
+ public final void mINTEGERCONSTANT() throws RecognitionException {
+ try {
+ int _type = INTEGERCONSTANT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:495:16: ( ( PLUS | MINUS )? ( '0' .. '9' )+ )
+ // src/petascope/wcps/grammar/wcps.g:495:19: ( PLUS | MINUS )? ( '0' .. '9' )+
+ {
+ // src/petascope/wcps/grammar/wcps.g:495:19: ( PLUS | MINUS )?
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0=='+'||LA2_0=='-') ) {
+ alt2=1;
+ }
+ switch (alt2) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ }
+
+ // src/petascope/wcps/grammar/wcps.g:495:33: ( '0' .. '9' )+
+ int cnt3=0;
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( ((LA3_0>='0' && LA3_0<='9')) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:495:34: '0' .. '9'
+ {
+ matchRange('0','9');
+
+ }
+ break;
+
+ default :
+ if ( cnt3 >= 1 ) break loop3;
+ EarlyExitException eee =
+ new EarlyExitException(3, input);
+ throw eee;
+ }
+ cnt3++;
+ } while (true);
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "INTEGERCONSTANT"
+
+ // $ANTLR start "FLOATCONSTANT"
+ public final void mFLOATCONSTANT() throws RecognitionException {
+ try {
+ int _type = FLOATCONSTANT;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:496:14: ( INTEGERCONSTANT ( '.' ) ( ( '0' .. '9' )+ ) ( ( 'e' | 'E' ) ( ( '-' | '+' )? ) ( ( '0' .. '9' )+ ) )? )
+ // src/petascope/wcps/grammar/wcps.g:496:16: INTEGERCONSTANT ( '.' ) ( ( '0' .. '9' )+ ) ( ( 'e' | 'E' ) ( ( '-' | '+' )? ) ( ( '0' .. '9' )+ ) )?
+ {
+ mINTEGERCONSTANT();
+ // src/petascope/wcps/grammar/wcps.g:496:32: ( '.' )
+ // src/petascope/wcps/grammar/wcps.g:496:33: '.'
+ {
+ match('.');
+
+ }
+
+ // src/petascope/wcps/grammar/wcps.g:496:37: ( ( '0' .. '9' )+ )
+ // src/petascope/wcps/grammar/wcps.g:496:38: ( '0' .. '9' )+
+ {
+ // src/petascope/wcps/grammar/wcps.g:496:38: ( '0' .. '9' )+
+ int cnt4=0;
+ loop4:
+ do {
+ int alt4=2;
+ int LA4_0 = input.LA(1);
+
+ if ( ((LA4_0>='0' && LA4_0<='9')) ) {
+ alt4=1;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:496:38: '0' .. '9'
+ {
+ matchRange('0','9');
+
+ }
+ break;
+
+ default :
+ if ( cnt4 >= 1 ) break loop4;
+ EarlyExitException eee =
+ new EarlyExitException(4, input);
+ throw eee;
+ }
+ cnt4++;
+ } while (true);
+
+
+ }
+
+ // src/petascope/wcps/grammar/wcps.g:496:48: ( ( 'e' | 'E' ) ( ( '-' | '+' )? ) ( ( '0' .. '9' )+ ) )?
+ int alt7=2;
+ int LA7_0 = input.LA(1);
+
+ if ( (LA7_0=='E'||LA7_0=='e') ) {
+ alt7=1;
+ }
+ switch (alt7) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:496:49: ( 'e' | 'E' ) ( ( '-' | '+' )? ) ( ( '0' .. '9' )+ )
+ {
+ if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ // src/petascope/wcps/grammar/wcps.g:496:58: ( ( '-' | '+' )? )
+ // src/petascope/wcps/grammar/wcps.g:496:59: ( '-' | '+' )?
+ {
+ // src/petascope/wcps/grammar/wcps.g:496:59: ( '-' | '+' )?
+ int alt5=2;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0=='+'||LA5_0=='-') ) {
+ alt5=1;
+ }
+ switch (alt5) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ // src/petascope/wcps/grammar/wcps.g:496:70: ( ( '0' .. '9' )+ )
+ // src/petascope/wcps/grammar/wcps.g:496:71: ( '0' .. '9' )+
+ {
+ // src/petascope/wcps/grammar/wcps.g:496:71: ( '0' .. '9' )+
+ int cnt6=0;
+ loop6:
+ do {
+ int alt6=2;
+ int LA6_0 = input.LA(1);
+
+ if ( ((LA6_0>='0' && LA6_0<='9')) ) {
+ alt6=1;
+ }
+
+
+ switch (alt6) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:496:71: '0' .. '9'
+ {
+ matchRange('0','9');
+
+ }
+ break;
+
+ default :
+ if ( cnt6 >= 1 ) break loop6;
+ EarlyExitException eee =
+ new EarlyExitException(6, input);
+ throw eee;
+ }
+ cnt6++;
+ } while (true);
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "FLOATCONSTANT"
+
+ // $ANTLR start "STRING"
+ public final void mSTRING() throws RecognitionException {
+ try {
+ int _type = STRING;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:497:7: ( '\"' ( options {greedy=false; } : . )* '\"' )
+ // src/petascope/wcps/grammar/wcps.g:497:9: '\"' ( options {greedy=false; } : . )* '\"'
+ {
+ match('\"');
+ // src/petascope/wcps/grammar/wcps.g:497:13: ( options {greedy=false; } : . )*
+ loop8:
+ do {
+ int alt8=2;
+ int LA8_0 = input.LA(1);
+
+ if ( (LA8_0=='\"') ) {
+ alt8=2;
+ }
+ else if ( ((LA8_0>='\u0000' && LA8_0<='!')||(LA8_0>='#' && LA8_0<='\uFFFF')) ) {
+ alt8=1;
+ }
+
+
+ switch (alt8) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:497:41: .
+ {
+ matchAny();
+
+ }
+ break;
+
+ default :
+ break loop8;
+ }
+ } while (true);
+
+ match('\"');
+ setText(getText().substring(1, getText().length()-1));
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "STRING"
+
+ // $ANTLR start "NAME"
+ public final void mNAME() throws RecognitionException {
+ try {
+ int _type = NAME;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:498:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) )
+ // src/petascope/wcps/grammar/wcps.g:498:7: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* )
+ {
+ if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+ // src/petascope/wcps/grammar/wcps.g:498:30: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* )
+ // src/petascope/wcps/grammar/wcps.g:498:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*
+ {
+ // src/petascope/wcps/grammar/wcps.g:498:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*
+ loop9:
+ do {
+ int alt9=2;
+ int LA9_0 = input.LA(1);
+
+ if ( ((LA9_0>='0' && LA9_0<='9')||(LA9_0>='A' && LA9_0<='Z')||LA9_0=='_'||(LA9_0>='a' && LA9_0<='z')) ) {
+ alt9=1;
+ }
+
+
+ switch (alt9) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ default :
+ break loop9;
+ }
+ } while (true);
+
+
+ }
+
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "NAME"
+
+ // $ANTLR start "VARIABLE_DOLLAR"
+ public final void mVARIABLE_DOLLAR() throws RecognitionException {
+ try {
+ int _type = VARIABLE_DOLLAR;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:499:16: ( '$' ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) )
+ // src/petascope/wcps/grammar/wcps.g:499:18: '$' ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* )
+ {
+ match('$');
+ // src/petascope/wcps/grammar/wcps.g:499:21: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* )
+ // src/petascope/wcps/grammar/wcps.g:499:22: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*
+ {
+ // src/petascope/wcps/grammar/wcps.g:499:22: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*
+ loop10:
+ do {
+ int alt10=2;
+ int LA10_0 = input.LA(1);
+
+ if ( ((LA10_0>='0' && LA10_0<='9')||(LA10_0>='A' && LA10_0<='Z')||LA10_0=='_'||(LA10_0>='a' && LA10_0<='z')) ) {
+ alt10=1;
+ }
+
+
+ switch (alt10) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ default :
+ break loop10;
+ }
+ } while (true);
+
+
+ }
+
+ setText(getText().substring(1, getText().length()));
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "VARIABLE_DOLLAR"
+
+ // $ANTLR start "WHITESPACE"
+ public final void mWHITESPACE() throws RecognitionException {
+ try {
+ int _type = WHITESPACE;
+ int _channel = DEFAULT_TOKEN_CHANNEL;
+ // src/petascope/wcps/grammar/wcps.g:500:11: ( ( ' ' | '\\t' | '\\r' | '\\n' | '\\u000C' )+ )
+ // src/petascope/wcps/grammar/wcps.g:500:13: ( ' ' | '\\t' | '\\r' | '\\n' | '\\u000C' )+
+ {
+ // src/petascope/wcps/grammar/wcps.g:500:13: ( ' ' | '\\t' | '\\r' | '\\n' | '\\u000C' )+
+ int cnt11=0;
+ loop11:
+ do {
+ int alt11=2;
+ int LA11_0 = input.LA(1);
+
+ if ( ((LA11_0>='\t' && LA11_0<='\n')||(LA11_0>='\f' && LA11_0<='\r')||LA11_0==' ') ) {
+ alt11=1;
+ }
+
+
+ switch (alt11) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:
+ {
+ if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||(input.LA(1)>='\f' && input.LA(1)<='\r')||input.LA(1)==' ' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ recover(mse);
+ throw mse;}
+
+
+ }
+ break;
+
+ default :
+ if ( cnt11 >= 1 ) break loop11;
+ EarlyExitException eee =
+ new EarlyExitException(11, input);
+ throw eee;
+ }
+ cnt11++;
+ } while (true);
+
+ skip();
+
+ }
+
+ state.type = _type;
+ state.channel = _channel;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end "WHITESPACE"
+
+ public void mTokens() throws RecognitionException {
+ // src/petascope/wcps/grammar/wcps.g:1:8: ( PLUS | MINUS | DIVIDE | MULT | EQUALS | NOTEQUALS | LT | GT | LTE | GTE | DOT | LPAREN | RPAREN | LBRACKET | RBRACKET | LBRACE | RBRACE | COMMA | COLON | SEMICOLON | FOR | IN | WHERE | RETURN | STORE | ENCODE | SQRT | SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN | EXP | LN | LOG | ROUND | ABS | OVERLAY | STRUCT | RE | IM | AND | OR | XOR | NOT | IDENTIFIER | IMAGECRS | IMAGECRSDOMAIN | CRSSET | DOMAIN | NULLSET | NULLDEFAULT | INTERPOLATIONDEFAULT | INTERPOLATIONSET | SETIDENTIFIER | SETNULLSET | SETINTERPOLATIONDEFAULT | SETINTERPOLATIONSET | SETCRSSET | TRIM | SLICE | EXTEND | SCALE | CRSTRANSFORM | COUNT | ADD | AVG | MAX | MIN | SOME | ALL | COVERAGE | OVER | VALUE | VALUES | LIST | CONDENSE | USING | NEAREST | LINEAR | QUADRATIC | CUBIC | FULL | NONE | HALF | OTHER | PHI | BIT | UNSIGNED | BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT | STRING | NAME | VARIABLE_DOLLAR | WHITESPACE )
+ int alt12=108;
+ alt12 = dfa12.predict(input);
+ switch (alt12) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:1:10: PLUS
+ {
+ mPLUS();
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:1:15: MINUS
+ {
+ mMINUS();
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:1:21: DIVIDE
+ {
+ mDIVIDE();
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:1:28: MULT
+ {
+ mMULT();
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:1:33: EQUALS
+ {
+ mEQUALS();
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:1:40: NOTEQUALS
+ {
+ mNOTEQUALS();
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:1:50: LT
+ {
+ mLT();
+
+ }
+ break;
+ case 8 :
+ // src/petascope/wcps/grammar/wcps.g:1:53: GT
+ {
+ mGT();
+
+ }
+ break;
+ case 9 :
+ // src/petascope/wcps/grammar/wcps.g:1:56: LTE
+ {
+ mLTE();
+
+ }
+ break;
+ case 10 :
+ // src/petascope/wcps/grammar/wcps.g:1:60: GTE
+ {
+ mGTE();
+
+ }
+ break;
+ case 11 :
+ // src/petascope/wcps/grammar/wcps.g:1:64: DOT
+ {
+ mDOT();
+
+ }
+ break;
+ case 12 :
+ // src/petascope/wcps/grammar/wcps.g:1:68: LPAREN
+ {
+ mLPAREN();
+
+ }
+ break;
+ case 13 :
+ // src/petascope/wcps/grammar/wcps.g:1:75: RPAREN
+ {
+ mRPAREN();
+
+ }
+ break;
+ case 14 :
+ // src/petascope/wcps/grammar/wcps.g:1:82: LBRACKET
+ {
+ mLBRACKET();
+
+ }
+ break;
+ case 15 :
+ // src/petascope/wcps/grammar/wcps.g:1:91: RBRACKET
+ {
+ mRBRACKET();
+
+ }
+ break;
+ case 16 :
+ // src/petascope/wcps/grammar/wcps.g:1:100: LBRACE
+ {
+ mLBRACE();
+
+ }
+ break;
+ case 17 :
+ // src/petascope/wcps/grammar/wcps.g:1:107: RBRACE
+ {
+ mRBRACE();
+
+ }
+ break;
+ case 18 :
+ // src/petascope/wcps/grammar/wcps.g:1:114: COMMA
+ {
+ mCOMMA();
+
+ }
+ break;
+ case 19 :
+ // src/petascope/wcps/grammar/wcps.g:1:120: COLON
+ {
+ mCOLON();
+
+ }
+ break;
+ case 20 :
+ // src/petascope/wcps/grammar/wcps.g:1:126: SEMICOLON
+ {
+ mSEMICOLON();
+
+ }
+ break;
+ case 21 :
+ // src/petascope/wcps/grammar/wcps.g:1:136: FOR
+ {
+ mFOR();
+
+ }
+ break;
+ case 22 :
+ // src/petascope/wcps/grammar/wcps.g:1:140: IN
+ {
+ mIN();
+
+ }
+ break;
+ case 23 :
+ // src/petascope/wcps/grammar/wcps.g:1:143: WHERE
+ {
+ mWHERE();
+
+ }
+ break;
+ case 24 :
+ // src/petascope/wcps/grammar/wcps.g:1:149: RETURN
+ {
+ mRETURN();
+
+ }
+ break;
+ case 25 :
+ // src/petascope/wcps/grammar/wcps.g:1:156: STORE
+ {
+ mSTORE();
+
+ }
+ break;
+ case 26 :
+ // src/petascope/wcps/grammar/wcps.g:1:162: ENCODE
+ {
+ mENCODE();
+
+ }
+ break;
+ case 27 :
+ // src/petascope/wcps/grammar/wcps.g:1:169: SQRT
+ {
+ mSQRT();
+
+ }
+ break;
+ case 28 :
+ // src/petascope/wcps/grammar/wcps.g:1:174: SIN
+ {
+ mSIN();
+
+ }
+ break;
+ case 29 :
+ // src/petascope/wcps/grammar/wcps.g:1:178: COS
+ {
+ mCOS();
+
+ }
+ break;
+ case 30 :
+ // src/petascope/wcps/grammar/wcps.g:1:182: TAN
+ {
+ mTAN();
+
+ }
+ break;
+ case 31 :
+ // src/petascope/wcps/grammar/wcps.g:1:186: SINH
+ {
+ mSINH();
+
+ }
+ break;
+ case 32 :
+ // src/petascope/wcps/grammar/wcps.g:1:191: COSH
+ {
+ mCOSH();
+
+ }
+ break;
+ case 33 :
+ // src/petascope/wcps/grammar/wcps.g:1:196: TANH
+ {
+ mTANH();
+
+ }
+ break;
+ case 34 :
+ // src/petascope/wcps/grammar/wcps.g:1:201: ARCSIN
+ {
+ mARCSIN();
+
+ }
+ break;
+ case 35 :
+ // src/petascope/wcps/grammar/wcps.g:1:208: ARCCOS
+ {
+ mARCCOS();
+
+ }
+ break;
+ case 36 :
+ // src/petascope/wcps/grammar/wcps.g:1:215: ARCTAN
+ {
+ mARCTAN();
+
+ }
+ break;
+ case 37 :
+ // src/petascope/wcps/grammar/wcps.g:1:222: EXP
+ {
+ mEXP();
+
+ }
+ break;
+ case 38 :
+ // src/petascope/wcps/grammar/wcps.g:1:226: LN
+ {
+ mLN();
+
+ }
+ break;
+ case 39 :
+ // src/petascope/wcps/grammar/wcps.g:1:229: LOG
+ {
+ mLOG();
+
+ }
+ break;
+ case 40 :
+ // src/petascope/wcps/grammar/wcps.g:1:233: ROUND
+ {
+ mROUND();
+
+ }
+ break;
+ case 41 :
+ // src/petascope/wcps/grammar/wcps.g:1:239: ABS
+ {
+ mABS();
+
+ }
+ break;
+ case 42 :
+ // src/petascope/wcps/grammar/wcps.g:1:243: OVERLAY
+ {
+ mOVERLAY();
+
+ }
+ break;
+ case 43 :
+ // src/petascope/wcps/grammar/wcps.g:1:251: STRUCT
+ {
+ mSTRUCT();
+
+ }
+ break;
+ case 44 :
+ // src/petascope/wcps/grammar/wcps.g:1:258: RE
+ {
+ mRE();
+
+ }
+ break;
+ case 45 :
+ // src/petascope/wcps/grammar/wcps.g:1:261: IM
+ {
+ mIM();
+
+ }
+ break;
+ case 46 :
+ // src/petascope/wcps/grammar/wcps.g:1:264: AND
+ {
+ mAND();
+
+ }
+ break;
+ case 47 :
+ // src/petascope/wcps/grammar/wcps.g:1:268: OR
+ {
+ mOR();
+
+ }
+ break;
+ case 48 :
+ // src/petascope/wcps/grammar/wcps.g:1:271: XOR
+ {
+ mXOR();
+
+ }
+ break;
+ case 49 :
+ // src/petascope/wcps/grammar/wcps.g:1:275: NOT
+ {
+ mNOT();
+
+ }
+ break;
+ case 50 :
+ // src/petascope/wcps/grammar/wcps.g:1:279: IDENTIFIER
+ {
+ mIDENTIFIER();
+
+ }
+ break;
+ case 51 :
+ // src/petascope/wcps/grammar/wcps.g:1:290: IMAGECRS
+ {
+ mIMAGECRS();
+
+ }
+ break;
+ case 52 :
+ // src/petascope/wcps/grammar/wcps.g:1:299: IMAGECRSDOMAIN
+ {
+ mIMAGECRSDOMAIN();
+
+ }
+ break;
+ case 53 :
+ // src/petascope/wcps/grammar/wcps.g:1:314: CRSSET
+ {
+ mCRSSET();
+
+ }
+ break;
+ case 54 :
+ // src/petascope/wcps/grammar/wcps.g:1:321: DOMAIN
+ {
+ mDOMAIN();
+
+ }
+ break;
+ case 55 :
+ // src/petascope/wcps/grammar/wcps.g:1:328: NULLSET
+ {
+ mNULLSET();
+
+ }
+ break;
+ case 56 :
+ // src/petascope/wcps/grammar/wcps.g:1:336: NULLDEFAULT
+ {
+ mNULLDEFAULT();
+
+ }
+ break;
+ case 57 :
+ // src/petascope/wcps/grammar/wcps.g:1:348: INTERPOLATIONDEFAULT
+ {
+ mINTERPOLATIONDEFAULT();
+
+ }
+ break;
+ case 58 :
+ // src/petascope/wcps/grammar/wcps.g:1:369: INTERPOLATIONSET
+ {
+ mINTERPOLATIONSET();
+
+ }
+ break;
+ case 59 :
+ // src/petascope/wcps/grammar/wcps.g:1:386: SETIDENTIFIER
+ {
+ mSETIDENTIFIER();
+
+ }
+ break;
+ case 60 :
+ // src/petascope/wcps/grammar/wcps.g:1:400: SETNULLSET
+ {
+ mSETNULLSET();
+
+ }
+ break;
+ case 61 :
+ // src/petascope/wcps/grammar/wcps.g:1:411: SETINTERPOLATIONDEFAULT
+ {
+ mSETINTERPOLATIONDEFAULT();
+
+ }
+ break;
+ case 62 :
+ // src/petascope/wcps/grammar/wcps.g:1:435: SETINTERPOLATIONSET
+ {
+ mSETINTERPOLATIONSET();
+
+ }
+ break;
+ case 63 :
+ // src/petascope/wcps/grammar/wcps.g:1:455: SETCRSSET
+ {
+ mSETCRSSET();
+
+ }
+ break;
+ case 64 :
+ // src/petascope/wcps/grammar/wcps.g:1:465: TRIM
+ {
+ mTRIM();
+
+ }
+ break;
+ case 65 :
+ // src/petascope/wcps/grammar/wcps.g:1:470: SLICE
+ {
+ mSLICE();
+
+ }
+ break;
+ case 66 :
+ // src/petascope/wcps/grammar/wcps.g:1:476: EXTEND
+ {
+ mEXTEND();
+
+ }
+ break;
+ case 67 :
+ // src/petascope/wcps/grammar/wcps.g:1:483: SCALE
+ {
+ mSCALE();
+
+ }
+ break;
+ case 68 :
+ // src/petascope/wcps/grammar/wcps.g:1:489: CRSTRANSFORM
+ {
+ mCRSTRANSFORM();
+
+ }
+ break;
+ case 69 :
+ // src/petascope/wcps/grammar/wcps.g:1:502: COUNT
+ {
+ mCOUNT();
+
+ }
+ break;
+ case 70 :
+ // src/petascope/wcps/grammar/wcps.g:1:508: ADD
+ {
+ mADD();
+
+ }
+ break;
+ case 71 :
+ // src/petascope/wcps/grammar/wcps.g:1:512: AVG
+ {
+ mAVG();
+
+ }
+ break;
+ case 72 :
+ // src/petascope/wcps/grammar/wcps.g:1:516: MAX
+ {
+ mMAX();
+
+ }
+ break;
+ case 73 :
+ // src/petascope/wcps/grammar/wcps.g:1:520: MIN
+ {
+ mMIN();
+
+ }
+ break;
+ case 74 :
+ // src/petascope/wcps/grammar/wcps.g:1:524: SOME
+ {
+ mSOME();
+
+ }
+ break;
+ case 75 :
+ // src/petascope/wcps/grammar/wcps.g:1:529: ALL
+ {
+ mALL();
+
+ }
+ break;
+ case 76 :
+ // src/petascope/wcps/grammar/wcps.g:1:533: COVERAGE
+ {
+ mCOVERAGE();
+
+ }
+ break;
+ case 77 :
+ // src/petascope/wcps/grammar/wcps.g:1:542: OVER
+ {
+ mOVER();
+
+ }
+ break;
+ case 78 :
+ // src/petascope/wcps/grammar/wcps.g:1:547: VALUE
+ {
+ mVALUE();
+
+ }
+ break;
+ case 79 :
+ // src/petascope/wcps/grammar/wcps.g:1:553: VALUES
+ {
+ mVALUES();
+
+ }
+ break;
+ case 80 :
+ // src/petascope/wcps/grammar/wcps.g:1:560: LIST
+ {
+ mLIST();
+
+ }
+ break;
+ case 81 :
+ // src/petascope/wcps/grammar/wcps.g:1:565: CONDENSE
+ {
+ mCONDENSE();
+
+ }
+ break;
+ case 82 :
+ // src/petascope/wcps/grammar/wcps.g:1:574: USING
+ {
+ mUSING();
+
+ }
+ break;
+ case 83 :
+ // src/petascope/wcps/grammar/wcps.g:1:580: NEAREST
+ {
+ mNEAREST();
+
+ }
+ break;
+ case 84 :
+ // src/petascope/wcps/grammar/wcps.g:1:588: LINEAR
+ {
+ mLINEAR();
+
+ }
+ break;
+ case 85 :
+ // src/petascope/wcps/grammar/wcps.g:1:595: QUADRATIC
+ {
+ mQUADRATIC();
+
+ }
+ break;
+ case 86 :
+ // src/petascope/wcps/grammar/wcps.g:1:605: CUBIC
+ {
+ mCUBIC();
+
+ }
+ break;
+ case 87 :
+ // src/petascope/wcps/grammar/wcps.g:1:611: FULL
+ {
+ mFULL();
+
+ }
+ break;
+ case 88 :
+ // src/petascope/wcps/grammar/wcps.g:1:616: NONE
+ {
+ mNONE();
+
+ }
+ break;
+ case 89 :
+ // src/petascope/wcps/grammar/wcps.g:1:621: HALF
+ {
+ mHALF();
+
+ }
+ break;
+ case 90 :
+ // src/petascope/wcps/grammar/wcps.g:1:626: OTHER
+ {
+ mOTHER();
+
+ }
+ break;
+ case 91 :
+ // src/petascope/wcps/grammar/wcps.g:1:632: PHI
+ {
+ mPHI();
+
+ }
+ break;
+ case 92 :
+ // src/petascope/wcps/grammar/wcps.g:1:636: BIT
+ {
+ mBIT();
+
+ }
+ break;
+ case 93 :
+ // src/petascope/wcps/grammar/wcps.g:1:640: UNSIGNED
+ {
+ mUNSIGNED();
+
+ }
+ break;
+ case 94 :
+ // src/petascope/wcps/grammar/wcps.g:1:649: BOOLEAN
+ {
+ mBOOLEAN();
+
+ }
+ break;
+ case 95 :
+ // src/petascope/wcps/grammar/wcps.g:1:657: CHAR
+ {
+ mCHAR();
+
+ }
+ break;
+ case 96 :
+ // src/petascope/wcps/grammar/wcps.g:1:662: SHORT
+ {
+ mSHORT();
+
+ }
+ break;
+ case 97 :
+ // src/petascope/wcps/grammar/wcps.g:1:668: LONG
+ {
+ mLONG();
+
+ }
+ break;
+ case 98 :
+ // src/petascope/wcps/grammar/wcps.g:1:673: FLOAT
+ {
+ mFLOAT();
+
+ }
+ break;
+ case 99 :
+ // src/petascope/wcps/grammar/wcps.g:1:679: DOUBLE
+ {
+ mDOUBLE();
+
+ }
+ break;
+ case 100 :
+ // src/petascope/wcps/grammar/wcps.g:1:686: COMPLEX
+ {
+ mCOMPLEX();
+
+ }
+ break;
+ case 101 :
+ // src/petascope/wcps/grammar/wcps.g:1:694: COMPLEX2
+ {
+ mCOMPLEX2();
+
+ }
+ break;
+ case 102 :
+ // src/petascope/wcps/grammar/wcps.g:1:703: BOOLEANCONSTANT
+ {
+ mBOOLEANCONSTANT();
+
+ }
+ break;
+ case 103 :
+ // src/petascope/wcps/grammar/wcps.g:1:719: INTEGERCONSTANT
+ {
+ mINTEGERCONSTANT();
+
+ }
+ break;
+ case 104 :
+ // src/petascope/wcps/grammar/wcps.g:1:735: FLOATCONSTANT
+ {
+ mFLOATCONSTANT();
+
+ }
+ break;
+ case 105 :
+ // src/petascope/wcps/grammar/wcps.g:1:749: STRING
+ {
+ mSTRING();
+
+ }
+ break;
+ case 106 :
+ // src/petascope/wcps/grammar/wcps.g:1:756: NAME
+ {
+ mNAME();
+
+ }
+ break;
+ case 107 :
+ // src/petascope/wcps/grammar/wcps.g:1:761: VARIABLE_DOLLAR
+ {
+ mVARIABLE_DOLLAR();
+
+ }
+ break;
+ case 108 :
+ // src/petascope/wcps/grammar/wcps.g:1:777: WHITESPACE
+ {
+ mWHITESPACE();
+
+ }
+ break;
+
+ }
+
+ }
+
+
+ protected DFA12 dfa12 = new DFA12(this);
+ static final String DFA12_eotS =
+ "\1\uffff\1\55\1\56\4\uffff\1\60\1\62\12\uffff\25\52\1\150\12\uffff"+
+ "\4\52\1\157\1\161\2\52\1\165\27\52\1\u0094\3\52\1\u009a\20\52\2"+
+ "\uffff\1\u00ad\4\52\1\uffff\1\52\1\uffff\3\52\1\uffff\4\52\1\u00bb"+
+ "\6\52\1\u00c4\1\52\1\u00c7\7\52\1\u00d1\3\52\1\u00d7\1\u00d8\1\u00d9"+
+ "\1\u00da\1\u00db\1\uffff\1\u00dc\4\52\1\uffff\1\52\1\u00e2\1\u00e3"+
+ "\5\52\1\u00e9\1\u00ea\5\52\1\u00f0\1\u00f1\1\52\1\uffff\1\u00f3"+
+ "\12\52\1\u00fe\1\u00ff\1\uffff\5\52\1\u0106\2\52\1\uffff\1\52\1"+
+ "\u010a\1\uffff\7\52\1\u0112\1\u0113\1\uffff\1\u0114\1\u0115\3\52"+
+ "\6\uffff\1\u0119\1\u011a\1\52\1\u011d\1\52\2\uffff\1\u011f\4\52"+
+ "\2\uffff\4\52\1\u0129\2\uffff\1\52\1\uffff\1\u012b\1\u0115\3\52"+
+ "\1\u012f\1\52\1\u0131\1\u0132\1\52\2\uffff\4\52\1\u0138\1\u0139"+
+ "\1\uffff\1\u013a\2\52\1\uffff\1\u013d\5\52\1\u0143\4\uffff\3\52"+
+ "\2\uffff\2\52\1\uffff\1\u0149\1\uffff\5\52\1\u0150\1\u0151\2\52"+
+ "\1\uffff\1\52\1\uffff\3\52\1\uffff\1\u0158\2\uffff\1\u0159\4\52"+
+ "\3\uffff\1\u015e\1\u015f\1\uffff\3\52\1\u0163\1\52\1\uffff\1\u0165"+
+ "\1\u0166\1\u0167\1\u0168\1\52\1\uffff\3\52\1\u016d\1\u016e\1\u016f"+
+ "\2\uffff\6\52\2\uffff\4\52\2\uffff\2\52\1\u017d\1\uffff\1\52\4\uffff"+
+ "\1\u017f\1\u0180\1\52\1\u0182\3\uffff\2\52\1\u0185\1\52\1\u0188"+
+ "\5\52\1\u018e\1\u018f\1\u0190\1\uffff\1\52\2\uffff\1\52\1\uffff"+
+ "\1\u0193\1\52\1\uffff\2\52\1\uffff\4\52\1\u019b\3\uffff\2\52\1\uffff"+
+ "\1\u019e\2\52\1\u01a1\2\52\1\u01a4\1\uffff\2\52\1\uffff\2\52\1\uffff"+
+ "\2\52\1\uffff\1\52\1\u01ac\4\52\1\u01b1\1\uffff\2\52\1\u01b5\1\52"+
+ "\1\uffff\2\52\1\u01b9\1\uffff\3\52\1\uffff\2\52\1\u01bf\2\52\1\uffff"+
+ "\7\52\1\u01ca\1\u01cb\1\52\2\uffff\2\52\1\u01cf\1\uffff";
+ static final String DFA12_eofS =
+ "\u01d0\uffff";
+ static final String DFA12_minS =
+ "\1\11\2\60\4\uffff\2\75\12\uffff\1\101\1\104\1\110\1\105\1\103\1"+
+ "\116\1\110\1\101\1\102\1\111\1\122\1\117\1\105\1\117\2\101\1\116"+
+ "\1\125\1\101\1\110\1\111\1\56\12\uffff\1\122\1\114\1\117\1\114\2"+
+ "\60\2\105\1\60\1\125\1\117\1\122\1\116\1\124\1\111\1\101\1\115\1"+
+ "\117\1\103\1\120\1\115\1\123\1\102\1\101\1\116\1\111\1\103\1\123"+
+ "\2\104\1\107\1\114\1\60\1\107\1\116\1\105\1\60\1\110\1\122\1\116"+
+ "\1\114\1\101\1\115\1\130\1\116\1\114\1\111\1\123\1\101\1\114\1\111"+
+ "\1\124\1\117\2\uffff\1\60\1\114\1\101\1\123\1\105\1\uffff\1\107"+
+ "\1\uffff\1\116\1\122\1\125\1\uffff\1\116\1\122\1\125\1\124\1\60"+
+ "\2\103\1\114\1\105\1\122\1\117\1\60\1\105\1\60\1\116\1\105\1\104"+
+ "\1\120\1\123\1\111\1\122\1\60\1\115\1\105\1\103\5\60\1\uffff\1\60"+
+ "\1\107\1\124\1\105\1\122\1\uffff\1\105\2\60\1\105\1\114\1\122\1"+
+ "\101\1\102\2\60\1\125\1\116\1\111\1\104\1\106\2\60\1\114\1\uffff"+
+ "\1\60\1\124\1\105\1\122\1\105\1\124\1\105\1\122\1\104\1\105\1\103"+
+ "\2\60\1\uffff\1\104\1\125\1\122\2\105\1\60\1\124\1\104\1\uffff\1"+
+ "\116\1\60\1\uffff\1\124\1\122\1\105\1\114\1\105\1\122\1\103\2\60"+
+ "\1\uffff\2\60\1\111\1\117\1\101\6\uffff\2\60\1\101\1\60\1\122\2"+
+ "\uffff\1\60\1\104\1\105\1\111\1\114\2\uffff\1\105\2\107\1\122\1"+
+ "\60\2\uffff\1\105\1\uffff\2\60\1\120\1\103\1\111\1\60\1\116\2\60"+
+ "\1\124\2\uffff\1\105\1\124\1\114\1\123\2\60\1\uffff\1\60\1\105\1"+
+ "\104\1\uffff\1\60\1\101\1\116\1\105\1\124\1\101\1\60\4\uffff\1\116"+
+ "\1\123\1\116\2\uffff\1\122\1\101\1\uffff\1\60\1\uffff\2\105\1\123"+
+ "\1\116\1\105\2\60\1\116\1\101\1\uffff\1\101\1\uffff\1\117\1\122"+
+ "\1\106\1\uffff\1\60\2\uffff\1\60\1\116\1\105\1\114\1\123\3\uffff"+
+ "\2\60\1\uffff\1\107\1\123\1\130\1\60\1\116\1\uffff\4\60\1\131\1"+
+ "\uffff\1\124\1\106\1\124\3\60\2\uffff\1\105\1\124\1\116\1\114\1"+
+ "\123\1\111\2\uffff\1\124\1\122\1\123\1\105\2\uffff\2\105\1\60\1"+
+ "\uffff\1\123\4\uffff\2\60\1\101\1\60\3\uffff\1\104\1\111\1\60\1"+
+ "\101\1\60\1\105\1\111\1\120\1\105\1\124\3\60\1\uffff\1\106\2\uffff"+
+ "\1\125\1\uffff\1\60\1\103\1\uffff\1\124\1\117\1\uffff\1\122\1\106"+
+ "\1\117\1\124\1\60\3\uffff\1\117\1\114\1\uffff\1\60\1\111\1\115\1"+
+ "\60\1\111\1\114\1\60\1\uffff\1\122\1\124\1\uffff\1\117\1\101\1\uffff"+
+ "\1\105\1\101\1\uffff\1\115\1\60\1\116\1\111\1\122\1\124\1\60\1\uffff"+
+ "\1\104\1\116\1\60\1\111\1\uffff\2\105\1\60\1\uffff\1\117\1\106\1"+
+ "\124\1\uffff\1\116\1\101\1\60\1\104\1\125\1\uffff\2\105\1\114\1"+
+ "\106\2\124\1\101\2\60\1\125\2\uffff\1\114\1\124\1\60\1\uffff";
+ static final String DFA12_maxS =
+ "\1\175\2\71\4\uffff\2\75\12\uffff\1\165\1\156\1\150\1\157\1\164"+
+ "\1\170\1\165\1\162\1\166\1\157\1\166\1\157\1\165\1\157\1\151\1\141"+
+ "\1\163\1\165\1\141\1\150\1\157\1\71\12\uffff\1\162\1\154\1\157\1"+
+ "\154\2\172\2\145\1\172\1\165\2\162\1\156\1\164\1\151\1\141\1\155"+
+ "\1\157\1\143\1\164\1\166\1\163\1\142\1\141\1\156\1\165\1\143\1\163"+
+ "\2\144\1\147\1\154\1\172\1\156\1\163\1\145\1\172\1\150\1\162\1\164"+
+ "\1\154\1\141\1\165\1\170\1\156\1\154\1\151\1\163\1\141\1\154\1\151"+
+ "\1\164\1\157\2\uffff\1\172\1\154\1\141\1\163\1\145\1\uffff\1\147"+
+ "\1\uffff\1\156\1\162\1\165\1\uffff\1\156\1\162\1\165\1\164\1\172"+
+ "\1\156\1\143\1\154\1\145\1\162\1\157\1\172\1\145\1\172\1\156\1\145"+
+ "\1\144\1\160\1\164\1\151\1\162\1\172\1\155\1\145\1\164\5\172\1\uffff"+
+ "\1\172\1\147\1\164\1\145\1\162\1\uffff\1\145\2\172\1\145\1\154\1"+
+ "\162\1\141\1\142\2\172\1\165\1\156\1\151\1\144\1\146\2\172\1\154"+
+ "\1\uffff\1\172\1\164\1\145\1\162\1\145\1\164\1\145\1\162\1\144\1"+
+ "\145\1\143\2\172\1\uffff\1\156\1\165\1\162\2\145\1\172\1\164\1\144"+
+ "\1\uffff\1\156\1\172\1\uffff\1\164\1\162\1\145\1\154\1\145\1\162"+
+ "\1\143\2\172\1\uffff\2\172\1\151\1\157\1\141\6\uffff\2\172\1\141"+
+ "\1\172\1\162\2\uffff\1\172\1\163\1\145\1\151\1\154\2\uffff\1\145"+
+ "\2\147\1\162\1\172\2\uffff\1\145\1\uffff\2\172\1\160\1\143\1\151"+
+ "\1\172\1\156\2\172\1\164\2\uffff\1\145\1\164\1\154\1\163\2\172\1"+
+ "\uffff\1\172\1\145\1\144\1\uffff\1\172\1\141\1\156\1\145\1\164\1"+
+ "\141\1\172\4\uffff\1\156\1\163\1\156\2\uffff\1\162\1\141\1\uffff"+
+ "\1\172\1\uffff\2\145\1\163\1\156\1\145\2\172\1\156\1\141\1\uffff"+
+ "\1\141\1\uffff\1\157\1\162\1\146\1\uffff\1\172\2\uffff\1\172\1\156"+
+ "\1\145\1\154\1\163\3\uffff\2\172\1\uffff\1\147\1\163\1\170\1\172"+
+ "\1\156\1\uffff\4\172\1\171\1\uffff\1\164\1\146\1\164\3\172\2\uffff"+
+ "\1\145\1\164\1\156\1\154\1\163\1\151\2\uffff\1\164\1\162\1\163\1"+
+ "\145\2\uffff\2\145\1\172\1\uffff\1\163\4\uffff\2\172\1\141\1\172"+
+ "\3\uffff\1\144\1\151\1\172\1\141\1\172\1\145\1\151\1\160\1\145\1"+
+ "\164\3\172\1\uffff\1\146\2\uffff\1\165\1\uffff\1\172\1\143\1\uffff"+
+ "\1\164\1\157\1\uffff\1\162\1\146\1\157\1\164\1\172\3\uffff\1\157"+
+ "\1\154\1\uffff\1\172\1\151\1\155\1\172\1\151\1\154\1\172\1\uffff"+
+ "\1\162\1\164\1\uffff\1\157\1\141\1\uffff\1\145\1\141\1\uffff\1\155"+
+ "\1\172\1\156\1\151\1\162\1\164\1\172\1\uffff\1\163\1\156\1\172\1"+
+ "\151\1\uffff\2\145\1\172\1\uffff\1\157\1\146\1\164\1\uffff\1\156"+
+ "\1\141\1\172\1\163\1\165\1\uffff\2\145\1\154\1\146\2\164\1\141\2"+
+ "\172\1\165\2\uffff\1\154\1\164\1\172\1\uffff";
+ static final String DFA12_acceptS =
+ "\3\uffff\1\3\1\4\1\5\1\6\2\uffff\1\13\1\14\1\15\1\16\1\17\1\20\1"+
+ "\21\1\22\1\23\1\24\26\uffff\1\151\1\152\1\153\1\154\1\1\1\2\1\11"+
+ "\1\7\1\12\1\10\65\uffff\1\147\1\150\5\uffff\1\26\1\uffff\1\55\3"+
+ "\uffff\1\54\36\uffff\1\46\5\uffff\1\57\22\uffff\1\25\15\uffff\1"+
+ "\34\10\uffff\1\45\2\uffff\1\35\11\uffff\1\36\5\uffff\1\51\1\56\1"+
+ "\106\1\107\1\113\1\47\5\uffff\1\60\1\61\5\uffff\1\110\1\111\5\uffff"+
+ "\1\133\1\134\1\uffff\1\127\12\uffff\1\33\1\37\6\uffff\1\112\3\uffff"+
+ "\1\40\7\uffff\1\137\1\41\1\100\1\146\3\uffff\1\141\1\120\2\uffff"+
+ "\1\115\1\uffff\1\130\11\uffff\1\131\1\uffff\1\142\3\uffff\1\27\1"+
+ "\uffff\1\50\1\31\5\uffff\1\101\1\103\1\140\2\uffff\1\105\5\uffff"+
+ "\1\126\5\uffff\1\132\6\uffff\1\116\1\122\6\uffff\1\30\1\53\4\uffff"+
+ "\1\32\1\102\3\uffff\1\65\1\uffff\1\42\1\43\1\44\1\124\4\uffff\1"+
+ "\66\1\143\1\117\15\uffff\1\144\1\uffff\1\52\1\67\1\uffff\1\123\2"+
+ "\uffff\1\136\2\uffff\1\63\5\uffff\1\114\1\121\1\145\2\uffff\1\135"+
+ "\7\uffff\1\77\2\uffff\1\125\2\uffff\1\62\2\uffff\1\74\7\uffff\1"+
+ "\70\4\uffff\1\104\3\uffff\1\73\3\uffff\1\64\5\uffff\1\72\12\uffff"+
+ "\1\76\1\71\3\uffff\1\75";
+ static final String DFA12_specialS =
+ "\u01d0\uffff}>";
+ static final String[] DFA12_transitionS = {
+ "\2\54\1\uffff\2\54\22\uffff\1\54\1\6\1\51\1\uffff\1\53\3\uffff"+
+ "\1\12\1\13\1\4\1\1\1\20\1\2\1\11\1\3\12\50\1\21\1\22\1\7\1\5"+
+ "\1\10\2\uffff\1\33\1\47\1\31\1\40\1\30\1\23\1\52\1\45\1\24\2"+
+ "\52\1\34\1\41\1\37\1\35\1\46\1\44\1\26\1\27\1\32\1\43\1\42\1"+
+ "\25\1\36\2\52\1\14\1\uffff\1\15\1\uffff\1\52\1\uffff\1\33\1"+
+ "\47\1\31\1\40\1\30\1\23\1\52\1\45\1\24\2\52\1\34\1\41\1\37\1"+
+ "\35\1\46\1\44\1\26\1\27\1\32\1\43\1\42\1\25\1\36\2\52\1\16\1"+
+ "\uffff\1\17",
+ "\12\50",
+ "\12\50",
+ "",
+ "",
+ "",
+ "",
+ "\1\57",
+ "\1\61",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\66\12\uffff\1\65\2\uffff\1\63\5\uffff\1\64\13\uffff\1\66"+
+ "\12\uffff\1\65\2\uffff\1\63\5\uffff\1\64",
+ "\1\71\10\uffff\1\70\1\67\25\uffff\1\71\10\uffff\1\70\1\67",
+ "\1\72\37\uffff\1\72",
+ "\1\73\11\uffff\1\74\25\uffff\1\73\11\uffff\1\74",
+ "\1\102\1\uffff\1\100\2\uffff\1\104\1\77\2\uffff\1\101\2\uffff"+
+ "\1\103\1\uffff\1\76\2\uffff\1\75\16\uffff\1\102\1\uffff\1\100"+
+ "\2\uffff\1\104\1\77\2\uffff\1\101\2\uffff\1\103\1\uffff\1\76"+
+ "\2\uffff\1\75",
+ "\1\105\11\uffff\1\106\25\uffff\1\105\11\uffff\1\106",
+ "\1\112\6\uffff\1\107\2\uffff\1\110\2\uffff\1\111\22\uffff\1"+
+ "\112\6\uffff\1\107\2\uffff\1\110\2\uffff\1\111",
+ "\1\113\20\uffff\1\114\16\uffff\1\113\20\uffff\1\114",
+ "\1\116\1\uffff\1\120\7\uffff\1\122\1\uffff\1\117\3\uffff\1"+
+ "\115\3\uffff\1\121\13\uffff\1\116\1\uffff\1\120\7\uffff\1\122"+
+ "\1\uffff\1\117\3\uffff\1\115\3\uffff\1\121",
+ "\1\125\4\uffff\1\123\1\124\31\uffff\1\125\4\uffff\1\123\1\124",
+ "\1\127\1\uffff\1\130\1\uffff\1\126\33\uffff\1\127\1\uffff\1"+
+ "\130\1\uffff\1\126",
+ "\1\131\37\uffff\1\131",
+ "\1\134\11\uffff\1\132\5\uffff\1\133\17\uffff\1\134\11\uffff"+
+ "\1\132\5\uffff\1\133",
+ "\1\135\37\uffff\1\135",
+ "\1\136\7\uffff\1\137\27\uffff\1\136\7\uffff\1\137",
+ "\1\140\37\uffff\1\140",
+ "\1\142\4\uffff\1\141\32\uffff\1\142\4\uffff\1\141",
+ "\1\143\37\uffff\1\143",
+ "\1\144\37\uffff\1\144",
+ "\1\145\37\uffff\1\145",
+ "\1\146\5\uffff\1\147\31\uffff\1\146\5\uffff\1\147",
+ "\1\151\1\uffff\12\50",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\152\37\uffff\1\152",
+ "\1\153\37\uffff\1\153",
+ "\1\154\37\uffff\1\154",
+ "\1\155\37\uffff\1\155",
+ "\12\52\7\uffff\23\52\1\156\6\52\4\uffff\1\52\1\uffff\23\52"+
+ "\1\156\6\52",
+ "\12\52\7\uffff\1\160\31\52\4\uffff\1\52\1\uffff\1\160\31\52",
+ "\1\162\37\uffff\1\162",
+ "\1\163\37\uffff\1\163",
+ "\12\52\7\uffff\23\52\1\164\6\52\4\uffff\1\52\1\uffff\23\52"+
+ "\1\164\6\52",
+ "\1\166\37\uffff\1\166",
+ "\1\167\2\uffff\1\170\34\uffff\1\167\2\uffff\1\170",
+ "\1\171\37\uffff\1\171",
+ "\1\172\37\uffff\1\172",
+ "\1\173\37\uffff\1\173",
+ "\1\174\37\uffff\1\174",
+ "\1\175\37\uffff\1\175",
+ "\1\176\37\uffff\1\176",
+ "\1\177\37\uffff\1\177",
+ "\1\u0080\37\uffff\1\u0080",
+ "\1\u0081\3\uffff\1\u0082\33\uffff\1\u0081\3\uffff\1\u0082",
+ "\1\u0087\1\u0086\4\uffff\1\u0083\1\uffff\1\u0084\1\u0085\26"+
+ "\uffff\1\u0087\1\u0086\4\uffff\1\u0083\1\uffff\1\u0084\1\u0085",
+ "\1\u0088\37\uffff\1\u0088",
+ "\1\u0089\37\uffff\1\u0089",
+ "\1\u008a\37\uffff\1\u008a",
+ "\1\u008b\37\uffff\1\u008b",
+ "\1\u008c\13\uffff\1\u008d\23\uffff\1\u008c\13\uffff\1\u008d",
+ "\1\u008e\37\uffff\1\u008e",
+ "\1\u008f\37\uffff\1\u008f",
+ "\1\u0090\37\uffff\1\u0090",
+ "\1\u0091\37\uffff\1\u0091",
+ "\1\u0092\37\uffff\1\u0092",
+ "\1\u0093\37\uffff\1\u0093",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0095\6\uffff\1\u0096\30\uffff\1\u0095\6\uffff\1\u0096",
+ "\1\u0098\4\uffff\1\u0097\32\uffff\1\u0098\4\uffff\1\u0097",
+ "\1\u0099\37\uffff\1\u0099",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u009b\37\uffff\1\u009b",
+ "\1\u009c\37\uffff\1\u009c",
+ "\1\u009e\5\uffff\1\u009d\31\uffff\1\u009e\5\uffff\1\u009d",
+ "\1\u009f\37\uffff\1\u009f",
+ "\1\u00a0\37\uffff\1\u00a0",
+ "\1\u00a1\7\uffff\1\u00a2\27\uffff\1\u00a1\7\uffff\1\u00a2",
+ "\1\u00a3\37\uffff\1\u00a3",
+ "\1\u00a4\37\uffff\1\u00a4",
+ "\1\u00a5\37\uffff\1\u00a5",
+ "\1\u00a6\37\uffff\1\u00a6",
+ "\1\u00a7\37\uffff\1\u00a7",
+ "\1\u00a8\37\uffff\1\u00a8",
+ "\1\u00a9\37\uffff\1\u00a9",
+ "\1\u00aa\37\uffff\1\u00aa",
+ "\1\u00ab\37\uffff\1\u00ab",
+ "\1\u00ac\37\uffff\1\u00ac",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00ae\37\uffff\1\u00ae",
+ "\1\u00af\37\uffff\1\u00af",
+ "\1\u00b0\37\uffff\1\u00b0",
+ "\1\u00b1\37\uffff\1\u00b1",
+ "",
+ "\1\u00b2\37\uffff\1\u00b2",
+ "",
+ "\1\u00b3\37\uffff\1\u00b3",
+ "\1\u00b4\37\uffff\1\u00b4",
+ "\1\u00b5\37\uffff\1\u00b5",
+ "",
+ "\1\u00b6\37\uffff\1\u00b6",
+ "\1\u00b7\37\uffff\1\u00b7",
+ "\1\u00b8\37\uffff\1\u00b8",
+ "\1\u00b9\37\uffff\1\u00b9",
+ "\12\52\7\uffff\7\52\1\u00ba\22\52\4\uffff\1\52\1\uffff\7\52"+
+ "\1\u00ba\22\52",
+ "\1\u00be\5\uffff\1\u00bc\4\uffff\1\u00bd\24\uffff\1\u00be\5"+
+ "\uffff\1\u00bc\4\uffff\1\u00bd",
+ "\1\u00bf\37\uffff\1\u00bf",
+ "\1\u00c0\37\uffff\1\u00c0",
+ "\1\u00c1\37\uffff\1\u00c1",
+ "\1\u00c2\37\uffff\1\u00c2",
+ "\1\u00c3\37\uffff\1\u00c3",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00c5\37\uffff\1\u00c5",
+ "\12\52\7\uffff\7\52\1\u00c6\22\52\4\uffff\1\52\1\uffff\7\52"+
+ "\1\u00c6\22\52",
+ "\1\u00c8\37\uffff\1\u00c8",
+ "\1\u00c9\37\uffff\1\u00c9",
+ "\1\u00ca\37\uffff\1\u00ca",
+ "\1\u00cb\37\uffff\1\u00cb",
+ "\1\u00cc\1\u00cd\36\uffff\1\u00cc\1\u00cd",
+ "\1\u00ce\37\uffff\1\u00ce",
+ "\1\u00cf\37\uffff\1\u00cf",
+ "\12\52\7\uffff\7\52\1\u00d0\22\52\4\uffff\1\52\1\uffff\7\52"+
+ "\1\u00d0\22\52",
+ "\1\u00d2\37\uffff\1\u00d2",
+ "\1\u00d3\37\uffff\1\u00d3",
+ "\1\u00d5\17\uffff\1\u00d4\1\u00d6\16\uffff\1\u00d5\17\uffff"+
+ "\1\u00d4\1\u00d6",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00dd\37\uffff\1\u00dd",
+ "\1\u00de\37\uffff\1\u00de",
+ "\1\u00df\37\uffff\1\u00df",
+ "\1\u00e0\37\uffff\1\u00e0",
+ "",
+ "\1\u00e1\37\uffff\1\u00e1",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00e4\37\uffff\1\u00e4",
+ "\1\u00e5\37\uffff\1\u00e5",
+ "\1\u00e6\37\uffff\1\u00e6",
+ "\1\u00e7\37\uffff\1\u00e7",
+ "\1\u00e8\37\uffff\1\u00e8",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00eb\37\uffff\1\u00eb",
+ "\1\u00ec\37\uffff\1\u00ec",
+ "\1\u00ed\37\uffff\1\u00ed",
+ "\1\u00ee\37\uffff\1\u00ee",
+ "\1\u00ef\37\uffff\1\u00ef",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00f2\37\uffff\1\u00f2",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u00f4\37\uffff\1\u00f4",
+ "\1\u00f5\37\uffff\1\u00f5",
+ "\1\u00f6\37\uffff\1\u00f6",
+ "\1\u00f7\37\uffff\1\u00f7",
+ "\1\u00f8\37\uffff\1\u00f8",
+ "\1\u00f9\37\uffff\1\u00f9",
+ "\1\u00fa\37\uffff\1\u00fa",
+ "\1\u00fb\37\uffff\1\u00fb",
+ "\1\u00fc\37\uffff\1\u00fc",
+ "\1\u00fd\37\uffff\1\u00fd",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u0100\11\uffff\1\u0101\25\uffff\1\u0100\11\uffff\1\u0101",
+ "\1\u0102\37\uffff\1\u0102",
+ "\1\u0103\37\uffff\1\u0103",
+ "\1\u0104\37\uffff\1\u0104",
+ "\1\u0105\37\uffff\1\u0105",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0107\37\uffff\1\u0107",
+ "\1\u0108\37\uffff\1\u0108",
+ "",
+ "\1\u0109\37\uffff\1\u0109",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u010b\37\uffff\1\u010b",
+ "\1\u010c\37\uffff\1\u010c",
+ "\1\u010d\37\uffff\1\u010d",
+ "\1\u010e\37\uffff\1\u010e",
+ "\1\u010f\37\uffff\1\u010f",
+ "\1\u0110\37\uffff\1\u0110",
+ "\1\u0111\37\uffff\1\u0111",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0116\37\uffff\1\u0116",
+ "\1\u0117\37\uffff\1\u0117",
+ "\1\u0118\37\uffff\1\u0118",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u011b\37\uffff\1\u011b",
+ "\12\52\7\uffff\13\52\1\u011c\16\52\4\uffff\1\52\1\uffff\13"+
+ "\52\1\u011c\16\52",
+ "\1\u011e\37\uffff\1\u011e",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0121\16\uffff\1\u0120\20\uffff\1\u0121\16\uffff\1\u0120",
+ "\1\u0122\37\uffff\1\u0122",
+ "\1\u0123\37\uffff\1\u0123",
+ "\1\u0124\37\uffff\1\u0124",
+ "",
+ "",
+ "\1\u0125\37\uffff\1\u0125",
+ "\1\u0126\37\uffff\1\u0126",
+ "\1\u0127\37\uffff\1\u0127",
+ "\1\u0128\37\uffff\1\u0128",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "\1\u012a\37\uffff\1\u012a",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u012c\37\uffff\1\u012c",
+ "\1\u012d\37\uffff\1\u012d",
+ "\1\u012e\37\uffff\1\u012e",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0130\37\uffff\1\u0130",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0133\37\uffff\1\u0133",
+ "",
+ "",
+ "\1\u0134\37\uffff\1\u0134",
+ "\1\u0135\37\uffff\1\u0135",
+ "\1\u0136\37\uffff\1\u0136",
+ "\1\u0137\37\uffff\1\u0137",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u013b\37\uffff\1\u013b",
+ "\1\u013c\37\uffff\1\u013c",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u013e\37\uffff\1\u013e",
+ "\1\u013f\37\uffff\1\u013f",
+ "\1\u0140\37\uffff\1\u0140",
+ "\1\u0141\37\uffff\1\u0141",
+ "\1\u0142\37\uffff\1\u0142",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "",
+ "",
+ "\1\u0144\37\uffff\1\u0144",
+ "\1\u0145\37\uffff\1\u0145",
+ "\1\u0146\37\uffff\1\u0146",
+ "",
+ "",
+ "\1\u0147\37\uffff\1\u0147",
+ "\1\u0148\37\uffff\1\u0148",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u014a\37\uffff\1\u014a",
+ "\1\u014b\37\uffff\1\u014b",
+ "\1\u014c\37\uffff\1\u014c",
+ "\1\u014d\37\uffff\1\u014d",
+ "\1\u014e\37\uffff\1\u014e",
+ "\12\52\7\uffff\22\52\1\u014f\7\52\4\uffff\1\52\1\uffff\22\52"+
+ "\1\u014f\7\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0152\37\uffff\1\u0152",
+ "\1\u0153\37\uffff\1\u0153",
+ "",
+ "\1\u0154\37\uffff\1\u0154",
+ "",
+ "\1\u0155\37\uffff\1\u0155",
+ "\1\u0156\37\uffff\1\u0156",
+ "\1\u0157\37\uffff\1\u0157",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u015a\37\uffff\1\u015a",
+ "\1\u015b\37\uffff\1\u015b",
+ "\1\u015c\37\uffff\1\u015c",
+ "\1\u015d\37\uffff\1\u015d",
+ "",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u0160\37\uffff\1\u0160",
+ "\1\u0161\37\uffff\1\u0161",
+ "\1\u0162\37\uffff\1\u0162",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0164\37\uffff\1\u0164",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0169\37\uffff\1\u0169",
+ "",
+ "\1\u016a\37\uffff\1\u016a",
+ "\1\u016b\37\uffff\1\u016b",
+ "\1\u016c\37\uffff\1\u016c",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "\1\u0170\37\uffff\1\u0170",
+ "\1\u0171\37\uffff\1\u0171",
+ "\1\u0172\37\uffff\1\u0172",
+ "\1\u0173\37\uffff\1\u0173",
+ "\1\u0174\37\uffff\1\u0174",
+ "\1\u0175\37\uffff\1\u0175",
+ "",
+ "",
+ "\1\u0176\37\uffff\1\u0176",
+ "\1\u0177\37\uffff\1\u0177",
+ "\1\u0178\37\uffff\1\u0178",
+ "\1\u0179\37\uffff\1\u0179",
+ "",
+ "",
+ "\1\u017a\37\uffff\1\u017a",
+ "\1\u017b\37\uffff\1\u017b",
+ "\2\52\1\u017c\7\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u017e\37\uffff\1\u017e",
+ "",
+ "",
+ "",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0181\37\uffff\1\u0181",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "",
+ "\1\u0183\37\uffff\1\u0183",
+ "\1\u0184\37\uffff\1\u0184",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0186\37\uffff\1\u0186",
+ "\12\52\7\uffff\3\52\1\u0187\26\52\4\uffff\1\52\1\uffff\3\52"+
+ "\1\u0187\26\52",
+ "\1\u0189\37\uffff\1\u0189",
+ "\1\u018a\37\uffff\1\u018a",
+ "\1\u018b\37\uffff\1\u018b",
+ "\1\u018c\37\uffff\1\u018c",
+ "\1\u018d\37\uffff\1\u018d",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u0191\37\uffff\1\u0191",
+ "",
+ "",
+ "\1\u0192\37\uffff\1\u0192",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u0194\37\uffff\1\u0194",
+ "",
+ "\1\u0195\37\uffff\1\u0195",
+ "\1\u0196\37\uffff\1\u0196",
+ "",
+ "\1\u0197\37\uffff\1\u0197",
+ "\1\u0198\37\uffff\1\u0198",
+ "\1\u0199\37\uffff\1\u0199",
+ "\1\u019a\37\uffff\1\u019a",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "",
+ "",
+ "\1\u019c\37\uffff\1\u019c",
+ "\1\u019d\37\uffff\1\u019d",
+ "",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u019f\37\uffff\1\u019f",
+ "\1\u01a0\37\uffff\1\u01a0",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01a2\37\uffff\1\u01a2",
+ "\1\u01a3\37\uffff\1\u01a3",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u01a5\37\uffff\1\u01a5",
+ "\1\u01a6\37\uffff\1\u01a6",
+ "",
+ "\1\u01a7\37\uffff\1\u01a7",
+ "\1\u01a8\37\uffff\1\u01a8",
+ "",
+ "\1\u01a9\37\uffff\1\u01a9",
+ "\1\u01aa\37\uffff\1\u01aa",
+ "",
+ "\1\u01ab\37\uffff\1\u01ab",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01ad\37\uffff\1\u01ad",
+ "\1\u01ae\37\uffff\1\u01ae",
+ "\1\u01af\37\uffff\1\u01af",
+ "\1\u01b0\37\uffff\1\u01b0",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u01b2\16\uffff\1\u01b3\20\uffff\1\u01b2\16\uffff\1\u01b3",
+ "\1\u01b4\37\uffff\1\u01b4",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01b6\37\uffff\1\u01b6",
+ "",
+ "\1\u01b7\37\uffff\1\u01b7",
+ "\1\u01b8\37\uffff\1\u01b8",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "",
+ "\1\u01ba\37\uffff\1\u01ba",
+ "\1\u01bb\37\uffff\1\u01bb",
+ "\1\u01bc\37\uffff\1\u01bc",
+ "",
+ "\1\u01bd\37\uffff\1\u01bd",
+ "\1\u01be\37\uffff\1\u01be",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01c0\16\uffff\1\u01c1\20\uffff\1\u01c0\16\uffff\1\u01c1",
+ "\1\u01c2\37\uffff\1\u01c2",
+ "",
+ "\1\u01c3\37\uffff\1\u01c3",
+ "\1\u01c4\37\uffff\1\u01c4",
+ "\1\u01c5\37\uffff\1\u01c5",
+ "\1\u01c6\37\uffff\1\u01c6",
+ "\1\u01c7\37\uffff\1\u01c7",
+ "\1\u01c8\37\uffff\1\u01c8",
+ "\1\u01c9\37\uffff\1\u01c9",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ "\1\u01cc\37\uffff\1\u01cc",
+ "",
+ "",
+ "\1\u01cd\37\uffff\1\u01cd",
+ "\1\u01ce\37\uffff\1\u01ce",
+ "\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff\32\52",
+ ""
+ };
+
+ static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
+ static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
+ static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
+ static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
+ static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
+ static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
+ static final short[][] DFA12_transition;
+
+ static {
+ int numStates = DFA12_transitionS.length;
+ DFA12_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
+ }
+ }
+
+ class DFA12 extends DFA {
+
+ public DFA12(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 12;
+ this.eot = DFA12_eot;
+ this.eof = DFA12_eof;
+ this.min = DFA12_min;
+ this.max = DFA12_max;
+ this.accept = DFA12_accept;
+ this.special = DFA12_special;
+ this.transition = DFA12_transition;
+ }
+ public String getDescription() {
+ return "1:1: Tokens : ( PLUS | MINUS | DIVIDE | MULT | EQUALS | NOTEQUALS | LT | GT | LTE | GTE | DOT | LPAREN | RPAREN | LBRACKET | RBRACKET | LBRACE | RBRACE | COMMA | COLON | SEMICOLON | FOR | IN | WHERE | RETURN | STORE | ENCODE | SQRT | SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN | EXP | LN | LOG | ROUND | ABS | OVERLAY | STRUCT | RE | IM | AND | OR | XOR | NOT | IDENTIFIER | IMAGECRS | IMAGECRSDOMAIN | CRSSET | DOMAIN | NULLSET | NULLDEFAULT | INTERPOLATIONDEFAULT | INTERPOLATIONSET | SETIDENTIFIER | SETNULLSET | SETINTERPOLATIONDEFAULT | SETINTERPOLATIONSET | SETCRSSET | TRIM | SLICE | EXTEND | SCALE | CRSTRANSFORM | COUNT | ADD | AVG | MAX | MIN | SOME | ALL | COVERAGE | OVER | VALUE | VALUES | LIST | CONDENSE | USING | NEAREST | LINEAR | QUADRATIC | CUBIC | FULL | NONE | HALF | OTHER | PHI | BIT | UNSIGNED | BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT | STRING | NAME | VARIABLE_DOLLAR | WHITESPACE );";
+ }
+ }
+
+
+} \ No newline at end of file
diff --git a/petascope/src/petascope/wcps/grammar/wcpsParser.java b/petascope/src/petascope/wcps/grammar/wcpsParser.java
new file mode 100644
index 0000000..27f75f8
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/wcpsParser.java
@@ -0,0 +1,18359 @@
+// $ANTLR 3.2 Sep 23, 2009 12:02:23 src/petascope/wcps/grammar/wcps.g 2010-04-29 23:04:40
+package petascope.wcps.grammar;
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+
+import org.antlr.runtime.tree.*;
+
+public class wcpsParser extends Parser {
+ public static final String[] tokenNames = new String[] {
+ "<invalid>", "<EOR>", "<DOWN>", "<UP>", "FOR", "IN", "LPAREN", "RPAREN", "COMMA", "WHERE", "RETURN", "ENCODE", "STORE", "OR", "XOR", "AND", "EQUALS", "NOTEQUALS", "LT", "GT", "LTE", "GTE", "PLUS", "MINUS", "MULT", "DIVIDE", "OVERLAY", "IDENTIFIER", "IMAGECRS", "IMAGECRSDOMAIN", "CRSSET", "NULLSET", "INTERPOLATIONDEFAULT", "INTERPOLATIONSET", "DOMAIN", "ALL", "SOME", "COUNT", "ADD", "AVG", "MIN", "MAX", "CONDENSE", "OVER", "USING", "COLON", "COVERAGE", "VALUE", "LIST", "SEMICOLON", "VALUES", "SETIDENTIFIER", "SETCRSSET", "SETNULLSET", "SETINTERPOLATIONDEFAULT", "SETINTERPOLATIONSET", "LBRACE", "RBRACE", "STRUCT", "CRSTRANSFORM", "SQRT", "ABS", "RE", "IM", "EXP", "LOG", "LN", "SIN", "COS", "TAN", "SINH", "COSH", "TANH", "ARCSIN", "ARCCOS", "ARCTAN", "NOT", "BIT", "INTEGERCONSTANT", "ROUND", "STRING", "SCALE", "LBRACKET", "RBRACKET", "TRIM", "SLICE", "EXTEND", "BOOLEAN", "CHAR", "SHORT", "LONG", "FLOAT", "DOUBLE", "COMPLEX", "COMPLEX2", "UNSIGNED", "DOT", "BOOLEANCONSTANT", "FLOATCONSTANT", "NEAREST", "LINEAR", "QUADRATIC", "CUBIC", "FULL", "NONE", "HALF", "OTHER", "NAME", "VARIABLE_DOLLAR", "NULLDEFAULT", "PHI", "WHITESPACE"
+ };
+ public static final int IMAGECRS=28;
+ public static final int LT=18;
+ public static final int LN=66;
+ public static final int LOG=65;
+ public static final int CHAR=88;
+ public static final int COMPLEX=93;
+ public static final int SETINTERPOLATIONDEFAULT=54;
+ public static final int COUNT=37;
+ public static final int EQUALS=16;
+ public static final int COSH=71;
+ public static final int NOT=76;
+ public static final int INTEGERCONSTANT=78;
+ public static final int EOF=-1;
+ public static final int SINH=70;
+ public static final int LBRACKET=82;
+ public static final int RPAREN=7;
+ public static final int NAME=107;
+ public static final int LINEAR=100;
+ public static final int TANH=72;
+ public static final int FULL=103;
+ public static final int USING=44;
+ public static final int SIN=67;
+ public static final int EXP=64;
+ public static final int COS=68;
+ public static final int TAN=69;
+ public static final int RETURN=10;
+ public static final int DOUBLE=92;
+ public static final int NULLDEFAULT=109;
+ public static final int DIVIDE=25;
+ public static final int STORE=12;
+ public static final int BOOLEANCONSTANT=97;
+ public static final int RBRACE=57;
+ public static final int SETNULLSET=53;
+ public static final int CONDENSE=42;
+ public static final int WHITESPACE=111;
+ public static final int SEMICOLON=49;
+ public static final int MULT=24;
+ public static final int VALUE=47;
+ public static final int LIST=48;
+ public static final int COMPLEX2=94;
+ public static final int ABS=61;
+ public static final int CRSSET=30;
+ public static final int SCALE=81;
+ public static final int VARIABLE_DOLLAR=108;
+ public static final int FLOATCONSTANT=98;
+ public static final int IMAGECRSDOMAIN=29;
+ public static final int NONE=104;
+ public static final int OR=13;
+ public static final int TRIM=84;
+ public static final int GT=19;
+ public static final int ROUND=79;
+ public static final int QUADRATIC=101;
+ public static final int ENCODE=11;
+ public static final int PHI=110;
+ public static final int OVER=43;
+ public static final int COVERAGE=46;
+ public static final int WHERE=9;
+ public static final int RE=62;
+ public static final int OVERLAY=26;
+ public static final int GTE=21;
+ public static final int LBRACE=56;
+ public static final int MAX=41;
+ public static final int INTERPOLATIONDEFAULT=32;
+ public static final int FOR=4;
+ public static final int FLOAT=91;
+ public static final int SLICE=85;
+ public static final int AND=15;
+ public static final int LTE=20;
+ public static final int LPAREN=6;
+ public static final int EXTEND=86;
+ public static final int IM=63;
+ public static final int BOOLEAN=87;
+ public static final int IN=5;
+ public static final int COMMA=8;
+ public static final int AVG=39;
+ public static final int IDENTIFIER=27;
+ public static final int SOME=36;
+ public static final int ALL=35;
+ public static final int ARCSIN=73;
+ public static final int PLUS=22;
+ public static final int ARCCOS=74;
+ public static final int RBRACKET=83;
+ public static final int DOT=96;
+ public static final int ADD=38;
+ public static final int SETIDENTIFIER=51;
+ public static final int XOR=14;
+ public static final int SETINTERPOLATIONSET=55;
+ public static final int OTHER=106;
+ public static final int VALUES=50;
+ public static final int ARCTAN=75;
+ public static final int NOTEQUALS=17;
+ public static final int STRUCT=58;
+ public static final int SHORT=89;
+ public static final int MIN=40;
+ public static final int MINUS=23;
+ public static final int SQRT=60;
+ public static final int DOMAIN=34;
+ public static final int CRSTRANSFORM=59;
+ public static final int COLON=45;
+ public static final int CUBIC=102;
+ public static final int UNSIGNED=95;
+ public static final int NULLSET=31;
+ public static final int BIT=77;
+ public static final int INTERPOLATIONSET=33;
+ public static final int LONG=90;
+ public static final int SETCRSSET=52;
+ public static final int HALF=105;
+ public static final int STRING=80;
+ public static final int NEAREST=99;
+
+ // delegates
+ // delegators
+
+
+ public wcpsParser(TokenStream input) {
+ this(input, new RecognizerSharedState());
+ }
+ public wcpsParser(TokenStream input, RecognizerSharedState state) {
+ super(input, state);
+ this.state.ruleMemo = new HashMap[241+1];
+
+
+ }
+
+ protected TreeAdaptor adaptor = new CommonTreeAdaptor();
+
+ public void setTreeAdaptor(TreeAdaptor adaptor) {
+ this.adaptor = adaptor;
+ }
+ public TreeAdaptor getTreeAdaptor() {
+ return adaptor;
+ }
+
+ public String[] getTokenNames() { return wcpsParser.tokenNames; }
+ public String getGrammarFileName() { return "src/petascope/wcps/grammar/wcps.g"; }
+
+
+ public static class wcpsRequest_return extends ParserRuleReturnScope {
+ public WCPSRequest value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "wcpsRequest"
+ // src/petascope/wcps/grammar/wcps.g:32:1: wcpsRequest returns [WCPSRequest value] : e1= forClause (e2= whereClause )? e3= returnClause ;
+ public final wcpsParser.wcpsRequest_return wcpsRequest() throws RecognitionException {
+ wcpsParser.wcpsRequest_return retval = new wcpsParser.wcpsRequest_return();
+ retval.start = input.LT(1);
+ int wcpsRequest_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.forClause_return e1 = null;
+
+ wcpsParser.whereClause_return e2 = null;
+
+ wcpsParser.returnClause_return e3 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 1) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:33:2: (e1= forClause (e2= whereClause )? e3= returnClause )
+ // src/petascope/wcps/grammar/wcps.g:33:4: e1= forClause (e2= whereClause )? e3= returnClause
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_forClause_in_wcpsRequest63);
+ e1=forClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new WCPSRequest((e1!=null?e1.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:34:3: (e2= whereClause )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0==WHERE) ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:34:4: e2= whereClause
+ {
+ pushFollow(FOLLOW_whereClause_in_wcpsRequest72);
+ e2=whereClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setWhere((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+ pushFollow(FOLLOW_returnClause_in_wcpsRequest83);
+ e3=returnClause();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setReturn((e3!=null?e3.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 1, wcpsRequest_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "wcpsRequest"
+
+ public static class forClause_return extends ParserRuleReturnScope {
+ public ForClauseElements value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "forClause"
+ // src/petascope/wcps/grammar/wcps.g:37:1: forClause returns [ForClauseElements value] : FOR v= coverageVariable IN LPAREN list= coverageList RPAREN ( COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN )* ;
+ public final wcpsParser.forClause_return forClause() throws RecognitionException {
+ wcpsParser.forClause_return retval = new wcpsParser.forClause_return();
+ retval.start = input.LT(1);
+ int forClause_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token FOR1=null;
+ Token IN2=null;
+ Token LPAREN3=null;
+ Token RPAREN4=null;
+ Token COMMA5=null;
+ Token IN6=null;
+ Token LPAREN7=null;
+ Token RPAREN8=null;
+ wcpsParser.coverageVariable_return v = null;
+
+ wcpsParser.coverageList_return list = null;
+
+
+ Object FOR1_tree=null;
+ Object IN2_tree=null;
+ Object LPAREN3_tree=null;
+ Object RPAREN4_tree=null;
+ Object COMMA5_tree=null;
+ Object IN6_tree=null;
+ Object LPAREN7_tree=null;
+ Object RPAREN8_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 2) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:38:2: ( FOR v= coverageVariable IN LPAREN list= coverageList RPAREN ( COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN )* )
+ // src/petascope/wcps/grammar/wcps.g:38:4: FOR v= coverageVariable IN LPAREN list= coverageList RPAREN ( COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ FOR1=(Token)match(input,FOR,FOLLOW_FOR_in_forClause98); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ FOR1_tree = (Object)adaptor.create(FOR1);
+ adaptor.addChild(root_0, FOR1_tree);
+ }
+ pushFollow(FOLLOW_coverageVariable_in_forClause102);
+ v=coverageVariable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, v.getTree());
+ IN2=(Token)match(input,IN,FOLLOW_IN_in_forClause104); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ IN2_tree = (Object)adaptor.create(IN2);
+ adaptor.addChild(root_0, IN2_tree);
+ }
+ LPAREN3=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_forClause106); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN3_tree = (Object)adaptor.create(LPAREN3);
+ adaptor.addChild(root_0, LPAREN3_tree);
+ }
+ pushFollow(FOLLOW_coverageList_in_forClause110);
+ list=coverageList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, list.getTree());
+ RPAREN4=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_forClause112); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN4_tree = (Object)adaptor.create(RPAREN4);
+ adaptor.addChild(root_0, RPAREN4_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ForClauseElements((v!=null?v.value:null), (list!=null?list.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:40:4: ( COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN )*
+ loop2:
+ do {
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0==COMMA) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:40:5: COMMA v= coverageVariable IN LPAREN list= coverageList RPAREN
+ {
+ COMMA5=(Token)match(input,COMMA,FOLLOW_COMMA_in_forClause122); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA5_tree = (Object)adaptor.create(COMMA5);
+ adaptor.addChild(root_0, COMMA5_tree);
+ }
+ pushFollow(FOLLOW_coverageVariable_in_forClause126);
+ v=coverageVariable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, v.getTree());
+ IN6=(Token)match(input,IN,FOLLOW_IN_in_forClause128); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ IN6_tree = (Object)adaptor.create(IN6);
+ adaptor.addChild(root_0, IN6_tree);
+ }
+ LPAREN7=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_forClause130); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN7_tree = (Object)adaptor.create(LPAREN7);
+ adaptor.addChild(root_0, LPAREN7_tree);
+ }
+ pushFollow(FOLLOW_coverageList_in_forClause134);
+ list=coverageList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, list.getTree());
+ RPAREN8=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_forClause136); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN8_tree = (Object)adaptor.create(RPAREN8);
+ adaptor.addChild(root_0, RPAREN8_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ForClauseElements((v!=null?v.value:null), (list!=null?list.value:null), retval.value);
+ }
+
+ }
+ break;
+
+ default :
+ break loop2;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 2, forClause_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "forClause"
+
+ public static class whereClause_return extends ParserRuleReturnScope {
+ public WhereClause value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "whereClause"
+ // src/petascope/wcps/grammar/wcps.g:43:1: whereClause returns [WhereClause value] : WHERE e1= booleanScalarExpr ;
+ public final wcpsParser.whereClause_return whereClause() throws RecognitionException {
+ wcpsParser.whereClause_return retval = new wcpsParser.whereClause_return();
+ retval.start = input.LT(1);
+ int whereClause_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token WHERE9=null;
+ wcpsParser.booleanScalarExpr_return e1 = null;
+
+
+ Object WHERE9_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 3) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:44:2: ( WHERE e1= booleanScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:44:4: WHERE e1= booleanScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ WHERE9=(Token)match(input,WHERE,FOLLOW_WHERE_in_whereClause157); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ WHERE9_tree = (Object)adaptor.create(WHERE9);
+ adaptor.addChild(root_0, WHERE9_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarExpr_in_whereClause161);
+ e1=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new WhereClause((e1!=null?e1.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 3, whereClause_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "whereClause"
+
+ public static class returnClause_return extends ParserRuleReturnScope {
+ public ReturnClause value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "returnClause"
+ // src/petascope/wcps/grammar/wcps.g:46:1: returnClause returns [ReturnClause value] : RETURN e1= processingExpr ;
+ public final wcpsParser.returnClause_return returnClause() throws RecognitionException {
+ wcpsParser.returnClause_return retval = new wcpsParser.returnClause_return();
+ retval.start = input.LT(1);
+ int returnClause_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token RETURN10=null;
+ wcpsParser.processingExpr_return e1 = null;
+
+
+ Object RETURN10_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 4) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:47:2: ( RETURN e1= processingExpr )
+ // src/petascope/wcps/grammar/wcps.g:47:4: RETURN e1= processingExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ RETURN10=(Token)match(input,RETURN,FOLLOW_RETURN_in_returnClause176); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RETURN10_tree = (Object)adaptor.create(RETURN10);
+ adaptor.addChild(root_0, RETURN10_tree);
+ }
+ pushFollow(FOLLOW_processingExpr_in_returnClause180);
+ e1=processingExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ReturnClause((e1!=null?e1.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 4, returnClause_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "returnClause"
+
+ public static class coverageList_return extends ParserRuleReturnScope {
+ public CoverageList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageList"
+ // src/petascope/wcps/grammar/wcps.g:49:1: coverageList returns [CoverageList value] : cname= coverageName ( COMMA next= coverageName )* ;
+ public final wcpsParser.coverageList_return coverageList() throws RecognitionException {
+ wcpsParser.coverageList_return retval = new wcpsParser.coverageList_return();
+ retval.start = input.LT(1);
+ int coverageList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COMMA11=null;
+ wcpsParser.coverageName_return cname = null;
+
+ wcpsParser.coverageName_return next = null;
+
+
+ Object COMMA11_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 5) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:50:2: (cname= coverageName ( COMMA next= coverageName )* )
+ // src/petascope/wcps/grammar/wcps.g:50:4: cname= coverageName ( COMMA next= coverageName )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageName_in_coverageList197);
+ cname=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cname.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageList((cname!=null?cname.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:51:3: ( COMMA next= coverageName )*
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( (LA3_0==COMMA) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:51:4: COMMA next= coverageName
+ {
+ COMMA11=(Token)match(input,COMMA,FOLLOW_COMMA_in_coverageList204); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA11_tree = (Object)adaptor.create(COMMA11);
+ adaptor.addChild(root_0, COMMA11_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_coverageList208);
+ next=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, next.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageList((next!=null?next.value:null), retval.value);
+ }
+
+ }
+ break;
+
+ default :
+ break loop3;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 5, coverageList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageList"
+
+ public static class processingExpr_return extends ParserRuleReturnScope {
+ public ProcessingExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "processingExpr"
+ // src/petascope/wcps/grammar/wcps.g:53:1: processingExpr returns [ProcessingExpr value] : (e1= encodedCoverageExpr | e2= storeExpr | e3= scalarExpr );
+ public final wcpsParser.processingExpr_return processingExpr() throws RecognitionException {
+ wcpsParser.processingExpr_return retval = new wcpsParser.processingExpr_return();
+ retval.start = input.LT(1);
+ int processingExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.encodedCoverageExpr_return e1 = null;
+
+ wcpsParser.storeExpr_return e2 = null;
+
+ wcpsParser.scalarExpr_return e3 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 6) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:54:5: (e1= encodedCoverageExpr | e2= storeExpr | e3= scalarExpr )
+ int alt4=3;
+ alt4 = dfa4.predict(input);
+ switch (alt4) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:54:7: e1= encodedCoverageExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_encodedCoverageExpr_in_processingExpr230);
+ e1=encodedCoverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ProcessingExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:55:7: e2= storeExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_storeExpr_in_processingExpr242);
+ e2=storeExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ProcessingExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:56:7: e3= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scalarExpr_in_processingExpr254);
+ e3=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ProcessingExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 6, processingExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "processingExpr"
+
+ public static class encodedCoverageExpr_return extends ParserRuleReturnScope {
+ public EncodedCoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "encodedCoverageExpr"
+ // src/petascope/wcps/grammar/wcps.g:58:1: encodedCoverageExpr returns [EncodedCoverageExpr value] : ENCODE LPAREN cov= coverageExpr COMMA format= stringConstant ( COMMA params= stringConstant )? RPAREN ;
+ public final wcpsParser.encodedCoverageExpr_return encodedCoverageExpr() throws RecognitionException {
+ wcpsParser.encodedCoverageExpr_return retval = new wcpsParser.encodedCoverageExpr_return();
+ retval.start = input.LT(1);
+ int encodedCoverageExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token ENCODE12=null;
+ Token LPAREN13=null;
+ Token COMMA14=null;
+ Token COMMA15=null;
+ Token RPAREN16=null;
+ wcpsParser.coverageExpr_return cov = null;
+
+ wcpsParser.stringConstant_return format = null;
+
+ wcpsParser.stringConstant_return params = null;
+
+
+ Object ENCODE12_tree=null;
+ Object LPAREN13_tree=null;
+ Object COMMA14_tree=null;
+ Object COMMA15_tree=null;
+ Object RPAREN16_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 7) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:59:2: ( ENCODE LPAREN cov= coverageExpr COMMA format= stringConstant ( COMMA params= stringConstant )? RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:59:4: ENCODE LPAREN cov= coverageExpr COMMA format= stringConstant ( COMMA params= stringConstant )? RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ ENCODE12=(Token)match(input,ENCODE,FOLLOW_ENCODE_in_encodedCoverageExpr272); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ ENCODE12_tree = (Object)adaptor.create(ENCODE12);
+ adaptor.addChild(root_0, ENCODE12_tree);
+ }
+ LPAREN13=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_encodedCoverageExpr274); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN13_tree = (Object)adaptor.create(LPAREN13);
+ adaptor.addChild(root_0, LPAREN13_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_encodedCoverageExpr278);
+ cov=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cov.getTree());
+ COMMA14=(Token)match(input,COMMA,FOLLOW_COMMA_in_encodedCoverageExpr280); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA14_tree = (Object)adaptor.create(COMMA14);
+ adaptor.addChild(root_0, COMMA14_tree);
+ }
+ pushFollow(FOLLOW_stringConstant_in_encodedCoverageExpr284);
+ format=stringConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, format.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new EncodedCoverageExpr((cov!=null?cov.value:null), (format!=null?input.toString(format.start,format.stop):null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:60:3: ( COMMA params= stringConstant )?
+ int alt5=2;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0==COMMA) ) {
+ alt5=1;
+ }
+ switch (alt5) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:60:4: COMMA params= stringConstant
+ {
+ COMMA15=(Token)match(input,COMMA,FOLLOW_COMMA_in_encodedCoverageExpr291); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA15_tree = (Object)adaptor.create(COMMA15);
+ adaptor.addChild(root_0, COMMA15_tree);
+ }
+ pushFollow(FOLLOW_stringConstant_in_encodedCoverageExpr295);
+ params=stringConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, params.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setParams((params!=null?input.toString(params.start,params.stop):null));
+ }
+
+ }
+ break;
+
+ }
+
+ RPAREN16=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_encodedCoverageExpr302); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN16_tree = (Object)adaptor.create(RPAREN16);
+ adaptor.addChild(root_0, RPAREN16_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 7, encodedCoverageExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "encodedCoverageExpr"
+
+ public static class storeExpr_return extends ParserRuleReturnScope {
+ public StoreExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "storeExpr"
+ // src/petascope/wcps/grammar/wcps.g:62:1: storeExpr returns [StoreExpr value] : STORE LPAREN e1= encodedCoverageExpr RPAREN ;
+ public final wcpsParser.storeExpr_return storeExpr() throws RecognitionException {
+ wcpsParser.storeExpr_return retval = new wcpsParser.storeExpr_return();
+ retval.start = input.LT(1);
+ int storeExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token STORE17=null;
+ Token LPAREN18=null;
+ Token RPAREN19=null;
+ wcpsParser.encodedCoverageExpr_return e1 = null;
+
+
+ Object STORE17_tree=null;
+ Object LPAREN18_tree=null;
+ Object RPAREN19_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 8) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:63:5: ( STORE LPAREN e1= encodedCoverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:63:7: STORE LPAREN e1= encodedCoverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ STORE17=(Token)match(input,STORE,FOLLOW_STORE_in_storeExpr319); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ STORE17_tree = (Object)adaptor.create(STORE17);
+ adaptor.addChild(root_0, STORE17_tree);
+ }
+ LPAREN18=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_storeExpr321); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN18_tree = (Object)adaptor.create(LPAREN18);
+ adaptor.addChild(root_0, LPAREN18_tree);
+ }
+ pushFollow(FOLLOW_encodedCoverageExpr_in_storeExpr325);
+ e1=encodedCoverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN19=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_storeExpr327); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN19_tree = (Object)adaptor.create(RPAREN19);
+ adaptor.addChild(root_0, RPAREN19_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new StoreExpr((e1!=null?e1.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 8, storeExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "storeExpr"
+
+ public static class coverageExpr_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageExpr"
+ // src/petascope/wcps/grammar/wcps.g:65:1: coverageExpr returns [CoverageExpr value] : e1= coverageLogicTerm (op= ( OR | XOR ) e2= coverageLogicTerm )* ;
+ public final wcpsParser.coverageExpr_return coverageExpr() throws RecognitionException {
+ wcpsParser.coverageExpr_return retval = new wcpsParser.coverageExpr_return();
+ retval.start = input.LT(1);
+ int coverageExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageLogicTerm_return e1 = null;
+
+ wcpsParser.coverageLogicTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 9) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:66:5: (e1= coverageLogicTerm (op= ( OR | XOR ) e2= coverageLogicTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:66:7: e1= coverageLogicTerm (op= ( OR | XOR ) e2= coverageLogicTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageLogicTerm_in_coverageExpr350);
+ e1=coverageLogicTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:67:9: (op= ( OR | XOR ) e2= coverageLogicTerm )*
+ loop6:
+ do {
+ int alt6=2;
+ alt6 = dfa6.predict(input);
+ switch (alt6) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:67:10: op= ( OR | XOR ) e2= coverageLogicTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=OR && input.LA(1)<=XOR) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageLogicTerm_in_coverageExpr374);
+ e2=coverageLogicTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop6;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 9, coverageExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageExpr"
+
+ public static class coverageLogicTerm_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageLogicTerm"
+ // src/petascope/wcps/grammar/wcps.g:69:1: coverageLogicTerm returns [CoverageExpr value] : e1= coverageLogicFactor (op= AND e2= coverageLogicFactor )* ;
+ public final wcpsParser.coverageLogicTerm_return coverageLogicTerm() throws RecognitionException {
+ wcpsParser.coverageLogicTerm_return retval = new wcpsParser.coverageLogicTerm_return();
+ retval.start = input.LT(1);
+ int coverageLogicTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageLogicFactor_return e1 = null;
+
+ wcpsParser.coverageLogicFactor_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 10) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:70:5: (e1= coverageLogicFactor (op= AND e2= coverageLogicFactor )* )
+ // src/petascope/wcps/grammar/wcps.g:70:7: e1= coverageLogicFactor (op= AND e2= coverageLogicFactor )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageLogicFactor_in_coverageLogicTerm400);
+ e1=coverageLogicFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:71:9: (op= AND e2= coverageLogicFactor )*
+ loop7:
+ do {
+ int alt7=2;
+ alt7 = dfa7.predict(input);
+ switch (alt7) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:71:10: op= AND e2= coverageLogicFactor
+ {
+ op=(Token)match(input,AND,FOLLOW_AND_in_coverageLogicTerm416); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_coverageLogicFactor_in_coverageLogicTerm420);
+ e2=coverageLogicFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop7;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 10, coverageLogicTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageLogicTerm"
+
+ public static class coverageLogicFactor_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageLogicFactor"
+ // src/petascope/wcps/grammar/wcps.g:73:1: coverageLogicFactor returns [CoverageExpr value] : e1= coverageArithmeticExpr (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )? ;
+ public final wcpsParser.coverageLogicFactor_return coverageLogicFactor() throws RecognitionException {
+ wcpsParser.coverageLogicFactor_return retval = new wcpsParser.coverageLogicFactor_return();
+ retval.start = input.LT(1);
+ int coverageLogicFactor_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageArithmeticExpr_return e1 = null;
+
+ wcpsParser.coverageArithmeticExpr_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 11) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:74:5: (e1= coverageArithmeticExpr (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )? )
+ // src/petascope/wcps/grammar/wcps.g:74:7: e1= coverageArithmeticExpr (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )?
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageArithmeticExpr_in_coverageLogicFactor447);
+ e1=coverageArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:75:9: (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )?
+ int alt8=2;
+ alt8 = dfa8.predict(input);
+ switch (alt8) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:75:10: op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=EQUALS && input.LA(1)<=GTE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticExpr_in_coverageLogicFactor479);
+ e2=coverageArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 11, coverageLogicFactor_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageLogicFactor"
+
+ public static class coverageArithmeticExpr_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageArithmeticExpr"
+ // src/petascope/wcps/grammar/wcps.g:77:1: coverageArithmeticExpr returns [CoverageExpr value] : e1= coverageArithmeticTerm (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )* ;
+ public final wcpsParser.coverageArithmeticExpr_return coverageArithmeticExpr() throws RecognitionException {
+ wcpsParser.coverageArithmeticExpr_return retval = new wcpsParser.coverageArithmeticExpr_return();
+ retval.start = input.LT(1);
+ int coverageArithmeticExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageArithmeticTerm_return e1 = null;
+
+ wcpsParser.coverageArithmeticTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 12) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:78:5: (e1= coverageArithmeticTerm (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:78:7: e1= coverageArithmeticTerm (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageArithmeticTerm_in_coverageArithmeticExpr507);
+ e1=coverageArithmeticTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:79:9: (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )*
+ loop9:
+ do {
+ int alt9=2;
+ alt9 = dfa9.predict(input);
+ switch (alt9) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:79:10: op= ( PLUS | MINUS ) e2= coverageArithmeticTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticTerm_in_coverageArithmeticExpr531);
+ e2=coverageArithmeticTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop9;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 12, coverageArithmeticExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageArithmeticExpr"
+
+ public static class coverageArithmeticTerm_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageArithmeticTerm"
+ // src/petascope/wcps/grammar/wcps.g:81:1: coverageArithmeticTerm returns [CoverageExpr value] : e1= coverageArithmeticFactor (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )* ;
+ public final wcpsParser.coverageArithmeticTerm_return coverageArithmeticTerm() throws RecognitionException {
+ wcpsParser.coverageArithmeticTerm_return retval = new wcpsParser.coverageArithmeticTerm_return();
+ retval.start = input.LT(1);
+ int coverageArithmeticTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageArithmeticFactor_return e1 = null;
+
+ wcpsParser.coverageArithmeticFactor_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 13) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:82:5: (e1= coverageArithmeticFactor (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )* )
+ // src/petascope/wcps/grammar/wcps.g:82:9: e1= coverageArithmeticFactor (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageArithmeticFactor_in_coverageArithmeticTerm559);
+ e1=coverageArithmeticFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:83:9: (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )*
+ loop10:
+ do {
+ int alt10=2;
+ alt10 = dfa10.predict(input);
+ switch (alt10) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:83:10: op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticFactor_in_coverageArithmeticTerm582);
+ e2=coverageArithmeticFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop10;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 13, coverageArithmeticTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageArithmeticTerm"
+
+ public static class coverageArithmeticFactor_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageArithmeticFactor"
+ // src/petascope/wcps/grammar/wcps.g:85:1: coverageArithmeticFactor returns [CoverageExpr value] : e1= coverageValue (op= OVERLAY e2= coverageValue )* ;
+ public final wcpsParser.coverageArithmeticFactor_return coverageArithmeticFactor() throws RecognitionException {
+ wcpsParser.coverageArithmeticFactor_return retval = new wcpsParser.coverageArithmeticFactor_return();
+ retval.start = input.LT(1);
+ int coverageArithmeticFactor_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.coverageValue_return e1 = null;
+
+ wcpsParser.coverageValue_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 14) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:86:5: (e1= coverageValue (op= OVERLAY e2= coverageValue )* )
+ // src/petascope/wcps/grammar/wcps.g:86:7: e1= coverageValue (op= OVERLAY e2= coverageValue )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageValue_in_coverageArithmeticFactor610);
+ e1=coverageValue();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:87:9: (op= OVERLAY e2= coverageValue )*
+ loop11:
+ do {
+ int alt11=2;
+ alt11 = dfa11.predict(input);
+ switch (alt11) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:87:10: op= OVERLAY e2= coverageValue
+ {
+ op=(Token)match(input,OVERLAY,FOLLOW_OVERLAY_in_coverageArithmeticFactor625); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_coverageValue_in_coverageArithmeticFactor629);
+ e2=coverageValue();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop11;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 14, coverageArithmeticFactor_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageArithmeticFactor"
+
+ public static class coverageValue_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageValue"
+ // src/petascope/wcps/grammar/wcps.g:89:1: coverageValue returns [CoverageExpr value] : (e5= subsetExpr | e2= unaryInducedExpr | e4= scaleExpr | e3= crsTransformExpr | e1= coverageAtom );
+ public final wcpsParser.coverageValue_return coverageValue() throws RecognitionException {
+ wcpsParser.coverageValue_return retval = new wcpsParser.coverageValue_return();
+ retval.start = input.LT(1);
+ int coverageValue_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.subsetExpr_return e5 = null;
+
+ wcpsParser.unaryInducedExpr_return e2 = null;
+
+ wcpsParser.scaleExpr_return e4 = null;
+
+ wcpsParser.crsTransformExpr_return e3 = null;
+
+ wcpsParser.coverageAtom_return e1 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 15) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:90:5: (e5= subsetExpr | e2= unaryInducedExpr | e4= scaleExpr | e3= crsTransformExpr | e1= coverageAtom )
+ int alt12=5;
+ alt12 = dfa12.predict(input);
+ switch (alt12) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:90:7: e5= subsetExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_subsetExpr_in_coverageValue655);
+ e5=subsetExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:91:7: e2= unaryInducedExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_unaryInducedExpr_in_coverageValue668);
+ e2=unaryInducedExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e2!=null?e2.value:null);
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:92:7: e4= scaleExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scaleExpr_in_coverageValue680);
+ e4=scaleExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:93:7: e3= crsTransformExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_crsTransformExpr_in_coverageValue692);
+ e3=crsTransformExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:94:7: e1= coverageAtom
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageAtom_in_coverageValue704);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 15, coverageValue_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageValue"
+
+ public static class coverageAtom_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageAtom"
+ // src/petascope/wcps/grammar/wcps.g:96:1: coverageAtom returns [CoverageExpr value] : (e2= scalarExpr | e1= coverageVariable | LPAREN e7= coverageExpr RPAREN | e3= coverageConstantExpr | e4= coverageConstructorExpr | e5= setMetaDataExpr | e6= rangeConstructorExpr );
+ public final wcpsParser.coverageAtom_return coverageAtom() throws RecognitionException {
+ wcpsParser.coverageAtom_return retval = new wcpsParser.coverageAtom_return();
+ retval.start = input.LT(1);
+ int coverageAtom_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN20=null;
+ Token RPAREN21=null;
+ wcpsParser.scalarExpr_return e2 = null;
+
+ wcpsParser.coverageVariable_return e1 = null;
+
+ wcpsParser.coverageExpr_return e7 = null;
+
+ wcpsParser.coverageConstantExpr_return e3 = null;
+
+ wcpsParser.coverageConstructorExpr_return e4 = null;
+
+ wcpsParser.setMetaDataExpr_return e5 = null;
+
+ wcpsParser.rangeConstructorExpr_return e6 = null;
+
+
+ Object LPAREN20_tree=null;
+ Object RPAREN21_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 16) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:97:5: (e2= scalarExpr | e1= coverageVariable | LPAREN e7= coverageExpr RPAREN | e3= coverageConstantExpr | e4= coverageConstructorExpr | e5= setMetaDataExpr | e6= rangeConstructorExpr )
+ int alt13=7;
+ alt13 = dfa13.predict(input);
+ switch (alt13) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:97:7: e2= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scalarExpr_in_coverageAtom727);
+ e2=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:98:7: e1= coverageVariable
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageVariable_in_coverageAtom739);
+ e1=coverageVariable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:99:7: LPAREN e7= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN20=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_coverageAtom749); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN20_tree = (Object)adaptor.create(LPAREN20);
+ adaptor.addChild(root_0, LPAREN20_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_coverageAtom753);
+ e7=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e7.getTree());
+ RPAREN21=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_coverageAtom755); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN21_tree = (Object)adaptor.create(RPAREN21);
+ adaptor.addChild(root_0, RPAREN21_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e7!=null?e7.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:100:7: e3= coverageConstantExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageConstantExpr_in_coverageAtom768);
+ e3=coverageConstantExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:101:7: e4= coverageConstructorExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageConstructorExpr_in_coverageAtom780);
+ e4=coverageConstructorExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:102:7: e5= setMetaDataExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_setMetaDataExpr_in_coverageAtom793);
+ e5=setMetaDataExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:103:7: e6= rangeConstructorExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_rangeConstructorExpr_in_coverageAtom806);
+ e6=rangeConstructorExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e6.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e6!=null?e6.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 16, coverageAtom_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageAtom"
+
+ public static class scalarExpr_return extends ParserRuleReturnScope {
+ public ScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "scalarExpr"
+ // src/petascope/wcps/grammar/wcps.g:105:1: scalarExpr returns [ScalarExpr value] : (e1= metaDataExpr | e2= condenseExpr | e3= booleanScalarExpr | e4= numericScalarExpr | e5= stringScalarExpr | LPAREN e6= scalarExpr RPAREN );
+ public final wcpsParser.scalarExpr_return scalarExpr() throws RecognitionException {
+ wcpsParser.scalarExpr_return retval = new wcpsParser.scalarExpr_return();
+ retval.start = input.LT(1);
+ int scalarExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN22=null;
+ Token RPAREN23=null;
+ wcpsParser.metaDataExpr_return e1 = null;
+
+ wcpsParser.condenseExpr_return e2 = null;
+
+ wcpsParser.booleanScalarExpr_return e3 = null;
+
+ wcpsParser.numericScalarExpr_return e4 = null;
+
+ wcpsParser.stringScalarExpr_return e5 = null;
+
+ wcpsParser.scalarExpr_return e6 = null;
+
+
+ Object LPAREN22_tree=null;
+ Object RPAREN23_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 17) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:106:5: (e1= metaDataExpr | e2= condenseExpr | e3= booleanScalarExpr | e4= numericScalarExpr | e5= stringScalarExpr | LPAREN e6= scalarExpr RPAREN )
+ int alt14=6;
+ alt14 = dfa14.predict(input);
+ switch (alt14) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:106:7: e1= metaDataExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_metaDataExpr_in_scalarExpr830);
+ e1=metaDataExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:107:7: e2= condenseExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_condenseExpr_in_scalarExpr843);
+ e2=condenseExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:108:7: e3= booleanScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanScalarExpr_in_scalarExpr856);
+ e3=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:109:7: e4= numericScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_numericScalarExpr_in_scalarExpr870);
+ e4=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:110:7: e5= stringScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_stringScalarExpr_in_scalarExpr883);
+ e5=stringScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScalarExpr((e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:111:7: LPAREN e6= scalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN22=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scalarExpr894); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN22_tree = (Object)adaptor.create(LPAREN22);
+ adaptor.addChild(root_0, LPAREN22_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_scalarExpr898);
+ e6=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e6.getTree());
+ RPAREN23=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scalarExpr900); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN23_tree = (Object)adaptor.create(RPAREN23);
+ adaptor.addChild(root_0, RPAREN23_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (e6!=null?e6.value:null);
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 17, scalarExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "scalarExpr"
+
+ public static class metaDataExpr_return extends ParserRuleReturnScope {
+ public MetaDataExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "metaDataExpr"
+ // src/petascope/wcps/grammar/wcps.g:113:1: metaDataExpr returns [MetaDataExpr value] : (op= IDENTIFIER LPAREN e1= coverageExpr RPAREN | op= IMAGECRS LPAREN e1= coverageExpr RPAREN | op= IMAGECRSDOMAIN LPAREN e1= coverageExpr ( COMMA e2= axisName )? RPAREN | op= CRSSET LPAREN e1= coverageExpr RPAREN | de= domainExpr | op= NULLSET LPAREN e1= coverageExpr RPAREN | op= INTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN | op= INTERPOLATIONSET LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN );
+ public final wcpsParser.metaDataExpr_return metaDataExpr() throws RecognitionException {
+ wcpsParser.metaDataExpr_return retval = new wcpsParser.metaDataExpr_return();
+ retval.start = input.LT(1);
+ int metaDataExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN24=null;
+ Token RPAREN25=null;
+ Token LPAREN26=null;
+ Token RPAREN27=null;
+ Token LPAREN28=null;
+ Token COMMA29=null;
+ Token RPAREN30=null;
+ Token LPAREN31=null;
+ Token RPAREN32=null;
+ Token LPAREN33=null;
+ Token RPAREN34=null;
+ Token LPAREN35=null;
+ Token COMMA36=null;
+ Token RPAREN37=null;
+ Token LPAREN38=null;
+ Token COMMA39=null;
+ Token RPAREN40=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.axisName_return e2 = null;
+
+ wcpsParser.domainExpr_return de = null;
+
+ wcpsParser.fieldName_return f1 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN24_tree=null;
+ Object RPAREN25_tree=null;
+ Object LPAREN26_tree=null;
+ Object RPAREN27_tree=null;
+ Object LPAREN28_tree=null;
+ Object COMMA29_tree=null;
+ Object RPAREN30_tree=null;
+ Object LPAREN31_tree=null;
+ Object RPAREN32_tree=null;
+ Object LPAREN33_tree=null;
+ Object RPAREN34_tree=null;
+ Object LPAREN35_tree=null;
+ Object COMMA36_tree=null;
+ Object RPAREN37_tree=null;
+ Object LPAREN38_tree=null;
+ Object COMMA39_tree=null;
+ Object RPAREN40_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 18) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:114:5: (op= IDENTIFIER LPAREN e1= coverageExpr RPAREN | op= IMAGECRS LPAREN e1= coverageExpr RPAREN | op= IMAGECRSDOMAIN LPAREN e1= coverageExpr ( COMMA e2= axisName )? RPAREN | op= CRSSET LPAREN e1= coverageExpr RPAREN | de= domainExpr | op= NULLSET LPAREN e1= coverageExpr RPAREN | op= INTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN | op= INTERPOLATIONSET LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN )
+ int alt16=8;
+ switch ( input.LA(1) ) {
+ case IDENTIFIER:
+ {
+ alt16=1;
+ }
+ break;
+ case IMAGECRS:
+ {
+ alt16=2;
+ }
+ break;
+ case IMAGECRSDOMAIN:
+ {
+ alt16=3;
+ }
+ break;
+ case CRSSET:
+ {
+ alt16=4;
+ }
+ break;
+ case DOMAIN:
+ {
+ alt16=5;
+ }
+ break;
+ case NULLSET:
+ {
+ alt16=6;
+ }
+ break;
+ case INTERPOLATIONDEFAULT:
+ {
+ alt16=7;
+ }
+ break;
+ case INTERPOLATIONSET:
+ {
+ alt16=8;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 16, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt16) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:114:7: op= IDENTIFIER LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_metaDataExpr924); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN24=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr926); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN24_tree = (Object)adaptor.create(LPAREN24);
+ adaptor.addChild(root_0, LPAREN24_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr930);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN25=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr932); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN25_tree = (Object)adaptor.create(RPAREN25);
+ adaptor.addChild(root_0, RPAREN25_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:115:7: op= IMAGECRS LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,IMAGECRS,FOLLOW_IMAGECRS_in_metaDataExpr944); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN26=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr946); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN26_tree = (Object)adaptor.create(LPAREN26);
+ adaptor.addChild(root_0, LPAREN26_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr950);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN27=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr952); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN27_tree = (Object)adaptor.create(RPAREN27);
+ adaptor.addChild(root_0, RPAREN27_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:116:7: op= IMAGECRSDOMAIN LPAREN e1= coverageExpr ( COMMA e2= axisName )? RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,IMAGECRSDOMAIN,FOLLOW_IMAGECRSDOMAIN_in_metaDataExpr964); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN28=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr966); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN28_tree = (Object)adaptor.create(LPAREN28);
+ adaptor.addChild(root_0, LPAREN28_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr970);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ // src/petascope/wcps/grammar/wcps.g:116:48: ( COMMA e2= axisName )?
+ int alt15=2;
+ int LA15_0 = input.LA(1);
+
+ if ( (LA15_0==COMMA) ) {
+ alt15=1;
+ }
+ switch (alt15) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:116:49: COMMA e2= axisName
+ {
+ COMMA29=(Token)match(input,COMMA,FOLLOW_COMMA_in_metaDataExpr973); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA29_tree = (Object)adaptor.create(COMMA29);
+ adaptor.addChild(root_0, COMMA29_tree);
+ }
+ pushFollow(FOLLOW_axisName_in_metaDataExpr977);
+ e2=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+
+ }
+ break;
+
+ }
+
+ RPAREN30=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr981); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN30_tree = (Object)adaptor.create(RPAREN30);
+ adaptor.addChild(root_0, RPAREN30_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:117:7: op= CRSSET LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,CRSSET,FOLLOW_CRSSET_in_metaDataExpr993); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN31=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr995); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN31_tree = (Object)adaptor.create(LPAREN31);
+ adaptor.addChild(root_0, LPAREN31_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr999);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN32=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr1001); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN32_tree = (Object)adaptor.create(RPAREN32);
+ adaptor.addChild(root_0, RPAREN32_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:118:7: de= domainExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_domainExpr_in_metaDataExpr1013);
+ de=domainExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, de.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((de!=null?de.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:119:7: op= NULLSET LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,NULLSET,FOLLOW_NULLSET_in_metaDataExpr1025); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN33=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr1027); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN33_tree = (Object)adaptor.create(LPAREN33);
+ adaptor.addChild(root_0, LPAREN33_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr1031);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN34=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr1033); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN34_tree = (Object)adaptor.create(RPAREN34);
+ adaptor.addChild(root_0, RPAREN34_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null),(e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:120:7: op= INTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,INTERPOLATIONDEFAULT,FOLLOW_INTERPOLATIONDEFAULT_in_metaDataExpr1045); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN35=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr1047); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN35_tree = (Object)adaptor.create(LPAREN35);
+ adaptor.addChild(root_0, LPAREN35_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr1051);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA36=(Token)match(input,COMMA,FOLLOW_COMMA_in_metaDataExpr1053); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA36_tree = (Object)adaptor.create(COMMA36);
+ adaptor.addChild(root_0, COMMA36_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_metaDataExpr1057);
+ f1=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, f1.getTree());
+ RPAREN37=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr1059); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN37_tree = (Object)adaptor.create(RPAREN37);
+ adaptor.addChild(root_0, RPAREN37_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (f1!=null?f1.value:null));
+ }
+
+ }
+ break;
+ case 8 :
+ // src/petascope/wcps/grammar/wcps.g:121:7: op= INTERPOLATIONSET LPAREN e1= coverageExpr COMMA f1= fieldName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,INTERPOLATIONSET,FOLLOW_INTERPOLATIONSET_in_metaDataExpr1071); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN38=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_metaDataExpr1073); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN38_tree = (Object)adaptor.create(LPAREN38);
+ adaptor.addChild(root_0, LPAREN38_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_metaDataExpr1077);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA39=(Token)match(input,COMMA,FOLLOW_COMMA_in_metaDataExpr1079); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA39_tree = (Object)adaptor.create(COMMA39);
+ adaptor.addChild(root_0, COMMA39_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_metaDataExpr1083);
+ f1=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, f1.getTree());
+ RPAREN40=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_metaDataExpr1085); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN40_tree = (Object)adaptor.create(RPAREN40);
+ adaptor.addChild(root_0, RPAREN40_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new MetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (f1!=null?f1.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 18, metaDataExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "metaDataExpr"
+
+ public static class domainExpr_return extends ParserRuleReturnScope {
+ public DomainExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "domainExpr"
+ // src/petascope/wcps/grammar/wcps.g:123:1: domainExpr returns [DomainExpr value] : DOMAIN LPAREN var= coverageVariable COMMA axis= axisName COMMA crs= crsName RPAREN ;
+ public final wcpsParser.domainExpr_return domainExpr() throws RecognitionException {
+ wcpsParser.domainExpr_return retval = new wcpsParser.domainExpr_return();
+ retval.start = input.LT(1);
+ int domainExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token DOMAIN41=null;
+ Token LPAREN42=null;
+ Token COMMA43=null;
+ Token COMMA44=null;
+ Token RPAREN45=null;
+ wcpsParser.coverageVariable_return var = null;
+
+ wcpsParser.axisName_return axis = null;
+
+ wcpsParser.crsName_return crs = null;
+
+
+ Object DOMAIN41_tree=null;
+ Object LPAREN42_tree=null;
+ Object COMMA43_tree=null;
+ Object COMMA44_tree=null;
+ Object RPAREN45_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 19) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:124:2: ( DOMAIN LPAREN var= coverageVariable COMMA axis= axisName COMMA crs= crsName RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:124:4: DOMAIN LPAREN var= coverageVariable COMMA axis= axisName COMMA crs= crsName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ DOMAIN41=(Token)match(input,DOMAIN,FOLLOW_DOMAIN_in_domainExpr1104); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ DOMAIN41_tree = (Object)adaptor.create(DOMAIN41);
+ adaptor.addChild(root_0, DOMAIN41_tree);
+ }
+ LPAREN42=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_domainExpr1106); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN42_tree = (Object)adaptor.create(LPAREN42);
+ adaptor.addChild(root_0, LPAREN42_tree);
+ }
+ pushFollow(FOLLOW_coverageVariable_in_domainExpr1110);
+ var=coverageVariable();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, var.getTree());
+ COMMA43=(Token)match(input,COMMA,FOLLOW_COMMA_in_domainExpr1112); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA43_tree = (Object)adaptor.create(COMMA43);
+ adaptor.addChild(root_0, COMMA43_tree);
+ }
+ pushFollow(FOLLOW_axisName_in_domainExpr1116);
+ axis=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, axis.getTree());
+ COMMA44=(Token)match(input,COMMA,FOLLOW_COMMA_in_domainExpr1118); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA44_tree = (Object)adaptor.create(COMMA44);
+ adaptor.addChild(root_0, COMMA44_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_domainExpr1122);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ RPAREN45=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_domainExpr1124); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN45_tree = (Object)adaptor.create(RPAREN45);
+ adaptor.addChild(root_0, RPAREN45_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new DomainExpr((var!=null?var.value:null), (axis!=null?axis.value:null), (crs!=null?crs.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 19, domainExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "domainExpr"
+
+ public static class condenseExpr_return extends ParserRuleReturnScope {
+ public CondenseExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "condenseExpr"
+ // src/petascope/wcps/grammar/wcps.g:126:1: condenseExpr returns [CondenseExpr value] : (e1= reduceExpr | e2= generalCondenseExpr );
+ public final wcpsParser.condenseExpr_return condenseExpr() throws RecognitionException {
+ wcpsParser.condenseExpr_return retval = new wcpsParser.condenseExpr_return();
+ retval.start = input.LT(1);
+ int condenseExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.reduceExpr_return e1 = null;
+
+ wcpsParser.generalCondenseExpr_return e2 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 20) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:127:2: (e1= reduceExpr | e2= generalCondenseExpr )
+ int alt17=2;
+ int LA17_0 = input.LA(1);
+
+ if ( ((LA17_0>=ALL && LA17_0<=MAX)) ) {
+ alt17=1;
+ }
+ else if ( (LA17_0==CONDENSE) ) {
+ alt17=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 17, 0, input);
+
+ throw nvae;
+ }
+ switch (alt17) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:127:4: e1= reduceExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_reduceExpr_in_condenseExpr1141);
+ e1=reduceExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CondenseExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:128:4: e2= generalCondenseExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_generalCondenseExpr_in_condenseExpr1150);
+ e2=generalCondenseExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CondenseExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 20, condenseExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "condenseExpr"
+
+ public static class reduceExpr_return extends ParserRuleReturnScope {
+ public ReduceExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "reduceExpr"
+ // src/petascope/wcps/grammar/wcps.g:130:1: reduceExpr returns [ReduceExpr value] : op= ( ALL | SOME | COUNT | ADD | AVG | MIN | MAX ) LPAREN e1= coverageExpr RPAREN ;
+ public final wcpsParser.reduceExpr_return reduceExpr() throws RecognitionException {
+ wcpsParser.reduceExpr_return retval = new wcpsParser.reduceExpr_return();
+ retval.start = input.LT(1);
+ int reduceExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN46=null;
+ Token RPAREN47=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN46_tree=null;
+ Object RPAREN47_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 21) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:131:2: (op= ( ALL | SOME | COUNT | ADD | AVG | MIN | MAX ) LPAREN e1= coverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:131:4: op= ( ALL | SOME | COUNT | ADD | AVG | MIN | MAX ) LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=ALL && input.LA(1)<=MAX) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ LPAREN46=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_reduceExpr1183); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN46_tree = (Object)adaptor.create(LPAREN46);
+ adaptor.addChild(root_0, LPAREN46_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_reduceExpr1187);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN47=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_reduceExpr1189); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN47_tree = (Object)adaptor.create(RPAREN47);
+ adaptor.addChild(root_0, RPAREN47_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ReduceExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 21, reduceExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "reduceExpr"
+
+ public static class generalCondenseExpr_return extends ParserRuleReturnScope {
+ public GeneralCondenseExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "generalCondenseExpr"
+ // src/petascope/wcps/grammar/wcps.g:133:1: generalCondenseExpr returns [GeneralCondenseExpr value] : CONDENSE op= condenseOpType OVER ail= axisIteratorList ( WHERE cond= booleanScalarExpr )? USING ce= coverageExpr ;
+ public final wcpsParser.generalCondenseExpr_return generalCondenseExpr() throws RecognitionException {
+ wcpsParser.generalCondenseExpr_return retval = new wcpsParser.generalCondenseExpr_return();
+ retval.start = input.LT(1);
+ int generalCondenseExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token CONDENSE48=null;
+ Token OVER49=null;
+ Token WHERE50=null;
+ Token USING51=null;
+ wcpsParser.condenseOpType_return op = null;
+
+ wcpsParser.axisIteratorList_return ail = null;
+
+ wcpsParser.booleanScalarExpr_return cond = null;
+
+ wcpsParser.coverageExpr_return ce = null;
+
+
+ Object CONDENSE48_tree=null;
+ Object OVER49_tree=null;
+ Object WHERE50_tree=null;
+ Object USING51_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 22) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:134:2: ( CONDENSE op= condenseOpType OVER ail= axisIteratorList ( WHERE cond= booleanScalarExpr )? USING ce= coverageExpr )
+ // src/petascope/wcps/grammar/wcps.g:134:4: CONDENSE op= condenseOpType OVER ail= axisIteratorList ( WHERE cond= booleanScalarExpr )? USING ce= coverageExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ CONDENSE48=(Token)match(input,CONDENSE,FOLLOW_CONDENSE_in_generalCondenseExpr1204); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ CONDENSE48_tree = (Object)adaptor.create(CONDENSE48);
+ adaptor.addChild(root_0, CONDENSE48_tree);
+ }
+ pushFollow(FOLLOW_condenseOpType_in_generalCondenseExpr1208);
+ op=condenseOpType();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, op.getTree());
+ OVER49=(Token)match(input,OVER,FOLLOW_OVER_in_generalCondenseExpr1210); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ OVER49_tree = (Object)adaptor.create(OVER49);
+ adaptor.addChild(root_0, OVER49_tree);
+ }
+ pushFollow(FOLLOW_axisIteratorList_in_generalCondenseExpr1214);
+ ail=axisIteratorList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ail.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new GeneralCondenseExpr((op!=null?op.value:null), (ail!=null?ail.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:135:3: ( WHERE cond= booleanScalarExpr )?
+ int alt18=2;
+ int LA18_0 = input.LA(1);
+
+ if ( (LA18_0==WHERE) ) {
+ alt18=1;
+ }
+ switch (alt18) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:135:4: WHERE cond= booleanScalarExpr
+ {
+ WHERE50=(Token)match(input,WHERE,FOLLOW_WHERE_in_generalCondenseExpr1221); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ WHERE50_tree = (Object)adaptor.create(WHERE50);
+ adaptor.addChild(root_0, WHERE50_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarExpr_in_generalCondenseExpr1225);
+ cond=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cond.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setWhere((cond!=null?cond.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+ USING51=(Token)match(input,USING,FOLLOW_USING_in_generalCondenseExpr1233); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ USING51_tree = (Object)adaptor.create(USING51);
+ adaptor.addChild(root_0, USING51_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_generalCondenseExpr1237);
+ ce=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ce.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setUsing((ce!=null?ce.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 22, generalCondenseExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "generalCondenseExpr"
+
+ public static class axisIteratorList_return extends ParserRuleReturnScope {
+ public AxisIteratorList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "axisIteratorList"
+ // src/petascope/wcps/grammar/wcps.g:138:1: axisIteratorList returns [AxisIteratorList value] : vn= variableName an= axisName LPAREN ie= intervalExpr RPAREN ( COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN )* ;
+ public final wcpsParser.axisIteratorList_return axisIteratorList() throws RecognitionException {
+ wcpsParser.axisIteratorList_return retval = new wcpsParser.axisIteratorList_return();
+ retval.start = input.LT(1);
+ int axisIteratorList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN52=null;
+ Token RPAREN53=null;
+ Token COMMA54=null;
+ Token LPAREN55=null;
+ Token RPAREN56=null;
+ wcpsParser.variableName_return vn = null;
+
+ wcpsParser.axisName_return an = null;
+
+ wcpsParser.intervalExpr_return ie = null;
+
+ wcpsParser.variableName_return vn2 = null;
+
+ wcpsParser.axisName_return an2 = null;
+
+ wcpsParser.intervalExpr_return ie2 = null;
+
+
+ Object LPAREN52_tree=null;
+ Object RPAREN53_tree=null;
+ Object COMMA54_tree=null;
+ Object LPAREN55_tree=null;
+ Object RPAREN56_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 23) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:139:2: (vn= variableName an= axisName LPAREN ie= intervalExpr RPAREN ( COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN )* )
+ // src/petascope/wcps/grammar/wcps.g:139:4: vn= variableName an= axisName LPAREN ie= intervalExpr RPAREN ( COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_variableName_in_axisIteratorList1254);
+ vn=variableName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, vn.getTree());
+ pushFollow(FOLLOW_axisName_in_axisIteratorList1258);
+ an=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, an.getTree());
+ LPAREN52=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_axisIteratorList1260); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN52_tree = (Object)adaptor.create(LPAREN52);
+ adaptor.addChild(root_0, LPAREN52_tree);
+ }
+ pushFollow(FOLLOW_intervalExpr_in_axisIteratorList1264);
+ ie=intervalExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ie.getTree());
+ RPAREN53=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_axisIteratorList1266); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN53_tree = (Object)adaptor.create(RPAREN53);
+ adaptor.addChild(root_0, RPAREN53_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new AxisIteratorList(new AxisIterator((vn!=null?vn.value:null), (an!=null?an.value:null), (ie!=null?ie.value:null)));
+ }
+ // src/petascope/wcps/grammar/wcps.g:141:2: ( COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN )*
+ loop19:
+ do {
+ int alt19=2;
+ int LA19_0 = input.LA(1);
+
+ if ( (LA19_0==COMMA) ) {
+ alt19=1;
+ }
+
+
+ switch (alt19) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:141:3: COMMA vn2= variableName an2= axisName LPAREN ie2= intervalExpr RPAREN
+ {
+ COMMA54=(Token)match(input,COMMA,FOLLOW_COMMA_in_axisIteratorList1274); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA54_tree = (Object)adaptor.create(COMMA54);
+ adaptor.addChild(root_0, COMMA54_tree);
+ }
+ pushFollow(FOLLOW_variableName_in_axisIteratorList1278);
+ vn2=variableName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, vn2.getTree());
+ pushFollow(FOLLOW_axisName_in_axisIteratorList1282);
+ an2=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, an2.getTree());
+ LPAREN55=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_axisIteratorList1284); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN55_tree = (Object)adaptor.create(LPAREN55);
+ adaptor.addChild(root_0, LPAREN55_tree);
+ }
+ pushFollow(FOLLOW_intervalExpr_in_axisIteratorList1288);
+ ie2=intervalExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ie2.getTree());
+ RPAREN56=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_axisIteratorList1290); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN56_tree = (Object)adaptor.create(RPAREN56);
+ adaptor.addChild(root_0, RPAREN56_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new AxisIteratorList(new AxisIterator((vn2!=null?vn2.value:null), (an2!=null?an2.value:null), (ie2!=null?ie2.value:null)), retval.value);
+ }
+
+ }
+ break;
+
+ default :
+ break loop19;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 23, axisIteratorList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "axisIteratorList"
+
+ public static class intervalExpr_return extends ParserRuleReturnScope {
+ public IntervalExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "intervalExpr"
+ // src/petascope/wcps/grammar/wcps.g:144:1: intervalExpr returns [IntervalExpr value] : (lo= indexExpr COLON hi= indexExpr | IMAGECRSDOMAIN LPAREN e1= coverageName COMMA e2= axisName RPAREN );
+ public final wcpsParser.intervalExpr_return intervalExpr() throws RecognitionException {
+ wcpsParser.intervalExpr_return retval = new wcpsParser.intervalExpr_return();
+ retval.start = input.LT(1);
+ int intervalExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COLON57=null;
+ Token IMAGECRSDOMAIN58=null;
+ Token LPAREN59=null;
+ Token COMMA60=null;
+ Token RPAREN61=null;
+ wcpsParser.indexExpr_return lo = null;
+
+ wcpsParser.indexExpr_return hi = null;
+
+ wcpsParser.coverageName_return e1 = null;
+
+ wcpsParser.axisName_return e2 = null;
+
+
+ Object COLON57_tree=null;
+ Object IMAGECRSDOMAIN58_tree=null;
+ Object LPAREN59_tree=null;
+ Object COMMA60_tree=null;
+ Object RPAREN61_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 24) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:145:5: (lo= indexExpr COLON hi= indexExpr | IMAGECRSDOMAIN LPAREN e1= coverageName COMMA e2= axisName RPAREN )
+ int alt20=2;
+ int LA20_0 = input.LA(1);
+
+ if ( (LA20_0==LPAREN||(LA20_0>=INTEGERCONSTANT && LA20_0<=ROUND)) ) {
+ alt20=1;
+ }
+ else if ( (LA20_0==IMAGECRSDOMAIN) ) {
+ alt20=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 20, 0, input);
+
+ throw nvae;
+ }
+ switch (alt20) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:145:7: lo= indexExpr COLON hi= indexExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_indexExpr_in_intervalExpr1314);
+ lo=indexExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, lo.getTree());
+ COLON57=(Token)match(input,COLON,FOLLOW_COLON_in_intervalExpr1316); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON57_tree = (Object)adaptor.create(COLON57);
+ adaptor.addChild(root_0, COLON57_tree);
+ }
+ pushFollow(FOLLOW_indexExpr_in_intervalExpr1320);
+ hi=indexExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, hi.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new IntervalExpr((lo!=null?lo.value:null), (hi!=null?hi.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:147:7: IMAGECRSDOMAIN LPAREN e1= coverageName COMMA e2= axisName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ IMAGECRSDOMAIN58=(Token)match(input,IMAGECRSDOMAIN,FOLLOW_IMAGECRSDOMAIN_in_intervalExpr1335); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ IMAGECRSDOMAIN58_tree = (Object)adaptor.create(IMAGECRSDOMAIN58);
+ adaptor.addChild(root_0, IMAGECRSDOMAIN58_tree);
+ }
+ LPAREN59=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_intervalExpr1337); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN59_tree = (Object)adaptor.create(LPAREN59);
+ adaptor.addChild(root_0, LPAREN59_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_intervalExpr1341);
+ e1=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA60=(Token)match(input,COMMA,FOLLOW_COMMA_in_intervalExpr1343); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA60_tree = (Object)adaptor.create(COMMA60);
+ adaptor.addChild(root_0, COMMA60_tree);
+ }
+ pushFollow(FOLLOW_axisName_in_intervalExpr1347);
+ e2=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ RPAREN61=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_intervalExpr1349); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN61_tree = (Object)adaptor.create(RPAREN61);
+ adaptor.addChild(root_0, RPAREN61_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new IntervalExpr((e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 24, intervalExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "intervalExpr"
+
+ public static class coverageConstantExpr_return extends ParserRuleReturnScope {
+ public CoverageConstantExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageConstantExpr"
+ // src/petascope/wcps/grammar/wcps.g:150:1: coverageConstantExpr returns [CoverageConstantExpr value] : COVERAGE aname= coverageName OVER iter= axisIteratorList VALUE LIST LT values= constantList GT ;
+ public final wcpsParser.coverageConstantExpr_return coverageConstantExpr() throws RecognitionException {
+ wcpsParser.coverageConstantExpr_return retval = new wcpsParser.coverageConstantExpr_return();
+ retval.start = input.LT(1);
+ int coverageConstantExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COVERAGE62=null;
+ Token OVER63=null;
+ Token VALUE64=null;
+ Token LIST65=null;
+ Token LT66=null;
+ Token GT67=null;
+ wcpsParser.coverageName_return aname = null;
+
+ wcpsParser.axisIteratorList_return iter = null;
+
+ wcpsParser.constantList_return values = null;
+
+
+ Object COVERAGE62_tree=null;
+ Object OVER63_tree=null;
+ Object VALUE64_tree=null;
+ Object LIST65_tree=null;
+ Object LT66_tree=null;
+ Object GT67_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 25) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:151:5: ( COVERAGE aname= coverageName OVER iter= axisIteratorList VALUE LIST LT values= constantList GT )
+ // src/petascope/wcps/grammar/wcps.g:151:7: COVERAGE aname= coverageName OVER iter= axisIteratorList VALUE LIST LT values= constantList GT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ COVERAGE62=(Token)match(input,COVERAGE,FOLLOW_COVERAGE_in_coverageConstantExpr1375); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COVERAGE62_tree = (Object)adaptor.create(COVERAGE62);
+ adaptor.addChild(root_0, COVERAGE62_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_coverageConstantExpr1379);
+ aname=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ OVER63=(Token)match(input,OVER,FOLLOW_OVER_in_coverageConstantExpr1381); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ OVER63_tree = (Object)adaptor.create(OVER63);
+ adaptor.addChild(root_0, OVER63_tree);
+ }
+ pushFollow(FOLLOW_axisIteratorList_in_coverageConstantExpr1385);
+ iter=axisIteratorList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, iter.getTree());
+ VALUE64=(Token)match(input,VALUE,FOLLOW_VALUE_in_coverageConstantExpr1387); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ VALUE64_tree = (Object)adaptor.create(VALUE64);
+ adaptor.addChild(root_0, VALUE64_tree);
+ }
+ LIST65=(Token)match(input,LIST,FOLLOW_LIST_in_coverageConstantExpr1389); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LIST65_tree = (Object)adaptor.create(LIST65);
+ adaptor.addChild(root_0, LIST65_tree);
+ }
+ LT66=(Token)match(input,LT,FOLLOW_LT_in_coverageConstantExpr1391); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LT66_tree = (Object)adaptor.create(LT66);
+ adaptor.addChild(root_0, LT66_tree);
+ }
+ pushFollow(FOLLOW_constantList_in_coverageConstantExpr1395);
+ values=constantList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, values.getTree());
+ GT67=(Token)match(input,GT,FOLLOW_GT_in_coverageConstantExpr1397); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ GT67_tree = (Object)adaptor.create(GT67);
+ adaptor.addChild(root_0, GT67_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageConstantExpr((aname!=null?aname.value:null), (iter!=null?iter.value:null), (values!=null?values.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 25, coverageConstantExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageConstantExpr"
+
+ public static class constantList_return extends ParserRuleReturnScope {
+ public ConstantList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "constantList"
+ // src/petascope/wcps/grammar/wcps.g:154:1: constantList returns [ConstantList value] : c= constant ( SEMICOLON c= constant )* ;
+ public final wcpsParser.constantList_return constantList() throws RecognitionException {
+ wcpsParser.constantList_return retval = new wcpsParser.constantList_return();
+ retval.start = input.LT(1);
+ int constantList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token SEMICOLON68=null;
+ wcpsParser.constant_return c = null;
+
+
+ Object SEMICOLON68_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 26) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:155:5: (c= constant ( SEMICOLON c= constant )* )
+ // src/petascope/wcps/grammar/wcps.g:155:7: c= constant ( SEMICOLON c= constant )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_constant_in_constantList1428);
+ c=constant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, c.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ConstantList((c!=null?c.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:155:59: ( SEMICOLON c= constant )*
+ loop21:
+ do {
+ int alt21=2;
+ int LA21_0 = input.LA(1);
+
+ if ( (LA21_0==SEMICOLON) ) {
+ alt21=1;
+ }
+
+
+ switch (alt21) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:155:60: SEMICOLON c= constant
+ {
+ SEMICOLON68=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_constantList1433); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ SEMICOLON68_tree = (Object)adaptor.create(SEMICOLON68);
+ adaptor.addChild(root_0, SEMICOLON68_tree);
+ }
+ pushFollow(FOLLOW_constant_in_constantList1437);
+ c=constant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, c.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((c!=null?c.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop21;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 26, constantList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "constantList"
+
+ public static class coverageConstructorExpr_return extends ParserRuleReturnScope {
+ public CoverageConstructorExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageConstructorExpr"
+ // src/petascope/wcps/grammar/wcps.g:157:1: coverageConstructorExpr returns [CoverageConstructorExpr value] : COVERAGE coverage= coverageName OVER ail= axisIteratorList VALUES se= scalarExpr ;
+ public final wcpsParser.coverageConstructorExpr_return coverageConstructorExpr() throws RecognitionException {
+ wcpsParser.coverageConstructorExpr_return retval = new wcpsParser.coverageConstructorExpr_return();
+ retval.start = input.LT(1);
+ int coverageConstructorExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COVERAGE69=null;
+ Token OVER70=null;
+ Token VALUES71=null;
+ wcpsParser.coverageName_return coverage = null;
+
+ wcpsParser.axisIteratorList_return ail = null;
+
+ wcpsParser.scalarExpr_return se = null;
+
+
+ Object COVERAGE69_tree=null;
+ Object OVER70_tree=null;
+ Object VALUES71_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 27) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:158:2: ( COVERAGE coverage= coverageName OVER ail= axisIteratorList VALUES se= scalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:158:4: COVERAGE coverage= coverageName OVER ail= axisIteratorList VALUES se= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ COVERAGE69=(Token)match(input,COVERAGE,FOLLOW_COVERAGE_in_coverageConstructorExpr1457); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COVERAGE69_tree = (Object)adaptor.create(COVERAGE69);
+ adaptor.addChild(root_0, COVERAGE69_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_coverageConstructorExpr1461);
+ coverage=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, coverage.getTree());
+ OVER70=(Token)match(input,OVER,FOLLOW_OVER_in_coverageConstructorExpr1463); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ OVER70_tree = (Object)adaptor.create(OVER70);
+ adaptor.addChild(root_0, OVER70_tree);
+ }
+ pushFollow(FOLLOW_axisIteratorList_in_coverageConstructorExpr1467);
+ ail=axisIteratorList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, ail.getTree());
+ VALUES71=(Token)match(input,VALUES,FOLLOW_VALUES_in_coverageConstructorExpr1469); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ VALUES71_tree = (Object)adaptor.create(VALUES71);
+ adaptor.addChild(root_0, VALUES71_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_coverageConstructorExpr1473);
+ se=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, se.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageConstructorExpr((coverage!=null?coverage.value:null), (ail!=null?ail.value:null), (se!=null?se.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 27, coverageConstructorExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageConstructorExpr"
+
+ public static class setMetaDataExpr_return extends ParserRuleReturnScope {
+ public SetMetaDataExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "setMetaDataExpr"
+ // src/petascope/wcps/grammar/wcps.g:161:1: setMetaDataExpr returns [SetMetaDataExpr value] : (op= SETIDENTIFIER LPAREN s= stringConstant COMMA e1= coverageExpr RPAREN | op= SETCRSSET LPAREN e1= coverageExpr COMMA crs= crsList RPAREN | op= SETNULLSET LPAREN e1= coverageExpr COMMA rel= rangeExprList RPAREN | op= SETINTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA fn= fieldName COMMA im= interpolationMethod RPAREN | op= SETINTERPOLATIONSET LPAREN e1= coverageExpr COMMA fn= fieldName COMMA iml= interpolationMethodList RPAREN );
+ public final wcpsParser.setMetaDataExpr_return setMetaDataExpr() throws RecognitionException {
+ wcpsParser.setMetaDataExpr_return retval = new wcpsParser.setMetaDataExpr_return();
+ retval.start = input.LT(1);
+ int setMetaDataExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN72=null;
+ Token COMMA73=null;
+ Token RPAREN74=null;
+ Token LPAREN75=null;
+ Token COMMA76=null;
+ Token RPAREN77=null;
+ Token LPAREN78=null;
+ Token COMMA79=null;
+ Token RPAREN80=null;
+ Token LPAREN81=null;
+ Token COMMA82=null;
+ Token COMMA83=null;
+ Token RPAREN84=null;
+ Token LPAREN85=null;
+ Token COMMA86=null;
+ Token COMMA87=null;
+ Token RPAREN88=null;
+ wcpsParser.stringConstant_return s = null;
+
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.crsList_return crs = null;
+
+ wcpsParser.rangeExprList_return rel = null;
+
+ wcpsParser.fieldName_return fn = null;
+
+ wcpsParser.interpolationMethod_return im = null;
+
+ wcpsParser.interpolationMethodList_return iml = null;
+
+
+ Object op_tree=null;
+ Object LPAREN72_tree=null;
+ Object COMMA73_tree=null;
+ Object RPAREN74_tree=null;
+ Object LPAREN75_tree=null;
+ Object COMMA76_tree=null;
+ Object RPAREN77_tree=null;
+ Object LPAREN78_tree=null;
+ Object COMMA79_tree=null;
+ Object RPAREN80_tree=null;
+ Object LPAREN81_tree=null;
+ Object COMMA82_tree=null;
+ Object COMMA83_tree=null;
+ Object RPAREN84_tree=null;
+ Object LPAREN85_tree=null;
+ Object COMMA86_tree=null;
+ Object COMMA87_tree=null;
+ Object RPAREN88_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 28) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:162:5: (op= SETIDENTIFIER LPAREN s= stringConstant COMMA e1= coverageExpr RPAREN | op= SETCRSSET LPAREN e1= coverageExpr COMMA crs= crsList RPAREN | op= SETNULLSET LPAREN e1= coverageExpr COMMA rel= rangeExprList RPAREN | op= SETINTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA fn= fieldName COMMA im= interpolationMethod RPAREN | op= SETINTERPOLATIONSET LPAREN e1= coverageExpr COMMA fn= fieldName COMMA iml= interpolationMethodList RPAREN )
+ int alt22=5;
+ switch ( input.LA(1) ) {
+ case SETIDENTIFIER:
+ {
+ alt22=1;
+ }
+ break;
+ case SETCRSSET:
+ {
+ alt22=2;
+ }
+ break;
+ case SETNULLSET:
+ {
+ alt22=3;
+ }
+ break;
+ case SETINTERPOLATIONDEFAULT:
+ {
+ alt22=4;
+ }
+ break;
+ case SETINTERPOLATIONSET:
+ {
+ alt22=5;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 22, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt22) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:162:7: op= SETIDENTIFIER LPAREN s= stringConstant COMMA e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETIDENTIFIER,FOLLOW_SETIDENTIFIER_in_setMetaDataExpr1495); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN72=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1497); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN72_tree = (Object)adaptor.create(LPAREN72);
+ adaptor.addChild(root_0, LPAREN72_tree);
+ }
+ pushFollow(FOLLOW_stringConstant_in_setMetaDataExpr1501);
+ s=stringConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, s.getTree());
+ COMMA73=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1503); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA73_tree = (Object)adaptor.create(COMMA73);
+ adaptor.addChild(root_0, COMMA73_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1507);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN74=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1509); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN74_tree = (Object)adaptor.create(RPAREN74);
+ adaptor.addChild(root_0, RPAREN74_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (s!=null?s.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:164:7: op= SETCRSSET LPAREN e1= coverageExpr COMMA crs= crsList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETCRSSET,FOLLOW_SETCRSSET_in_setMetaDataExpr1522); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN75=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1524); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN75_tree = (Object)adaptor.create(LPAREN75);
+ adaptor.addChild(root_0, LPAREN75_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1528);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA76=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1530); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA76_tree = (Object)adaptor.create(COMMA76);
+ adaptor.addChild(root_0, COMMA76_tree);
+ }
+ pushFollow(FOLLOW_crsList_in_setMetaDataExpr1534);
+ crs=crsList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ RPAREN77=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1536); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN77_tree = (Object)adaptor.create(RPAREN77);
+ adaptor.addChild(root_0, RPAREN77_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (crs!=null?crs.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:166:7: op= SETNULLSET LPAREN e1= coverageExpr COMMA rel= rangeExprList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETNULLSET,FOLLOW_SETNULLSET_in_setMetaDataExpr1553); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN78=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1555); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN78_tree = (Object)adaptor.create(LPAREN78);
+ adaptor.addChild(root_0, LPAREN78_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1559);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA79=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1561); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA79_tree = (Object)adaptor.create(COMMA79);
+ adaptor.addChild(root_0, COMMA79_tree);
+ }
+ pushFollow(FOLLOW_rangeExprList_in_setMetaDataExpr1565);
+ rel=rangeExprList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, rel.getTree());
+ RPAREN80=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1567); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN80_tree = (Object)adaptor.create(RPAREN80);
+ adaptor.addChild(root_0, RPAREN80_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (rel!=null?rel.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:168:7: op= SETINTERPOLATIONDEFAULT LPAREN e1= coverageExpr COMMA fn= fieldName COMMA im= interpolationMethod RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETINTERPOLATIONDEFAULT,FOLLOW_SETINTERPOLATIONDEFAULT_in_setMetaDataExpr1584); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN81=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1586); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN81_tree = (Object)adaptor.create(LPAREN81);
+ adaptor.addChild(root_0, LPAREN81_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1590);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA82=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1592); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA82_tree = (Object)adaptor.create(COMMA82);
+ adaptor.addChild(root_0, COMMA82_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_setMetaDataExpr1596);
+ fn=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, fn.getTree());
+ COMMA83=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1598); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA83_tree = (Object)adaptor.create(COMMA83);
+ adaptor.addChild(root_0, COMMA83_tree);
+ }
+ pushFollow(FOLLOW_interpolationMethod_in_setMetaDataExpr1602);
+ im=interpolationMethod();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, im.getTree());
+ RPAREN84=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1604); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN84_tree = (Object)adaptor.create(RPAREN84);
+ adaptor.addChild(root_0, RPAREN84_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (im!=null?im.value:null), (fn!=null?fn.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:170:7: op= SETINTERPOLATIONSET LPAREN e1= coverageExpr COMMA fn= fieldName COMMA iml= interpolationMethodList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SETINTERPOLATIONSET,FOLLOW_SETINTERPOLATIONSET_in_setMetaDataExpr1624); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN85=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_setMetaDataExpr1626); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN85_tree = (Object)adaptor.create(LPAREN85);
+ adaptor.addChild(root_0, LPAREN85_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_setMetaDataExpr1630);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA86=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1632); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA86_tree = (Object)adaptor.create(COMMA86);
+ adaptor.addChild(root_0, COMMA86_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_setMetaDataExpr1636);
+ fn=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, fn.getTree());
+ COMMA87=(Token)match(input,COMMA,FOLLOW_COMMA_in_setMetaDataExpr1638); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA87_tree = (Object)adaptor.create(COMMA87);
+ adaptor.addChild(root_0, COMMA87_tree);
+ }
+ pushFollow(FOLLOW_interpolationMethodList_in_setMetaDataExpr1642);
+ iml=interpolationMethodList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, iml.getTree());
+ RPAREN88=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_setMetaDataExpr1644); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN88_tree = (Object)adaptor.create(RPAREN88);
+ adaptor.addChild(root_0, RPAREN88_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SetMetaDataExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (iml!=null?iml.value:null), (fn!=null?fn.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 28, setMetaDataExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "setMetaDataExpr"
+
+ public static class crsList_return extends ParserRuleReturnScope {
+ public CrsList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "crsList"
+ // src/petascope/wcps/grammar/wcps.g:173:1: crsList returns [CrsList value] : LBRACE (crs= crsName ( COMMA crs= crsName )* )? RBRACE ;
+ public final wcpsParser.crsList_return crsList() throws RecognitionException {
+ wcpsParser.crsList_return retval = new wcpsParser.crsList_return();
+ retval.start = input.LT(1);
+ int crsList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACE89=null;
+ Token COMMA90=null;
+ Token RBRACE91=null;
+ wcpsParser.crsName_return crs = null;
+
+
+ Object LBRACE89_tree=null;
+ Object COMMA90_tree=null;
+ Object RBRACE91_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 29) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:174:5: ( LBRACE (crs= crsName ( COMMA crs= crsName )* )? RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:174:7: LBRACE (crs= crsName ( COMMA crs= crsName )* )? RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LBRACE89=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_crsList1673); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE89_tree = (Object)adaptor.create(LBRACE89);
+ adaptor.addChild(root_0, LBRACE89_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CrsList();
+ }
+ // src/petascope/wcps/grammar/wcps.g:174:40: (crs= crsName ( COMMA crs= crsName )* )?
+ int alt24=2;
+ int LA24_0 = input.LA(1);
+
+ if ( (LA24_0==STRING) ) {
+ alt24=1;
+ }
+ switch (alt24) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:174:41: crs= crsName ( COMMA crs= crsName )*
+ {
+ pushFollow(FOLLOW_crsName_in_crsList1680);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((crs!=null?crs.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:174:81: ( COMMA crs= crsName )*
+ loop23:
+ do {
+ int alt23=2;
+ int LA23_0 = input.LA(1);
+
+ if ( (LA23_0==COMMA) ) {
+ alt23=1;
+ }
+
+
+ switch (alt23) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:174:82: COMMA crs= crsName
+ {
+ COMMA90=(Token)match(input,COMMA,FOLLOW_COMMA_in_crsList1685); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA90_tree = (Object)adaptor.create(COMMA90);
+ adaptor.addChild(root_0, COMMA90_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_crsList1689);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((crs!=null?crs.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop23;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+
+ RBRACE91=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_crsList1698); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE91_tree = (Object)adaptor.create(RBRACE91);
+ adaptor.addChild(root_0, RBRACE91_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 29, crsList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "crsList"
+
+ public static class rangeExprList_return extends ParserRuleReturnScope {
+ public RangeExprList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "rangeExprList"
+ // src/petascope/wcps/grammar/wcps.g:176:1: rangeExprList returns [RangeExprList value] : LBRACE (re1= rangeExpr ( COMMA re2= rangeExpr )* )? RBRACE ;
+ public final wcpsParser.rangeExprList_return rangeExprList() throws RecognitionException {
+ wcpsParser.rangeExprList_return retval = new wcpsParser.rangeExprList_return();
+ retval.start = input.LT(1);
+ int rangeExprList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACE92=null;
+ Token COMMA93=null;
+ Token RBRACE94=null;
+ wcpsParser.rangeExpr_return re1 = null;
+
+ wcpsParser.rangeExpr_return re2 = null;
+
+
+ Object LBRACE92_tree=null;
+ Object COMMA93_tree=null;
+ Object RBRACE94_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 30) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:177:5: ( LBRACE (re1= rangeExpr ( COMMA re2= rangeExpr )* )? RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:177:7: LBRACE (re1= rangeExpr ( COMMA re2= rangeExpr )* )? RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LBRACE92=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_rangeExprList1717); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE92_tree = (Object)adaptor.create(LBRACE92);
+ adaptor.addChild(root_0, LBRACE92_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new RangeExprList();
+ }
+ // src/petascope/wcps/grammar/wcps.g:177:48: (re1= rangeExpr ( COMMA re2= rangeExpr )* )?
+ int alt26=2;
+ int LA26_0 = input.LA(1);
+
+ if ( (LA26_0==STRUCT) ) {
+ alt26=1;
+ }
+ switch (alt26) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:177:49: re1= rangeExpr ( COMMA re2= rangeExpr )*
+ {
+ pushFollow(FOLLOW_rangeExpr_in_rangeExprList1724);
+ re1=rangeExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, re1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((re1!=null?re1.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:177:91: ( COMMA re2= rangeExpr )*
+ loop25:
+ do {
+ int alt25=2;
+ int LA25_0 = input.LA(1);
+
+ if ( (LA25_0==COMMA) ) {
+ alt25=1;
+ }
+
+
+ switch (alt25) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:177:92: COMMA re2= rangeExpr
+ {
+ COMMA93=(Token)match(input,COMMA,FOLLOW_COMMA_in_rangeExprList1729); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA93_tree = (Object)adaptor.create(COMMA93);
+ adaptor.addChild(root_0, COMMA93_tree);
+ }
+ pushFollow(FOLLOW_rangeExpr_in_rangeExprList1733);
+ re2=rangeExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, re2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((re2!=null?re2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop25;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+
+ RBRACE94=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_rangeExprList1742); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE94_tree = (Object)adaptor.create(RBRACE94);
+ adaptor.addChild(root_0, RBRACE94_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 30, rangeExprList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "rangeExprList"
+
+ public static class interpolationMethodList_return extends ParserRuleReturnScope {
+ public InterpolationMethodList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "interpolationMethodList"
+ // src/petascope/wcps/grammar/wcps.g:179:1: interpolationMethodList returns [InterpolationMethodList value] : LBRACE (e= interpolationMethod ( COMMA e= interpolationMethod )* )? RBRACE ;
+ public final wcpsParser.interpolationMethodList_return interpolationMethodList() throws RecognitionException {
+ wcpsParser.interpolationMethodList_return retval = new wcpsParser.interpolationMethodList_return();
+ retval.start = input.LT(1);
+ int interpolationMethodList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACE95=null;
+ Token COMMA96=null;
+ Token RBRACE97=null;
+ wcpsParser.interpolationMethod_return e = null;
+
+
+ Object LBRACE95_tree=null;
+ Object COMMA96_tree=null;
+ Object RBRACE97_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 31) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:180:2: ( LBRACE (e= interpolationMethod ( COMMA e= interpolationMethod )* )? RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:180:4: LBRACE (e= interpolationMethod ( COMMA e= interpolationMethod )* )? RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LBRACE95=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_interpolationMethodList1758); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE95_tree = (Object)adaptor.create(LBRACE95);
+ adaptor.addChild(root_0, LBRACE95_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new InterpolationMethodList();
+ }
+ // src/petascope/wcps/grammar/wcps.g:180:53: (e= interpolationMethod ( COMMA e= interpolationMethod )* )?
+ int alt28=2;
+ int LA28_0 = input.LA(1);
+
+ if ( (LA28_0==LPAREN) ) {
+ alt28=1;
+ }
+ switch (alt28) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:180:54: e= interpolationMethod ( COMMA e= interpolationMethod )*
+ {
+ pushFollow(FOLLOW_interpolationMethod_in_interpolationMethodList1765);
+ e=interpolationMethod();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((e!=null?e.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:180:102: ( COMMA e= interpolationMethod )*
+ loop27:
+ do {
+ int alt27=2;
+ int LA27_0 = input.LA(1);
+
+ if ( (LA27_0==COMMA) ) {
+ alt27=1;
+ }
+
+
+ switch (alt27) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:180:103: COMMA e= interpolationMethod
+ {
+ COMMA96=(Token)match(input,COMMA,FOLLOW_COMMA_in_interpolationMethodList1770); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA96_tree = (Object)adaptor.create(COMMA96);
+ adaptor.addChild(root_0, COMMA96_tree);
+ }
+ pushFollow(FOLLOW_interpolationMethod_in_interpolationMethodList1774);
+ e=interpolationMethod();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((e!=null?e.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop27;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+
+ RBRACE97=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_interpolationMethodList1782); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE97_tree = (Object)adaptor.create(RBRACE97);
+ adaptor.addChild(root_0, RBRACE97_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 31, interpolationMethodList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "interpolationMethodList"
+
+ public static class rangeExpr_return extends ParserRuleReturnScope {
+ public RangeExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "rangeExpr"
+ // src/petascope/wcps/grammar/wcps.g:182:1: rangeExpr returns [RangeExpr value] : STRUCT LBRACE (field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )* )? RBRACE ;
+ public final wcpsParser.rangeExpr_return rangeExpr() throws RecognitionException {
+ wcpsParser.rangeExpr_return retval = new wcpsParser.rangeExpr_return();
+ retval.start = input.LT(1);
+ int rangeExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token STRUCT98=null;
+ Token LBRACE99=null;
+ Token COLON100=null;
+ Token COMMA101=null;
+ Token COLON102=null;
+ Token RBRACE103=null;
+ wcpsParser.fieldName_return field = null;
+
+ wcpsParser.scalarExpr_return expr = null;
+
+
+ Object STRUCT98_tree=null;
+ Object LBRACE99_tree=null;
+ Object COLON100_tree=null;
+ Object COMMA101_tree=null;
+ Object COLON102_tree=null;
+ Object RBRACE103_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 32) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:183:2: ( STRUCT LBRACE (field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )* )? RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:183:4: STRUCT LBRACE (field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )* )? RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ STRUCT98=(Token)match(input,STRUCT,FOLLOW_STRUCT_in_rangeExpr1795); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ STRUCT98_tree = (Object)adaptor.create(STRUCT98);
+ adaptor.addChild(root_0, STRUCT98_tree);
+ }
+ LBRACE99=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_rangeExpr1797); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE99_tree = (Object)adaptor.create(LBRACE99);
+ adaptor.addChild(root_0, LBRACE99_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value =new RangeExpr();
+ }
+ // src/petascope/wcps/grammar/wcps.g:184:2: (field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )* )?
+ int alt30=2;
+ int LA30_0 = input.LA(1);
+
+ if ( (LA30_0==INTEGERCONSTANT||LA30_0==STRING||LA30_0==NAME) ) {
+ alt30=1;
+ }
+ switch (alt30) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:184:3: field= fieldName COLON expr= scalarExpr ( COMMA field= fieldName COLON expr= scalarExpr )*
+ {
+ pushFollow(FOLLOW_fieldName_in_rangeExpr1805);
+ field=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, field.getTree());
+ COLON100=(Token)match(input,COLON,FOLLOW_COLON_in_rangeExpr1807); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON100_tree = (Object)adaptor.create(COLON100);
+ adaptor.addChild(root_0, COLON100_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_rangeExpr1811);
+ expr=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, expr.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((field!=null?field.value:null), (expr!=null?expr.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:185:3: ( COMMA field= fieldName COLON expr= scalarExpr )*
+ loop29:
+ do {
+ int alt29=2;
+ int LA29_0 = input.LA(1);
+
+ if ( (LA29_0==COMMA) ) {
+ alt29=1;
+ }
+
+
+ switch (alt29) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:185:4: COMMA field= fieldName COLON expr= scalarExpr
+ {
+ COMMA101=(Token)match(input,COMMA,FOLLOW_COMMA_in_rangeExpr1818); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA101_tree = (Object)adaptor.create(COMMA101);
+ adaptor.addChild(root_0, COMMA101_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_rangeExpr1822);
+ field=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, field.getTree());
+ COLON102=(Token)match(input,COLON,FOLLOW_COLON_in_rangeExpr1824); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON102_tree = (Object)adaptor.create(COLON102);
+ adaptor.addChild(root_0, COLON102_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_rangeExpr1828);
+ expr=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, expr.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((field!=null?field.value:null), (expr!=null?expr.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop29;
+ }
+ } while (true);
+
+
+ }
+ break;
+
+ }
+
+ RBRACE103=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_rangeExpr1839); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE103_tree = (Object)adaptor.create(RBRACE103);
+ adaptor.addChild(root_0, RBRACE103_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 32, rangeExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "rangeExpr"
+
+ public static class rangeConstructorExpr_return extends ParserRuleReturnScope {
+ public RangeConstructorExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "rangeConstructorExpr"
+ // src/petascope/wcps/grammar/wcps.g:188:1: rangeConstructorExpr returns [RangeConstructorExpr value] : ( STRUCT )? LBRACE field= fieldName COLON expr= coverageExpr ( SEMICOLON field= fieldName COLON expr= coverageExpr )* RBRACE ;
+ public final wcpsParser.rangeConstructorExpr_return rangeConstructorExpr() throws RecognitionException {
+ wcpsParser.rangeConstructorExpr_return retval = new wcpsParser.rangeConstructorExpr_return();
+ retval.start = input.LT(1);
+ int rangeConstructorExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token STRUCT104=null;
+ Token LBRACE105=null;
+ Token COLON106=null;
+ Token SEMICOLON107=null;
+ Token COLON108=null;
+ Token RBRACE109=null;
+ wcpsParser.fieldName_return field = null;
+
+ wcpsParser.coverageExpr_return expr = null;
+
+
+ Object STRUCT104_tree=null;
+ Object LBRACE105_tree=null;
+ Object COLON106_tree=null;
+ Object SEMICOLON107_tree=null;
+ Object COLON108_tree=null;
+ Object RBRACE109_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 33) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:189:5: ( ( STRUCT )? LBRACE field= fieldName COLON expr= coverageExpr ( SEMICOLON field= fieldName COLON expr= coverageExpr )* RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:189:7: ( STRUCT )? LBRACE field= fieldName COLON expr= coverageExpr ( SEMICOLON field= fieldName COLON expr= coverageExpr )* RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ // src/petascope/wcps/grammar/wcps.g:189:7: ( STRUCT )?
+ int alt31=2;
+ int LA31_0 = input.LA(1);
+
+ if ( (LA31_0==STRUCT) ) {
+ alt31=1;
+ }
+ switch (alt31) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:189:8: STRUCT
+ {
+ STRUCT104=(Token)match(input,STRUCT,FOLLOW_STRUCT_in_rangeConstructorExpr1856); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ STRUCT104_tree = (Object)adaptor.create(STRUCT104);
+ adaptor.addChild(root_0, STRUCT104_tree);
+ }
+
+ }
+ break;
+
+ }
+
+ LBRACE105=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_rangeConstructorExpr1860); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE105_tree = (Object)adaptor.create(LBRACE105);
+ adaptor.addChild(root_0, LBRACE105_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_rangeConstructorExpr1864);
+ field=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, field.getTree());
+ COLON106=(Token)match(input,COLON,FOLLOW_COLON_in_rangeConstructorExpr1866); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON106_tree = (Object)adaptor.create(COLON106);
+ adaptor.addChild(root_0, COLON106_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_rangeConstructorExpr1870);
+ expr=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, expr.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new RangeConstructorExpr((field!=null?field.value:null), (expr!=null?expr.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:190:9: ( SEMICOLON field= fieldName COLON expr= coverageExpr )*
+ loop32:
+ do {
+ int alt32=2;
+ int LA32_0 = input.LA(1);
+
+ if ( (LA32_0==SEMICOLON) ) {
+ alt32=1;
+ }
+
+
+ switch (alt32) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:190:10: SEMICOLON field= fieldName COLON expr= coverageExpr
+ {
+ SEMICOLON107=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_rangeConstructorExpr1883); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ SEMICOLON107_tree = (Object)adaptor.create(SEMICOLON107);
+ adaptor.addChild(root_0, SEMICOLON107_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_rangeConstructorExpr1887);
+ field=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, field.getTree());
+ COLON108=(Token)match(input,COLON,FOLLOW_COLON_in_rangeConstructorExpr1889); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON108_tree = (Object)adaptor.create(COLON108);
+ adaptor.addChild(root_0, COLON108_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_rangeConstructorExpr1893);
+ expr=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, expr.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((field!=null?field.value:null), (expr!=null?expr.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop32;
+ }
+ } while (true);
+
+ RBRACE109=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_rangeConstructorExpr1899); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE109_tree = (Object)adaptor.create(RBRACE109);
+ adaptor.addChild(root_0, RBRACE109_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 33, rangeConstructorExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "rangeConstructorExpr"
+
+ public static class crsTransformExpr_return extends ParserRuleReturnScope {
+ public CrsTransformExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "crsTransformExpr"
+ // src/petascope/wcps/grammar/wcps.g:192:1: crsTransformExpr returns [CrsTransformExpr value] : CRSTRANSFORM LPAREN e1= coverageExpr COMMA dcl= dimensionIntervalList COMMA fil= fieldInterpolationList RPAREN ;
+ public final wcpsParser.crsTransformExpr_return crsTransformExpr() throws RecognitionException {
+ wcpsParser.crsTransformExpr_return retval = new wcpsParser.crsTransformExpr_return();
+ retval.start = input.LT(1);
+ int crsTransformExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token CRSTRANSFORM110=null;
+ Token LPAREN111=null;
+ Token COMMA112=null;
+ Token COMMA113=null;
+ Token RPAREN114=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.dimensionIntervalList_return dcl = null;
+
+ wcpsParser.fieldInterpolationList_return fil = null;
+
+
+ Object CRSTRANSFORM110_tree=null;
+ Object LPAREN111_tree=null;
+ Object COMMA112_tree=null;
+ Object COMMA113_tree=null;
+ Object RPAREN114_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 34) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:193:2: ( CRSTRANSFORM LPAREN e1= coverageExpr COMMA dcl= dimensionIntervalList COMMA fil= fieldInterpolationList RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:193:4: CRSTRANSFORM LPAREN e1= coverageExpr COMMA dcl= dimensionIntervalList COMMA fil= fieldInterpolationList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ CRSTRANSFORM110=(Token)match(input,CRSTRANSFORM,FOLLOW_CRSTRANSFORM_in_crsTransformExpr1915); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ CRSTRANSFORM110_tree = (Object)adaptor.create(CRSTRANSFORM110);
+ adaptor.addChild(root_0, CRSTRANSFORM110_tree);
+ }
+ LPAREN111=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_crsTransformExpr1917); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN111_tree = (Object)adaptor.create(LPAREN111);
+ adaptor.addChild(root_0, LPAREN111_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_crsTransformExpr1921);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA112=(Token)match(input,COMMA,FOLLOW_COMMA_in_crsTransformExpr1923); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA112_tree = (Object)adaptor.create(COMMA112);
+ adaptor.addChild(root_0, COMMA112_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_crsTransformExpr1927);
+ dcl=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dcl.getTree());
+ COMMA113=(Token)match(input,COMMA,FOLLOW_COMMA_in_crsTransformExpr1929); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA113_tree = (Object)adaptor.create(COMMA113);
+ adaptor.addChild(root_0, COMMA113_tree);
+ }
+ pushFollow(FOLLOW_fieldInterpolationList_in_crsTransformExpr1933);
+ fil=fieldInterpolationList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, fil.getTree());
+ RPAREN114=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_crsTransformExpr1935); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN114_tree = (Object)adaptor.create(RPAREN114);
+ adaptor.addChild(root_0, RPAREN114_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CrsTransformExpr((e1!=null?e1.value:null), (dcl!=null?dcl.value:null), (fil!=null?fil.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 34, crsTransformExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "crsTransformExpr"
+
+ public static class fieldInterpolationList_return extends ParserRuleReturnScope {
+ public FieldInterpolationList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "fieldInterpolationList"
+ // src/petascope/wcps/grammar/wcps.g:196:1: fieldInterpolationList returns [FieldInterpolationList value] : LBRACE elem= fieldInterpolationElement ( COMMA elem= fieldInterpolationElement )* RBRACE ;
+ public final wcpsParser.fieldInterpolationList_return fieldInterpolationList() throws RecognitionException {
+ wcpsParser.fieldInterpolationList_return retval = new wcpsParser.fieldInterpolationList_return();
+ retval.start = input.LT(1);
+ int fieldInterpolationList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACE115=null;
+ Token COMMA116=null;
+ Token RBRACE117=null;
+ wcpsParser.fieldInterpolationElement_return elem = null;
+
+
+ Object LBRACE115_tree=null;
+ Object COMMA116_tree=null;
+ Object RBRACE117_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 35) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:197:2: ( LBRACE elem= fieldInterpolationElement ( COMMA elem= fieldInterpolationElement )* RBRACE )
+ // src/petascope/wcps/grammar/wcps.g:197:4: LBRACE elem= fieldInterpolationElement ( COMMA elem= fieldInterpolationElement )* RBRACE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LBRACE115=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_fieldInterpolationList1952); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE115_tree = (Object)adaptor.create(LBRACE115);
+ adaptor.addChild(root_0, LBRACE115_tree);
+ }
+ pushFollow(FOLLOW_fieldInterpolationElement_in_fieldInterpolationList1956);
+ elem=fieldInterpolationElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new FieldInterpolationList((elem!=null?elem.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:198:3: ( COMMA elem= fieldInterpolationElement )*
+ loop33:
+ do {
+ int alt33=2;
+ int LA33_0 = input.LA(1);
+
+ if ( (LA33_0==COMMA) ) {
+ alt33=1;
+ }
+
+
+ switch (alt33) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:198:4: COMMA elem= fieldInterpolationElement
+ {
+ COMMA116=(Token)match(input,COMMA,FOLLOW_COMMA_in_fieldInterpolationList1963); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA116_tree = (Object)adaptor.create(COMMA116);
+ adaptor.addChild(root_0, COMMA116_tree);
+ }
+ pushFollow(FOLLOW_fieldInterpolationElement_in_fieldInterpolationList1967);
+ elem=fieldInterpolationElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((elem!=null?elem.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop33;
+ }
+ } while (true);
+
+ RBRACE117=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_fieldInterpolationList1974); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE117_tree = (Object)adaptor.create(RBRACE117);
+ adaptor.addChild(root_0, RBRACE117_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 35, fieldInterpolationList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "fieldInterpolationList"
+
+ public static class fieldInterpolationElement_return extends ParserRuleReturnScope {
+ public FieldInterpolationElement value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "fieldInterpolationElement"
+ // src/petascope/wcps/grammar/wcps.g:200:1: fieldInterpolationElement returns [FieldInterpolationElement value] : aname= fieldName method= interpolationMethod ;
+ public final wcpsParser.fieldInterpolationElement_return fieldInterpolationElement() throws RecognitionException {
+ wcpsParser.fieldInterpolationElement_return retval = new wcpsParser.fieldInterpolationElement_return();
+ retval.start = input.LT(1);
+ int fieldInterpolationElement_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.fieldName_return aname = null;
+
+ wcpsParser.interpolationMethod_return method = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 36) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:201:2: (aname= fieldName method= interpolationMethod )
+ // src/petascope/wcps/grammar/wcps.g:201:4: aname= fieldName method= interpolationMethod
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_fieldName_in_fieldInterpolationElement1989);
+ aname=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ pushFollow(FOLLOW_interpolationMethod_in_fieldInterpolationElement1993);
+ method=interpolationMethod();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, method.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new FieldInterpolationElement((aname!=null?aname.value:null), (method!=null?method.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 36, fieldInterpolationElement_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "fieldInterpolationElement"
+
+ public static class unaryInducedExpr_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "unaryInducedExpr"
+ // src/petascope/wcps/grammar/wcps.g:203:1: unaryInducedExpr returns [CoverageExpr value] : (e6= fieldExpr | e1= unaryArithmeticExpr | e2= exponentialExpr | e3= trigonometricExpr | e4= booleanExpr | e5= castExpr | e7= rangeConstructorExpr );
+ public final wcpsParser.unaryInducedExpr_return unaryInducedExpr() throws RecognitionException {
+ wcpsParser.unaryInducedExpr_return retval = new wcpsParser.unaryInducedExpr_return();
+ retval.start = input.LT(1);
+ int unaryInducedExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.fieldExpr_return e6 = null;
+
+ wcpsParser.unaryArithmeticExpr_return e1 = null;
+
+ wcpsParser.exponentialExpr_return e2 = null;
+
+ wcpsParser.trigonometricExpr_return e3 = null;
+
+ wcpsParser.booleanExpr_return e4 = null;
+
+ wcpsParser.castExpr_return e5 = null;
+
+ wcpsParser.rangeConstructorExpr_return e7 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 37) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:204:5: (e6= fieldExpr | e1= unaryArithmeticExpr | e2= exponentialExpr | e3= trigonometricExpr | e4= booleanExpr | e5= castExpr | e7= rangeConstructorExpr )
+ int alt34=7;
+ alt34 = dfa34.predict(input);
+ switch (alt34) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:204:7: e6= fieldExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_fieldExpr_in_unaryInducedExpr2013);
+ e6=fieldExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e6.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e6!=null?e6.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:205:4: e1= unaryArithmeticExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_unaryArithmeticExpr_in_unaryInducedExpr2022);
+ e1=unaryArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:206:7: e2= exponentialExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_exponentialExpr_in_unaryInducedExpr2034);
+ e2=exponentialExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:207:7: e3= trigonometricExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_trigonometricExpr_in_unaryInducedExpr2046);
+ e3=trigonometricExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:208:7: e4= booleanExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanExpr_in_unaryInducedExpr2058);
+ e4=booleanExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:209:7: e5= castExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_castExpr_in_unaryInducedExpr2070);
+ e5=castExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:210:7: e7= rangeConstructorExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_rangeConstructorExpr_in_unaryInducedExpr2082);
+ e7=rangeConstructorExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e7.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((e7!=null?e7.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 37, unaryInducedExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "unaryInducedExpr"
+
+ public static class unaryArithmeticExpr_return extends ParserRuleReturnScope {
+ public CoverageExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "unaryArithmeticExpr"
+ // src/petascope/wcps/grammar/wcps.g:212:1: unaryArithmeticExpr returns [CoverageExpr value] : (op= ( MINUS | PLUS ) e1= coverageAtom | op= ( SQRT | ABS | RE | IM ) LPAREN e2= coverageExpr RPAREN );
+ public final wcpsParser.unaryArithmeticExpr_return unaryArithmeticExpr() throws RecognitionException {
+ wcpsParser.unaryArithmeticExpr_return retval = new wcpsParser.unaryArithmeticExpr_return();
+ retval.start = input.LT(1);
+ int unaryArithmeticExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN118=null;
+ Token RPAREN119=null;
+ wcpsParser.coverageAtom_return e1 = null;
+
+ wcpsParser.coverageExpr_return e2 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN118_tree=null;
+ Object RPAREN119_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 38) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:213:5: (op= ( MINUS | PLUS ) e1= coverageAtom | op= ( SQRT | ABS | RE | IM ) LPAREN e2= coverageExpr RPAREN )
+ int alt35=2;
+ int LA35_0 = input.LA(1);
+
+ if ( ((LA35_0>=PLUS && LA35_0<=MINUS)) ) {
+ alt35=1;
+ }
+ else if ( ((LA35_0>=SQRT && LA35_0<=IM)) ) {
+ alt35=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 35, 0, input);
+
+ throw nvae;
+ }
+ switch (alt35) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:213:7: op= ( MINUS | PLUS ) e1= coverageAtom
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageAtom_in_unaryArithmeticExpr2113);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:214:7: op= ( SQRT | ABS | RE | IM ) LPAREN e2= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=SQRT && input.LA(1)<=IM) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ LPAREN118=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_unaryArithmeticExpr2135); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN118_tree = (Object)adaptor.create(LPAREN118);
+ adaptor.addChild(root_0, LPAREN118_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_unaryArithmeticExpr2139);
+ e2=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ RPAREN119=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_unaryArithmeticExpr2141); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN119_tree = (Object)adaptor.create(RPAREN119);
+ adaptor.addChild(root_0, RPAREN119_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new CoverageExpr((op!=null?op.getText():null), (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 38, unaryArithmeticExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "unaryArithmeticExpr"
+
+ public static class exponentialExpr_return extends ParserRuleReturnScope {
+ public ExponentialExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "exponentialExpr"
+ // src/petascope/wcps/grammar/wcps.g:216:1: exponentialExpr returns [ExponentialExpr value] : op= ( EXP | LOG | LN ) LPAREN e1= coverageExpr RPAREN ;
+ public final wcpsParser.exponentialExpr_return exponentialExpr() throws RecognitionException {
+ wcpsParser.exponentialExpr_return retval = new wcpsParser.exponentialExpr_return();
+ retval.start = input.LT(1);
+ int exponentialExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN120=null;
+ Token RPAREN121=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN120_tree=null;
+ Object RPAREN121_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 39) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:217:5: (op= ( EXP | LOG | LN ) LPAREN e1= coverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:217:7: op= ( EXP | LOG | LN ) LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=EXP && input.LA(1)<=LN) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ LPAREN120=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_exponentialExpr2172); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN120_tree = (Object)adaptor.create(LPAREN120);
+ adaptor.addChild(root_0, LPAREN120_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_exponentialExpr2176);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN121=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_exponentialExpr2178); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN121_tree = (Object)adaptor.create(RPAREN121);
+ adaptor.addChild(root_0, RPAREN121_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ExponentialExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 39, exponentialExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "exponentialExpr"
+
+ public static class trigonometricExpr_return extends ParserRuleReturnScope {
+ public TrigonometricExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "trigonometricExpr"
+ // src/petascope/wcps/grammar/wcps.g:219:1: trigonometricExpr returns [TrigonometricExpr value] : op= ( SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN ) LPAREN e1= coverageExpr RPAREN ;
+ public final wcpsParser.trigonometricExpr_return trigonometricExpr() throws RecognitionException {
+ wcpsParser.trigonometricExpr_return retval = new wcpsParser.trigonometricExpr_return();
+ retval.start = input.LT(1);
+ int trigonometricExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN122=null;
+ Token RPAREN123=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN122_tree=null;
+ Object RPAREN123_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 40) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:220:5: (op= ( SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN ) LPAREN e1= coverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:220:7: op= ( SIN | COS | TAN | SINH | COSH | TANH | ARCSIN | ARCCOS | ARCTAN ) LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=SIN && input.LA(1)<=ARCTAN) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ LPAREN122=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_trigonometricExpr2221); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN122_tree = (Object)adaptor.create(LPAREN122);
+ adaptor.addChild(root_0, LPAREN122_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_trigonometricExpr2225);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN123=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_trigonometricExpr2227); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN123_tree = (Object)adaptor.create(RPAREN123);
+ adaptor.addChild(root_0, RPAREN123_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new TrigonometricExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 40, trigonometricExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "trigonometricExpr"
+
+ public static class booleanExpr_return extends ParserRuleReturnScope {
+ public BooleanExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanExpr"
+ // src/petascope/wcps/grammar/wcps.g:222:1: booleanExpr returns [BooleanExpr value] : (op= NOT e1= coverageExpr | op= BIT LPAREN e1= coverageExpr COMMA e2= indexExpr RPAREN );
+ public final wcpsParser.booleanExpr_return booleanExpr() throws RecognitionException {
+ wcpsParser.booleanExpr_return retval = new wcpsParser.booleanExpr_return();
+ retval.start = input.LT(1);
+ int booleanExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token LPAREN124=null;
+ Token COMMA125=null;
+ Token RPAREN126=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.indexExpr_return e2 = null;
+
+
+ Object op_tree=null;
+ Object LPAREN124_tree=null;
+ Object COMMA125_tree=null;
+ Object RPAREN126_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 41) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:223:5: (op= NOT e1= coverageExpr | op= BIT LPAREN e1= coverageExpr COMMA e2= indexExpr RPAREN )
+ int alt36=2;
+ int LA36_0 = input.LA(1);
+
+ if ( (LA36_0==NOT) ) {
+ alt36=1;
+ }
+ else if ( (LA36_0==BIT) ) {
+ alt36=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 36, 0, input);
+
+ throw nvae;
+ }
+ switch (alt36) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:223:7: op= NOT e1= coverageExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,NOT,FOLLOW_NOT_in_booleanExpr2250); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_booleanExpr2254);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:224:7: op= BIT LPAREN e1= coverageExpr COMMA e2= indexExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,BIT,FOLLOW_BIT_in_booleanExpr2266); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN124=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_booleanExpr2268); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN124_tree = (Object)adaptor.create(LPAREN124);
+ adaptor.addChild(root_0, LPAREN124_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_booleanExpr2272);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA125=(Token)match(input,COMMA,FOLLOW_COMMA_in_booleanExpr2274); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA125_tree = (Object)adaptor.create(COMMA125);
+ adaptor.addChild(root_0, COMMA125_tree);
+ }
+ pushFollow(FOLLOW_indexExpr_in_booleanExpr2278);
+ e2=indexExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ RPAREN126=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_booleanExpr2280); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN126_tree = (Object)adaptor.create(RPAREN126);
+ adaptor.addChild(root_0, RPAREN126_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanExpr((op!=null?op.getText():null), (e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 41, booleanExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanExpr"
+
+ public static class indexExpr_return extends ParserRuleReturnScope {
+ public IndexExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "indexExpr"
+ // src/petascope/wcps/grammar/wcps.g:226:1: indexExpr returns [IndexExpr value] : e1= indexTerm (op= ( PLUS | MINUS ) e2= indexTerm )* ;
+ public final wcpsParser.indexExpr_return indexExpr() throws RecognitionException {
+ wcpsParser.indexExpr_return retval = new wcpsParser.indexExpr_return();
+ retval.start = input.LT(1);
+ int indexExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.indexTerm_return e1 = null;
+
+ wcpsParser.indexTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 42) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:227:5: (e1= indexTerm (op= ( PLUS | MINUS ) e2= indexTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:227:7: e1= indexTerm (op= ( PLUS | MINUS ) e2= indexTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_indexTerm_in_indexExpr2303);
+ e1=indexTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:228:3: (op= ( PLUS | MINUS ) e2= indexTerm )*
+ loop37:
+ do {
+ int alt37=2;
+ int LA37_0 = input.LA(1);
+
+ if ( ((LA37_0>=PLUS && LA37_0<=MINUS)) ) {
+ alt37=1;
+ }
+
+
+ switch (alt37) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:228:4: op= ( PLUS | MINUS ) e2= indexTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_indexTerm_in_indexExpr2321);
+ e2=indexTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new IndexExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop37;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 42, indexExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "indexExpr"
+
+ public static class indexTerm_return extends ParserRuleReturnScope {
+ public IndexExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "indexTerm"
+ // src/petascope/wcps/grammar/wcps.g:230:1: indexTerm returns [IndexExpr value] : e1= indexFactor ( (op= ( MULT | DIVIDE ) e2= indexFactor ) )* ;
+ public final wcpsParser.indexTerm_return indexTerm() throws RecognitionException {
+ wcpsParser.indexTerm_return retval = new wcpsParser.indexTerm_return();
+ retval.start = input.LT(1);
+ int indexTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.indexFactor_return e1 = null;
+
+ wcpsParser.indexFactor_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 43) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:231:5: (e1= indexFactor ( (op= ( MULT | DIVIDE ) e2= indexFactor ) )* )
+ // src/petascope/wcps/grammar/wcps.g:231:7: e1= indexFactor ( (op= ( MULT | DIVIDE ) e2= indexFactor ) )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_indexFactor_in_indexTerm2346);
+ e1=indexFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:232:6: ( (op= ( MULT | DIVIDE ) e2= indexFactor ) )*
+ loop38:
+ do {
+ int alt38=2;
+ int LA38_0 = input.LA(1);
+
+ if ( ((LA38_0>=MULT && LA38_0<=DIVIDE)) ) {
+ alt38=1;
+ }
+
+
+ switch (alt38) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:232:7: (op= ( MULT | DIVIDE ) e2= indexFactor )
+ {
+ // src/petascope/wcps/grammar/wcps.g:232:7: (op= ( MULT | DIVIDE ) e2= indexFactor )
+ // src/petascope/wcps/grammar/wcps.g:232:8: op= ( MULT | DIVIDE ) e2= indexFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_indexFactor_in_indexTerm2367);
+ e2=indexFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new IndexExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop38;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 43, indexTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "indexTerm"
+
+ public static class indexFactor_return extends ParserRuleReturnScope {
+ public IndexExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "indexFactor"
+ // src/petascope/wcps/grammar/wcps.g:234:1: indexFactor returns [IndexExpr value] : (e= INTEGERCONSTANT | op= ROUND LPAREN e1= numericScalarExpr RPAREN | ( LPAREN e2= indexExpr RPAREN ) );
+ public final wcpsParser.indexFactor_return indexFactor() throws RecognitionException {
+ wcpsParser.indexFactor_return retval = new wcpsParser.indexFactor_return();
+ retval.start = input.LT(1);
+ int indexFactor_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token e=null;
+ Token op=null;
+ Token LPAREN127=null;
+ Token RPAREN128=null;
+ Token LPAREN129=null;
+ Token RPAREN130=null;
+ wcpsParser.numericScalarExpr_return e1 = null;
+
+ wcpsParser.indexExpr_return e2 = null;
+
+
+ Object e_tree=null;
+ Object op_tree=null;
+ Object LPAREN127_tree=null;
+ Object RPAREN128_tree=null;
+ Object LPAREN129_tree=null;
+ Object RPAREN130_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 44) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:235:5: (e= INTEGERCONSTANT | op= ROUND LPAREN e1= numericScalarExpr RPAREN | ( LPAREN e2= indexExpr RPAREN ) )
+ int alt39=3;
+ switch ( input.LA(1) ) {
+ case INTEGERCONSTANT:
+ {
+ alt39=1;
+ }
+ break;
+ case ROUND:
+ {
+ alt39=2;
+ }
+ break;
+ case LPAREN:
+ {
+ alt39=3;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 39, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt39) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:235:7: e= INTEGERCONSTANT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,INTEGERCONSTANT,FOLLOW_INTEGERCONSTANT_in_indexFactor2394); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new IndexExpr((e!=null?e.getText():null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:236:7: op= ROUND LPAREN e1= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,ROUND,FOLLOW_ROUND_in_indexFactor2407); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN127=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_indexFactor2409); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN127_tree = (Object)adaptor.create(LPAREN127);
+ adaptor.addChild(root_0, LPAREN127_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_indexFactor2413);
+ e1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN128=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_indexFactor2415); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN128_tree = (Object)adaptor.create(RPAREN128);
+ adaptor.addChild(root_0, RPAREN128_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new IndexExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:237:7: ( LPAREN e2= indexExpr RPAREN )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ // src/petascope/wcps/grammar/wcps.g:237:7: ( LPAREN e2= indexExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:237:8: LPAREN e2= indexExpr RPAREN
+ {
+ LPAREN129=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_indexFactor2427); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN129_tree = (Object)adaptor.create(LPAREN129);
+ adaptor.addChild(root_0, LPAREN129_tree);
+ }
+ pushFollow(FOLLOW_indexExpr_in_indexFactor2431);
+ e2=indexExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ RPAREN130=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_indexFactor2433); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN130_tree = (Object)adaptor.create(RPAREN130);
+ adaptor.addChild(root_0, RPAREN130_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (e2!=null?e2.value:null);
+ }
+
+ }
+
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 44, indexFactor_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "indexFactor"
+
+ public static class stringScalarExpr_return extends ParserRuleReturnScope {
+ public StringScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "stringScalarExpr"
+ // src/petascope/wcps/grammar/wcps.g:239:1: stringScalarExpr returns [StringScalarExpr value] : (op= IDENTIFIER LPAREN e1= coverageExpr RPAREN | e= STRING );
+ public final wcpsParser.stringScalarExpr_return stringScalarExpr() throws RecognitionException {
+ wcpsParser.stringScalarExpr_return retval = new wcpsParser.stringScalarExpr_return();
+ retval.start = input.LT(1);
+ int stringScalarExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token e=null;
+ Token LPAREN131=null;
+ Token RPAREN132=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+
+ Object op_tree=null;
+ Object e_tree=null;
+ Object LPAREN131_tree=null;
+ Object RPAREN132_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 45) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:241:5: (op= IDENTIFIER LPAREN e1= coverageExpr RPAREN | e= STRING )
+ int alt40=2;
+ int LA40_0 = input.LA(1);
+
+ if ( (LA40_0==IDENTIFIER) ) {
+ alt40=1;
+ }
+ else if ( (LA40_0==STRING) ) {
+ alt40=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 40, 0, input);
+
+ throw nvae;
+ }
+ switch (alt40) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:241:7: op= IDENTIFIER LPAREN e1= coverageExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_stringScalarExpr2460); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN131=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_stringScalarExpr2462); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN131_tree = (Object)adaptor.create(LPAREN131);
+ adaptor.addChild(root_0, LPAREN131_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_stringScalarExpr2466);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN132=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_stringScalarExpr2468); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN132_tree = (Object)adaptor.create(RPAREN132);
+ adaptor.addChild(root_0, RPAREN132_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new StringScalarExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:242:7: e= STRING
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,STRING,FOLLOW_STRING_in_stringScalarExpr2481); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new StringScalarExpr((e!=null?e.getText():null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 45, stringScalarExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "stringScalarExpr"
+
+ public static class scaleExpr_return extends ParserRuleReturnScope {
+ public ScaleExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "scaleExpr"
+ // src/petascope/wcps/grammar/wcps.g:244:1: scaleExpr returns [ScaleExpr value] : SCALE LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList ( COMMA fil= fieldInterpolationList )? RPAREN ;
+ public final wcpsParser.scaleExpr_return scaleExpr() throws RecognitionException {
+ wcpsParser.scaleExpr_return retval = new wcpsParser.scaleExpr_return();
+ retval.start = input.LT(1);
+ int scaleExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token SCALE133=null;
+ Token LPAREN134=null;
+ Token COMMA135=null;
+ Token COMMA136=null;
+ Token RPAREN137=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.dimensionIntervalList_return dil = null;
+
+ wcpsParser.fieldInterpolationList_return fil = null;
+
+
+ Object SCALE133_tree=null;
+ Object LPAREN134_tree=null;
+ Object COMMA135_tree=null;
+ Object COMMA136_tree=null;
+ Object RPAREN137_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 46) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:245:2: ( SCALE LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList ( COMMA fil= fieldInterpolationList )? RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:245:4: SCALE LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList ( COMMA fil= fieldInterpolationList )? RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ SCALE133=(Token)match(input,SCALE,FOLLOW_SCALE_in_scaleExpr2499); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ SCALE133_tree = (Object)adaptor.create(SCALE133);
+ adaptor.addChild(root_0, SCALE133_tree);
+ }
+ LPAREN134=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_scaleExpr2501); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN134_tree = (Object)adaptor.create(LPAREN134);
+ adaptor.addChild(root_0, LPAREN134_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_scaleExpr2505);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA135=(Token)match(input,COMMA,FOLLOW_COMMA_in_scaleExpr2507); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA135_tree = (Object)adaptor.create(COMMA135);
+ adaptor.addChild(root_0, COMMA135_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_scaleExpr2511);
+ dil=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dil.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new ScaleExpr((e1!=null?e1.value:null), (dil!=null?dil.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:246:13: ( COMMA fil= fieldInterpolationList )?
+ int alt41=2;
+ int LA41_0 = input.LA(1);
+
+ if ( (LA41_0==COMMA) ) {
+ alt41=1;
+ }
+ switch (alt41) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:246:14: COMMA fil= fieldInterpolationList
+ {
+ COMMA136=(Token)match(input,COMMA,FOLLOW_COMMA_in_scaleExpr2528); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA136_tree = (Object)adaptor.create(COMMA136);
+ adaptor.addChild(root_0, COMMA136_tree);
+ }
+ pushFollow(FOLLOW_fieldInterpolationList_in_scaleExpr2532);
+ fil=fieldInterpolationList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, fil.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.addInterpolationList((fil!=null?fil.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+ RPAREN137=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_scaleExpr2557); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN137_tree = (Object)adaptor.create(RPAREN137);
+ adaptor.addChild(root_0, RPAREN137_tree);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 46, scaleExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "scaleExpr"
+
+ public static class subsetExpr_return extends ParserRuleReturnScope {
+ public SubsetExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "subsetExpr"
+ // src/petascope/wcps/grammar/wcps.g:250:1: subsetExpr returns [SubsetExpr value] : (e1= trimExpr | e2= sliceExpr | e3= extendExpr );
+ public final wcpsParser.subsetExpr_return subsetExpr() throws RecognitionException {
+ wcpsParser.subsetExpr_return retval = new wcpsParser.subsetExpr_return();
+ retval.start = input.LT(1);
+ int subsetExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.trimExpr_return e1 = null;
+
+ wcpsParser.sliceExpr_return e2 = null;
+
+ wcpsParser.extendExpr_return e3 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 47) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:251:2: (e1= trimExpr | e2= sliceExpr | e3= extendExpr )
+ int alt42=3;
+ alt42 = dfa42.predict(input);
+ switch (alt42) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:251:4: e1= trimExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_trimExpr_in_subsetExpr2575);
+ e1=trimExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new SubsetExpr((e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:252:4: e2= sliceExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_sliceExpr_in_subsetExpr2584);
+ e2=sliceExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new SubsetExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:253:4: e3= extendExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_extendExpr_in_subsetExpr2593);
+ e3=extendExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new SubsetExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 47, subsetExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "subsetExpr"
+
+ public static class trimExpr_return extends ParserRuleReturnScope {
+ public TrimExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "trimExpr"
+ // src/petascope/wcps/grammar/wcps.g:255:1: trimExpr returns [TrimExpr value] : (e1= coverageAtom LBRACKET dil= dimensionIntervalList RBRACKET | TRIM LPAREN e2= coverageExpr COMMA LBRACE dil= dimensionIntervalList RBRACE RPAREN );
+ public final wcpsParser.trimExpr_return trimExpr() throws RecognitionException {
+ wcpsParser.trimExpr_return retval = new wcpsParser.trimExpr_return();
+ retval.start = input.LT(1);
+ int trimExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACKET138=null;
+ Token RBRACKET139=null;
+ Token TRIM140=null;
+ Token LPAREN141=null;
+ Token COMMA142=null;
+ Token LBRACE143=null;
+ Token RBRACE144=null;
+ Token RPAREN145=null;
+ wcpsParser.coverageAtom_return e1 = null;
+
+ wcpsParser.dimensionIntervalList_return dil = null;
+
+ wcpsParser.coverageExpr_return e2 = null;
+
+
+ Object LBRACKET138_tree=null;
+ Object RBRACKET139_tree=null;
+ Object TRIM140_tree=null;
+ Object LPAREN141_tree=null;
+ Object COMMA142_tree=null;
+ Object LBRACE143_tree=null;
+ Object RBRACE144_tree=null;
+ Object RPAREN145_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 48) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:256:2: (e1= coverageAtom LBRACKET dil= dimensionIntervalList RBRACKET | TRIM LPAREN e2= coverageExpr COMMA LBRACE dil= dimensionIntervalList RBRACE RPAREN )
+ int alt43=2;
+ alt43 = dfa43.predict(input);
+ switch (alt43) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:256:4: e1= coverageAtom LBRACKET dil= dimensionIntervalList RBRACKET
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageAtom_in_trimExpr2610);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ LBRACKET138=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_trimExpr2612); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACKET138_tree = (Object)adaptor.create(LBRACKET138);
+ adaptor.addChild(root_0, LBRACKET138_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_trimExpr2616);
+ dil=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dil.getTree());
+ RBRACKET139=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_trimExpr2618); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACKET139_tree = (Object)adaptor.create(RBRACKET139);
+ adaptor.addChild(root_0, RBRACKET139_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new TrimExpr((e1!=null?e1.value:null), (dil!=null?dil.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:257:6: TRIM LPAREN e2= coverageExpr COMMA LBRACE dil= dimensionIntervalList RBRACE RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ TRIM140=(Token)match(input,TRIM,FOLLOW_TRIM_in_trimExpr2627); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ TRIM140_tree = (Object)adaptor.create(TRIM140);
+ adaptor.addChild(root_0, TRIM140_tree);
+ }
+ LPAREN141=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_trimExpr2629); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN141_tree = (Object)adaptor.create(LPAREN141);
+ adaptor.addChild(root_0, LPAREN141_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_trimExpr2633);
+ e2=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ COMMA142=(Token)match(input,COMMA,FOLLOW_COMMA_in_trimExpr2635); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA142_tree = (Object)adaptor.create(COMMA142);
+ adaptor.addChild(root_0, COMMA142_tree);
+ }
+ LBRACE143=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_trimExpr2637); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE143_tree = (Object)adaptor.create(LBRACE143);
+ adaptor.addChild(root_0, LBRACE143_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_trimExpr2641);
+ dil=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dil.getTree());
+ RBRACE144=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_trimExpr2643); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE144_tree = (Object)adaptor.create(RBRACE144);
+ adaptor.addChild(root_0, RBRACE144_tree);
+ }
+ RPAREN145=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_trimExpr2645); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN145_tree = (Object)adaptor.create(RPAREN145);
+ adaptor.addChild(root_0, RPAREN145_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new TrimExpr((e2!=null?e2.value:null), (dil!=null?dil.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 48, trimExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "trimExpr"
+
+ public static class sliceExpr_return extends ParserRuleReturnScope {
+ public SliceExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "sliceExpr"
+ // src/petascope/wcps/grammar/wcps.g:259:1: sliceExpr returns [SliceExpr value] : (e1= coverageAtom LBRACKET dpl= dimensionPointList RBRACKET | SLICE LPAREN e2= coverageExpr COMMA LBRACE dpl= dimensionPointList RBRACE RPAREN );
+ public final wcpsParser.sliceExpr_return sliceExpr() throws RecognitionException {
+ wcpsParser.sliceExpr_return retval = new wcpsParser.sliceExpr_return();
+ retval.start = input.LT(1);
+ int sliceExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LBRACKET146=null;
+ Token RBRACKET147=null;
+ Token SLICE148=null;
+ Token LPAREN149=null;
+ Token COMMA150=null;
+ Token LBRACE151=null;
+ Token RBRACE152=null;
+ Token RPAREN153=null;
+ wcpsParser.coverageAtom_return e1 = null;
+
+ wcpsParser.dimensionPointList_return dpl = null;
+
+ wcpsParser.coverageExpr_return e2 = null;
+
+
+ Object LBRACKET146_tree=null;
+ Object RBRACKET147_tree=null;
+ Object SLICE148_tree=null;
+ Object LPAREN149_tree=null;
+ Object COMMA150_tree=null;
+ Object LBRACE151_tree=null;
+ Object RBRACE152_tree=null;
+ Object RPAREN153_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 49) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:260:2: (e1= coverageAtom LBRACKET dpl= dimensionPointList RBRACKET | SLICE LPAREN e2= coverageExpr COMMA LBRACE dpl= dimensionPointList RBRACE RPAREN )
+ int alt44=2;
+ alt44 = dfa44.predict(input);
+ switch (alt44) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:260:4: e1= coverageAtom LBRACKET dpl= dimensionPointList RBRACKET
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageAtom_in_sliceExpr2662);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ LBRACKET146=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_sliceExpr2664); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACKET146_tree = (Object)adaptor.create(LBRACKET146);
+ adaptor.addChild(root_0, LBRACKET146_tree);
+ }
+ pushFollow(FOLLOW_dimensionPointList_in_sliceExpr2668);
+ dpl=dimensionPointList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dpl.getTree());
+ RBRACKET147=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_sliceExpr2670); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACKET147_tree = (Object)adaptor.create(RBRACKET147);
+ adaptor.addChild(root_0, RBRACKET147_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SliceExpr((e1!=null?e1.value:null), (dpl!=null?dpl.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:261:4: SLICE LPAREN e2= coverageExpr COMMA LBRACE dpl= dimensionPointList RBRACE RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ SLICE148=(Token)match(input,SLICE,FOLLOW_SLICE_in_sliceExpr2677); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ SLICE148_tree = (Object)adaptor.create(SLICE148);
+ adaptor.addChild(root_0, SLICE148_tree);
+ }
+ LPAREN149=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_sliceExpr2679); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN149_tree = (Object)adaptor.create(LPAREN149);
+ adaptor.addChild(root_0, LPAREN149_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_sliceExpr2683);
+ e2=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ COMMA150=(Token)match(input,COMMA,FOLLOW_COMMA_in_sliceExpr2685); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA150_tree = (Object)adaptor.create(COMMA150);
+ adaptor.addChild(root_0, COMMA150_tree);
+ }
+ LBRACE151=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_sliceExpr2687); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LBRACE151_tree = (Object)adaptor.create(LBRACE151);
+ adaptor.addChild(root_0, LBRACE151_tree);
+ }
+ pushFollow(FOLLOW_dimensionPointList_in_sliceExpr2691);
+ dpl=dimensionPointList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dpl.getTree());
+ RBRACE152=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_sliceExpr2693); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RBRACE152_tree = (Object)adaptor.create(RBRACE152);
+ adaptor.addChild(root_0, RBRACE152_tree);
+ }
+ RPAREN153=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_sliceExpr2695); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN153_tree = (Object)adaptor.create(RPAREN153);
+ adaptor.addChild(root_0, RPAREN153_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new SliceExpr((e2!=null?e2.value:null), (dpl!=null?dpl.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 49, sliceExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "sliceExpr"
+
+ public static class extendExpr_return extends ParserRuleReturnScope {
+ public ExtendExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "extendExpr"
+ // src/petascope/wcps/grammar/wcps.g:263:1: extendExpr returns [ExtendExpr value] : EXTEND LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList RPAREN ;
+ public final wcpsParser.extendExpr_return extendExpr() throws RecognitionException {
+ wcpsParser.extendExpr_return retval = new wcpsParser.extendExpr_return();
+ retval.start = input.LT(1);
+ int extendExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token EXTEND154=null;
+ Token LPAREN155=null;
+ Token COMMA156=null;
+ Token RPAREN157=null;
+ wcpsParser.coverageExpr_return e1 = null;
+
+ wcpsParser.dimensionIntervalList_return dil = null;
+
+
+ Object EXTEND154_tree=null;
+ Object LPAREN155_tree=null;
+ Object COMMA156_tree=null;
+ Object RPAREN157_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 50) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:264:2: ( EXTEND LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:264:4: EXTEND LPAREN e1= coverageExpr COMMA dil= dimensionIntervalList RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ EXTEND154=(Token)match(input,EXTEND,FOLLOW_EXTEND_in_extendExpr2710); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ EXTEND154_tree = (Object)adaptor.create(EXTEND154);
+ adaptor.addChild(root_0, EXTEND154_tree);
+ }
+ LPAREN155=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_extendExpr2712); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN155_tree = (Object)adaptor.create(LPAREN155);
+ adaptor.addChild(root_0, LPAREN155_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_extendExpr2716);
+ e1=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COMMA156=(Token)match(input,COMMA,FOLLOW_COMMA_in_extendExpr2718); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA156_tree = (Object)adaptor.create(COMMA156);
+ adaptor.addChild(root_0, COMMA156_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalList_in_extendExpr2722);
+ dil=dimensionIntervalList();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dil.getTree());
+ RPAREN157=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_extendExpr2724); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN157_tree = (Object)adaptor.create(RPAREN157);
+ adaptor.addChild(root_0, RPAREN157_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new ExtendExpr((e1!=null?e1.value:null), (dil!=null?dil.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 50, extendExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "extendExpr"
+
+ public static class castExpr_return extends ParserRuleReturnScope {
+ public CastExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "castExpr"
+ // src/petascope/wcps/grammar/wcps.g:266:1: castExpr returns [CastExpr value] : LPAREN e1= rangeType RPAREN e2= coverageExpr ;
+ public final wcpsParser.castExpr_return castExpr() throws RecognitionException {
+ wcpsParser.castExpr_return retval = new wcpsParser.castExpr_return();
+ retval.start = input.LT(1);
+ int castExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN158=null;
+ Token RPAREN159=null;
+ wcpsParser.rangeType_return e1 = null;
+
+ wcpsParser.coverageExpr_return e2 = null;
+
+
+ Object LPAREN158_tree=null;
+ Object RPAREN159_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 51) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:267:5: ( LPAREN e1= rangeType RPAREN e2= coverageExpr )
+ // src/petascope/wcps/grammar/wcps.g:267:7: LPAREN e1= rangeType RPAREN e2= coverageExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN158=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_castExpr2742); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN158_tree = (Object)adaptor.create(LPAREN158);
+ adaptor.addChild(root_0, LPAREN158_tree);
+ }
+ pushFollow(FOLLOW_rangeType_in_castExpr2746);
+ e1=rangeType();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN159=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_castExpr2748); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN159_tree = (Object)adaptor.create(RPAREN159);
+ adaptor.addChild(root_0, RPAREN159_tree);
+ }
+ pushFollow(FOLLOW_coverageExpr_in_castExpr2752);
+ e2=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new CastExpr((e2!=null?e2.value:null), (e1!=null?e1.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 51, castExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "castExpr"
+
+ public static class rangeType_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "rangeType"
+ // src/petascope/wcps/grammar/wcps.g:269:1: rangeType returns [String value] : (type= ( BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 ) | UNSIGNED type= ( CHAR | SHORT | LONG ) );
+ public final wcpsParser.rangeType_return rangeType() throws RecognitionException {
+ wcpsParser.rangeType_return retval = new wcpsParser.rangeType_return();
+ retval.start = input.LT(1);
+ int rangeType_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token type=null;
+ Token UNSIGNED160=null;
+
+ Object type_tree=null;
+ Object UNSIGNED160_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 52) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:270:5: (type= ( BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 ) | UNSIGNED type= ( CHAR | SHORT | LONG ) )
+ int alt45=2;
+ int LA45_0 = input.LA(1);
+
+ if ( ((LA45_0>=BOOLEAN && LA45_0<=COMPLEX2)) ) {
+ alt45=1;
+ }
+ else if ( (LA45_0==UNSIGNED) ) {
+ alt45=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 45, 0, input);
+
+ throw nvae;
+ }
+ switch (alt45) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:270:7: type= ( BOOLEAN | CHAR | SHORT | LONG | FLOAT | DOUBLE | COMPLEX | COMPLEX2 )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ type=(Token)input.LT(1);
+ if ( (input.LA(1)>=BOOLEAN && input.LA(1)<=COMPLEX2) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(type));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new String((type!=null?type.getText():null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:271:7: UNSIGNED type= ( CHAR | SHORT | LONG )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ UNSIGNED160=(Token)match(input,UNSIGNED,FOLLOW_UNSIGNED_in_rangeType2801); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ UNSIGNED160_tree = (Object)adaptor.create(UNSIGNED160);
+ adaptor.addChild(root_0, UNSIGNED160_tree);
+ }
+ type=(Token)input.LT(1);
+ if ( (input.LA(1)>=CHAR && input.LA(1)<=LONG) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(type));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new String("unsigned " + (type!=null?type.getText():null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 52, rangeType_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "rangeType"
+
+ public static class fieldExpr_return extends ParserRuleReturnScope {
+ public SelectExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "fieldExpr"
+ // src/petascope/wcps/grammar/wcps.g:273:1: fieldExpr returns [SelectExpr value] : e1= coverageAtom DOT e2= fieldName ;
+ public final wcpsParser.fieldExpr_return fieldExpr() throws RecognitionException {
+ wcpsParser.fieldExpr_return retval = new wcpsParser.fieldExpr_return();
+ retval.start = input.LT(1);
+ int fieldExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token DOT161=null;
+ wcpsParser.coverageAtom_return e1 = null;
+
+ wcpsParser.fieldName_return e2 = null;
+
+
+ Object DOT161_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 53) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:274:5: (e1= coverageAtom DOT e2= fieldName )
+ // src/petascope/wcps/grammar/wcps.g:274:7: e1= coverageAtom DOT e2= fieldName
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_coverageAtom_in_fieldExpr2834);
+ e1=coverageAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ DOT161=(Token)match(input,DOT,FOLLOW_DOT_in_fieldExpr2836); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ DOT161_tree = (Object)adaptor.create(DOT161);
+ adaptor.addChild(root_0, DOT161_tree);
+ }
+ pushFollow(FOLLOW_fieldName_in_fieldExpr2840);
+ e2=fieldName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new SelectExpr((e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 53, fieldExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "fieldExpr"
+
+ public static class booleanScalarExpr_return extends ParserRuleReturnScope {
+ public BooleanScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanScalarExpr"
+ // src/petascope/wcps/grammar/wcps.g:278:1: booleanScalarExpr returns [BooleanScalarExpr value] : e1= booleanScalarTerm (op= ( OR | XOR ) e2= booleanScalarTerm )* ;
+ public final wcpsParser.booleanScalarExpr_return booleanScalarExpr() throws RecognitionException {
+ wcpsParser.booleanScalarExpr_return retval = new wcpsParser.booleanScalarExpr_return();
+ retval.start = input.LT(1);
+ int booleanScalarExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.booleanScalarTerm_return e1 = null;
+
+ wcpsParser.booleanScalarTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 54) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:279:5: (e1= booleanScalarTerm (op= ( OR | XOR ) e2= booleanScalarTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:279:7: e1= booleanScalarTerm (op= ( OR | XOR ) e2= booleanScalarTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanScalarTerm_in_booleanScalarExpr2865);
+ e1=booleanScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:280:7: (op= ( OR | XOR ) e2= booleanScalarTerm )*
+ loop46:
+ do {
+ int alt46=2;
+ alt46 = dfa46.predict(input);
+ switch (alt46) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:280:8: op= ( OR | XOR ) e2= booleanScalarTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=OR && input.LA(1)<=XOR) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_booleanScalarTerm_in_booleanScalarExpr2886);
+ e2=booleanScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop46;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 54, booleanScalarExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanScalarExpr"
+
+ public static class booleanScalarTerm_return extends ParserRuleReturnScope {
+ public BooleanScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanScalarTerm"
+ // src/petascope/wcps/grammar/wcps.g:282:1: booleanScalarTerm returns [BooleanScalarExpr value] : e1= booleanScalarNegation (op= AND e2= booleanScalarNegation )* ;
+ public final wcpsParser.booleanScalarTerm_return booleanScalarTerm() throws RecognitionException {
+ wcpsParser.booleanScalarTerm_return retval = new wcpsParser.booleanScalarTerm_return();
+ retval.start = input.LT(1);
+ int booleanScalarTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.booleanScalarNegation_return e1 = null;
+
+ wcpsParser.booleanScalarNegation_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 55) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:283:2: (e1= booleanScalarNegation (op= AND e2= booleanScalarNegation )* )
+ // src/petascope/wcps/grammar/wcps.g:283:4: e1= booleanScalarNegation (op= AND e2= booleanScalarNegation )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanScalarNegation_in_booleanScalarTerm2908);
+ e1=booleanScalarNegation();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:284:4: (op= AND e2= booleanScalarNegation )*
+ loop47:
+ do {
+ int alt47=2;
+ alt47 = dfa47.predict(input);
+ switch (alt47) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:284:5: op= AND e2= booleanScalarNegation
+ {
+ op=(Token)match(input,AND,FOLLOW_AND_in_booleanScalarTerm2918); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarNegation_in_booleanScalarTerm2922);
+ e2=booleanScalarNegation();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop47;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 55, booleanScalarTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanScalarTerm"
+
+ public static class booleanScalarNegation_return extends ParserRuleReturnScope {
+ public BooleanScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanScalarNegation"
+ // src/petascope/wcps/grammar/wcps.g:286:1: booleanScalarNegation returns [BooleanScalarExpr value] : (e1= booleanScalarAtom | op= NOT e1= booleanScalarAtom );
+ public final wcpsParser.booleanScalarNegation_return booleanScalarNegation() throws RecognitionException {
+ wcpsParser.booleanScalarNegation_return retval = new wcpsParser.booleanScalarNegation_return();
+ retval.start = input.LT(1);
+ int booleanScalarNegation_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.booleanScalarAtom_return e1 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 56) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:287:2: (e1= booleanScalarAtom | op= NOT e1= booleanScalarAtom )
+ int alt48=2;
+ alt48 = dfa48.predict(input);
+ switch (alt48) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:287:4: e1= booleanScalarAtom
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_booleanScalarAtom_in_booleanScalarNegation2943);
+ e1=booleanScalarAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:288:4: op= NOT e1= booleanScalarAtom
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,NOT,FOLLOW_NOT_in_booleanScalarNegation2952); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarAtom_in_booleanScalarNegation2956);
+ e1=booleanScalarAtom();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 56, booleanScalarNegation_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanScalarNegation"
+
+ public static class booleanScalarAtom_return extends ParserRuleReturnScope {
+ public BooleanScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "booleanScalarAtom"
+ // src/petascope/wcps/grammar/wcps.g:290:1: booleanScalarAtom returns [BooleanScalarExpr value] : ( LPAREN e1= booleanScalarExpr RPAREN | s1= stringScalarExpr cop= compOp s2= stringScalarExpr | n1= numericScalarExpr cop= compOp n2= numericScalarExpr | e= BOOLEANCONSTANT );
+ public final wcpsParser.booleanScalarAtom_return booleanScalarAtom() throws RecognitionException {
+ wcpsParser.booleanScalarAtom_return retval = new wcpsParser.booleanScalarAtom_return();
+ retval.start = input.LT(1);
+ int booleanScalarAtom_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token e=null;
+ Token LPAREN162=null;
+ Token RPAREN163=null;
+ wcpsParser.booleanScalarExpr_return e1 = null;
+
+ wcpsParser.stringScalarExpr_return s1 = null;
+
+ wcpsParser.compOp_return cop = null;
+
+ wcpsParser.stringScalarExpr_return s2 = null;
+
+ wcpsParser.numericScalarExpr_return n1 = null;
+
+ wcpsParser.numericScalarExpr_return n2 = null;
+
+
+ Object e_tree=null;
+ Object LPAREN162_tree=null;
+ Object RPAREN163_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 57) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:291:2: ( LPAREN e1= booleanScalarExpr RPAREN | s1= stringScalarExpr cop= compOp s2= stringScalarExpr | n1= numericScalarExpr cop= compOp n2= numericScalarExpr | e= BOOLEANCONSTANT )
+ int alt49=4;
+ alt49 = dfa49.predict(input);
+ switch (alt49) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:291:4: LPAREN e1= booleanScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN162=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_booleanScalarAtom2971); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN162_tree = (Object)adaptor.create(LPAREN162);
+ adaptor.addChild(root_0, LPAREN162_tree);
+ }
+ pushFollow(FOLLOW_booleanScalarExpr_in_booleanScalarAtom2975);
+ e1=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN163=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_booleanScalarAtom2977); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN163_tree = (Object)adaptor.create(RPAREN163);
+ adaptor.addChild(root_0, RPAREN163_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:292:4: s1= stringScalarExpr cop= compOp s2= stringScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_stringScalarExpr_in_booleanScalarAtom2986);
+ s1=stringScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, s1.getTree());
+ pushFollow(FOLLOW_compOp_in_booleanScalarAtom2990);
+ cop=compOp();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cop.getTree());
+ pushFollow(FOLLOW_stringScalarExpr_in_booleanScalarAtom2994);
+ s2=stringScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, s2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((cop!=null?cop.value:null), (s1!=null?s1.value:null), (s2!=null?s2.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:293:4: n1= numericScalarExpr cop= compOp n2= numericScalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_numericScalarExpr_in_booleanScalarAtom3004);
+ n1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, n1.getTree());
+ pushFollow(FOLLOW_compOp_in_booleanScalarAtom3008);
+ cop=compOp();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, cop.getTree());
+ pushFollow(FOLLOW_numericScalarExpr_in_booleanScalarAtom3012);
+ n2=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, n2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((cop!=null?cop.value:null), (n1!=null?n1.value:null), (n2!=null?n2.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:294:4: e= BOOLEANCONSTANT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,BOOLEANCONSTANT,FOLLOW_BOOLEANCONSTANT_in_booleanScalarAtom3022); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new BooleanScalarExpr((e!=null?e.getText():null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 57, booleanScalarAtom_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "booleanScalarAtom"
+
+ public static class numericScalarExpr_return extends ParserRuleReturnScope {
+ public NumericScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "numericScalarExpr"
+ // src/petascope/wcps/grammar/wcps.g:296:1: numericScalarExpr returns [NumericScalarExpr value] : e1= numericScalarTerm (op= ( PLUS | MINUS ) e2= numericScalarTerm )* ;
+ public final wcpsParser.numericScalarExpr_return numericScalarExpr() throws RecognitionException {
+ wcpsParser.numericScalarExpr_return retval = new wcpsParser.numericScalarExpr_return();
+ retval.start = input.LT(1);
+ int numericScalarExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.numericScalarTerm_return e1 = null;
+
+ wcpsParser.numericScalarTerm_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 58) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:297:2: (e1= numericScalarTerm (op= ( PLUS | MINUS ) e2= numericScalarTerm )* )
+ // src/petascope/wcps/grammar/wcps.g:297:4: e1= numericScalarTerm (op= ( PLUS | MINUS ) e2= numericScalarTerm )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_numericScalarTerm_in_numericScalarExpr3039);
+ e1=numericScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:298:4: (op= ( PLUS | MINUS ) e2= numericScalarTerm )*
+ loop50:
+ do {
+ int alt50=2;
+ alt50 = dfa50.predict(input);
+ switch (alt50) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:298:5: op= ( PLUS | MINUS ) e2= numericScalarTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_numericScalarTerm_in_numericScalarExpr3057);
+ e2=numericScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop50;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 58, numericScalarExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "numericScalarExpr"
+
+ public static class numericScalarTerm_return extends ParserRuleReturnScope {
+ public NumericScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "numericScalarTerm"
+ // src/petascope/wcps/grammar/wcps.g:300:1: numericScalarTerm returns [NumericScalarExpr value] : e1= numericScalarFactor (op= ( MULT | DIVIDE ) e2= numericScalarFactor )* ;
+ public final wcpsParser.numericScalarTerm_return numericScalarTerm() throws RecognitionException {
+ wcpsParser.numericScalarTerm_return retval = new wcpsParser.numericScalarTerm_return();
+ retval.start = input.LT(1);
+ int numericScalarTerm_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ wcpsParser.numericScalarFactor_return e1 = null;
+
+ wcpsParser.numericScalarFactor_return e2 = null;
+
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 59) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:301:2: (e1= numericScalarFactor (op= ( MULT | DIVIDE ) e2= numericScalarFactor )* )
+ // src/petascope/wcps/grammar/wcps.g:301:4: e1= numericScalarFactor (op= ( MULT | DIVIDE ) e2= numericScalarFactor )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_numericScalarFactor_in_numericScalarTerm3076);
+ e1=numericScalarFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+ // src/petascope/wcps/grammar/wcps.g:302:3: (op= ( MULT | DIVIDE ) e2= numericScalarFactor )*
+ loop51:
+ do {
+ int alt51=2;
+ alt51 = dfa51.predict(input);
+ switch (alt51) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:302:4: op= ( MULT | DIVIDE ) e2= numericScalarFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_numericScalarFactor_in_numericScalarTerm3093);
+ e2=numericScalarFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), retval.value, (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop51;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 59, numericScalarTerm_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "numericScalarTerm"
+
+ public static class numericScalarFactor_return extends ParserRuleReturnScope {
+ public NumericScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "numericScalarFactor"
+ // src/petascope/wcps/grammar/wcps.g:304:1: numericScalarFactor returns [NumericScalarExpr value] : ( LPAREN e1= numericScalarExpr RPAREN | op= MINUS e10= numericScalarFactor | op= ABS LPAREN e12= numericScalarExpr RPAREN | op= SQRT LPAREN e11= numericScalarExpr RPAREN | op= ROUND LPAREN e1= numericScalarExpr RPAREN | e= INTEGERCONSTANT | e= FLOATCONSTANT | e2= complexConstant | e3= condenseExpr | e4= variableName );
+ public final wcpsParser.numericScalarFactor_return numericScalarFactor() throws RecognitionException {
+ wcpsParser.numericScalarFactor_return retval = new wcpsParser.numericScalarFactor_return();
+ retval.start = input.LT(1);
+ int numericScalarFactor_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+ Token e=null;
+ Token LPAREN164=null;
+ Token RPAREN165=null;
+ Token LPAREN166=null;
+ Token RPAREN167=null;
+ Token LPAREN168=null;
+ Token RPAREN169=null;
+ Token LPAREN170=null;
+ Token RPAREN171=null;
+ wcpsParser.numericScalarExpr_return e1 = null;
+
+ wcpsParser.numericScalarFactor_return e10 = null;
+
+ wcpsParser.numericScalarExpr_return e12 = null;
+
+ wcpsParser.numericScalarExpr_return e11 = null;
+
+ wcpsParser.complexConstant_return e2 = null;
+
+ wcpsParser.condenseExpr_return e3 = null;
+
+ wcpsParser.variableName_return e4 = null;
+
+
+ Object op_tree=null;
+ Object e_tree=null;
+ Object LPAREN164_tree=null;
+ Object RPAREN165_tree=null;
+ Object LPAREN166_tree=null;
+ Object RPAREN167_tree=null;
+ Object LPAREN168_tree=null;
+ Object RPAREN169_tree=null;
+ Object LPAREN170_tree=null;
+ Object RPAREN171_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 60) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:305:5: ( LPAREN e1= numericScalarExpr RPAREN | op= MINUS e10= numericScalarFactor | op= ABS LPAREN e12= numericScalarExpr RPAREN | op= SQRT LPAREN e11= numericScalarExpr RPAREN | op= ROUND LPAREN e1= numericScalarExpr RPAREN | e= INTEGERCONSTANT | e= FLOATCONSTANT | e2= complexConstant | e3= condenseExpr | e4= variableName )
+ int alt52=10;
+ alt52 = dfa52.predict(input);
+ switch (alt52) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:305:7: LPAREN e1= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN164=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_numericScalarFactor3113); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN164_tree = (Object)adaptor.create(LPAREN164);
+ adaptor.addChild(root_0, LPAREN164_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_numericScalarFactor3117);
+ e1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN165=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_numericScalarFactor3119); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN165_tree = (Object)adaptor.create(RPAREN165);
+ adaptor.addChild(root_0, RPAREN165_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:306:7: op= MINUS e10= numericScalarFactor
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,MINUS,FOLLOW_MINUS_in_numericScalarFactor3131); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ pushFollow(FOLLOW_numericScalarFactor_in_numericScalarFactor3135);
+ e10=numericScalarFactor();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e10.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), (e10!=null?e10.value:null));
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:307:7: op= ABS LPAREN e12= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,ABS,FOLLOW_ABS_in_numericScalarFactor3147); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN166=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_numericScalarFactor3149); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN166_tree = (Object)adaptor.create(LPAREN166);
+ adaptor.addChild(root_0, LPAREN166_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_numericScalarFactor3153);
+ e12=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e12.getTree());
+ RPAREN167=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_numericScalarFactor3155); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN167_tree = (Object)adaptor.create(RPAREN167);
+ adaptor.addChild(root_0, RPAREN167_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), (e12!=null?e12.value:null));
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:308:7: op= SQRT LPAREN e11= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,SQRT,FOLLOW_SQRT_in_numericScalarFactor3167); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN168=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_numericScalarFactor3169); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN168_tree = (Object)adaptor.create(LPAREN168);
+ adaptor.addChild(root_0, LPAREN168_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_numericScalarFactor3173);
+ e11=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e11.getTree());
+ RPAREN169=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_numericScalarFactor3175); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN169_tree = (Object)adaptor.create(RPAREN169);
+ adaptor.addChild(root_0, RPAREN169_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), (e11!=null?e11.value:null));
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:309:7: op= ROUND LPAREN e1= numericScalarExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)match(input,ROUND,FOLLOW_ROUND_in_numericScalarFactor3187); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ op_tree = (Object)adaptor.create(op);
+ adaptor.addChild(root_0, op_tree);
+ }
+ LPAREN170=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_numericScalarFactor3189); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN170_tree = (Object)adaptor.create(LPAREN170);
+ adaptor.addChild(root_0, LPAREN170_tree);
+ }
+ pushFollow(FOLLOW_numericScalarExpr_in_numericScalarFactor3193);
+ e1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ RPAREN171=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_numericScalarFactor3195); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN171_tree = (Object)adaptor.create(RPAREN171);
+ adaptor.addChild(root_0, RPAREN171_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((op!=null?op.getText():null), (e1!=null?e1.value:null));
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:310:7: e= INTEGERCONSTANT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,INTEGERCONSTANT,FOLLOW_INTEGERCONSTANT_in_numericScalarFactor3207); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((e!=null?e.getText():null));
+ }
+
+ }
+ break;
+ case 7 :
+ // src/petascope/wcps/grammar/wcps.g:311:7: e= FLOATCONSTANT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)match(input,FLOATCONSTANT,FOLLOW_FLOATCONSTANT_in_numericScalarFactor3219); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ e_tree = (Object)adaptor.create(e);
+ adaptor.addChild(root_0, e_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((e!=null?e.getText():null));
+ }
+
+ }
+ break;
+ case 8 :
+ // src/petascope/wcps/grammar/wcps.g:312:7: e2= complexConstant
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_complexConstant_in_numericScalarFactor3231);
+ e2=complexConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 9 :
+ // src/petascope/wcps/grammar/wcps.g:313:7: e3= condenseExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_condenseExpr_in_numericScalarFactor3243);
+ e3=condenseExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr((e3!=null?e3.value:null));
+ }
+
+ }
+ break;
+ case 10 :
+ // src/petascope/wcps/grammar/wcps.g:314:7: e4= variableName
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_variableName_in_numericScalarFactor3255);
+ e4=variableName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new NumericScalarExpr("var", (e4!=null?e4.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 60, numericScalarFactor_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "numericScalarFactor"
+
+ public static class compOp_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "compOp"
+ // src/petascope/wcps/grammar/wcps.g:316:1: compOp returns [String value] : ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE );
+ public final wcpsParser.compOp_return compOp() throws RecognitionException {
+ wcpsParser.compOp_return retval = new wcpsParser.compOp_return();
+ retval.start = input.LT(1);
+ int compOp_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token EQUALS172=null;
+ Token NOTEQUALS173=null;
+ Token LT174=null;
+ Token GT175=null;
+ Token LTE176=null;
+ Token GTE177=null;
+
+ Object EQUALS172_tree=null;
+ Object NOTEQUALS173_tree=null;
+ Object LT174_tree=null;
+ Object GT175_tree=null;
+ Object LTE176_tree=null;
+ Object GTE177_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 61) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:317:2: ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE )
+ int alt53=6;
+ switch ( input.LA(1) ) {
+ case EQUALS:
+ {
+ alt53=1;
+ }
+ break;
+ case NOTEQUALS:
+ {
+ alt53=2;
+ }
+ break;
+ case LT:
+ {
+ alt53=3;
+ }
+ break;
+ case GT:
+ {
+ alt53=4;
+ }
+ break;
+ case LTE:
+ {
+ alt53=5;
+ }
+ break;
+ case GTE:
+ {
+ alt53=6;
+ }
+ break;
+ default:
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 53, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt53) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:317:4: EQUALS
+ {
+ root_0 = (Object)adaptor.nil();
+
+ EQUALS172=(Token)match(input,EQUALS,FOLLOW_EQUALS_in_compOp3273); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ EQUALS172_tree = (Object)adaptor.create(EQUALS172);
+ adaptor.addChild(root_0, EQUALS172_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("equals");
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:318:4: NOTEQUALS
+ {
+ root_0 = (Object)adaptor.nil();
+
+ NOTEQUALS173=(Token)match(input,NOTEQUALS,FOLLOW_NOTEQUALS_in_compOp3280); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ NOTEQUALS173_tree = (Object)adaptor.create(NOTEQUALS173);
+ adaptor.addChild(root_0, NOTEQUALS173_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("notEqual");
+ }
+
+ }
+ break;
+ case 3 :
+ // src/petascope/wcps/grammar/wcps.g:319:4: LT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LT174=(Token)match(input,LT,FOLLOW_LT_in_compOp3287); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LT174_tree = (Object)adaptor.create(LT174);
+ adaptor.addChild(root_0, LT174_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("lessThan");
+ }
+
+ }
+ break;
+ case 4 :
+ // src/petascope/wcps/grammar/wcps.g:320:4: GT
+ {
+ root_0 = (Object)adaptor.nil();
+
+ GT175=(Token)match(input,GT,FOLLOW_GT_in_compOp3294); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ GT175_tree = (Object)adaptor.create(GT175);
+ adaptor.addChild(root_0, GT175_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("greaterThan");
+ }
+
+ }
+ break;
+ case 5 :
+ // src/petascope/wcps/grammar/wcps.g:321:4: LTE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LTE176=(Token)match(input,LTE,FOLLOW_LTE_in_compOp3301); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LTE176_tree = (Object)adaptor.create(LTE176);
+ adaptor.addChild(root_0, LTE176_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("lessOrEqual");
+ }
+
+ }
+ break;
+ case 6 :
+ // src/petascope/wcps/grammar/wcps.g:322:4: GTE
+ {
+ root_0 = (Object)adaptor.nil();
+
+ GTE177=(Token)match(input,GTE,FOLLOW_GTE_in_compOp3308); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ GTE177_tree = (Object)adaptor.create(GTE177);
+ adaptor.addChild(root_0, GTE177_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String("greaterOrEqual");
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 61, compOp_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "compOp"
+
+ public static class dimensionIntervalList_return extends ParserRuleReturnScope {
+ public DimensionIntervalList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionIntervalList"
+ // src/petascope/wcps/grammar/wcps.g:324:1: dimensionIntervalList returns [DimensionIntervalList value] : elem= dimensionIntervalElement ( COMMA elem= dimensionIntervalElement )* ;
+ public final wcpsParser.dimensionIntervalList_return dimensionIntervalList() throws RecognitionException {
+ wcpsParser.dimensionIntervalList_return retval = new wcpsParser.dimensionIntervalList_return();
+ retval.start = input.LT(1);
+ int dimensionIntervalList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COMMA178=null;
+ wcpsParser.dimensionIntervalElement_return elem = null;
+
+
+ Object COMMA178_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 62) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:325:5: (elem= dimensionIntervalElement ( COMMA elem= dimensionIntervalElement )* )
+ // src/petascope/wcps/grammar/wcps.g:325:7: elem= dimensionIntervalElement ( COMMA elem= dimensionIntervalElement )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_dimensionIntervalElement_in_dimensionIntervalList3328);
+ elem=dimensionIntervalElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionIntervalList((elem!=null?elem.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:326:9: ( COMMA elem= dimensionIntervalElement )*
+ loop54:
+ do {
+ int alt54=2;
+ int LA54_0 = input.LA(1);
+
+ if ( (LA54_0==COMMA) ) {
+ int LA54_1 = input.LA(2);
+
+ if ( (LA54_1==INTEGERCONSTANT||LA54_1==STRING||LA54_1==NAME) ) {
+ alt54=1;
+ }
+
+
+ }
+
+
+ switch (alt54) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:326:10: COMMA elem= dimensionIntervalElement
+ {
+ COMMA178=(Token)match(input,COMMA,FOLLOW_COMMA_in_dimensionIntervalList3341); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA178_tree = (Object)adaptor.create(COMMA178);
+ adaptor.addChild(root_0, COMMA178_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalElement_in_dimensionIntervalList3345);
+ elem=dimensionIntervalElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((elem!=null?elem.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop54;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 62, dimensionIntervalList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionIntervalList"
+
+ public static class dimensionIntervalElement_return extends ParserRuleReturnScope {
+ public DimensionIntervalElement value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionIntervalElement"
+ // src/petascope/wcps/grammar/wcps.g:328:1: dimensionIntervalElement returns [DimensionIntervalElement value] : aname= axisName ( COLON crs= crsName )? LPAREN die= dimensionIntervalExpr RPAREN ;
+ public final wcpsParser.dimensionIntervalElement_return dimensionIntervalElement() throws RecognitionException {
+ wcpsParser.dimensionIntervalElement_return retval = new wcpsParser.dimensionIntervalElement_return();
+ retval.start = input.LT(1);
+ int dimensionIntervalElement_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COLON179=null;
+ Token LPAREN180=null;
+ Token RPAREN181=null;
+ wcpsParser.axisName_return aname = null;
+
+ wcpsParser.crsName_return crs = null;
+
+ wcpsParser.dimensionIntervalExpr_return die = null;
+
+
+ Object COLON179_tree=null;
+ Object LPAREN180_tree=null;
+ Object RPAREN181_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 63) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:329:5: (aname= axisName ( COLON crs= crsName )? LPAREN die= dimensionIntervalExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:329:7: aname= axisName ( COLON crs= crsName )? LPAREN die= dimensionIntervalExpr RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_axisName_in_dimensionIntervalElement3370);
+ aname=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionIntervalElement((aname!=null?aname.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:329:79: ( COLON crs= crsName )?
+ int alt55=2;
+ int LA55_0 = input.LA(1);
+
+ if ( (LA55_0==COLON) ) {
+ alt55=1;
+ }
+ switch (alt55) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:329:80: COLON crs= crsName
+ {
+ COLON179=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionIntervalElement3375); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON179_tree = (Object)adaptor.create(COLON179);
+ adaptor.addChild(root_0, COLON179_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_dimensionIntervalElement3379);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.setCrs((crs!=null?crs.value:null));
+ }
+
+ }
+ break;
+
+ }
+
+ LPAREN180=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_dimensionIntervalElement3390); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN180_tree = (Object)adaptor.create(LPAREN180);
+ adaptor.addChild(root_0, LPAREN180_tree);
+ }
+ pushFollow(FOLLOW_dimensionIntervalExpr_in_dimensionIntervalElement3394);
+ die=dimensionIntervalExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, die.getTree());
+ RPAREN181=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_dimensionIntervalElement3396); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN181_tree = (Object)adaptor.create(RPAREN181);
+ adaptor.addChild(root_0, RPAREN181_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value.setIntervalExpr((die!=null?die.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 63, dimensionIntervalElement_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionIntervalElement"
+
+ public static class dimensionIntervalExpr_return extends ParserRuleReturnScope {
+ public DimensionIntervalExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionIntervalExpr"
+ // src/petascope/wcps/grammar/wcps.g:332:1: dimensionIntervalExpr returns [DimensionIntervalExpr value] : (e1= scalarExpr COLON e2= scalarExpr | DOMAIN LPAREN e3= coverageName COLON e4= axisName COLON e5= crsName RPAREN );
+ public final wcpsParser.dimensionIntervalExpr_return dimensionIntervalExpr() throws RecognitionException {
+ wcpsParser.dimensionIntervalExpr_return retval = new wcpsParser.dimensionIntervalExpr_return();
+ retval.start = input.LT(1);
+ int dimensionIntervalExpr_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COLON182=null;
+ Token DOMAIN183=null;
+ Token LPAREN184=null;
+ Token COLON185=null;
+ Token COLON186=null;
+ Token RPAREN187=null;
+ wcpsParser.scalarExpr_return e1 = null;
+
+ wcpsParser.scalarExpr_return e2 = null;
+
+ wcpsParser.coverageName_return e3 = null;
+
+ wcpsParser.axisName_return e4 = null;
+
+ wcpsParser.crsName_return e5 = null;
+
+
+ Object COLON182_tree=null;
+ Object DOMAIN183_tree=null;
+ Object LPAREN184_tree=null;
+ Object COLON185_tree=null;
+ Object COLON186_tree=null;
+ Object RPAREN187_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 64) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:333:5: (e1= scalarExpr COLON e2= scalarExpr | DOMAIN LPAREN e3= coverageName COLON e4= axisName COLON e5= crsName RPAREN )
+ int alt56=2;
+ alt56 = dfa56.predict(input);
+ switch (alt56) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:333:7: e1= scalarExpr COLON e2= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scalarExpr_in_dimensionIntervalExpr3419);
+ e1=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ COLON182=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionIntervalExpr3421); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON182_tree = (Object)adaptor.create(COLON182);
+ adaptor.addChild(root_0, COLON182_tree);
+ }
+ pushFollow(FOLLOW_scalarExpr_in_dimensionIntervalExpr3425);
+ e2=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionIntervalExpr((e1!=null?e1.value:null), (e2!=null?e2.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:334:7: DOMAIN LPAREN e3= coverageName COLON e4= axisName COLON e5= crsName RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ DOMAIN183=(Token)match(input,DOMAIN,FOLLOW_DOMAIN_in_dimensionIntervalExpr3435); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ DOMAIN183_tree = (Object)adaptor.create(DOMAIN183);
+ adaptor.addChild(root_0, DOMAIN183_tree);
+ }
+ LPAREN184=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_dimensionIntervalExpr3437); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN184_tree = (Object)adaptor.create(LPAREN184);
+ adaptor.addChild(root_0, LPAREN184_tree);
+ }
+ pushFollow(FOLLOW_coverageName_in_dimensionIntervalExpr3441);
+ e3=coverageName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e3.getTree());
+ COLON185=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionIntervalExpr3443); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON185_tree = (Object)adaptor.create(COLON185);
+ adaptor.addChild(root_0, COLON185_tree);
+ }
+ pushFollow(FOLLOW_axisName_in_dimensionIntervalExpr3447);
+ e4=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e4.getTree());
+ COLON186=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionIntervalExpr3449); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON186_tree = (Object)adaptor.create(COLON186);
+ adaptor.addChild(root_0, COLON186_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_dimensionIntervalExpr3453);
+ e5=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e5.getTree());
+ RPAREN187=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_dimensionIntervalExpr3455); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN187_tree = (Object)adaptor.create(RPAREN187);
+ adaptor.addChild(root_0, RPAREN187_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionIntervalExpr((e3!=null?e3.value:null), (e4!=null?e4.value:null), (e5!=null?e5.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 64, dimensionIntervalExpr_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionIntervalExpr"
+
+ public static class dimensionPointList_return extends ParserRuleReturnScope {
+ public DimensionPointList value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionPointList"
+ // src/petascope/wcps/grammar/wcps.g:336:1: dimensionPointList returns [DimensionPointList value] : elem1= dimensionPointElement ( COMMA elem2= dimensionPointElement )* ;
+ public final wcpsParser.dimensionPointList_return dimensionPointList() throws RecognitionException {
+ wcpsParser.dimensionPointList_return retval = new wcpsParser.dimensionPointList_return();
+ retval.start = input.LT(1);
+ int dimensionPointList_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token COMMA188=null;
+ wcpsParser.dimensionPointElement_return elem1 = null;
+
+ wcpsParser.dimensionPointElement_return elem2 = null;
+
+
+ Object COMMA188_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 65) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:337:5: (elem1= dimensionPointElement ( COMMA elem2= dimensionPointElement )* )
+ // src/petascope/wcps/grammar/wcps.g:337:7: elem1= dimensionPointElement ( COMMA elem2= dimensionPointElement )*
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_dimensionPointElement_in_dimensionPointList3478);
+ elem1=dimensionPointElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionPointList((elem1!=null?elem1.value:null));
+ }
+ // src/petascope/wcps/grammar/wcps.g:338:6: ( COMMA elem2= dimensionPointElement )*
+ loop57:
+ do {
+ int alt57=2;
+ int LA57_0 = input.LA(1);
+
+ if ( (LA57_0==COMMA) ) {
+ alt57=1;
+ }
+
+
+ switch (alt57) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:338:7: COMMA elem2= dimensionPointElement
+ {
+ COMMA188=(Token)match(input,COMMA,FOLLOW_COMMA_in_dimensionPointList3488); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA188_tree = (Object)adaptor.create(COMMA188);
+ adaptor.addChild(root_0, COMMA188_tree);
+ }
+ pushFollow(FOLLOW_dimensionPointElement_in_dimensionPointList3492);
+ elem2=dimensionPointElement();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, elem2.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value.add((elem2!=null?elem2.value:null));
+ }
+
+ }
+ break;
+
+ default :
+ break loop57;
+ }
+ } while (true);
+
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 65, dimensionPointList_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionPointList"
+
+ public static class dimensionPointElement_return extends ParserRuleReturnScope {
+ public DimensionPointElement value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionPointElement"
+ // src/petascope/wcps/grammar/wcps.g:340:1: dimensionPointElement returns [DimensionPointElement value] : (aname= axisName LPAREN dpe= dimensionPoint RPAREN | aname= axisName COLON crs= crsName LPAREN dpe= dimensionPoint RPAREN );
+ public final wcpsParser.dimensionPointElement_return dimensionPointElement() throws RecognitionException {
+ wcpsParser.dimensionPointElement_return retval = new wcpsParser.dimensionPointElement_return();
+ retval.start = input.LT(1);
+ int dimensionPointElement_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN189=null;
+ Token RPAREN190=null;
+ Token COLON191=null;
+ Token LPAREN192=null;
+ Token RPAREN193=null;
+ wcpsParser.axisName_return aname = null;
+
+ wcpsParser.dimensionPoint_return dpe = null;
+
+ wcpsParser.crsName_return crs = null;
+
+
+ Object LPAREN189_tree=null;
+ Object RPAREN190_tree=null;
+ Object COLON191_tree=null;
+ Object LPAREN192_tree=null;
+ Object RPAREN193_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 66) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:341:5: (aname= axisName LPAREN dpe= dimensionPoint RPAREN | aname= axisName COLON crs= crsName LPAREN dpe= dimensionPoint RPAREN )
+ int alt58=2;
+ int LA58_0 = input.LA(1);
+
+ if ( (LA58_0==INTEGERCONSTANT||LA58_0==STRING||LA58_0==NAME) ) {
+ int LA58_1 = input.LA(2);
+
+ if ( (LA58_1==LPAREN) ) {
+ alt58=1;
+ }
+ else if ( (LA58_1==COLON) ) {
+ alt58=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 58, 1, input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 58, 0, input);
+
+ throw nvae;
+ }
+ switch (alt58) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:341:7: aname= axisName LPAREN dpe= dimensionPoint RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_axisName_in_dimensionPointElement3517);
+ aname=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ LPAREN189=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_dimensionPointElement3519); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN189_tree = (Object)adaptor.create(LPAREN189);
+ adaptor.addChild(root_0, LPAREN189_tree);
+ }
+ pushFollow(FOLLOW_dimensionPoint_in_dimensionPointElement3523);
+ dpe=dimensionPoint();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dpe.getTree());
+ RPAREN190=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_dimensionPointElement3525); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN190_tree = (Object)adaptor.create(RPAREN190);
+ adaptor.addChild(root_0, RPAREN190_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionPointElement((aname!=null?aname.value:null), (dpe!=null?dpe.value:null));
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:342:7: aname= axisName COLON crs= crsName LPAREN dpe= dimensionPoint RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_axisName_in_dimensionPointElement3537);
+ aname=axisName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, aname.getTree());
+ COLON191=(Token)match(input,COLON,FOLLOW_COLON_in_dimensionPointElement3539); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON191_tree = (Object)adaptor.create(COLON191);
+ adaptor.addChild(root_0, COLON191_tree);
+ }
+ pushFollow(FOLLOW_crsName_in_dimensionPointElement3543);
+ crs=crsName();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, crs.getTree());
+ LPAREN192=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_dimensionPointElement3545); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN192_tree = (Object)adaptor.create(LPAREN192);
+ adaptor.addChild(root_0, LPAREN192_tree);
+ }
+ pushFollow(FOLLOW_dimensionPoint_in_dimensionPointElement3549);
+ dpe=dimensionPoint();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, dpe.getTree());
+ RPAREN193=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_dimensionPointElement3551); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN193_tree = (Object)adaptor.create(RPAREN193);
+ adaptor.addChild(root_0, RPAREN193_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new DimensionPointElement((aname!=null?aname.value:null), (crs!=null?crs.value:null), (dpe!=null?dpe.value:null));
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 66, dimensionPointElement_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionPointElement"
+
+ public static class dimensionPoint_return extends ParserRuleReturnScope {
+ public ScalarExpr value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "dimensionPoint"
+ // src/petascope/wcps/grammar/wcps.g:344:1: dimensionPoint returns [ScalarExpr value] : e1= scalarExpr ;
+ public final wcpsParser.dimensionPoint_return dimensionPoint() throws RecognitionException {
+ wcpsParser.dimensionPoint_return retval = new wcpsParser.dimensionPoint_return();
+ retval.start = input.LT(1);
+ int dimensionPoint_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.scalarExpr_return e1 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 67) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:345:5: (e1= scalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:345:7: e1= scalarExpr
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_scalarExpr_in_dimensionPoint3574);
+ e1=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 67, dimensionPoint_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "dimensionPoint"
+
+ public static class interpolationMethod_return extends ParserRuleReturnScope {
+ public InterpolationMethod value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "interpolationMethod"
+ // src/petascope/wcps/grammar/wcps.g:347:1: interpolationMethod returns [InterpolationMethod value] : LPAREN type= interpolationType COLON res= nullResistence RPAREN ;
+ public final wcpsParser.interpolationMethod_return interpolationMethod() throws RecognitionException {
+ wcpsParser.interpolationMethod_return retval = new wcpsParser.interpolationMethod_return();
+ retval.start = input.LT(1);
+ int interpolationMethod_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token LPAREN194=null;
+ Token COLON195=null;
+ Token RPAREN196=null;
+ wcpsParser.interpolationType_return type = null;
+
+ wcpsParser.nullResistence_return res = null;
+
+
+ Object LPAREN194_tree=null;
+ Object COLON195_tree=null;
+ Object RPAREN196_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 68) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:348:2: ( LPAREN type= interpolationType COLON res= nullResistence RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:348:4: LPAREN type= interpolationType COLON res= nullResistence RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN194=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_interpolationMethod3592); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN194_tree = (Object)adaptor.create(LPAREN194);
+ adaptor.addChild(root_0, LPAREN194_tree);
+ }
+ pushFollow(FOLLOW_interpolationType_in_interpolationMethod3596);
+ type=interpolationType();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, type.getTree());
+ COLON195=(Token)match(input,COLON,FOLLOW_COLON_in_interpolationMethod3598); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COLON195_tree = (Object)adaptor.create(COLON195);
+ adaptor.addChild(root_0, COLON195_tree);
+ }
+ pushFollow(FOLLOW_nullResistence_in_interpolationMethod3602);
+ res=nullResistence();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, res.getTree());
+ RPAREN196=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_interpolationMethod3604); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN196_tree = (Object)adaptor.create(RPAREN196);
+ adaptor.addChild(root_0, RPAREN196_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new InterpolationMethod((type!=null?type.value:null), (res!=null?res.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 68, interpolationMethod_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "interpolationMethod"
+
+ public static class interpolationType_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "interpolationType"
+ // src/petascope/wcps/grammar/wcps.g:350:1: interpolationType returns [String value] : type= ( NEAREST | LINEAR | QUADRATIC | CUBIC ) ;
+ public final wcpsParser.interpolationType_return interpolationType() throws RecognitionException {
+ wcpsParser.interpolationType_return retval = new wcpsParser.interpolationType_return();
+ retval.start = input.LT(1);
+ int interpolationType_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token type=null;
+
+ Object type_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 69) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:351:2: (type= ( NEAREST | LINEAR | QUADRATIC | CUBIC ) )
+ // src/petascope/wcps/grammar/wcps.g:351:4: type= ( NEAREST | LINEAR | QUADRATIC | CUBIC )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ type=(Token)input.LT(1);
+ if ( (input.LA(1)>=NEAREST && input.LA(1)<=CUBIC) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(type));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new String((type!=null?type.getText():null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 69, interpolationType_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "interpolationType"
+
+ public static class nullResistence_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "nullResistence"
+ // src/petascope/wcps/grammar/wcps.g:353:1: nullResistence returns [String value] : resistance= ( FULL | NONE | HALF | OTHER ) ;
+ public final wcpsParser.nullResistence_return nullResistence() throws RecognitionException {
+ wcpsParser.nullResistence_return retval = new wcpsParser.nullResistence_return();
+ retval.start = input.LT(1);
+ int nullResistence_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token resistance=null;
+
+ Object resistance_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 70) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:354:2: (resistance= ( FULL | NONE | HALF | OTHER ) )
+ // src/petascope/wcps/grammar/wcps.g:354:4: resistance= ( FULL | NONE | HALF | OTHER )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ resistance=(Token)input.LT(1);
+ if ( (input.LA(1)>=FULL && input.LA(1)<=OTHER) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(resistance));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new String((resistance!=null?resistance.getText():null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 70, nullResistence_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "nullResistence"
+
+ public static class condenseOpType_return extends ParserRuleReturnScope {
+ public CondenseOperation value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "condenseOpType"
+ // src/petascope/wcps/grammar/wcps.g:356:1: condenseOpType returns [CondenseOperation value] : op= ( PLUS | MULT | MAX | MIN | AND | OR ) ;
+ public final wcpsParser.condenseOpType_return condenseOpType() throws RecognitionException {
+ wcpsParser.condenseOpType_return retval = new wcpsParser.condenseOpType_return();
+ retval.start = input.LT(1);
+ int condenseOpType_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token op=null;
+
+ Object op_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 71) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:357:2: (op= ( PLUS | MULT | MAX | MIN | AND | OR ) )
+ // src/petascope/wcps/grammar/wcps.g:357:4: op= ( PLUS | MULT | MAX | MIN | AND | OR )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ op=(Token)input.LT(1);
+ if ( input.LA(1)==OR||input.LA(1)==AND||input.LA(1)==PLUS||input.LA(1)==MULT||(input.LA(1)>=MIN && input.LA(1)<=MAX) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = new CondenseOperation((op!=null?op.getText():null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 71, condenseOpType_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "condenseOpType"
+
+ public static class fieldName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "fieldName"
+ // src/petascope/wcps/grammar/wcps.g:359:1: fieldName returns [String value] : name ;
+ public final wcpsParser.fieldName_return fieldName() throws RecognitionException {
+ wcpsParser.fieldName_return retval = new wcpsParser.fieldName_return();
+ retval.start = input.LT(1);
+ int fieldName_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.name_return name197 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 72) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:360:2: ( name )
+ // src/petascope/wcps/grammar/wcps.g:360:4: name
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_name_in_fieldName3698);
+ name197=name();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, name197.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new String((name197!=null?name197.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 72, fieldName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "fieldName"
+
+ public static class constant_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "constant"
+ // src/petascope/wcps/grammar/wcps.g:362:1: constant returns [String value] : (e= ( STRING | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT ) | e1= complexConstant );
+ public final wcpsParser.constant_return constant() throws RecognitionException {
+ wcpsParser.constant_return retval = new wcpsParser.constant_return();
+ retval.start = input.LT(1);
+ int constant_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token e=null;
+ wcpsParser.complexConstant_return e1 = null;
+
+
+ Object e_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 73) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:363:2: (e= ( STRING | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT ) | e1= complexConstant )
+ int alt59=2;
+ int LA59_0 = input.LA(1);
+
+ if ( (LA59_0==INTEGERCONSTANT||LA59_0==STRING||(LA59_0>=BOOLEANCONSTANT && LA59_0<=FLOATCONSTANT)) ) {
+ alt59=1;
+ }
+ else if ( (LA59_0==LPAREN) ) {
+ alt59=2;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ NoViableAltException nvae =
+ new NoViableAltException("", 59, 0, input);
+
+ throw nvae;
+ }
+ switch (alt59) {
+ case 1 :
+ // src/petascope/wcps/grammar/wcps.g:363:4: e= ( STRING | BOOLEANCONSTANT | INTEGERCONSTANT | FLOATCONSTANT )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ e=(Token)input.LT(1);
+ if ( input.LA(1)==INTEGERCONSTANT||input.LA(1)==STRING||(input.LA(1)>=BOOLEANCONSTANT && input.LA(1)<=FLOATCONSTANT) ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(e));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = (e!=null?e.getText():null);
+ }
+
+ }
+ break;
+ case 2 :
+ // src/petascope/wcps/grammar/wcps.g:364:4: e1= complexConstant
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_complexConstant_in_constant3732);
+ e1=complexConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (e1!=null?e1.value:null);
+ }
+
+ }
+ break;
+
+ }
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 73, constant_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "constant"
+
+ public static class complexConstant_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "complexConstant"
+ // src/petascope/wcps/grammar/wcps.g:366:1: complexConstant returns [String value] : LPAREN re1= FLOATCONSTANT COMMA im1= FLOATCONSTANT RPAREN ;
+ public final wcpsParser.complexConstant_return complexConstant() throws RecognitionException {
+ wcpsParser.complexConstant_return retval = new wcpsParser.complexConstant_return();
+ retval.start = input.LT(1);
+ int complexConstant_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token re1=null;
+ Token im1=null;
+ Token LPAREN198=null;
+ Token COMMA199=null;
+ Token RPAREN200=null;
+
+ Object re1_tree=null;
+ Object im1_tree=null;
+ Object LPAREN198_tree=null;
+ Object COMMA199_tree=null;
+ Object RPAREN200_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 74) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:367:2: ( LPAREN re1= FLOATCONSTANT COMMA im1= FLOATCONSTANT RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:367:4: LPAREN re1= FLOATCONSTANT COMMA im1= FLOATCONSTANT RPAREN
+ {
+ root_0 = (Object)adaptor.nil();
+
+ LPAREN198=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_complexConstant3747); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ LPAREN198_tree = (Object)adaptor.create(LPAREN198);
+ adaptor.addChild(root_0, LPAREN198_tree);
+ }
+ re1=(Token)match(input,FLOATCONSTANT,FOLLOW_FLOATCONSTANT_in_complexConstant3751); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ re1_tree = (Object)adaptor.create(re1);
+ adaptor.addChild(root_0, re1_tree);
+ }
+ COMMA199=(Token)match(input,COMMA,FOLLOW_COMMA_in_complexConstant3753); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ COMMA199_tree = (Object)adaptor.create(COMMA199);
+ adaptor.addChild(root_0, COMMA199_tree);
+ }
+ im1=(Token)match(input,FLOATCONSTANT,FOLLOW_FLOATCONSTANT_in_complexConstant3757); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ im1_tree = (Object)adaptor.create(im1);
+ adaptor.addChild(root_0, im1_tree);
+ }
+ RPAREN200=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_complexConstant3759); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ RPAREN200_tree = (Object)adaptor.create(RPAREN200);
+ adaptor.addChild(root_0, RPAREN200_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String((re1!=null?re1.getText():null) +"+i"+(im1!=null?im1.getText():null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 74, complexConstant_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "complexConstant"
+
+ public static class stringConstant_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "stringConstant"
+ // src/petascope/wcps/grammar/wcps.g:369:1: stringConstant returns [String value] : s= STRING ;
+ public final wcpsParser.stringConstant_return stringConstant() throws RecognitionException {
+ wcpsParser.stringConstant_return retval = new wcpsParser.stringConstant_return();
+ retval.start = input.LT(1);
+ int stringConstant_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token s=null;
+
+ Object s_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 75) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:370:2: (s= STRING )
+ // src/petascope/wcps/grammar/wcps.g:370:4: s= STRING
+ {
+ root_0 = (Object)adaptor.nil();
+
+ s=(Token)match(input,STRING,FOLLOW_STRING_in_stringConstant3776); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ s_tree = (Object)adaptor.create(s);
+ adaptor.addChild(root_0, s_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (s!=null?s.getText():null);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 75, stringConstant_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "stringConstant"
+
+ public static class name_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "name"
+ // src/petascope/wcps/grammar/wcps.g:372:1: name returns [String value] : var= ( NAME | STRING | INTEGERCONSTANT ) ;
+ public final wcpsParser.name_return name() throws RecognitionException {
+ wcpsParser.name_return retval = new wcpsParser.name_return();
+ retval.start = input.LT(1);
+ int name_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token var=null;
+
+ Object var_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 76) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:373:2: (var= ( NAME | STRING | INTEGERCONSTANT ) )
+ // src/petascope/wcps/grammar/wcps.g:373:4: var= ( NAME | STRING | INTEGERCONSTANT )
+ {
+ root_0 = (Object)adaptor.nil();
+
+ var=(Token)input.LT(1);
+ if ( input.LA(1)==INTEGERCONSTANT||input.LA(1)==STRING||input.LA(1)==NAME ) {
+ input.consume();
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(var));
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return retval;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ if ( state.backtracking==0 ) {
+ retval.value = (var!=null?var.getText():null);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 76, name_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "name"
+
+ public static class crsName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "crsName"
+ // src/petascope/wcps/grammar/wcps.g:375:1: crsName returns [String value] : s= stringConstant ;
+ public final wcpsParser.crsName_return crsName() throws RecognitionException {
+ wcpsParser.crsName_return retval = new wcpsParser.crsName_return();
+ retval.start = input.LT(1);
+ int crsName_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.stringConstant_return s = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 77) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:376:2: (s= stringConstant )
+ // src/petascope/wcps/grammar/wcps.g:376:4: s= stringConstant
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_stringConstant_in_crsName3820);
+ s=stringConstant();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, s.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (s!=null?s.value:null);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 77, crsName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "crsName"
+
+ public static class axisName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "axisName"
+ // src/petascope/wcps/grammar/wcps.g:378:1: axisName returns [String value] : type1= name ;
+ public final wcpsParser.axisName_return axisName() throws RecognitionException {
+ wcpsParser.axisName_return retval = new wcpsParser.axisName_return();
+ retval.start = input.LT(1);
+ int axisName_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.name_return type1 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 78) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:379:2: (type1= name )
+ // src/petascope/wcps/grammar/wcps.g:379:4: type1= name
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_name_in_axisName3837);
+ type1=name();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, type1.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = new String((type1!=null?type1.value:null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 78, axisName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "axisName"
+
+ public static class variableName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "variableName"
+ // src/petascope/wcps/grammar/wcps.g:381:1: variableName returns [String value] : var= VARIABLE_DOLLAR ;
+ public final wcpsParser.variableName_return variableName() throws RecognitionException {
+ wcpsParser.variableName_return retval = new wcpsParser.variableName_return();
+ retval.start = input.LT(1);
+ int variableName_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token var=null;
+
+ Object var_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 79) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:382:2: (var= VARIABLE_DOLLAR )
+ // src/petascope/wcps/grammar/wcps.g:382:4: var= VARIABLE_DOLLAR
+ {
+ root_0 = (Object)adaptor.nil();
+
+ var=(Token)match(input,VARIABLE_DOLLAR,FOLLOW_VARIABLE_DOLLAR_in_variableName3854); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ var_tree = (Object)adaptor.create(var);
+ adaptor.addChild(root_0, var_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = new String((var!=null?var.getText():null));
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 79, variableName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "variableName"
+
+ public static class coverageVariable_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageVariable"
+ // src/petascope/wcps/grammar/wcps.g:384:1: coverageVariable returns [String value] : var= NAME ;
+ public final wcpsParser.coverageVariable_return coverageVariable() throws RecognitionException {
+ wcpsParser.coverageVariable_return retval = new wcpsParser.coverageVariable_return();
+ retval.start = input.LT(1);
+ int coverageVariable_StartIndex = input.index();
+ Object root_0 = null;
+
+ Token var=null;
+
+ Object var_tree=null;
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 80) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:385:2: (var= NAME )
+ // src/petascope/wcps/grammar/wcps.g:385:4: var= NAME
+ {
+ root_0 = (Object)adaptor.nil();
+
+ var=(Token)match(input,NAME,FOLLOW_NAME_in_coverageVariable3871); if (state.failed) return retval;
+ if ( state.backtracking==0 ) {
+ var_tree = (Object)adaptor.create(var);
+ adaptor.addChild(root_0, var_tree);
+ }
+ if ( state.backtracking==0 ) {
+ retval.value = (var!=null?var.getText():null);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 80, coverageVariable_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageVariable"
+
+ public static class coverageName_return extends ParserRuleReturnScope {
+ public String value;
+ Object tree;
+ public Object getTree() { return tree; }
+ };
+
+ // $ANTLR start "coverageName"
+ // src/petascope/wcps/grammar/wcps.g:387:1: coverageName returns [String value] : name ;
+ public final wcpsParser.coverageName_return coverageName() throws RecognitionException {
+ wcpsParser.coverageName_return retval = new wcpsParser.coverageName_return();
+ retval.start = input.LT(1);
+ int coverageName_StartIndex = input.index();
+ Object root_0 = null;
+
+ wcpsParser.name_return name201 = null;
+
+
+
+ try {
+ if ( state.backtracking>0 && alreadyParsedRule(input, 81) ) { return retval; }
+ // src/petascope/wcps/grammar/wcps.g:388:2: ( name )
+ // src/petascope/wcps/grammar/wcps.g:388:4: name
+ {
+ root_0 = (Object)adaptor.nil();
+
+ pushFollow(FOLLOW_name_in_coverageName3886);
+ name201=name();
+
+ state._fsp--;
+ if (state.failed) return retval;
+ if ( state.backtracking==0 ) adaptor.addChild(root_0, name201.getTree());
+ if ( state.backtracking==0 ) {
+ retval.value = (name201!=null?name201.value:null);
+ }
+
+ }
+
+ retval.stop = input.LT(-1);
+
+ if ( state.backtracking==0 ) {
+
+ retval.tree = (Object)adaptor.rulePostProcessing(root_0);
+ adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (RecognitionException re) {
+ reportError(re);
+ recover(input,re);
+ retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
+
+ }
+ finally {
+ if ( state.backtracking>0 ) { memoize(input, 81, coverageName_StartIndex); }
+ }
+ return retval;
+ }
+ // $ANTLR end "coverageName"
+
+ // $ANTLR start synpred8_wcps
+ public final void synpred8_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageLogicTerm_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:67:10: (op= ( OR | XOR ) e2= coverageLogicTerm )
+ // src/petascope/wcps/grammar/wcps.g:67:10: op= ( OR | XOR ) e2= coverageLogicTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=OR && input.LA(1)<=XOR) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageLogicTerm_in_synpred8_wcps374);
+ e2=coverageLogicTerm();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred8_wcps
+
+ // $ANTLR start synpred9_wcps
+ public final void synpred9_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageLogicFactor_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:71:10: (op= AND e2= coverageLogicFactor )
+ // src/petascope/wcps/grammar/wcps.g:71:10: op= AND e2= coverageLogicFactor
+ {
+ op=(Token)match(input,AND,FOLLOW_AND_in_synpred9_wcps416); if (state.failed) return ;
+ pushFollow(FOLLOW_coverageLogicFactor_in_synpred9_wcps420);
+ e2=coverageLogicFactor();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred9_wcps
+
+ // $ANTLR start synpred15_wcps
+ public final void synpred15_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageArithmeticExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:75:10: (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )
+ // src/petascope/wcps/grammar/wcps.g:75:10: op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=EQUALS && input.LA(1)<=GTE) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticExpr_in_synpred15_wcps479);
+ e2=coverageArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred15_wcps
+
+ // $ANTLR start synpred17_wcps
+ public final void synpred17_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageArithmeticTerm_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:79:10: (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )
+ // src/petascope/wcps/grammar/wcps.g:79:10: op= ( PLUS | MINUS ) e2= coverageArithmeticTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticTerm_in_synpred17_wcps531);
+ e2=coverageArithmeticTerm();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred17_wcps
+
+ // $ANTLR start synpred19_wcps
+ public final void synpred19_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageArithmeticFactor_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:83:10: (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )
+ // src/petascope/wcps/grammar/wcps.g:83:10: op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_coverageArithmeticFactor_in_synpred19_wcps582);
+ e2=coverageArithmeticFactor();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred19_wcps
+
+ // $ANTLR start synpred20_wcps
+ public final void synpred20_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.coverageValue_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:87:10: (op= OVERLAY e2= coverageValue )
+ // src/petascope/wcps/grammar/wcps.g:87:10: op= OVERLAY e2= coverageValue
+ {
+ op=(Token)match(input,OVERLAY,FOLLOW_OVERLAY_in_synpred20_wcps625); if (state.failed) return ;
+ pushFollow(FOLLOW_coverageValue_in_synpred20_wcps629);
+ e2=coverageValue();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred20_wcps
+
+ // $ANTLR start synpred21_wcps
+ public final void synpred21_wcps_fragment() throws RecognitionException {
+ wcpsParser.subsetExpr_return e5 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:90:7: (e5= subsetExpr )
+ // src/petascope/wcps/grammar/wcps.g:90:7: e5= subsetExpr
+ {
+ pushFollow(FOLLOW_subsetExpr_in_synpred21_wcps655);
+ e5=subsetExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred21_wcps
+
+ // $ANTLR start synpred22_wcps
+ public final void synpred22_wcps_fragment() throws RecognitionException {
+ wcpsParser.unaryInducedExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:91:7: (e2= unaryInducedExpr )
+ // src/petascope/wcps/grammar/wcps.g:91:7: e2= unaryInducedExpr
+ {
+ pushFollow(FOLLOW_unaryInducedExpr_in_synpred22_wcps668);
+ e2=unaryInducedExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred22_wcps
+
+ // $ANTLR start synpred25_wcps
+ public final void synpred25_wcps_fragment() throws RecognitionException {
+ wcpsParser.scalarExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:97:7: (e2= scalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:97:7: e2= scalarExpr
+ {
+ pushFollow(FOLLOW_scalarExpr_in_synpred25_wcps727);
+ e2=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred25_wcps
+
+ // $ANTLR start synpred27_wcps
+ public final void synpred27_wcps_fragment() throws RecognitionException {
+ wcpsParser.coverageExpr_return e7 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:99:7: ( LPAREN e7= coverageExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:99:7: LPAREN e7= coverageExpr RPAREN
+ {
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred27_wcps749); if (state.failed) return ;
+ pushFollow(FOLLOW_coverageExpr_in_synpred27_wcps753);
+ e7=coverageExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred27_wcps755); if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred27_wcps
+
+ // $ANTLR start synpred28_wcps
+ public final void synpred28_wcps_fragment() throws RecognitionException {
+ wcpsParser.coverageConstantExpr_return e3 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:100:7: (e3= coverageConstantExpr )
+ // src/petascope/wcps/grammar/wcps.g:100:7: e3= coverageConstantExpr
+ {
+ pushFollow(FOLLOW_coverageConstantExpr_in_synpred28_wcps768);
+ e3=coverageConstantExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred28_wcps
+
+ // $ANTLR start synpred29_wcps
+ public final void synpred29_wcps_fragment() throws RecognitionException {
+ wcpsParser.coverageConstructorExpr_return e4 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:101:7: (e4= coverageConstructorExpr )
+ // src/petascope/wcps/grammar/wcps.g:101:7: e4= coverageConstructorExpr
+ {
+ pushFollow(FOLLOW_coverageConstructorExpr_in_synpred29_wcps780);
+ e4=coverageConstructorExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred29_wcps
+
+ // $ANTLR start synpred31_wcps
+ public final void synpred31_wcps_fragment() throws RecognitionException {
+ wcpsParser.metaDataExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:106:7: (e1= metaDataExpr )
+ // src/petascope/wcps/grammar/wcps.g:106:7: e1= metaDataExpr
+ {
+ pushFollow(FOLLOW_metaDataExpr_in_synpred31_wcps830);
+ e1=metaDataExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred31_wcps
+
+ // $ANTLR start synpred32_wcps
+ public final void synpred32_wcps_fragment() throws RecognitionException {
+ wcpsParser.condenseExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:107:7: (e2= condenseExpr )
+ // src/petascope/wcps/grammar/wcps.g:107:7: e2= condenseExpr
+ {
+ pushFollow(FOLLOW_condenseExpr_in_synpred32_wcps843);
+ e2=condenseExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred32_wcps
+
+ // $ANTLR start synpred33_wcps
+ public final void synpred33_wcps_fragment() throws RecognitionException {
+ wcpsParser.booleanScalarExpr_return e3 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:108:7: (e3= booleanScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:108:7: e3= booleanScalarExpr
+ {
+ pushFollow(FOLLOW_booleanScalarExpr_in_synpred33_wcps856);
+ e3=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred33_wcps
+
+ // $ANTLR start synpred34_wcps
+ public final void synpred34_wcps_fragment() throws RecognitionException {
+ wcpsParser.numericScalarExpr_return e4 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:109:7: (e4= numericScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:109:7: e4= numericScalarExpr
+ {
+ pushFollow(FOLLOW_numericScalarExpr_in_synpred34_wcps870);
+ e4=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred34_wcps
+
+ // $ANTLR start synpred35_wcps
+ public final void synpred35_wcps_fragment() throws RecognitionException {
+ wcpsParser.stringScalarExpr_return e5 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:110:7: (e5= stringScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:110:7: e5= stringScalarExpr
+ {
+ pushFollow(FOLLOW_stringScalarExpr_in_synpred35_wcps883);
+ e5=stringScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred35_wcps
+
+ // $ANTLR start synpred70_wcps
+ public final void synpred70_wcps_fragment() throws RecognitionException {
+ wcpsParser.fieldExpr_return e6 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:204:7: (e6= fieldExpr )
+ // src/petascope/wcps/grammar/wcps.g:204:7: e6= fieldExpr
+ {
+ pushFollow(FOLLOW_fieldExpr_in_synpred70_wcps2013);
+ e6=fieldExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred70_wcps
+
+ // $ANTLR start synpred71_wcps
+ public final void synpred71_wcps_fragment() throws RecognitionException {
+ wcpsParser.unaryArithmeticExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:205:4: (e1= unaryArithmeticExpr )
+ // src/petascope/wcps/grammar/wcps.g:205:4: e1= unaryArithmeticExpr
+ {
+ pushFollow(FOLLOW_unaryArithmeticExpr_in_synpred71_wcps2022);
+ e1=unaryArithmeticExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred71_wcps
+
+ // $ANTLR start synpred74_wcps
+ public final void synpred74_wcps_fragment() throws RecognitionException {
+ wcpsParser.booleanExpr_return e4 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:208:7: (e4= booleanExpr )
+ // src/petascope/wcps/grammar/wcps.g:208:7: e4= booleanExpr
+ {
+ pushFollow(FOLLOW_booleanExpr_in_synpred74_wcps2058);
+ e4=booleanExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred74_wcps
+
+ // $ANTLR start synpred100_wcps
+ public final void synpred100_wcps_fragment() throws RecognitionException {
+ wcpsParser.trimExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:251:4: (e1= trimExpr )
+ // src/petascope/wcps/grammar/wcps.g:251:4: e1= trimExpr
+ {
+ pushFollow(FOLLOW_trimExpr_in_synpred100_wcps2575);
+ e1=trimExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred100_wcps
+
+ // $ANTLR start synpred101_wcps
+ public final void synpred101_wcps_fragment() throws RecognitionException {
+ wcpsParser.sliceExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:252:4: (e2= sliceExpr )
+ // src/petascope/wcps/grammar/wcps.g:252:4: e2= sliceExpr
+ {
+ pushFollow(FOLLOW_sliceExpr_in_synpred101_wcps2584);
+ e2=sliceExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred101_wcps
+
+ // $ANTLR start synpred115_wcps
+ public final void synpred115_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.booleanScalarTerm_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:280:8: (op= ( OR | XOR ) e2= booleanScalarTerm )
+ // src/petascope/wcps/grammar/wcps.g:280:8: op= ( OR | XOR ) e2= booleanScalarTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=OR && input.LA(1)<=XOR) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_booleanScalarTerm_in_synpred115_wcps2886);
+ e2=booleanScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred115_wcps
+
+ // $ANTLR start synpred116_wcps
+ public final void synpred116_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.booleanScalarNegation_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:284:5: (op= AND e2= booleanScalarNegation )
+ // src/petascope/wcps/grammar/wcps.g:284:5: op= AND e2= booleanScalarNegation
+ {
+ op=(Token)match(input,AND,FOLLOW_AND_in_synpred116_wcps2918); if (state.failed) return ;
+ pushFollow(FOLLOW_booleanScalarNegation_in_synpred116_wcps2922);
+ e2=booleanScalarNegation();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred116_wcps
+
+ // $ANTLR start synpred118_wcps
+ public final void synpred118_wcps_fragment() throws RecognitionException {
+ wcpsParser.booleanScalarExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:291:4: ( LPAREN e1= booleanScalarExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:291:4: LPAREN e1= booleanScalarExpr RPAREN
+ {
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred118_wcps2971); if (state.failed) return ;
+ pushFollow(FOLLOW_booleanScalarExpr_in_synpred118_wcps2975);
+ e1=booleanScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred118_wcps2977); if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred118_wcps
+
+ // $ANTLR start synpred120_wcps
+ public final void synpred120_wcps_fragment() throws RecognitionException {
+ wcpsParser.numericScalarExpr_return n1 = null;
+
+ wcpsParser.compOp_return cop = null;
+
+ wcpsParser.numericScalarExpr_return n2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:293:4: (n1= numericScalarExpr cop= compOp n2= numericScalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:293:4: n1= numericScalarExpr cop= compOp n2= numericScalarExpr
+ {
+ pushFollow(FOLLOW_numericScalarExpr_in_synpred120_wcps3004);
+ n1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ pushFollow(FOLLOW_compOp_in_synpred120_wcps3008);
+ cop=compOp();
+
+ state._fsp--;
+ if (state.failed) return ;
+ pushFollow(FOLLOW_numericScalarExpr_in_synpred120_wcps3012);
+ n2=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred120_wcps
+
+ // $ANTLR start synpred122_wcps
+ public final void synpred122_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.numericScalarTerm_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:298:5: (op= ( PLUS | MINUS ) e2= numericScalarTerm )
+ // src/petascope/wcps/grammar/wcps.g:298:5: op= ( PLUS | MINUS ) e2= numericScalarTerm
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_numericScalarTerm_in_synpred122_wcps3057);
+ e2=numericScalarTerm();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred122_wcps
+
+ // $ANTLR start synpred124_wcps
+ public final void synpred124_wcps_fragment() throws RecognitionException {
+ Token op=null;
+ wcpsParser.numericScalarFactor_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:302:4: (op= ( MULT | DIVIDE ) e2= numericScalarFactor )
+ // src/petascope/wcps/grammar/wcps.g:302:4: op= ( MULT | DIVIDE ) e2= numericScalarFactor
+ {
+ op=(Token)input.LT(1);
+ if ( (input.LA(1)>=MULT && input.LA(1)<=DIVIDE) ) {
+ input.consume();
+ state.errorRecovery=false;state.failed=false;
+ }
+ else {
+ if (state.backtracking>0) {state.failed=true; return ;}
+ MismatchedSetException mse = new MismatchedSetException(null,input);
+ throw mse;
+ }
+
+ pushFollow(FOLLOW_numericScalarFactor_in_synpred124_wcps3093);
+ e2=numericScalarFactor();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred124_wcps
+
+ // $ANTLR start synpred125_wcps
+ public final void synpred125_wcps_fragment() throws RecognitionException {
+ wcpsParser.numericScalarExpr_return e1 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:305:7: ( LPAREN e1= numericScalarExpr RPAREN )
+ // src/petascope/wcps/grammar/wcps.g:305:7: LPAREN e1= numericScalarExpr RPAREN
+ {
+ match(input,LPAREN,FOLLOW_LPAREN_in_synpred125_wcps3113); if (state.failed) return ;
+ pushFollow(FOLLOW_numericScalarExpr_in_synpred125_wcps3117);
+ e1=numericScalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ match(input,RPAREN,FOLLOW_RPAREN_in_synpred125_wcps3119); if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred125_wcps
+
+ // $ANTLR start synpred132_wcps
+ public final void synpred132_wcps_fragment() throws RecognitionException {
+ wcpsParser.complexConstant_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:312:7: (e2= complexConstant )
+ // src/petascope/wcps/grammar/wcps.g:312:7: e2= complexConstant
+ {
+ pushFollow(FOLLOW_complexConstant_in_synpred132_wcps3231);
+ e2=complexConstant();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred132_wcps
+
+ // $ANTLR start synpred141_wcps
+ public final void synpred141_wcps_fragment() throws RecognitionException {
+ wcpsParser.scalarExpr_return e1 = null;
+
+ wcpsParser.scalarExpr_return e2 = null;
+
+
+ // src/petascope/wcps/grammar/wcps.g:333:7: (e1= scalarExpr COLON e2= scalarExpr )
+ // src/petascope/wcps/grammar/wcps.g:333:7: e1= scalarExpr COLON e2= scalarExpr
+ {
+ pushFollow(FOLLOW_scalarExpr_in_synpred141_wcps3419);
+ e1=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+ match(input,COLON,FOLLOW_COLON_in_synpred141_wcps3421); if (state.failed) return ;
+ pushFollow(FOLLOW_scalarExpr_in_synpred141_wcps3425);
+ e2=scalarExpr();
+
+ state._fsp--;
+ if (state.failed) return ;
+
+ }
+ }
+ // $ANTLR end synpred141_wcps
+
+ // Delegated rules
+
+ public final boolean synpred70_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred70_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred9_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred9_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred15_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred15_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred17_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred17_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred125_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred125_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred19_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred19_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred32_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred32_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred31_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred31_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred21_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred21_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred101_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred101_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred118_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred118_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred115_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred115_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred132_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred132_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred141_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred141_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred122_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred122_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred74_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred74_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred20_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred20_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred33_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred33_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred27_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred27_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred22_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred22_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred28_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred28_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred29_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred29_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred100_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred100_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred25_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred25_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred35_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred35_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred71_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred71_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred34_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred34_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred124_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred124_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred8_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred8_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred116_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred116_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+ public final boolean synpred120_wcps() {
+ state.backtracking++;
+ int start = input.mark();
+ try {
+ synpred120_wcps_fragment(); // can never throw exception
+ } catch (RecognitionException re) {
+ System.err.println("impossible: "+re);
+ }
+ boolean success = !state.failed;
+ input.rewind(start);
+ state.backtracking--;
+ state.failed=false;
+ return success;
+ }
+
+
+ protected DFA4 dfa4 = new DFA4(this);
+ protected DFA6 dfa6 = new DFA6(this);
+ protected DFA7 dfa7 = new DFA7(this);
+ protected DFA8 dfa8 = new DFA8(this);
+ protected DFA9 dfa9 = new DFA9(this);
+ protected DFA10 dfa10 = new DFA10(this);
+ protected DFA11 dfa11 = new DFA11(this);
+ protected DFA12 dfa12 = new DFA12(this);
+ protected DFA13 dfa13 = new DFA13(this);
+ protected DFA14 dfa14 = new DFA14(this);
+ protected DFA34 dfa34 = new DFA34(this);
+ protected DFA42 dfa42 = new DFA42(this);
+ protected DFA43 dfa43 = new DFA43(this);
+ protected DFA44 dfa44 = new DFA44(this);
+ protected DFA46 dfa46 = new DFA46(this);
+ protected DFA47 dfa47 = new DFA47(this);
+ protected DFA48 dfa48 = new DFA48(this);
+ protected DFA49 dfa49 = new DFA49(this);
+ protected DFA50 dfa50 = new DFA50(this);
+ protected DFA51 dfa51 = new DFA51(this);
+ protected DFA52 dfa52 = new DFA52(this);
+ protected DFA56 dfa56 = new DFA56(this);
+ static final String DFA4_eotS =
+ "\30\uffff";
+ static final String DFA4_eofS =
+ "\30\uffff";
+ static final String DFA4_minS =
+ "\1\6\27\uffff";
+ static final String DFA4_maxS =
+ "\1\154\27\uffff";
+ static final String DFA4_acceptS =
+ "\1\uffff\1\1\1\2\1\3\24\uffff";
+ static final String DFA4_specialS =
+ "\30\uffff}>";
+ static final String[] DFA4_transitionS = {
+ "\1\3\4\uffff\1\1\1\2\12\uffff\1\3\3\uffff\20\3\21\uffff\2\3"+
+ "\16\uffff\1\3\1\uffff\3\3\20\uffff\2\3\11\uffff\1\3",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA4_eot = DFA.unpackEncodedString(DFA4_eotS);
+ static final short[] DFA4_eof = DFA.unpackEncodedString(DFA4_eofS);
+ static final char[] DFA4_min = DFA.unpackEncodedStringToUnsignedChars(DFA4_minS);
+ static final char[] DFA4_max = DFA.unpackEncodedStringToUnsignedChars(DFA4_maxS);
+ static final short[] DFA4_accept = DFA.unpackEncodedString(DFA4_acceptS);
+ static final short[] DFA4_special = DFA.unpackEncodedString(DFA4_specialS);
+ static final short[][] DFA4_transition;
+
+ static {
+ int numStates = DFA4_transitionS.length;
+ DFA4_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA4_transition[i] = DFA.unpackEncodedString(DFA4_transitionS[i]);
+ }
+ }
+
+ class DFA4 extends DFA {
+
+ public DFA4(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 4;
+ this.eot = DFA4_eot;
+ this.eof = DFA4_eof;
+ this.min = DFA4_min;
+ this.max = DFA4_max;
+ this.accept = DFA4_accept;
+ this.special = DFA4_special;
+ this.transition = DFA4_transition;
+ }
+ public String getDescription() {
+ return "53:1: processingExpr returns [ProcessingExpr value] : (e1= encodedCoverageExpr | e2= storeExpr | e3= scalarExpr );";
+ }
+ }
+ static final String DFA6_eotS =
+ "\77\uffff";
+ static final String DFA6_eofS =
+ "\1\1\76\uffff";
+ static final String DFA6_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA6_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA6_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA6_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA6_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\2\11\14\1\21\uffff\2\1\3\uffff\1\1"+
+ "\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA6_eot = DFA.unpackEncodedString(DFA6_eotS);
+ static final short[] DFA6_eof = DFA.unpackEncodedString(DFA6_eofS);
+ static final char[] DFA6_min = DFA.unpackEncodedStringToUnsignedChars(DFA6_minS);
+ static final char[] DFA6_max = DFA.unpackEncodedStringToUnsignedChars(DFA6_maxS);
+ static final short[] DFA6_accept = DFA.unpackEncodedString(DFA6_acceptS);
+ static final short[] DFA6_special = DFA.unpackEncodedString(DFA6_specialS);
+ static final short[][] DFA6_transition;
+
+ static {
+ int numStates = DFA6_transitionS.length;
+ DFA6_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA6_transition[i] = DFA.unpackEncodedString(DFA6_transitionS[i]);
+ }
+ }
+
+ class DFA6 extends DFA {
+
+ public DFA6(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 6;
+ this.eot = DFA6_eot;
+ this.eof = DFA6_eof;
+ this.min = DFA6_min;
+ this.max = DFA6_max;
+ this.accept = DFA6_accept;
+ this.special = DFA6_special;
+ this.transition = DFA6_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 67:9: (op= ( OR | XOR ) e2= coverageLogicTerm )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA6_9 = input.LA(1);
+
+
+ int index6_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred8_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index6_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 6, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA7_eotS =
+ "\77\uffff";
+ static final String DFA7_eofS =
+ "\1\1\76\uffff";
+ static final String DFA7_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA7_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA7_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA7_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA7_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\2\1\1\11\13\1\21\uffff\2\1\3\uffff"+
+ "\1\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA7_eot = DFA.unpackEncodedString(DFA7_eotS);
+ static final short[] DFA7_eof = DFA.unpackEncodedString(DFA7_eofS);
+ static final char[] DFA7_min = DFA.unpackEncodedStringToUnsignedChars(DFA7_minS);
+ static final char[] DFA7_max = DFA.unpackEncodedStringToUnsignedChars(DFA7_maxS);
+ static final short[] DFA7_accept = DFA.unpackEncodedString(DFA7_acceptS);
+ static final short[] DFA7_special = DFA.unpackEncodedString(DFA7_specialS);
+ static final short[][] DFA7_transition;
+
+ static {
+ int numStates = DFA7_transitionS.length;
+ DFA7_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA7_transition[i] = DFA.unpackEncodedString(DFA7_transitionS[i]);
+ }
+ }
+
+ class DFA7 extends DFA {
+
+ public DFA7(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 7;
+ this.eot = DFA7_eot;
+ this.eof = DFA7_eof;
+ this.min = DFA7_min;
+ this.max = DFA7_max;
+ this.accept = DFA7_accept;
+ this.special = DFA7_special;
+ this.transition = DFA7_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 71:9: (op= AND e2= coverageLogicFactor )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA7_9 = input.LA(1);
+
+
+ int index7_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred9_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index7_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 7, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA8_eotS =
+ "\u0107\uffff";
+ static final String DFA8_eofS =
+ "\1\2\u0106\uffff";
+ static final String DFA8_minS =
+ "\1\7\1\0\14\uffff\5\0\u00f4\uffff";
+ static final String DFA8_maxS =
+ "\1\140\1\0\14\uffff\5\0\u00f4\uffff";
+ static final String DFA8_acceptS =
+ "\2\uffff\1\2\73\uffff\1\1\u00c8\uffff";
+ static final String DFA8_specialS =
+ "\1\uffff\1\0\14\uffff\1\1\1\2\1\3\1\4\1\5\u00f4\uffff}>";
+ static final String[] DFA8_transitionS = {
+ "\2\2\1\uffff\1\2\2\uffff\3\2\1\1\1\16\1\17\1\20\1\21\1\22\5"+
+ "\2\21\uffff\2\2\3\uffff\1\2\7\uffff\1\2\30\uffff\1\2\15\uffff"+
+ "\1\2",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS);
+ static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS);
+ static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS);
+ static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS);
+ static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS);
+ static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS);
+ static final short[][] DFA8_transition;
+
+ static {
+ int numStates = DFA8_transitionS.length;
+ DFA8_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA8_transition[i] = DFA.unpackEncodedString(DFA8_transitionS[i]);
+ }
+ }
+
+ class DFA8 extends DFA {
+
+ public DFA8(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 8;
+ this.eot = DFA8_eot;
+ this.eof = DFA8_eof;
+ this.min = DFA8_min;
+ this.max = DFA8_max;
+ this.accept = DFA8_accept;
+ this.special = DFA8_special;
+ this.transition = DFA8_transition;
+ }
+ public String getDescription() {
+ return "75:9: (op= ( EQUALS | NOTEQUALS | LT | GT | LTE | GTE ) e2= coverageArithmeticExpr )?";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA8_1 = input.LA(1);
+
+
+ int index8_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_1);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA8_14 = input.LA(1);
+
+
+ int index8_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_14);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA8_15 = input.LA(1);
+
+
+ int index8_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_15);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA8_16 = input.LA(1);
+
+
+ int index8_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_16);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA8_17 = input.LA(1);
+
+
+ int index8_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_17);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA8_18 = input.LA(1);
+
+
+ int index8_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred15_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 2;}
+
+
+ input.seek(index8_18);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 8, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA9_eotS =
+ "\77\uffff";
+ static final String DFA9_eofS =
+ "\1\1\76\uffff";
+ static final String DFA9_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA9_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA9_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA9_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA9_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\11\1\2\11\3\1\21\uffff\2\1\3\uffff"+
+ "\1\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA9_eot = DFA.unpackEncodedString(DFA9_eotS);
+ static final short[] DFA9_eof = DFA.unpackEncodedString(DFA9_eofS);
+ static final char[] DFA9_min = DFA.unpackEncodedStringToUnsignedChars(DFA9_minS);
+ static final char[] DFA9_max = DFA.unpackEncodedStringToUnsignedChars(DFA9_maxS);
+ static final short[] DFA9_accept = DFA.unpackEncodedString(DFA9_acceptS);
+ static final short[] DFA9_special = DFA.unpackEncodedString(DFA9_specialS);
+ static final short[][] DFA9_transition;
+
+ static {
+ int numStates = DFA9_transitionS.length;
+ DFA9_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA9_transition[i] = DFA.unpackEncodedString(DFA9_transitionS[i]);
+ }
+ }
+
+ class DFA9 extends DFA {
+
+ public DFA9(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 9;
+ this.eot = DFA9_eot;
+ this.eof = DFA9_eof;
+ this.min = DFA9_min;
+ this.max = DFA9_max;
+ this.accept = DFA9_accept;
+ this.special = DFA9_special;
+ this.transition = DFA9_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 79:9: (op= ( PLUS | MINUS ) e2= coverageArithmeticTerm )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA9_9 = input.LA(1);
+
+
+ int index9_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred17_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index9_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 9, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA10_eotS =
+ "\77\uffff";
+ static final String DFA10_eofS =
+ "\1\1\76\uffff";
+ static final String DFA10_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA10_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA10_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA10_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA10_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\13\1\2\11\1\1\21\uffff\2\1\3\uffff"+
+ "\1\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA10_eot = DFA.unpackEncodedString(DFA10_eotS);
+ static final short[] DFA10_eof = DFA.unpackEncodedString(DFA10_eofS);
+ static final char[] DFA10_min = DFA.unpackEncodedStringToUnsignedChars(DFA10_minS);
+ static final char[] DFA10_max = DFA.unpackEncodedStringToUnsignedChars(DFA10_maxS);
+ static final short[] DFA10_accept = DFA.unpackEncodedString(DFA10_acceptS);
+ static final short[] DFA10_special = DFA.unpackEncodedString(DFA10_specialS);
+ static final short[][] DFA10_transition;
+
+ static {
+ int numStates = DFA10_transitionS.length;
+ DFA10_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA10_transition[i] = DFA.unpackEncodedString(DFA10_transitionS[i]);
+ }
+ }
+
+ class DFA10 extends DFA {
+
+ public DFA10(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 10;
+ this.eot = DFA10_eot;
+ this.eof = DFA10_eof;
+ this.min = DFA10_min;
+ this.max = DFA10_max;
+ this.accept = DFA10_accept;
+ this.special = DFA10_special;
+ this.transition = DFA10_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 83:9: (op= ( MULT | DIVIDE ) e2= coverageArithmeticFactor )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA10_9 = input.LA(1);
+
+
+ int index10_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred19_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index10_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 10, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA11_eotS =
+ "\77\uffff";
+ static final String DFA11_eofS =
+ "\1\1\76\uffff";
+ static final String DFA11_minS =
+ "\1\7\10\uffff\1\0\65\uffff";
+ static final String DFA11_maxS =
+ "\1\140\10\uffff\1\0\65\uffff";
+ static final String DFA11_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA11_specialS =
+ "\11\uffff\1\0\65\uffff}>";
+ static final String[] DFA11_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\15\1\1\11\21\uffff\2\1\3\uffff\1\1"+
+ "\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA11_eot = DFA.unpackEncodedString(DFA11_eotS);
+ static final short[] DFA11_eof = DFA.unpackEncodedString(DFA11_eofS);
+ static final char[] DFA11_min = DFA.unpackEncodedStringToUnsignedChars(DFA11_minS);
+ static final char[] DFA11_max = DFA.unpackEncodedStringToUnsignedChars(DFA11_maxS);
+ static final short[] DFA11_accept = DFA.unpackEncodedString(DFA11_acceptS);
+ static final short[] DFA11_special = DFA.unpackEncodedString(DFA11_specialS);
+ static final short[][] DFA11_transition;
+
+ static {
+ int numStates = DFA11_transitionS.length;
+ DFA11_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA11_transition[i] = DFA.unpackEncodedString(DFA11_transitionS[i]);
+ }
+ }
+
+ class DFA11 extends DFA {
+
+ public DFA11(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 11;
+ this.eot = DFA11_eot;
+ this.eof = DFA11_eof;
+ this.min = DFA11_min;
+ this.max = DFA11_max;
+ this.accept = DFA11_accept;
+ this.special = DFA11_special;
+ this.transition = DFA11_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 87:9: (op= OVERLAY e2= coverageValue )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA11_9 = input.LA(1);
+
+
+ int index11_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred20_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index11_9);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 11, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA12_eotS =
+ "\52\uffff";
+ static final String DFA12_eofS =
+ "\52\uffff";
+ static final String DFA12_minS =
+ "\1\6\36\0\13\uffff";
+ static final String DFA12_maxS =
+ "\1\154\36\0\13\uffff";
+ static final String DFA12_acceptS =
+ "\37\uffff\1\1\2\uffff\1\2\4\uffff\1\3\1\4\1\5";
+ static final String DFA12_specialS =
+ "\1\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1\14"+
+ "\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\27\1\30\1\31"+
+ "\1\32\1\33\1\34\1\35\13\uffff}>";
+ static final String[] DFA12_transitionS = {
+ "\1\13\17\uffff\1\42\1\15\3\uffff\1\1\1\2\1\3\1\4\1\6\1\7\1\10"+
+ "\1\5\7\11\1\12\3\uffff\1\27\4\uffff\1\30\1\31\1\32\1\33\1\34"+
+ "\1\36\1\uffff\1\35\1\50\1\17\1\16\16\42\1\25\1\42\1\21\1\20"+
+ "\1\14\1\47\2\uffff\3\37\12\uffff\1\24\1\22\10\uffff\1\26\1\23",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
+ static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
+ static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
+ static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
+ static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
+ static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
+ static final short[][] DFA12_transition;
+
+ static {
+ int numStates = DFA12_transitionS.length;
+ DFA12_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
+ }
+ }
+
+ class DFA12 extends DFA {
+
+ public DFA12(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 12;
+ this.eot = DFA12_eot;
+ this.eof = DFA12_eof;
+ this.min = DFA12_min;
+ this.max = DFA12_max;
+ this.accept = DFA12_accept;
+ this.special = DFA12_special;
+ this.transition = DFA12_transition;
+ }
+ public String getDescription() {
+ return "89:1: coverageValue returns [CoverageExpr value] : (e5= subsetExpr | e2= unaryInducedExpr | e4= scaleExpr | e3= crsTransformExpr | e1= coverageAtom );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA12_1 = input.LA(1);
+
+
+ int index12_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_1);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA12_2 = input.LA(1);
+
+
+ int index12_2 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_2);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA12_3 = input.LA(1);
+
+
+ int index12_3 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_3);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA12_4 = input.LA(1);
+
+
+ int index12_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_4);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA12_5 = input.LA(1);
+
+
+ int index12_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_5);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA12_6 = input.LA(1);
+
+
+ int index12_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_6);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA12_7 = input.LA(1);
+
+
+ int index12_7 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_7);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA12_8 = input.LA(1);
+
+
+ int index12_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_8);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA12_9 = input.LA(1);
+
+
+ int index12_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_9);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA12_10 = input.LA(1);
+
+
+ int index12_10 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_10);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA12_11 = input.LA(1);
+
+
+ int index12_11 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_11);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA12_12 = input.LA(1);
+
+
+ int index12_12 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_12);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA12_13 = input.LA(1);
+
+
+ int index12_13 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_13);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA12_14 = input.LA(1);
+
+
+ int index12_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_14);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA12_15 = input.LA(1);
+
+
+ int index12_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_15);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA12_16 = input.LA(1);
+
+
+ int index12_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_16);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA12_17 = input.LA(1);
+
+
+ int index12_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_17);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA12_18 = input.LA(1);
+
+
+ int index12_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_18);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA12_19 = input.LA(1);
+
+
+ int index12_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_19);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA12_20 = input.LA(1);
+
+
+ int index12_20 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_20);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA12_21 = input.LA(1);
+
+
+ int index12_21 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_21);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA12_22 = input.LA(1);
+
+
+ int index12_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_22);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ int LA12_23 = input.LA(1);
+
+
+ int index12_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_23);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ int LA12_24 = input.LA(1);
+
+
+ int index12_24 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_24);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ int LA12_25 = input.LA(1);
+
+
+ int index12_25 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_25);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ int LA12_26 = input.LA(1);
+
+
+ int index12_26 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_26);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ int LA12_27 = input.LA(1);
+
+
+ int index12_27 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_27);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ int LA12_28 = input.LA(1);
+
+
+ int index12_28 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_28);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ int LA12_29 = input.LA(1);
+
+
+ int index12_29 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_29);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ int LA12_30 = input.LA(1);
+
+
+ int index12_30 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred21_wcps()) ) {s = 31;}
+
+ else if ( (synpred22_wcps()) ) {s = 34;}
+
+ else if ( (true) ) {s = 41;}
+
+
+ input.seek(index12_30);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 12, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA13_eotS =
+ "\112\uffff";
+ static final String DFA13_eofS =
+ "\112\uffff";
+ static final String DFA13_minS =
+ "\1\6\12\uffff\1\6\13\uffff\1\116\7\uffff\25\0\23\uffff\1\0\2\uffff";
+ static final String DFA13_maxS =
+ "\1\154\12\uffff\1\154\13\uffff\1\153\7\uffff\25\0\23\uffff\1\0\2"+
+ "\uffff";
+ static final String DFA13_acceptS =
+ "\1\uffff\1\1\24\uffff\1\2\1\uffff\1\6\4\uffff\1\7\26\uffff\1\3\23"+
+ "\uffff\1\4\1\5";
+ static final String DFA13_specialS =
+ "\37\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1"+
+ "\14\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\23\uffff\1\25\2\uffff}>";
+ static final String[] DFA13_transitionS = {
+ "\1\13\20\uffff\1\1\3\uffff\20\1\3\uffff\1\27\4\uffff\5\30\1"+
+ "\35\1\uffff\1\35\1\uffff\2\1\16\uffff\1\1\1\uffff\3\1\20\uffff"+
+ "\2\1\10\uffff\1\26\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\52\17\uffff\1\64\1\54\3\uffff\1\40\1\41\1\42\1\43\1\45\1"+
+ "\46\1\47\1\44\7\50\1\51\3\uffff\1\64\4\uffff\6\64\1\uffff\2"+
+ "\64\1\56\1\55\16\64\1\63\1\64\1\60\1\57\1\53\1\64\2\uffff\3"+
+ "\64\12\uffff\1\62\1\37\10\uffff\1\64\1\61",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\107\1\uffff\1\107\32\uffff\1\107",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ ""
+ };
+
+ static final short[] DFA13_eot = DFA.unpackEncodedString(DFA13_eotS);
+ static final short[] DFA13_eof = DFA.unpackEncodedString(DFA13_eofS);
+ static final char[] DFA13_min = DFA.unpackEncodedStringToUnsignedChars(DFA13_minS);
+ static final char[] DFA13_max = DFA.unpackEncodedStringToUnsignedChars(DFA13_maxS);
+ static final short[] DFA13_accept = DFA.unpackEncodedString(DFA13_acceptS);
+ static final short[] DFA13_special = DFA.unpackEncodedString(DFA13_specialS);
+ static final short[][] DFA13_transition;
+
+ static {
+ int numStates = DFA13_transitionS.length;
+ DFA13_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA13_transition[i] = DFA.unpackEncodedString(DFA13_transitionS[i]);
+ }
+ }
+
+ class DFA13 extends DFA {
+
+ public DFA13(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 13;
+ this.eot = DFA13_eot;
+ this.eof = DFA13_eof;
+ this.min = DFA13_min;
+ this.max = DFA13_max;
+ this.accept = DFA13_accept;
+ this.special = DFA13_special;
+ this.transition = DFA13_transition;
+ }
+ public String getDescription() {
+ return "96:1: coverageAtom returns [CoverageExpr value] : (e2= scalarExpr | e1= coverageVariable | LPAREN e7= coverageExpr RPAREN | e3= coverageConstantExpr | e4= coverageConstructorExpr | e5= setMetaDataExpr | e6= rangeConstructorExpr );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA13_31 = input.LA(1);
+
+
+ int index13_31 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_31);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA13_32 = input.LA(1);
+
+
+ int index13_32 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_32);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA13_33 = input.LA(1);
+
+
+ int index13_33 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_33);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA13_34 = input.LA(1);
+
+
+ int index13_34 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_34);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA13_35 = input.LA(1);
+
+
+ int index13_35 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_35);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA13_36 = input.LA(1);
+
+
+ int index13_36 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_36);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA13_37 = input.LA(1);
+
+
+ int index13_37 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_37);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA13_38 = input.LA(1);
+
+
+ int index13_38 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_38);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA13_39 = input.LA(1);
+
+
+ int index13_39 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_39);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA13_40 = input.LA(1);
+
+
+ int index13_40 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_40);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA13_41 = input.LA(1);
+
+
+ int index13_41 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_41);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA13_42 = input.LA(1);
+
+
+ int index13_42 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_42);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA13_43 = input.LA(1);
+
+
+ int index13_43 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_43);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA13_44 = input.LA(1);
+
+
+ int index13_44 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_44);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA13_45 = input.LA(1);
+
+
+ int index13_45 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_45);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA13_46 = input.LA(1);
+
+
+ int index13_46 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_46);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA13_47 = input.LA(1);
+
+
+ int index13_47 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_47);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA13_48 = input.LA(1);
+
+
+ int index13_48 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_48);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA13_49 = input.LA(1);
+
+
+ int index13_49 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_49);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA13_50 = input.LA(1);
+
+
+ int index13_50 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_50);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA13_51 = input.LA(1);
+
+
+ int index13_51 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred25_wcps()) ) {s = 1;}
+
+ else if ( (synpred27_wcps()) ) {s = 52;}
+
+
+ input.seek(index13_51);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA13_71 = input.LA(1);
+
+
+ int index13_71 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred28_wcps()) ) {s = 72;}
+
+ else if ( (synpred29_wcps()) ) {s = 73;}
+
+
+ input.seek(index13_71);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 13, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA14_eotS =
+ "\u0091\uffff";
+ static final String DFA14_eofS =
+ "\14\uffff\1\56\u0084\uffff";
+ static final String DFA14_minS =
+ "\2\6\7\uffff\1\6\1\15\1\6\1\7\4\6\3\0\2\uffff\16\0\7\uffff\3\0\4"+
+ "\uffff\1\0\4\uffff\5\0\7\uffff\15\0\101\uffff";
+ static final String DFA14_maxS =
+ "\1\154\1\6\7\uffff\1\6\1\51\1\154\1\140\1\154\3\6\3\0\2\uffff\16"+
+ "\0\7\uffff\3\0\4\uffff\1\0\4\uffff\5\0\7\uffff\15\0\101\uffff";
+ static final String DFA14_acceptS =
+ "\2\uffff\1\1\21\uffff\1\3\17\uffff\1\6\11\uffff\1\5\66\uffff\1\4"+
+ "\52\uffff\1\2";
+ static final String DFA14_specialS =
+ "\21\uffff\1\0\1\1\1\2\2\uffff\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12"+
+ "\1\13\1\14\1\15\1\16\1\17\1\20\7\uffff\1\21\1\22\1\23\4\uffff\1"+
+ "\24\4\uffff\1\25\1\26\1\27\1\30\1\31\7\uffff\1\32\1\33\1\34\1\35"+
+ "\1\36\1\37\1\40\1\41\1\42\1\43\1\44\1\45\1\46\101\uffff}>";
+ static final String[] DFA14_transitionS = {
+ "\1\13\20\uffff\1\15\3\uffff\1\1\7\2\7\11\1\12\21\uffff\1\17"+
+ "\1\16\16\uffff\1\24\1\uffff\1\21\1\20\1\14\20\uffff\1\24\1\22"+
+ "\11\uffff\1\23",
+ "\1\26",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\27",
+ "\1\30\1\uffff\1\30\6\uffff\1\30\1\uffff\1\30\17\uffff\2\30",
+ "\1\32\20\uffff\1\33\3\uffff\1\43\7\44\7\40\1\41\21\uffff\1"+
+ "\35\1\34\16\uffff\1\55\1\uffff\1\37\1\36\1\53\20\uffff\1\54"+
+ "\1\31\11\uffff\1\42",
+ "\2\56\1\uffff\1\56\2\uffff\3\56\1\62\1\67\1\70\1\71\1\72\1"+
+ "\73\5\56\21\uffff\2\56\3\uffff\1\56\7\uffff\1\56\30\uffff\1"+
+ "\56\15\uffff\1\56",
+ "\1\103\20\uffff\1\104\13\uffff\7\112\1\113\21\uffff\1\106\1"+
+ "\105\20\uffff\1\110\1\107\22\uffff\1\111\11\uffff\1\114",
+ "\1\115",
+ "\1\116",
+ "\1\117",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA14_eot = DFA.unpackEncodedString(DFA14_eotS);
+ static final short[] DFA14_eof = DFA.unpackEncodedString(DFA14_eofS);
+ static final char[] DFA14_min = DFA.unpackEncodedStringToUnsignedChars(DFA14_minS);
+ static final char[] DFA14_max = DFA.unpackEncodedStringToUnsignedChars(DFA14_maxS);
+ static final short[] DFA14_accept = DFA.unpackEncodedString(DFA14_acceptS);
+ static final short[] DFA14_special = DFA.unpackEncodedString(DFA14_specialS);
+ static final short[][] DFA14_transition;
+
+ static {
+ int numStates = DFA14_transitionS.length;
+ DFA14_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA14_transition[i] = DFA.unpackEncodedString(DFA14_transitionS[i]);
+ }
+ }
+
+ class DFA14 extends DFA {
+
+ public DFA14(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 14;
+ this.eot = DFA14_eot;
+ this.eof = DFA14_eof;
+ this.min = DFA14_min;
+ this.max = DFA14_max;
+ this.accept = DFA14_accept;
+ this.special = DFA14_special;
+ this.transition = DFA14_transition;
+ }
+ public String getDescription() {
+ return "105:1: scalarExpr returns [ScalarExpr value] : (e1= metaDataExpr | e2= condenseExpr | e3= booleanScalarExpr | e4= numericScalarExpr | e5= stringScalarExpr | LPAREN e6= scalarExpr RPAREN );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA14_17 = input.LA(1);
+
+
+ int index14_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_17);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA14_18 = input.LA(1);
+
+
+ int index14_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_18);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA14_19 = input.LA(1);
+
+
+ int index14_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_19);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA14_22 = input.LA(1);
+
+
+ int index14_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred31_wcps()) ) {s = 2;}
+
+ else if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_22);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA14_23 = input.LA(1);
+
+
+ int index14_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred32_wcps()) ) {s = 144;}
+
+ else if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_23);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA14_24 = input.LA(1);
+
+
+ int index14_24 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred32_wcps()) ) {s = 144;}
+
+ else if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_24);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA14_25 = input.LA(1);
+
+
+ int index14_25 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_25);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA14_26 = input.LA(1);
+
+
+ int index14_26 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_26);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA14_27 = input.LA(1);
+
+
+ int index14_27 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_27);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA14_28 = input.LA(1);
+
+
+ int index14_28 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_28);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA14_29 = input.LA(1);
+
+
+ int index14_29 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_29);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA14_30 = input.LA(1);
+
+
+ int index14_30 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_30);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA14_31 = input.LA(1);
+
+
+ int index14_31 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_31);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA14_32 = input.LA(1);
+
+
+ int index14_32 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_32);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA14_33 = input.LA(1);
+
+
+ int index14_33 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_33);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA14_34 = input.LA(1);
+
+
+ int index14_34 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_34);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA14_35 = input.LA(1);
+
+
+ int index14_35 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_35);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA14_43 = input.LA(1);
+
+
+ int index14_43 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_43);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA14_44 = input.LA(1);
+
+
+ int index14_44 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_44);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA14_45 = input.LA(1);
+
+
+ int index14_45 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (true) ) {s = 36;}
+
+
+ input.seek(index14_45);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA14_50 = input.LA(1);
+
+
+ int index14_50 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_50);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA14_55 = input.LA(1);
+
+
+ int index14_55 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_55);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ int LA14_56 = input.LA(1);
+
+
+ int index14_56 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_56);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ int LA14_57 = input.LA(1);
+
+
+ int index14_57 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_57);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ int LA14_58 = input.LA(1);
+
+
+ int index14_58 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_58);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ int LA14_59 = input.LA(1);
+
+
+ int index14_59 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred35_wcps()) ) {s = 46;}
+
+
+ input.seek(index14_59);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ int LA14_67 = input.LA(1);
+
+
+ int index14_67 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_67);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ int LA14_68 = input.LA(1);
+
+
+ int index14_68 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_68);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ int LA14_69 = input.LA(1);
+
+
+ int index14_69 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_69);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ int LA14_70 = input.LA(1);
+
+
+ int index14_70 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_70);
+ if ( s>=0 ) return s;
+ break;
+ case 30 :
+ int LA14_71 = input.LA(1);
+
+
+ int index14_71 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_71);
+ if ( s>=0 ) return s;
+ break;
+ case 31 :
+ int LA14_72 = input.LA(1);
+
+
+ int index14_72 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_72);
+ if ( s>=0 ) return s;
+ break;
+ case 32 :
+ int LA14_73 = input.LA(1);
+
+
+ int index14_73 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_73);
+ if ( s>=0 ) return s;
+ break;
+ case 33 :
+ int LA14_74 = input.LA(1);
+
+
+ int index14_74 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_74);
+ if ( s>=0 ) return s;
+ break;
+ case 34 :
+ int LA14_75 = input.LA(1);
+
+
+ int index14_75 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_75);
+ if ( s>=0 ) return s;
+ break;
+ case 35 :
+ int LA14_76 = input.LA(1);
+
+
+ int index14_76 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_76);
+ if ( s>=0 ) return s;
+ break;
+ case 36 :
+ int LA14_77 = input.LA(1);
+
+
+ int index14_77 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_77);
+ if ( s>=0 ) return s;
+ break;
+ case 37 :
+ int LA14_78 = input.LA(1);
+
+
+ int index14_78 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_78);
+ if ( s>=0 ) return s;
+ break;
+ case 38 :
+ int LA14_79 = input.LA(1);
+
+
+ int index14_79 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred33_wcps()) ) {s = 20;}
+
+ else if ( (synpred34_wcps()) ) {s = 101;}
+
+
+ input.seek(index14_79);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 14, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA34_eotS =
+ "\u0099\uffff";
+ static final String DFA34_eofS =
+ "\u0099\uffff";
+ static final String DFA34_minS =
+ "\1\6\12\uffff\1\6\1\uffff\3\6\5\uffff\1\6\7\uffff\1\70\1\116\57"+
+ "\uffff\12\0\24\uffff\3\0\7\uffff\14\0\24\uffff\2\0\1\uffff";
+ static final String DFA34_maxS =
+ "\1\154\12\uffff\1\154\1\uffff\1\154\2\6\5\uffff\1\154\7\uffff\1"+
+ "\70\1\153\57\uffff\12\0\24\uffff\3\0\7\uffff\14\0\24\uffff\2\0\1"+
+ "\uffff";
+ static final String DFA34_acceptS =
+ "\1\uffff\1\1\35\uffff\1\2\1\uffff\1\3\1\4\1\5\16\uffff\1\6\145\uffff"+
+ "\1\7";
+ static final String DFA34_specialS =
+ "\116\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\24\uffff\1"+
+ "\12\1\13\1\14\7\uffff\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1"+
+ "\25\1\26\1\27\1\30\24\uffff\1\31\1\32\1\uffff}>";
+ static final String[] DFA34_transitionS = {
+ "\1\13\17\uffff\1\37\1\15\3\uffff\20\1\3\uffff\1\1\4\uffff\5"+
+ "\1\1\36\1\uffff\1\35\1\uffff\1\17\1\16\2\37\3\41\11\42\1\25"+
+ "\1\43\3\1\20\uffff\2\1\10\uffff\2\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\1\17\uffff\2\1\3\uffff\20\1\3\uffff\1\1\4\uffff\6\1\1\uffff"+
+ "\30\1\2\uffff\3\1\11\62\1\uffff\2\1\10\uffff\2\1",
+ "",
+ "\1\116\20\uffff\1\117\3\uffff\10\37\7\125\1\126\3\uffff\1\37"+
+ "\4\uffff\6\37\1\uffff\1\37\1\uffff\1\121\1\120\16\uffff\1\37"+
+ "\1\uffff\1\123\1\122\1\37\20\uffff\1\37\1\124\10\uffff\1\37"+
+ "\1\127",
+ "\1\154",
+ "\1\155",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\170\17\uffff\1\43\1\172\3\uffff\1\156\7\43\7\166\1\167\3"+
+ "\uffff\1\43\4\uffff\6\43\1\uffff\2\43\1\174\1\173\20\43\1\176"+
+ "\1\175\1\171\1\43\2\uffff\3\43\12\uffff\1\u0081\1\177\10\uffff"+
+ "\1\43\1\u0080",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\u0096",
+ "\1\u0097\1\uffff\1\u0097\32\uffff\1\u0097",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ ""
+ };
+
+ static final short[] DFA34_eot = DFA.unpackEncodedString(DFA34_eotS);
+ static final short[] DFA34_eof = DFA.unpackEncodedString(DFA34_eofS);
+ static final char[] DFA34_min = DFA.unpackEncodedStringToUnsignedChars(DFA34_minS);
+ static final char[] DFA34_max = DFA.unpackEncodedStringToUnsignedChars(DFA34_maxS);
+ static final short[] DFA34_accept = DFA.unpackEncodedString(DFA34_acceptS);
+ static final short[] DFA34_special = DFA.unpackEncodedString(DFA34_specialS);
+ static final short[][] DFA34_transition;
+
+ static {
+ int numStates = DFA34_transitionS.length;
+ DFA34_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA34_transition[i] = DFA.unpackEncodedString(DFA34_transitionS[i]);
+ }
+ }
+
+ class DFA34 extends DFA {
+
+ public DFA34(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 34;
+ this.eot = DFA34_eot;
+ this.eof = DFA34_eof;
+ this.min = DFA34_min;
+ this.max = DFA34_max;
+ this.accept = DFA34_accept;
+ this.special = DFA34_special;
+ this.transition = DFA34_transition;
+ }
+ public String getDescription() {
+ return "203:1: unaryInducedExpr returns [CoverageExpr value] : (e6= fieldExpr | e1= unaryArithmeticExpr | e2= exponentialExpr | e3= trigonometricExpr | e4= booleanExpr | e5= castExpr | e7= rangeConstructorExpr );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA34_78 = input.LA(1);
+
+
+ int index34_78 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_78);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA34_79 = input.LA(1);
+
+
+ int index34_79 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_79);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA34_80 = input.LA(1);
+
+
+ int index34_80 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_80);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA34_81 = input.LA(1);
+
+
+ int index34_81 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_81);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA34_82 = input.LA(1);
+
+
+ int index34_82 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_82);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA34_83 = input.LA(1);
+
+
+ int index34_83 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_83);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA34_84 = input.LA(1);
+
+
+ int index34_84 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_84);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA34_85 = input.LA(1);
+
+
+ int index34_85 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_85);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA34_86 = input.LA(1);
+
+
+ int index34_86 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_86);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA34_87 = input.LA(1);
+
+
+ int index34_87 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_87);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA34_108 = input.LA(1);
+
+
+ int index34_108 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_108);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA34_109 = input.LA(1);
+
+
+ int index34_109 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred71_wcps()) ) {s = 31;}
+
+
+ input.seek(index34_109);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA34_110 = input.LA(1);
+
+
+ int index34_110 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_110);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA34_118 = input.LA(1);
+
+
+ int index34_118 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_118);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA34_119 = input.LA(1);
+
+
+ int index34_119 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_119);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA34_120 = input.LA(1);
+
+
+ int index34_120 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_120);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA34_121 = input.LA(1);
+
+
+ int index34_121 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_121);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA34_122 = input.LA(1);
+
+
+ int index34_122 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_122);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA34_123 = input.LA(1);
+
+
+ int index34_123 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_123);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA34_124 = input.LA(1);
+
+
+ int index34_124 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_124);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA34_125 = input.LA(1);
+
+
+ int index34_125 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_125);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA34_126 = input.LA(1);
+
+
+ int index34_126 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_126);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ int LA34_127 = input.LA(1);
+
+
+ int index34_127 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_127);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ int LA34_128 = input.LA(1);
+
+
+ int index34_128 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_128);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ int LA34_129 = input.LA(1);
+
+
+ int index34_129 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (synpred74_wcps()) ) {s = 35;}
+
+
+ input.seek(index34_129);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ int LA34_150 = input.LA(1);
+
+
+ int index34_150 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (true) ) {s = 152;}
+
+
+ input.seek(index34_150);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ int LA34_151 = input.LA(1);
+
+
+ int index34_151 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred70_wcps()) ) {s = 1;}
+
+ else if ( (true) ) {s = 152;}
+
+
+ input.seek(index34_151);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 34, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA42_eotS =
+ "\u009c\uffff";
+ static final String DFA42_eofS =
+ "\u009c\uffff";
+ static final String DFA42_minS =
+ "\12\6\1\15\1\6\1\20\4\6\3\20\1\15\1\6\1\122\1\116\5\6\1\70\1\116"+
+ "\3\uffff\172\0";
+ static final String DFA42_maxS =
+ "\1\154\11\6\1\51\1\154\1\122\1\154\3\6\4\122\1\154\1\122\1\153\5"+
+ "\6\1\70\1\153\3\uffff\172\0";
+ static final String DFA42_acceptS =
+ "\37\uffff\1\1\1\2\1\3\172\uffff";
+ static final String DFA42_specialS =
+ "\42\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1"+
+ "\14\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\27\1\30"+
+ "\1\31\1\32\1\33\1\34\1\35\1\36\1\37\1\40\1\41\1\42\1\43\1\44\1\45"+
+ "\1\46\1\47\1\50\1\51\1\52\1\53\1\54\1\55\1\56\1\57\1\60\1\61\1\62"+
+ "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72\1\73\1\74\1\75\1\76\1\77"+
+ "\1\100\1\101\1\102\1\103\1\104\1\105\1\106\1\107\1\110\1\111\1\112"+
+ "\1\113\1\114\1\115\1\116\1\117\1\120\1\121\1\122\1\123\1\124\1\125"+
+ "\1\126\1\127\1\130\1\131\1\132\1\133\1\134\1\135\1\136\1\137\1\140"+
+ "\1\141\1\142\1\143\1\144\1\145\1\146\1\147\1\150\1\151\1\152\1\153"+
+ "\1\154\1\155\1\156\1\157\1\160\1\161\1\162\1\163\1\164\1\165\1\166"+
+ "\1\167\1\170\1\171}>";
+ static final String[] DFA42_transitionS = {
+ "\1\13\20\uffff\1\15\3\uffff\1\1\1\2\1\3\1\4\1\6\1\7\1\10\1\5"+
+ "\7\11\1\12\3\uffff\1\27\4\uffff\1\30\1\31\1\32\1\33\1\34\1\36"+
+ "\1\uffff\1\35\1\uffff\1\17\1\16\16\uffff\1\25\1\uffff\1\21\1"+
+ "\20\1\14\3\uffff\1\37\1\40\1\41\12\uffff\1\24\1\22\10\uffff"+
+ "\1\26\1\23",
+ "\1\42",
+ "\1\43",
+ "\1\44",
+ "\1\45",
+ "\1\46",
+ "\1\47",
+ "\1\50",
+ "\1\51",
+ "\1\52",
+ "\1\53\1\uffff\1\53\6\uffff\1\53\1\uffff\1\53\17\uffff\2\53",
+ "\1\55\17\uffff\1\115\1\56\3\uffff\1\66\1\72\1\73\1\74\1\76"+
+ "\1\77\1\100\1\75\7\63\1\64\3\uffff\1\102\4\uffff\1\103\1\104"+
+ "\1\105\1\106\1\107\1\111\1\uffff\1\110\1\123\1\60\1\57\2\116"+
+ "\3\117\11\120\1\71\1\121\1\62\1\61\1\67\1\122\2\uffff\1\112"+
+ "\1\113\1\114\12\uffff\1\70\1\54\10\uffff\1\101\1\65",
+ "\1\124\1\125\1\126\1\127\1\130\1\131\74\uffff\1\132",
+ "\1\133\20\uffff\1\134\13\uffff\7\142\1\143\21\uffff\1\136\1"+
+ "\135\20\uffff\1\140\1\137\22\uffff\1\141\11\uffff\1\144",
+ "\1\145",
+ "\1\146",
+ "\1\147",
+ "\1\152\1\153\1\154\1\155\1\156\1\157\2\151\2\150\70\uffff\1"+
+ "\160",
+ "\1\164\1\165\1\166\1\167\1\170\1\171\2\162\2\161\70\uffff\1"+
+ "\163",
+ "\1\175\1\176\1\177\1\u0080\1\u0081\1\u0082\2\173\2\172\70\uffff"+
+ "\1\174",
+ "\2\u0084\1\u0083\102\uffff\1\u0085",
+ "\1\u0086\20\uffff\1\u0089\3\uffff\1\u0087\7\uffff\7\u008f\1"+
+ "\u0090\21\uffff\1\u008b\1\u008a\20\uffff\1\u008d\1\u008c\1\u0088"+
+ "\20\uffff\1\u0092\1\u008e\11\uffff\1\u0091",
+ "\1\u0093",
+ "\1\u0094\1\uffff\1\u0094\32\uffff\1\u0094",
+ "\1\u0095",
+ "\1\u0096",
+ "\1\u0097",
+ "\1\u0098",
+ "\1\u0099",
+ "\1\u009a",
+ "\1\u009b\1\uffff\1\u009b\32\uffff\1\u009b",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff"
+ };
+
+ static final short[] DFA42_eot = DFA.unpackEncodedString(DFA42_eotS);
+ static final short[] DFA42_eof = DFA.unpackEncodedString(DFA42_eofS);
+ static final char[] DFA42_min = DFA.unpackEncodedStringToUnsignedChars(DFA42_minS);
+ static final char[] DFA42_max = DFA.unpackEncodedStringToUnsignedChars(DFA42_maxS);
+ static final short[] DFA42_accept = DFA.unpackEncodedString(DFA42_acceptS);
+ static final short[] DFA42_special = DFA.unpackEncodedString(DFA42_specialS);
+ static final short[][] DFA42_transition;
+
+ static {
+ int numStates = DFA42_transitionS.length;
+ DFA42_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA42_transition[i] = DFA.unpackEncodedString(DFA42_transitionS[i]);
+ }
+ }
+
+ class DFA42 extends DFA {
+
+ public DFA42(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 42;
+ this.eot = DFA42_eot;
+ this.eof = DFA42_eof;
+ this.min = DFA42_min;
+ this.max = DFA42_max;
+ this.accept = DFA42_accept;
+ this.special = DFA42_special;
+ this.transition = DFA42_transition;
+ }
+ public String getDescription() {
+ return "250:1: subsetExpr returns [SubsetExpr value] : (e1= trimExpr | e2= sliceExpr | e3= extendExpr );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA42_34 = input.LA(1);
+
+
+ int index42_34 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_34);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA42_35 = input.LA(1);
+
+
+ int index42_35 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_35);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA42_36 = input.LA(1);
+
+
+ int index42_36 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_36);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA42_37 = input.LA(1);
+
+
+ int index42_37 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_37);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA42_38 = input.LA(1);
+
+
+ int index42_38 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_38);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA42_39 = input.LA(1);
+
+
+ int index42_39 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_39);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA42_40 = input.LA(1);
+
+
+ int index42_40 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_40);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA42_41 = input.LA(1);
+
+
+ int index42_41 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_41);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA42_42 = input.LA(1);
+
+
+ int index42_42 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_42);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA42_43 = input.LA(1);
+
+
+ int index42_43 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_43);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ int LA42_44 = input.LA(1);
+
+
+ int index42_44 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_44);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ int LA42_45 = input.LA(1);
+
+
+ int index42_45 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_45);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ int LA42_46 = input.LA(1);
+
+
+ int index42_46 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_46);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ int LA42_47 = input.LA(1);
+
+
+ int index42_47 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_47);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ int LA42_48 = input.LA(1);
+
+
+ int index42_48 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_48);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ int LA42_49 = input.LA(1);
+
+
+ int index42_49 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_49);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ int LA42_50 = input.LA(1);
+
+
+ int index42_50 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_50);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ int LA42_51 = input.LA(1);
+
+
+ int index42_51 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_51);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ int LA42_52 = input.LA(1);
+
+
+ int index42_52 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_52);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ int LA42_53 = input.LA(1);
+
+
+ int index42_53 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_53);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ int LA42_54 = input.LA(1);
+
+
+ int index42_54 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_54);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ int LA42_55 = input.LA(1);
+
+
+ int index42_55 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_55);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ int LA42_56 = input.LA(1);
+
+
+ int index42_56 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_56);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ int LA42_57 = input.LA(1);
+
+
+ int index42_57 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_57);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ int LA42_58 = input.LA(1);
+
+
+ int index42_58 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_58);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ int LA42_59 = input.LA(1);
+
+
+ int index42_59 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_59);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ int LA42_60 = input.LA(1);
+
+
+ int index42_60 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_60);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ int LA42_61 = input.LA(1);
+
+
+ int index42_61 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_61);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ int LA42_62 = input.LA(1);
+
+
+ int index42_62 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_62);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ int LA42_63 = input.LA(1);
+
+
+ int index42_63 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_63);
+ if ( s>=0 ) return s;
+ break;
+ case 30 :
+ int LA42_64 = input.LA(1);
+
+
+ int index42_64 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_64);
+ if ( s>=0 ) return s;
+ break;
+ case 31 :
+ int LA42_65 = input.LA(1);
+
+
+ int index42_65 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_65);
+ if ( s>=0 ) return s;
+ break;
+ case 32 :
+ int LA42_66 = input.LA(1);
+
+
+ int index42_66 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_66);
+ if ( s>=0 ) return s;
+ break;
+ case 33 :
+ int LA42_67 = input.LA(1);
+
+
+ int index42_67 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_67);
+ if ( s>=0 ) return s;
+ break;
+ case 34 :
+ int LA42_68 = input.LA(1);
+
+
+ int index42_68 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_68);
+ if ( s>=0 ) return s;
+ break;
+ case 35 :
+ int LA42_69 = input.LA(1);
+
+
+ int index42_69 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_69);
+ if ( s>=0 ) return s;
+ break;
+ case 36 :
+ int LA42_70 = input.LA(1);
+
+
+ int index42_70 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_70);
+ if ( s>=0 ) return s;
+ break;
+ case 37 :
+ int LA42_71 = input.LA(1);
+
+
+ int index42_71 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_71);
+ if ( s>=0 ) return s;
+ break;
+ case 38 :
+ int LA42_72 = input.LA(1);
+
+
+ int index42_72 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_72);
+ if ( s>=0 ) return s;
+ break;
+ case 39 :
+ int LA42_73 = input.LA(1);
+
+
+ int index42_73 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_73);
+ if ( s>=0 ) return s;
+ break;
+ case 40 :
+ int LA42_74 = input.LA(1);
+
+
+ int index42_74 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_74);
+ if ( s>=0 ) return s;
+ break;
+ case 41 :
+ int LA42_75 = input.LA(1);
+
+
+ int index42_75 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_75);
+ if ( s>=0 ) return s;
+ break;
+ case 42 :
+ int LA42_76 = input.LA(1);
+
+
+ int index42_76 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_76);
+ if ( s>=0 ) return s;
+ break;
+ case 43 :
+ int LA42_77 = input.LA(1);
+
+
+ int index42_77 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_77);
+ if ( s>=0 ) return s;
+ break;
+ case 44 :
+ int LA42_78 = input.LA(1);
+
+
+ int index42_78 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_78);
+ if ( s>=0 ) return s;
+ break;
+ case 45 :
+ int LA42_79 = input.LA(1);
+
+
+ int index42_79 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_79);
+ if ( s>=0 ) return s;
+ break;
+ case 46 :
+ int LA42_80 = input.LA(1);
+
+
+ int index42_80 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_80);
+ if ( s>=0 ) return s;
+ break;
+ case 47 :
+ int LA42_81 = input.LA(1);
+
+
+ int index42_81 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_81);
+ if ( s>=0 ) return s;
+ break;
+ case 48 :
+ int LA42_82 = input.LA(1);
+
+
+ int index42_82 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_82);
+ if ( s>=0 ) return s;
+ break;
+ case 49 :
+ int LA42_83 = input.LA(1);
+
+
+ int index42_83 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_83);
+ if ( s>=0 ) return s;
+ break;
+ case 50 :
+ int LA42_84 = input.LA(1);
+
+
+ int index42_84 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_84);
+ if ( s>=0 ) return s;
+ break;
+ case 51 :
+ int LA42_85 = input.LA(1);
+
+
+ int index42_85 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_85);
+ if ( s>=0 ) return s;
+ break;
+ case 52 :
+ int LA42_86 = input.LA(1);
+
+
+ int index42_86 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_86);
+ if ( s>=0 ) return s;
+ break;
+ case 53 :
+ int LA42_87 = input.LA(1);
+
+
+ int index42_87 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_87);
+ if ( s>=0 ) return s;
+ break;
+ case 54 :
+ int LA42_88 = input.LA(1);
+
+
+ int index42_88 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_88);
+ if ( s>=0 ) return s;
+ break;
+ case 55 :
+ int LA42_89 = input.LA(1);
+
+
+ int index42_89 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_89);
+ if ( s>=0 ) return s;
+ break;
+ case 56 :
+ int LA42_90 = input.LA(1);
+
+
+ int index42_90 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_90);
+ if ( s>=0 ) return s;
+ break;
+ case 57 :
+ int LA42_91 = input.LA(1);
+
+
+ int index42_91 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_91);
+ if ( s>=0 ) return s;
+ break;
+ case 58 :
+ int LA42_92 = input.LA(1);
+
+
+ int index42_92 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_92);
+ if ( s>=0 ) return s;
+ break;
+ case 59 :
+ int LA42_93 = input.LA(1);
+
+
+ int index42_93 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_93);
+ if ( s>=0 ) return s;
+ break;
+ case 60 :
+ int LA42_94 = input.LA(1);
+
+
+ int index42_94 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_94);
+ if ( s>=0 ) return s;
+ break;
+ case 61 :
+ int LA42_95 = input.LA(1);
+
+
+ int index42_95 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_95);
+ if ( s>=0 ) return s;
+ break;
+ case 62 :
+ int LA42_96 = input.LA(1);
+
+
+ int index42_96 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_96);
+ if ( s>=0 ) return s;
+ break;
+ case 63 :
+ int LA42_97 = input.LA(1);
+
+
+ int index42_97 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_97);
+ if ( s>=0 ) return s;
+ break;
+ case 64 :
+ int LA42_98 = input.LA(1);
+
+
+ int index42_98 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_98);
+ if ( s>=0 ) return s;
+ break;
+ case 65 :
+ int LA42_99 = input.LA(1);
+
+
+ int index42_99 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_99);
+ if ( s>=0 ) return s;
+ break;
+ case 66 :
+ int LA42_100 = input.LA(1);
+
+
+ int index42_100 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_100);
+ if ( s>=0 ) return s;
+ break;
+ case 67 :
+ int LA42_101 = input.LA(1);
+
+
+ int index42_101 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_101);
+ if ( s>=0 ) return s;
+ break;
+ case 68 :
+ int LA42_102 = input.LA(1);
+
+
+ int index42_102 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_102);
+ if ( s>=0 ) return s;
+ break;
+ case 69 :
+ int LA42_103 = input.LA(1);
+
+
+ int index42_103 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_103);
+ if ( s>=0 ) return s;
+ break;
+ case 70 :
+ int LA42_104 = input.LA(1);
+
+
+ int index42_104 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_104);
+ if ( s>=0 ) return s;
+ break;
+ case 71 :
+ int LA42_105 = input.LA(1);
+
+
+ int index42_105 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_105);
+ if ( s>=0 ) return s;
+ break;
+ case 72 :
+ int LA42_106 = input.LA(1);
+
+
+ int index42_106 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_106);
+ if ( s>=0 ) return s;
+ break;
+ case 73 :
+ int LA42_107 = input.LA(1);
+
+
+ int index42_107 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_107);
+ if ( s>=0 ) return s;
+ break;
+ case 74 :
+ int LA42_108 = input.LA(1);
+
+
+ int index42_108 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_108);
+ if ( s>=0 ) return s;
+ break;
+ case 75 :
+ int LA42_109 = input.LA(1);
+
+
+ int index42_109 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_109);
+ if ( s>=0 ) return s;
+ break;
+ case 76 :
+ int LA42_110 = input.LA(1);
+
+
+ int index42_110 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_110);
+ if ( s>=0 ) return s;
+ break;
+ case 77 :
+ int LA42_111 = input.LA(1);
+
+
+ int index42_111 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_111);
+ if ( s>=0 ) return s;
+ break;
+ case 78 :
+ int LA42_112 = input.LA(1);
+
+
+ int index42_112 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_112);
+ if ( s>=0 ) return s;
+ break;
+ case 79 :
+ int LA42_113 = input.LA(1);
+
+
+ int index42_113 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_113);
+ if ( s>=0 ) return s;
+ break;
+ case 80 :
+ int LA42_114 = input.LA(1);
+
+
+ int index42_114 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_114);
+ if ( s>=0 ) return s;
+ break;
+ case 81 :
+ int LA42_115 = input.LA(1);
+
+
+ int index42_115 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_115);
+ if ( s>=0 ) return s;
+ break;
+ case 82 :
+ int LA42_116 = input.LA(1);
+
+
+ int index42_116 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_116);
+ if ( s>=0 ) return s;
+ break;
+ case 83 :
+ int LA42_117 = input.LA(1);
+
+
+ int index42_117 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_117);
+ if ( s>=0 ) return s;
+ break;
+ case 84 :
+ int LA42_118 = input.LA(1);
+
+
+ int index42_118 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_118);
+ if ( s>=0 ) return s;
+ break;
+ case 85 :
+ int LA42_119 = input.LA(1);
+
+
+ int index42_119 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_119);
+ if ( s>=0 ) return s;
+ break;
+ case 86 :
+ int LA42_120 = input.LA(1);
+
+
+ int index42_120 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_120);
+ if ( s>=0 ) return s;
+ break;
+ case 87 :
+ int LA42_121 = input.LA(1);
+
+
+ int index42_121 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_121);
+ if ( s>=0 ) return s;
+ break;
+ case 88 :
+ int LA42_122 = input.LA(1);
+
+
+ int index42_122 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_122);
+ if ( s>=0 ) return s;
+ break;
+ case 89 :
+ int LA42_123 = input.LA(1);
+
+
+ int index42_123 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_123);
+ if ( s>=0 ) return s;
+ break;
+ case 90 :
+ int LA42_124 = input.LA(1);
+
+
+ int index42_124 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_124);
+ if ( s>=0 ) return s;
+ break;
+ case 91 :
+ int LA42_125 = input.LA(1);
+
+
+ int index42_125 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_125);
+ if ( s>=0 ) return s;
+ break;
+ case 92 :
+ int LA42_126 = input.LA(1);
+
+
+ int index42_126 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_126);
+ if ( s>=0 ) return s;
+ break;
+ case 93 :
+ int LA42_127 = input.LA(1);
+
+
+ int index42_127 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_127);
+ if ( s>=0 ) return s;
+ break;
+ case 94 :
+ int LA42_128 = input.LA(1);
+
+
+ int index42_128 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_128);
+ if ( s>=0 ) return s;
+ break;
+ case 95 :
+ int LA42_129 = input.LA(1);
+
+
+ int index42_129 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_129);
+ if ( s>=0 ) return s;
+ break;
+ case 96 :
+ int LA42_130 = input.LA(1);
+
+
+ int index42_130 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_130);
+ if ( s>=0 ) return s;
+ break;
+ case 97 :
+ int LA42_131 = input.LA(1);
+
+
+ int index42_131 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_131);
+ if ( s>=0 ) return s;
+ break;
+ case 98 :
+ int LA42_132 = input.LA(1);
+
+
+ int index42_132 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_132);
+ if ( s>=0 ) return s;
+ break;
+ case 99 :
+ int LA42_133 = input.LA(1);
+
+
+ int index42_133 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_133);
+ if ( s>=0 ) return s;
+ break;
+ case 100 :
+ int LA42_134 = input.LA(1);
+
+
+ int index42_134 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_134);
+ if ( s>=0 ) return s;
+ break;
+ case 101 :
+ int LA42_135 = input.LA(1);
+
+
+ int index42_135 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_135);
+ if ( s>=0 ) return s;
+ break;
+ case 102 :
+ int LA42_136 = input.LA(1);
+
+
+ int index42_136 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_136);
+ if ( s>=0 ) return s;
+ break;
+ case 103 :
+ int LA42_137 = input.LA(1);
+
+
+ int index42_137 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_137);
+ if ( s>=0 ) return s;
+ break;
+ case 104 :
+ int LA42_138 = input.LA(1);
+
+
+ int index42_138 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_138);
+ if ( s>=0 ) return s;
+ break;
+ case 105 :
+ int LA42_139 = input.LA(1);
+
+
+ int index42_139 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_139);
+ if ( s>=0 ) return s;
+ break;
+ case 106 :
+ int LA42_140 = input.LA(1);
+
+
+ int index42_140 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_140);
+ if ( s>=0 ) return s;
+ break;
+ case 107 :
+ int LA42_141 = input.LA(1);
+
+
+ int index42_141 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_141);
+ if ( s>=0 ) return s;
+ break;
+ case 108 :
+ int LA42_142 = input.LA(1);
+
+
+ int index42_142 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_142);
+ if ( s>=0 ) return s;
+ break;
+ case 109 :
+ int LA42_143 = input.LA(1);
+
+
+ int index42_143 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_143);
+ if ( s>=0 ) return s;
+ break;
+ case 110 :
+ int LA42_144 = input.LA(1);
+
+
+ int index42_144 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_144);
+ if ( s>=0 ) return s;
+ break;
+ case 111 :
+ int LA42_145 = input.LA(1);
+
+
+ int index42_145 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_145);
+ if ( s>=0 ) return s;
+ break;
+ case 112 :
+ int LA42_146 = input.LA(1);
+
+
+ int index42_146 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_146);
+ if ( s>=0 ) return s;
+ break;
+ case 113 :
+ int LA42_147 = input.LA(1);
+
+
+ int index42_147 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_147);
+ if ( s>=0 ) return s;
+ break;
+ case 114 :
+ int LA42_148 = input.LA(1);
+
+
+ int index42_148 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_148);
+ if ( s>=0 ) return s;
+ break;
+ case 115 :
+ int LA42_149 = input.LA(1);
+
+
+ int index42_149 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_149);
+ if ( s>=0 ) return s;
+ break;
+ case 116 :
+ int LA42_150 = input.LA(1);
+
+
+ int index42_150 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_150);
+ if ( s>=0 ) return s;
+ break;
+ case 117 :
+ int LA42_151 = input.LA(1);
+
+
+ int index42_151 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_151);
+ if ( s>=0 ) return s;
+ break;
+ case 118 :
+ int LA42_152 = input.LA(1);
+
+
+ int index42_152 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_152);
+ if ( s>=0 ) return s;
+ break;
+ case 119 :
+ int LA42_153 = input.LA(1);
+
+
+ int index42_153 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_153);
+ if ( s>=0 ) return s;
+ break;
+ case 120 :
+ int LA42_154 = input.LA(1);
+
+
+ int index42_154 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_154);
+ if ( s>=0 ) return s;
+ break;
+ case 121 :
+ int LA42_155 = input.LA(1);
+
+
+ int index42_155 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred100_wcps()) ) {s = 31;}
+
+ else if ( (synpred101_wcps()) ) {s = 32;}
+
+
+ input.seek(index42_155);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 42, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA43_eotS =
+ "\40\uffff";
+ static final String DFA43_eofS =
+ "\40\uffff";
+ static final String DFA43_minS =
+ "\1\6\37\uffff";
+ static final String DFA43_maxS =
+ "\1\154\37\uffff";
+ static final String DFA43_acceptS =
+ "\1\uffff\1\1\35\uffff\1\2";
+ static final String DFA43_specialS =
+ "\40\uffff}>";
+ static final String[] DFA43_transitionS = {
+ "\1\1\20\uffff\1\1\3\uffff\20\1\3\uffff\1\1\4\uffff\6\1\1\uffff"+
+ "\1\1\1\uffff\2\1\16\uffff\1\1\1\uffff\3\1\3\uffff\1\37\14\uffff"+
+ "\2\1\10\uffff\2\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA43_eot = DFA.unpackEncodedString(DFA43_eotS);
+ static final short[] DFA43_eof = DFA.unpackEncodedString(DFA43_eofS);
+ static final char[] DFA43_min = DFA.unpackEncodedStringToUnsignedChars(DFA43_minS);
+ static final char[] DFA43_max = DFA.unpackEncodedStringToUnsignedChars(DFA43_maxS);
+ static final short[] DFA43_accept = DFA.unpackEncodedString(DFA43_acceptS);
+ static final short[] DFA43_special = DFA.unpackEncodedString(DFA43_specialS);
+ static final short[][] DFA43_transition;
+
+ static {
+ int numStates = DFA43_transitionS.length;
+ DFA43_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA43_transition[i] = DFA.unpackEncodedString(DFA43_transitionS[i]);
+ }
+ }
+
+ class DFA43 extends DFA {
+
+ public DFA43(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 43;
+ this.eot = DFA43_eot;
+ this.eof = DFA43_eof;
+ this.min = DFA43_min;
+ this.max = DFA43_max;
+ this.accept = DFA43_accept;
+ this.special = DFA43_special;
+ this.transition = DFA43_transition;
+ }
+ public String getDescription() {
+ return "255:1: trimExpr returns [TrimExpr value] : (e1= coverageAtom LBRACKET dil= dimensionIntervalList RBRACKET | TRIM LPAREN e2= coverageExpr COMMA LBRACE dil= dimensionIntervalList RBRACE RPAREN );";
+ }
+ }
+ static final String DFA44_eotS =
+ "\40\uffff";
+ static final String DFA44_eofS =
+ "\40\uffff";
+ static final String DFA44_minS =
+ "\1\6\37\uffff";
+ static final String DFA44_maxS =
+ "\1\154\37\uffff";
+ static final String DFA44_acceptS =
+ "\1\uffff\1\1\35\uffff\1\2";
+ static final String DFA44_specialS =
+ "\40\uffff}>";
+ static final String[] DFA44_transitionS = {
+ "\1\1\20\uffff\1\1\3\uffff\20\1\3\uffff\1\1\4\uffff\6\1\1\uffff"+
+ "\1\1\1\uffff\2\1\16\uffff\1\1\1\uffff\3\1\4\uffff\1\37\13\uffff"+
+ "\2\1\10\uffff\2\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA44_eot = DFA.unpackEncodedString(DFA44_eotS);
+ static final short[] DFA44_eof = DFA.unpackEncodedString(DFA44_eofS);
+ static final char[] DFA44_min = DFA.unpackEncodedStringToUnsignedChars(DFA44_minS);
+ static final char[] DFA44_max = DFA.unpackEncodedStringToUnsignedChars(DFA44_maxS);
+ static final short[] DFA44_accept = DFA.unpackEncodedString(DFA44_acceptS);
+ static final short[] DFA44_special = DFA.unpackEncodedString(DFA44_specialS);
+ static final short[][] DFA44_transition;
+
+ static {
+ int numStates = DFA44_transitionS.length;
+ DFA44_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA44_transition[i] = DFA.unpackEncodedString(DFA44_transitionS[i]);
+ }
+ }
+
+ class DFA44 extends DFA {
+
+ public DFA44(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 44;
+ this.eot = DFA44_eot;
+ this.eof = DFA44_eof;
+ this.min = DFA44_min;
+ this.max = DFA44_max;
+ this.accept = DFA44_accept;
+ this.special = DFA44_special;
+ this.transition = DFA44_transition;
+ }
+ public String getDescription() {
+ return "259:1: sliceExpr returns [SliceExpr value] : (e1= coverageAtom LBRACKET dpl= dimensionPointList RBRACKET | SLICE LPAREN e2= coverageExpr COMMA LBRACE dpl= dimensionPointList RBRACE RPAREN );";
+ }
+ }
+ static final String DFA46_eotS =
+ "\77\uffff";
+ static final String DFA46_eofS =
+ "\1\1\76\uffff";
+ static final String DFA46_minS =
+ "\1\7\7\uffff\1\0\66\uffff";
+ static final String DFA46_maxS =
+ "\1\140\7\uffff\1\0\66\uffff";
+ static final String DFA46_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA46_specialS =
+ "\10\uffff\1\0\66\uffff}>";
+ static final String[] DFA46_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\2\10\14\1\21\uffff\2\1\3\uffff\1\1"+
+ "\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA46_eot = DFA.unpackEncodedString(DFA46_eotS);
+ static final short[] DFA46_eof = DFA.unpackEncodedString(DFA46_eofS);
+ static final char[] DFA46_min = DFA.unpackEncodedStringToUnsignedChars(DFA46_minS);
+ static final char[] DFA46_max = DFA.unpackEncodedStringToUnsignedChars(DFA46_maxS);
+ static final short[] DFA46_accept = DFA.unpackEncodedString(DFA46_acceptS);
+ static final short[] DFA46_special = DFA.unpackEncodedString(DFA46_specialS);
+ static final short[][] DFA46_transition;
+
+ static {
+ int numStates = DFA46_transitionS.length;
+ DFA46_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA46_transition[i] = DFA.unpackEncodedString(DFA46_transitionS[i]);
+ }
+ }
+
+ class DFA46 extends DFA {
+
+ public DFA46(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 46;
+ this.eot = DFA46_eot;
+ this.eof = DFA46_eof;
+ this.min = DFA46_min;
+ this.max = DFA46_max;
+ this.accept = DFA46_accept;
+ this.special = DFA46_special;
+ this.transition = DFA46_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 280:7: (op= ( OR | XOR ) e2= booleanScalarTerm )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA46_8 = input.LA(1);
+
+
+ int index46_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred115_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index46_8);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 46, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA47_eotS =
+ "\77\uffff";
+ static final String DFA47_eofS =
+ "\1\1\76\uffff";
+ static final String DFA47_minS =
+ "\1\7\7\uffff\1\0\66\uffff";
+ static final String DFA47_maxS =
+ "\1\140\7\uffff\1\0\66\uffff";
+ static final String DFA47_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA47_specialS =
+ "\10\uffff\1\0\66\uffff}>";
+ static final String[] DFA47_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\2\1\1\10\13\1\21\uffff\2\1\3\uffff"+
+ "\1\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA47_eot = DFA.unpackEncodedString(DFA47_eotS);
+ static final short[] DFA47_eof = DFA.unpackEncodedString(DFA47_eofS);
+ static final char[] DFA47_min = DFA.unpackEncodedStringToUnsignedChars(DFA47_minS);
+ static final char[] DFA47_max = DFA.unpackEncodedStringToUnsignedChars(DFA47_maxS);
+ static final short[] DFA47_accept = DFA.unpackEncodedString(DFA47_acceptS);
+ static final short[] DFA47_special = DFA.unpackEncodedString(DFA47_specialS);
+ static final short[][] DFA47_transition;
+
+ static {
+ int numStates = DFA47_transitionS.length;
+ DFA47_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA47_transition[i] = DFA.unpackEncodedString(DFA47_transitionS[i]);
+ }
+ }
+
+ class DFA47 extends DFA {
+
+ public DFA47(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 47;
+ this.eot = DFA47_eot;
+ this.eof = DFA47_eof;
+ this.min = DFA47_min;
+ this.max = DFA47_max;
+ this.accept = DFA47_accept;
+ this.special = DFA47_special;
+ this.transition = DFA47_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 284:4: (op= AND e2= booleanScalarNegation )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA47_8 = input.LA(1);
+
+
+ int index47_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred116_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index47_8);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 47, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA48_eotS =
+ "\17\uffff";
+ static final String DFA48_eofS =
+ "\17\uffff";
+ static final String DFA48_minS =
+ "\1\6\16\uffff";
+ static final String DFA48_maxS =
+ "\1\154\16\uffff";
+ static final String DFA48_acceptS =
+ "\1\uffff\1\1\14\uffff\1\2";
+ static final String DFA48_specialS =
+ "\17\uffff}>";
+ static final String[] DFA48_transitionS = {
+ "\1\1\20\uffff\1\1\3\uffff\1\1\7\uffff\10\1\21\uffff\2\1\16\uffff"+
+ "\1\16\1\uffff\3\1\20\uffff\2\1\11\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA48_eot = DFA.unpackEncodedString(DFA48_eotS);
+ static final short[] DFA48_eof = DFA.unpackEncodedString(DFA48_eofS);
+ static final char[] DFA48_min = DFA.unpackEncodedStringToUnsignedChars(DFA48_minS);
+ static final char[] DFA48_max = DFA.unpackEncodedStringToUnsignedChars(DFA48_maxS);
+ static final short[] DFA48_accept = DFA.unpackEncodedString(DFA48_acceptS);
+ static final short[] DFA48_special = DFA.unpackEncodedString(DFA48_specialS);
+ static final short[][] DFA48_transition;
+
+ static {
+ int numStates = DFA48_transitionS.length;
+ DFA48_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA48_transition[i] = DFA.unpackEncodedString(DFA48_transitionS[i]);
+ }
+ }
+
+ class DFA48 extends DFA {
+
+ public DFA48(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 48;
+ this.eot = DFA48_eot;
+ this.eof = DFA48_eof;
+ this.min = DFA48_min;
+ this.max = DFA48_max;
+ this.accept = DFA48_accept;
+ this.special = DFA48_special;
+ this.transition = DFA48_transition;
+ }
+ public String getDescription() {
+ return "286:1: booleanScalarNegation returns [BooleanScalarExpr value] : (e1= booleanScalarAtom | op= NOT e1= booleanScalarAtom );";
+ }
+ }
+ static final String DFA49_eotS =
+ "\34\uffff";
+ static final String DFA49_eofS =
+ "\34\uffff";
+ static final String DFA49_minS =
+ "\2\6\14\uffff\12\0\4\uffff";
+ static final String DFA49_maxS =
+ "\2\154\14\uffff\12\0\4\uffff";
+ static final String DFA49_acceptS =
+ "\2\uffff\1\2\1\uffff\1\3\10\uffff\1\4\12\uffff\1\1\3\uffff";
+ static final String DFA49_specialS =
+ "\16\uffff\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\4\uffff}>";
+ static final String[] DFA49_transitionS = {
+ "\1\1\20\uffff\1\4\3\uffff\1\2\7\uffff\10\4\21\uffff\2\4\20\uffff"+
+ "\2\4\1\2\20\uffff\1\15\1\4\11\uffff\1\4",
+ "\1\17\20\uffff\1\20\3\uffff\1\30\7\uffff\7\25\1\26\21\uffff"+
+ "\1\22\1\21\16\uffff\1\30\1\uffff\1\24\1\23\1\30\20\uffff\1\30"+
+ "\1\16\11\uffff\1\27",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA49_eot = DFA.unpackEncodedString(DFA49_eotS);
+ static final short[] DFA49_eof = DFA.unpackEncodedString(DFA49_eofS);
+ static final char[] DFA49_min = DFA.unpackEncodedStringToUnsignedChars(DFA49_minS);
+ static final char[] DFA49_max = DFA.unpackEncodedStringToUnsignedChars(DFA49_maxS);
+ static final short[] DFA49_accept = DFA.unpackEncodedString(DFA49_acceptS);
+ static final short[] DFA49_special = DFA.unpackEncodedString(DFA49_specialS);
+ static final short[][] DFA49_transition;
+
+ static {
+ int numStates = DFA49_transitionS.length;
+ DFA49_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA49_transition[i] = DFA.unpackEncodedString(DFA49_transitionS[i]);
+ }
+ }
+
+ class DFA49 extends DFA {
+
+ public DFA49(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 49;
+ this.eot = DFA49_eot;
+ this.eof = DFA49_eof;
+ this.min = DFA49_min;
+ this.max = DFA49_max;
+ this.accept = DFA49_accept;
+ this.special = DFA49_special;
+ this.transition = DFA49_transition;
+ }
+ public String getDescription() {
+ return "290:1: booleanScalarAtom returns [BooleanScalarExpr value] : ( LPAREN e1= booleanScalarExpr RPAREN | s1= stringScalarExpr cop= compOp s2= stringScalarExpr | n1= numericScalarExpr cop= compOp n2= numericScalarExpr | e= BOOLEANCONSTANT );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA49_14 = input.LA(1);
+
+
+ int index49_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_14);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ int LA49_15 = input.LA(1);
+
+
+ int index49_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_15);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ int LA49_16 = input.LA(1);
+
+
+ int index49_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_16);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ int LA49_17 = input.LA(1);
+
+
+ int index49_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_17);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ int LA49_18 = input.LA(1);
+
+
+ int index49_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_18);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ int LA49_19 = input.LA(1);
+
+
+ int index49_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_19);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ int LA49_20 = input.LA(1);
+
+
+ int index49_20 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_20);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ int LA49_21 = input.LA(1);
+
+
+ int index49_21 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_21);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ int LA49_22 = input.LA(1);
+
+
+ int index49_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_22);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ int LA49_23 = input.LA(1);
+
+
+ int index49_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred118_wcps()) ) {s = 24;}
+
+ else if ( (synpred120_wcps()) ) {s = 4;}
+
+
+ input.seek(index49_23);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 49, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA50_eotS =
+ "\77\uffff";
+ static final String DFA50_eofS =
+ "\1\1\76\uffff";
+ static final String DFA50_minS =
+ "\1\7\3\uffff\1\0\72\uffff";
+ static final String DFA50_maxS =
+ "\1\140\3\uffff\1\0\72\uffff";
+ static final String DFA50_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA50_specialS =
+ "\4\uffff\1\0\72\uffff}>";
+ static final String[] DFA50_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\11\1\2\4\3\1\21\uffff\2\1\3\uffff\1"+
+ "\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA50_eot = DFA.unpackEncodedString(DFA50_eotS);
+ static final short[] DFA50_eof = DFA.unpackEncodedString(DFA50_eofS);
+ static final char[] DFA50_min = DFA.unpackEncodedStringToUnsignedChars(DFA50_minS);
+ static final char[] DFA50_max = DFA.unpackEncodedStringToUnsignedChars(DFA50_maxS);
+ static final short[] DFA50_accept = DFA.unpackEncodedString(DFA50_acceptS);
+ static final short[] DFA50_special = DFA.unpackEncodedString(DFA50_specialS);
+ static final short[][] DFA50_transition;
+
+ static {
+ int numStates = DFA50_transitionS.length;
+ DFA50_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA50_transition[i] = DFA.unpackEncodedString(DFA50_transitionS[i]);
+ }
+ }
+
+ class DFA50 extends DFA {
+
+ public DFA50(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 50;
+ this.eot = DFA50_eot;
+ this.eof = DFA50_eof;
+ this.min = DFA50_min;
+ this.max = DFA50_max;
+ this.accept = DFA50_accept;
+ this.special = DFA50_special;
+ this.transition = DFA50_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 298:4: (op= ( PLUS | MINUS ) e2= numericScalarTerm )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA50_4 = input.LA(1);
+
+
+ int index50_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred122_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index50_4);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 50, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA51_eotS =
+ "\77\uffff";
+ static final String DFA51_eofS =
+ "\1\1\76\uffff";
+ static final String DFA51_minS =
+ "\1\7\3\uffff\1\0\72\uffff";
+ static final String DFA51_maxS =
+ "\1\140\3\uffff\1\0\72\uffff";
+ static final String DFA51_acceptS =
+ "\1\uffff\1\2\74\uffff\1\1";
+ static final String DFA51_specialS =
+ "\4\uffff\1\0\72\uffff}>";
+ static final String[] DFA51_transitionS = {
+ "\2\1\1\uffff\1\1\2\uffff\13\1\2\4\1\1\21\uffff\2\1\3\uffff\1"+
+ "\1\7\uffff\1\1\30\uffff\1\1\15\uffff\1\1",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA51_eot = DFA.unpackEncodedString(DFA51_eotS);
+ static final short[] DFA51_eof = DFA.unpackEncodedString(DFA51_eofS);
+ static final char[] DFA51_min = DFA.unpackEncodedStringToUnsignedChars(DFA51_minS);
+ static final char[] DFA51_max = DFA.unpackEncodedStringToUnsignedChars(DFA51_maxS);
+ static final short[] DFA51_accept = DFA.unpackEncodedString(DFA51_acceptS);
+ static final short[] DFA51_special = DFA.unpackEncodedString(DFA51_specialS);
+ static final short[][] DFA51_transition;
+
+ static {
+ int numStates = DFA51_transitionS.length;
+ DFA51_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA51_transition[i] = DFA.unpackEncodedString(DFA51_transitionS[i]);
+ }
+ }
+
+ class DFA51 extends DFA {
+
+ public DFA51(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 51;
+ this.eot = DFA51_eot;
+ this.eof = DFA51_eof;
+ this.min = DFA51_min;
+ this.max = DFA51_max;
+ this.accept = DFA51_accept;
+ this.special = DFA51_special;
+ this.transition = DFA51_transition;
+ }
+ public String getDescription() {
+ return "()* loopback of 302:3: (op= ( MULT | DIVIDE ) e2= numericScalarFactor )*";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA51_4 = input.LA(1);
+
+
+ int index51_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred124_wcps()) ) {s = 62;}
+
+ else if ( (true) ) {s = 1;}
+
+
+ input.seek(index51_4);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 51, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA52_eotS =
+ "\26\uffff";
+ static final String DFA52_eofS =
+ "\26\uffff";
+ static final String DFA52_minS =
+ "\2\6\11\uffff\1\0\12\uffff";
+ static final String DFA52_maxS =
+ "\2\154\11\uffff\1\0\12\uffff";
+ static final String DFA52_acceptS =
+ "\2\uffff\1\2\1\3\1\4\1\5\1\6\1\7\1\11\1\uffff\1\12\1\uffff\1\1\10"+
+ "\uffff\1\10";
+ static final String DFA52_specialS =
+ "\13\uffff\1\0\12\uffff}>";
+ static final String[] DFA52_transitionS = {
+ "\1\1\20\uffff\1\2\13\uffff\10\10\21\uffff\1\4\1\3\20\uffff\1"+
+ "\6\1\5\22\uffff\1\7\11\uffff\1\12",
+ "\1\14\20\uffff\1\14\13\uffff\10\14\21\uffff\2\14\20\uffff\2"+
+ "\14\22\uffff\1\13\11\uffff\1\14",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ };
+
+ static final short[] DFA52_eot = DFA.unpackEncodedString(DFA52_eotS);
+ static final short[] DFA52_eof = DFA.unpackEncodedString(DFA52_eofS);
+ static final char[] DFA52_min = DFA.unpackEncodedStringToUnsignedChars(DFA52_minS);
+ static final char[] DFA52_max = DFA.unpackEncodedStringToUnsignedChars(DFA52_maxS);
+ static final short[] DFA52_accept = DFA.unpackEncodedString(DFA52_acceptS);
+ static final short[] DFA52_special = DFA.unpackEncodedString(DFA52_specialS);
+ static final short[][] DFA52_transition;
+
+ static {
+ int numStates = DFA52_transitionS.length;
+ DFA52_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA52_transition[i] = DFA.unpackEncodedString(DFA52_transitionS[i]);
+ }
+ }
+
+ class DFA52 extends DFA {
+
+ public DFA52(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 52;
+ this.eot = DFA52_eot;
+ this.eof = DFA52_eof;
+ this.min = DFA52_min;
+ this.max = DFA52_max;
+ this.accept = DFA52_accept;
+ this.special = DFA52_special;
+ this.transition = DFA52_transition;
+ }
+ public String getDescription() {
+ return "304:1: numericScalarFactor returns [NumericScalarExpr value] : ( LPAREN e1= numericScalarExpr RPAREN | op= MINUS e10= numericScalarFactor | op= ABS LPAREN e12= numericScalarExpr RPAREN | op= SQRT LPAREN e11= numericScalarExpr RPAREN | op= ROUND LPAREN e1= numericScalarExpr RPAREN | e= INTEGERCONSTANT | e= FLOATCONSTANT | e2= complexConstant | e3= condenseExpr | e4= variableName );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA52_11 = input.LA(1);
+
+
+ int index52_11 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred125_wcps()) ) {s = 12;}
+
+ else if ( (synpred132_wcps()) ) {s = 21;}
+
+
+ input.seek(index52_11);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 52, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+ static final String DFA56_eotS =
+ "\30\uffff";
+ static final String DFA56_eofS =
+ "\30\uffff";
+ static final String DFA56_minS =
+ "\1\6\4\uffff\1\6\20\uffff\1\0\1\uffff";
+ static final String DFA56_maxS =
+ "\1\154\4\uffff\1\6\20\uffff\1\0\1\uffff";
+ static final String DFA56_acceptS =
+ "\1\uffff\1\1\25\uffff\1\2";
+ static final String DFA56_specialS =
+ "\26\uffff\1\0\1\uffff}>";
+ static final String[] DFA56_transitionS = {
+ "\1\1\20\uffff\1\1\3\uffff\7\1\1\5\10\1\21\uffff\2\1\16\uffff"+
+ "\1\1\1\uffff\3\1\20\uffff\2\1\11\uffff\1\1",
+ "",
+ "",
+ "",
+ "",
+ "\1\26",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\1\uffff",
+ ""
+ };
+
+ static final short[] DFA56_eot = DFA.unpackEncodedString(DFA56_eotS);
+ static final short[] DFA56_eof = DFA.unpackEncodedString(DFA56_eofS);
+ static final char[] DFA56_min = DFA.unpackEncodedStringToUnsignedChars(DFA56_minS);
+ static final char[] DFA56_max = DFA.unpackEncodedStringToUnsignedChars(DFA56_maxS);
+ static final short[] DFA56_accept = DFA.unpackEncodedString(DFA56_acceptS);
+ static final short[] DFA56_special = DFA.unpackEncodedString(DFA56_specialS);
+ static final short[][] DFA56_transition;
+
+ static {
+ int numStates = DFA56_transitionS.length;
+ DFA56_transition = new short[numStates][];
+ for (int i=0; i<numStates; i++) {
+ DFA56_transition[i] = DFA.unpackEncodedString(DFA56_transitionS[i]);
+ }
+ }
+
+ class DFA56 extends DFA {
+
+ public DFA56(BaseRecognizer recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 56;
+ this.eot = DFA56_eot;
+ this.eof = DFA56_eof;
+ this.min = DFA56_min;
+ this.max = DFA56_max;
+ this.accept = DFA56_accept;
+ this.special = DFA56_special;
+ this.transition = DFA56_transition;
+ }
+ public String getDescription() {
+ return "332:1: dimensionIntervalExpr returns [DimensionIntervalExpr value] : (e1= scalarExpr COLON e2= scalarExpr | DOMAIN LPAREN e3= coverageName COLON e4= axisName COLON e5= crsName RPAREN );";
+ }
+ public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
+ TokenStream input = (TokenStream)_input;
+ int _s = s;
+ switch ( s ) {
+ case 0 :
+ int LA56_22 = input.LA(1);
+
+
+ int index56_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (synpred141_wcps()) ) {s = 1;}
+
+ else if ( (true) ) {s = 23;}
+
+
+ input.seek(index56_22);
+ if ( s>=0 ) return s;
+ break;
+ }
+ if (state.backtracking>0) {state.failed=true; return -1;}
+ NoViableAltException nvae =
+ new NoViableAltException(getDescription(), 56, _s, input);
+ error(nvae);
+ throw nvae;
+ }
+ }
+
+
+ public static final BitSet FOLLOW_forClause_in_wcpsRequest63 = new BitSet(new long[]{0x0000000000000600L});
+ public static final BitSet FOLLOW_whereClause_in_wcpsRequest72 = new BitSet(new long[]{0x0000000000000600L});
+ public static final BitSet FOLLOW_returnClause_in_wcpsRequest83 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_FOR_in_forClause98 = new BitSet(new long[]{0x0000000000000000L,0x0000080000000000L});
+ public static final BitSet FOLLOW_coverageVariable_in_forClause102 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_IN_in_forClause104 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_forClause106 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageList_in_forClause110 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_forClause112 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_forClause122 = new BitSet(new long[]{0x0000000000000000L,0x0000080000000000L});
+ public static final BitSet FOLLOW_coverageVariable_in_forClause126 = new BitSet(new long[]{0x0000000000000020L});
+ public static final BitSet FOLLOW_IN_in_forClause128 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_forClause130 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageList_in_forClause134 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_forClause136 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_WHERE_in_whereClause157 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_whereClause161 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_RETURN_in_returnClause176 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_processingExpr_in_returnClause180 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageName_in_coverageList197 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_coverageList204 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_coverageList208 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_encodedCoverageExpr_in_processingExpr230 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_storeExpr_in_processingExpr242 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_processingExpr254 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ENCODE_in_encodedCoverageExpr272 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_encodedCoverageExpr274 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_encodedCoverageExpr278 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_encodedCoverageExpr280 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_stringConstant_in_encodedCoverageExpr284 = new BitSet(new long[]{0x0000000000000180L});
+ public static final BitSet FOLLOW_COMMA_in_encodedCoverageExpr291 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_stringConstant_in_encodedCoverageExpr295 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_encodedCoverageExpr302 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STORE_in_storeExpr319 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_storeExpr321 = new BitSet(new long[]{0x0000000000000800L});
+ public static final BitSet FOLLOW_encodedCoverageExpr_in_storeExpr325 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_storeExpr327 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageLogicTerm_in_coverageExpr350 = new BitSet(new long[]{0x0000000000006002L});
+ public static final BitSet FOLLOW_set_in_coverageExpr366 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageLogicTerm_in_coverageExpr374 = new BitSet(new long[]{0x0000000000006002L});
+ public static final BitSet FOLLOW_coverageLogicFactor_in_coverageLogicTerm400 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_AND_in_coverageLogicTerm416 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageLogicFactor_in_coverageLogicTerm420 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_coverageArithmeticExpr_in_coverageLogicFactor447 = new BitSet(new long[]{0x00000000003F0002L});
+ public static final BitSet FOLLOW_set_in_coverageLogicFactor463 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticExpr_in_coverageLogicFactor479 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageArithmeticTerm_in_coverageArithmeticExpr507 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_set_in_coverageArithmeticExpr523 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticTerm_in_coverageArithmeticExpr531 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_coverageArithmeticFactor_in_coverageArithmeticTerm559 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_set_in_coverageArithmeticTerm574 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticFactor_in_coverageArithmeticTerm582 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_coverageValue_in_coverageArithmeticFactor610 = new BitSet(new long[]{0x0000000004000002L});
+ public static final BitSet FOLLOW_OVERLAY_in_coverageArithmeticFactor625 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageValue_in_coverageArithmeticFactor629 = new BitSet(new long[]{0x0000000004000002L});
+ public static final BitSet FOLLOW_subsetExpr_in_coverageValue655 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_unaryInducedExpr_in_coverageValue668 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scaleExpr_in_coverageValue680 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_crsTransformExpr_in_coverageValue692 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageAtom_in_coverageValue704 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_coverageAtom727 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageVariable_in_coverageAtom739 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_coverageAtom749 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_coverageAtom753 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_coverageAtom755 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageConstantExpr_in_coverageAtom768 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageConstructorExpr_in_coverageAtom780 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_setMetaDataExpr_in_coverageAtom793 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_rangeConstructorExpr_in_coverageAtom806 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_metaDataExpr_in_scalarExpr830 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_condenseExpr_in_scalarExpr843 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_scalarExpr856 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_scalarExpr870 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stringScalarExpr_in_scalarExpr883 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_scalarExpr894 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_scalarExpr898 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_scalarExpr900 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IDENTIFIER_in_metaDataExpr924 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr926 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr930 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr932 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IMAGECRS_in_metaDataExpr944 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr946 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr950 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr952 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IMAGECRSDOMAIN_in_metaDataExpr964 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr966 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr970 = new BitSet(new long[]{0x0000000000000180L});
+ public static final BitSet FOLLOW_COMMA_in_metaDataExpr973 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_metaDataExpr977 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr981 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_CRSSET_in_metaDataExpr993 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr995 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr999 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr1001 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_domainExpr_in_metaDataExpr1013 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NULLSET_in_metaDataExpr1025 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr1027 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr1031 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr1033 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_INTERPOLATIONDEFAULT_in_metaDataExpr1045 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr1047 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr1051 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_metaDataExpr1053 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_metaDataExpr1057 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr1059 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_INTERPOLATIONSET_in_metaDataExpr1071 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_metaDataExpr1073 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_metaDataExpr1077 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_metaDataExpr1079 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_metaDataExpr1083 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_metaDataExpr1085 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_DOMAIN_in_domainExpr1104 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_domainExpr1106 = new BitSet(new long[]{0x0000000000000000L,0x0000080000000000L});
+ public static final BitSet FOLLOW_coverageVariable_in_domainExpr1110 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_domainExpr1112 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_domainExpr1116 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_domainExpr1118 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_domainExpr1122 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_domainExpr1124 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_reduceExpr_in_condenseExpr1141 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_generalCondenseExpr_in_condenseExpr1150 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_reduceExpr1167 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_reduceExpr1183 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_reduceExpr1187 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_reduceExpr1189 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_CONDENSE_in_generalCondenseExpr1204 = new BitSet(new long[]{0x000003000140A000L});
+ public static final BitSet FOLLOW_condenseOpType_in_generalCondenseExpr1208 = new BitSet(new long[]{0x0000080000000000L});
+ public static final BitSet FOLLOW_OVER_in_generalCondenseExpr1210 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_axisIteratorList_in_generalCondenseExpr1214 = new BitSet(new long[]{0x0000100000000200L});
+ public static final BitSet FOLLOW_WHERE_in_generalCondenseExpr1221 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_generalCondenseExpr1225 = new BitSet(new long[]{0x0000100000000000L});
+ public static final BitSet FOLLOW_USING_in_generalCondenseExpr1233 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_generalCondenseExpr1237 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_variableName_in_axisIteratorList1254 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_axisIteratorList1258 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_axisIteratorList1260 = new BitSet(new long[]{0x0000000020000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_intervalExpr_in_axisIteratorList1264 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_axisIteratorList1266 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_axisIteratorList1274 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_variableName_in_axisIteratorList1278 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_axisIteratorList1282 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_axisIteratorList1284 = new BitSet(new long[]{0x0000000020000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_intervalExpr_in_axisIteratorList1288 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_axisIteratorList1290 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_indexExpr_in_intervalExpr1314 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_intervalExpr1316 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexExpr_in_intervalExpr1320 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IMAGECRSDOMAIN_in_intervalExpr1335 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_intervalExpr1337 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_intervalExpr1341 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_intervalExpr1343 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_intervalExpr1347 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_intervalExpr1349 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_COVERAGE_in_coverageConstantExpr1375 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_coverageConstantExpr1379 = new BitSet(new long[]{0x0000080000000000L});
+ public static final BitSet FOLLOW_OVER_in_coverageConstantExpr1381 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_axisIteratorList_in_coverageConstantExpr1385 = new BitSet(new long[]{0x0000800000000000L});
+ public static final BitSet FOLLOW_VALUE_in_coverageConstantExpr1387 = new BitSet(new long[]{0x0001000000000000L});
+ public static final BitSet FOLLOW_LIST_in_coverageConstantExpr1389 = new BitSet(new long[]{0x0000000000040000L});
+ public static final BitSet FOLLOW_LT_in_coverageConstantExpr1391 = new BitSet(new long[]{0x0000000000000040L,0x0000000600014000L});
+ public static final BitSet FOLLOW_constantList_in_coverageConstantExpr1395 = new BitSet(new long[]{0x0000000000080000L});
+ public static final BitSet FOLLOW_GT_in_coverageConstantExpr1397 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_constant_in_constantList1428 = new BitSet(new long[]{0x0002000000000002L});
+ public static final BitSet FOLLOW_SEMICOLON_in_constantList1433 = new BitSet(new long[]{0x0000000000000040L,0x0000000600014000L});
+ public static final BitSet FOLLOW_constant_in_constantList1437 = new BitSet(new long[]{0x0002000000000002L});
+ public static final BitSet FOLLOW_COVERAGE_in_coverageConstructorExpr1457 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_coverageConstructorExpr1461 = new BitSet(new long[]{0x0000080000000000L});
+ public static final BitSet FOLLOW_OVER_in_coverageConstructorExpr1463 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_axisIteratorList_in_coverageConstructorExpr1467 = new BitSet(new long[]{0x0004000000000000L});
+ public static final BitSet FOLLOW_VALUES_in_coverageConstructorExpr1469 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_coverageConstructorExpr1473 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETIDENTIFIER_in_setMetaDataExpr1495 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1497 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_stringConstant_in_setMetaDataExpr1501 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1503 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1507 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1509 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETCRSSET_in_setMetaDataExpr1522 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1524 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1528 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1530 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_crsList_in_setMetaDataExpr1534 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1536 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETNULLSET_in_setMetaDataExpr1553 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1555 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1559 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1561 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_rangeExprList_in_setMetaDataExpr1565 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1567 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETINTERPOLATIONDEFAULT_in_setMetaDataExpr1584 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1586 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1590 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1592 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_setMetaDataExpr1596 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1598 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_interpolationMethod_in_setMetaDataExpr1602 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1604 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SETINTERPOLATIONSET_in_setMetaDataExpr1624 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_setMetaDataExpr1626 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_setMetaDataExpr1630 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1632 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_setMetaDataExpr1636 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_setMetaDataExpr1638 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_interpolationMethodList_in_setMetaDataExpr1642 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_setMetaDataExpr1644 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LBRACE_in_crsList1673 = new BitSet(new long[]{0x0200000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_crsList1680 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_crsList1685 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_crsList1689 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_crsList1698 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LBRACE_in_rangeExprList1717 = new BitSet(new long[]{0x0600000000000000L});
+ public static final BitSet FOLLOW_rangeExpr_in_rangeExprList1724 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_rangeExprList1729 = new BitSet(new long[]{0x0400000000000000L});
+ public static final BitSet FOLLOW_rangeExpr_in_rangeExprList1733 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_rangeExprList1742 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LBRACE_in_interpolationMethodList1758 = new BitSet(new long[]{0x0200000000000040L});
+ public static final BitSet FOLLOW_interpolationMethod_in_interpolationMethodList1765 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_interpolationMethodList1770 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_interpolationMethod_in_interpolationMethodList1774 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_interpolationMethodList1782 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRUCT_in_rangeExpr1795 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_LBRACE_in_rangeExpr1797 = new BitSet(new long[]{0x0200000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_rangeExpr1805 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_rangeExpr1807 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_rangeExpr1811 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_rangeExpr1818 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_rangeExpr1822 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_rangeExpr1824 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_rangeExpr1828 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_rangeExpr1839 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRUCT_in_rangeConstructorExpr1856 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_LBRACE_in_rangeConstructorExpr1860 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_rangeConstructorExpr1864 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_rangeConstructorExpr1866 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_rangeConstructorExpr1870 = new BitSet(new long[]{0x0202000000000000L});
+ public static final BitSet FOLLOW_SEMICOLON_in_rangeConstructorExpr1883 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_rangeConstructorExpr1887 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_rangeConstructorExpr1889 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_rangeConstructorExpr1893 = new BitSet(new long[]{0x0202000000000000L});
+ public static final BitSet FOLLOW_RBRACE_in_rangeConstructorExpr1899 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_CRSTRANSFORM_in_crsTransformExpr1915 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_crsTransformExpr1917 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_crsTransformExpr1921 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_crsTransformExpr1923 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_crsTransformExpr1927 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_crsTransformExpr1929 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_fieldInterpolationList_in_crsTransformExpr1933 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_crsTransformExpr1935 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LBRACE_in_fieldInterpolationList1952 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldInterpolationElement_in_fieldInterpolationList1956 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_fieldInterpolationList1963 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldInterpolationElement_in_fieldInterpolationList1967 = new BitSet(new long[]{0x0200000000000100L});
+ public static final BitSet FOLLOW_RBRACE_in_fieldInterpolationList1974 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_fieldName_in_fieldInterpolationElement1989 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_interpolationMethod_in_fieldInterpolationElement1993 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_fieldExpr_in_unaryInducedExpr2013 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_unaryArithmeticExpr_in_unaryInducedExpr2022 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_exponentialExpr_in_unaryInducedExpr2034 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_trigonometricExpr_in_unaryInducedExpr2046 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanExpr_in_unaryInducedExpr2058 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_castExpr_in_unaryInducedExpr2070 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_rangeConstructorExpr_in_unaryInducedExpr2082 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_unaryArithmeticExpr2105 = new BitSet(new long[]{0x35F847FFF8801840L,0x000018060001D000L});
+ public static final BitSet FOLLOW_coverageAtom_in_unaryArithmeticExpr2113 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_unaryArithmeticExpr2125 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_unaryArithmeticExpr2135 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_unaryArithmeticExpr2139 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_unaryArithmeticExpr2141 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_exponentialExpr2164 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_exponentialExpr2172 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_exponentialExpr2176 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_exponentialExpr2178 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_trigonometricExpr2201 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_trigonometricExpr2221 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_trigonometricExpr2225 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_trigonometricExpr2227 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NOT_in_booleanExpr2250 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_booleanExpr2254 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_BIT_in_booleanExpr2266 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_booleanExpr2268 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_booleanExpr2272 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_booleanExpr2274 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexExpr_in_booleanExpr2278 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_booleanExpr2280 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_indexTerm_in_indexExpr2303 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_set_in_indexExpr2313 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexTerm_in_indexExpr2321 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_indexFactor_in_indexTerm2346 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_set_in_indexTerm2359 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexFactor_in_indexTerm2367 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_INTEGERCONSTANT_in_indexFactor2394 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ROUND_in_indexFactor2407 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_indexFactor2409 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_indexFactor2413 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_indexFactor2415 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_indexFactor2427 = new BitSet(new long[]{0x0000000000000040L,0x000000000000C000L});
+ public static final BitSet FOLLOW_indexExpr_in_indexFactor2431 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_indexFactor2433 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_IDENTIFIER_in_stringScalarExpr2460 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_stringScalarExpr2462 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_stringScalarExpr2466 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_stringScalarExpr2468 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRING_in_stringScalarExpr2481 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SCALE_in_scaleExpr2499 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_scaleExpr2501 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_scaleExpr2505 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_scaleExpr2507 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_scaleExpr2511 = new BitSet(new long[]{0x0000000000000180L});
+ public static final BitSet FOLLOW_COMMA_in_scaleExpr2528 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_fieldInterpolationList_in_scaleExpr2532 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_scaleExpr2557 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_trimExpr_in_subsetExpr2575 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_sliceExpr_in_subsetExpr2584 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_extendExpr_in_subsetExpr2593 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageAtom_in_trimExpr2610 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
+ public static final BitSet FOLLOW_LBRACKET_in_trimExpr2612 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_trimExpr2616 = new BitSet(new long[]{0x0000000000000000L,0x0000000000080000L});
+ public static final BitSet FOLLOW_RBRACKET_in_trimExpr2618 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_TRIM_in_trimExpr2627 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_trimExpr2629 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_trimExpr2633 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_trimExpr2635 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_LBRACE_in_trimExpr2637 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_trimExpr2641 = new BitSet(new long[]{0x0200000000000000L});
+ public static final BitSet FOLLOW_RBRACE_in_trimExpr2643 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_trimExpr2645 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageAtom_in_sliceExpr2662 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
+ public static final BitSet FOLLOW_LBRACKET_in_sliceExpr2664 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionPointList_in_sliceExpr2668 = new BitSet(new long[]{0x0000000000000000L,0x0000000000080000L});
+ public static final BitSet FOLLOW_RBRACKET_in_sliceExpr2670 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SLICE_in_sliceExpr2677 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_sliceExpr2679 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_sliceExpr2683 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_sliceExpr2685 = new BitSet(new long[]{0x0100000000000000L});
+ public static final BitSet FOLLOW_LBRACE_in_sliceExpr2687 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionPointList_in_sliceExpr2691 = new BitSet(new long[]{0x0200000000000000L});
+ public static final BitSet FOLLOW_RBRACE_in_sliceExpr2693 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_sliceExpr2695 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_EXTEND_in_extendExpr2710 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_extendExpr2712 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_extendExpr2716 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_extendExpr2718 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalList_in_extendExpr2722 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_extendExpr2724 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_castExpr2742 = new BitSet(new long[]{0x0000000000000000L,0x00000000FF800000L});
+ public static final BitSet FOLLOW_rangeType_in_castExpr2746 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_castExpr2748 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_castExpr2752 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_rangeType2775 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_UNSIGNED_in_rangeType2801 = new BitSet(new long[]{0x0000000000000000L,0x0000000007000000L});
+ public static final BitSet FOLLOW_set_in_rangeType2805 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageAtom_in_fieldExpr2834 = new BitSet(new long[]{0x0000000000000000L,0x0000000100000000L});
+ public static final BitSet FOLLOW_DOT_in_fieldExpr2836 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_fieldName_in_fieldExpr2840 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanScalarTerm_in_booleanScalarExpr2865 = new BitSet(new long[]{0x0000000000006002L});
+ public static final BitSet FOLLOW_set_in_booleanScalarExpr2878 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarTerm_in_booleanScalarExpr2886 = new BitSet(new long[]{0x0000000000006002L});
+ public static final BitSet FOLLOW_booleanScalarNegation_in_booleanScalarTerm2908 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_AND_in_booleanScalarTerm2918 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarNegation_in_booleanScalarTerm2922 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_booleanScalarAtom_in_booleanScalarNegation2943 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NOT_in_booleanScalarNegation2952 = new BitSet(new long[]{0x300007F808800040L,0x000010060001C000L});
+ public static final BitSet FOLLOW_booleanScalarAtom_in_booleanScalarNegation2956 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_booleanScalarAtom2971 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_booleanScalarAtom2975 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_booleanScalarAtom2977 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stringScalarExpr_in_booleanScalarAtom2986 = new BitSet(new long[]{0x00000000003F0000L});
+ public static final BitSet FOLLOW_compOp_in_booleanScalarAtom2990 = new BitSet(new long[]{0x0000000008000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_stringScalarExpr_in_booleanScalarAtom2994 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_booleanScalarAtom3004 = new BitSet(new long[]{0x00000000003F0000L});
+ public static final BitSet FOLLOW_compOp_in_booleanScalarAtom3008 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_booleanScalarAtom3012 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_BOOLEANCONSTANT_in_booleanScalarAtom3022 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarTerm_in_numericScalarExpr3039 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_set_in_numericScalarExpr3049 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarTerm_in_numericScalarExpr3057 = new BitSet(new long[]{0x0000000000C00002L});
+ public static final BitSet FOLLOW_numericScalarFactor_in_numericScalarTerm3076 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_set_in_numericScalarTerm3085 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarFactor_in_numericScalarTerm3093 = new BitSet(new long[]{0x0000000003000002L});
+ public static final BitSet FOLLOW_LPAREN_in_numericScalarFactor3113 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_numericScalarFactor3117 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_numericScalarFactor3119 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_MINUS_in_numericScalarFactor3131 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarFactor_in_numericScalarFactor3135 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ABS_in_numericScalarFactor3147 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_numericScalarFactor3149 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_numericScalarFactor3153 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_numericScalarFactor3155 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_SQRT_in_numericScalarFactor3167 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_numericScalarFactor3169 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_numericScalarFactor3173 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_numericScalarFactor3175 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ROUND_in_numericScalarFactor3187 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_numericScalarFactor3189 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_numericScalarFactor3193 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_numericScalarFactor3195 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_INTEGERCONSTANT_in_numericScalarFactor3207 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_FLOATCONSTANT_in_numericScalarFactor3219 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_complexConstant_in_numericScalarFactor3231 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_condenseExpr_in_numericScalarFactor3243 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_variableName_in_numericScalarFactor3255 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_EQUALS_in_compOp3273 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NOTEQUALS_in_compOp3280 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LT_in_compOp3287 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_GT_in_compOp3294 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LTE_in_compOp3301 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_GTE_in_compOp3308 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_dimensionIntervalElement_in_dimensionIntervalList3328 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_dimensionIntervalList3341 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionIntervalElement_in_dimensionIntervalList3345 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_axisName_in_dimensionIntervalElement3370 = new BitSet(new long[]{0x0000200000000040L});
+ public static final BitSet FOLLOW_COLON_in_dimensionIntervalElement3375 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_dimensionIntervalElement3379 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_dimensionIntervalElement3390 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_dimensionIntervalExpr_in_dimensionIntervalElement3394 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_dimensionIntervalElement3396 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_dimensionIntervalExpr3419 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_dimensionIntervalExpr3421 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_dimensionIntervalExpr3425 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_DOMAIN_in_dimensionIntervalExpr3435 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_dimensionIntervalExpr3437 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_coverageName_in_dimensionIntervalExpr3441 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_dimensionIntervalExpr3443 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_axisName_in_dimensionIntervalExpr3447 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_dimensionIntervalExpr3449 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_dimensionIntervalExpr3453 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_dimensionIntervalExpr3455 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_dimensionPointElement_in_dimensionPointList3478 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_COMMA_in_dimensionPointList3488 = new BitSet(new long[]{0x0000000000000000L,0x0000080000014000L});
+ public static final BitSet FOLLOW_dimensionPointElement_in_dimensionPointList3492 = new BitSet(new long[]{0x0000000000000102L});
+ public static final BitSet FOLLOW_axisName_in_dimensionPointElement3517 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_dimensionPointElement3519 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_dimensionPoint_in_dimensionPointElement3523 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_dimensionPointElement3525 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_axisName_in_dimensionPointElement3537 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_dimensionPointElement3539 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
+ public static final BitSet FOLLOW_crsName_in_dimensionPointElement3543 = new BitSet(new long[]{0x0000000000000040L});
+ public static final BitSet FOLLOW_LPAREN_in_dimensionPointElement3545 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_dimensionPoint_in_dimensionPointElement3549 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_dimensionPointElement3551 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_dimensionPoint3574 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_interpolationMethod3592 = new BitSet(new long[]{0x0000000000000000L,0x0000007800000000L});
+ public static final BitSet FOLLOW_interpolationType_in_interpolationMethod3596 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_interpolationMethod3598 = new BitSet(new long[]{0x0000000000000000L,0x0000078000000000L});
+ public static final BitSet FOLLOW_nullResistence_in_interpolationMethod3602 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_interpolationMethod3604 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_interpolationType3621 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_nullResistence3646 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_condenseOpType3671 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_name_in_fieldName3698 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_constant3715 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_complexConstant_in_constant3732 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_complexConstant3747 = new BitSet(new long[]{0x0000000000000000L,0x0000000400000000L});
+ public static final BitSet FOLLOW_FLOATCONSTANT_in_complexConstant3751 = new BitSet(new long[]{0x0000000000000100L});
+ public static final BitSet FOLLOW_COMMA_in_complexConstant3753 = new BitSet(new long[]{0x0000000000000000L,0x0000000400000000L});
+ public static final BitSet FOLLOW_FLOATCONSTANT_in_complexConstant3757 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_complexConstant3759 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_STRING_in_stringConstant3776 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_name3793 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stringConstant_in_crsName3820 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_name_in_axisName3837 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_VARIABLE_DOLLAR_in_variableName3854 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_NAME_in_coverageVariable3871 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_name_in_coverageName3886 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred8_wcps366 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageLogicTerm_in_synpred8_wcps374 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_AND_in_synpred9_wcps416 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageLogicFactor_in_synpred9_wcps420 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred15_wcps463 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticExpr_in_synpred15_wcps479 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred17_wcps523 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticTerm_in_synpred17_wcps531 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred19_wcps574 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageArithmeticFactor_in_synpred19_wcps582 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_OVERLAY_in_synpred20_wcps625 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageValue_in_synpred20_wcps629 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_subsetExpr_in_synpred21_wcps655 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_unaryInducedExpr_in_synpred22_wcps668 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_synpred25_wcps727 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred27_wcps749 = new BitSet(new long[]{0xFDF847FFF8C01840L,0x000018060073FFFFL});
+ public static final BitSet FOLLOW_coverageExpr_in_synpred27_wcps753 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred27_wcps755 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageConstantExpr_in_synpred28_wcps768 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_coverageConstructorExpr_in_synpred29_wcps780 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_metaDataExpr_in_synpred31_wcps830 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_condenseExpr_in_synpred32_wcps843 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_synpred33_wcps856 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_synpred34_wcps870 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_stringScalarExpr_in_synpred35_wcps883 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_fieldExpr_in_synpred70_wcps2013 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_unaryArithmeticExpr_in_synpred71_wcps2022 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_booleanExpr_in_synpred74_wcps2058 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_trimExpr_in_synpred100_wcps2575 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_sliceExpr_in_synpred101_wcps2584 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred115_wcps2878 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarTerm_in_synpred115_wcps2886 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_AND_in_synpred116_wcps2918 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarNegation_in_synpred116_wcps2922 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred118_wcps2971 = new BitSet(new long[]{0x300007F808800040L,0x000010060001D000L});
+ public static final BitSet FOLLOW_booleanScalarExpr_in_synpred118_wcps2975 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred118_wcps2977 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_synpred120_wcps3004 = new BitSet(new long[]{0x00000000003F0000L});
+ public static final BitSet FOLLOW_compOp_in_synpred120_wcps3008 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_synpred120_wcps3012 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred122_wcps3049 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarTerm_in_synpred122_wcps3057 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_set_in_synpred124_wcps3085 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarFactor_in_synpred124_wcps3093 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_LPAREN_in_synpred125_wcps3113 = new BitSet(new long[]{0x300007F800800040L,0x000010040000C000L});
+ public static final BitSet FOLLOW_numericScalarExpr_in_synpred125_wcps3117 = new BitSet(new long[]{0x0000000000000080L});
+ public static final BitSet FOLLOW_RPAREN_in_synpred125_wcps3119 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_complexConstant_in_synpred132_wcps3231 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_scalarExpr_in_synpred141_wcps3419 = new BitSet(new long[]{0x0000200000000000L});
+ public static final BitSet FOLLOW_COLON_in_synpred141_wcps3421 = new BitSet(new long[]{0x300007FFF8801840L,0x000010060001D000L});
+ public static final BitSet FOLLOW_scalarExpr_in_synpred141_wcps3425 = new BitSet(new long[]{0x0000000000000002L});
+
+} \ No newline at end of file
diff --git a/petascope/src/petascope/wcps/grammar/wcps_no_actions.g b/petascope/src/petascope/wcps/grammar/wcps_no_actions.g
new file mode 100644
index 0000000..331ea0b
--- /dev/null
+++ b/petascope/src/petascope/wcps/grammar/wcps_no_actions.g
@@ -0,0 +1,491 @@
+/*
+Author: Sorin Stancu-Mara, Andrei Aiordachioaie
+History:
+07 02 2007 smsorin Updated to WCPS 1.0.0
+27 01 2009 smsorin Moved to ANTLR
+11 02 2009 andreia Updated to new grammar (spec 08-068r2)
+13 02 2009 andreia Fixed small bugs in grammar. Now it can fully compile.
+21 04 2009 andreia Removed comments.
+04 05 2009 andreia Fixed bugs in integer declaration.
+19 05 2009 andreia Fixed some other weird bugs. Grammar passes all tests now.
+28 05 2009 andreia Updated class actions names.
+02 06 2009 andreia Removed brackets around "and" binary operator in CoverageExpr
+03 06 2009 andreia Complex expressions introduced in the "using" clause of general condense operations
+05 08 2009 andreia Fixed definition of integer and floating-point numbers.
+*/
+grammar wcps_no_actions;
+options{
+backtrack=true;
+memoize=true;
+k=2;
+language=Java;
+output=AST;
+}
+
+/* Parser Rules */
+
+wcpsRequest
+ : e1=forClause
+ (e2=whereClause )?
+ e3=returnClause
+ ;
+forClause
+ : FOR v=coverageVariable IN LPAREN list=coverageList RPAREN
+
+ (COMMA v=coverageVariable IN LPAREN list=coverageList RPAREN
+ )*
+ ;
+whereClause
+ : WHERE e1=booleanScalarExpr
+ ;
+returnClause
+ : RETURN e1=processingExpr
+ ;
+coverageList
+ : cname=coverageName
+ (COMMA next=coverageName )*
+ ;
+processingExpr
+ : e1=encodedCoverageExpr
+ | e2=storeExpr
+ | e3=scalarExpr
+ ;
+encodedCoverageExpr
+ : ENCODE LPAREN cov=coverageExpr COMMA format=stringConstant
+ (COMMA params=stringConstant )? RPAREN
+ ;
+storeExpr
+ : STORE LPAREN e1=encodedCoverageExpr RPAREN
+ ;
+coverageExpr
+ : e1=coverageLogicTerm
+ (op=(OR|XOR) e2=coverageLogicTerm )*
+ ;
+coverageLogicTerm
+ : e1=coverageLogicFactor
+ (op=AND e2=coverageLogicFactor )*
+ ;
+coverageLogicFactor
+ : e1=coverageArithmeticExpr
+ (op=(EQUALS|NOTEQUALS|LT|GT|LTE|GTE) e2=coverageArithmeticExpr )?
+ ;
+coverageArithmeticExpr
+ : e1=coverageArithmeticTerm
+ (op=(PLUS|MINUS) e2=coverageArithmeticTerm )*
+ ;
+coverageArithmeticTerm
+ : e1=coverageArithmeticFactor
+ (op=(MULT|DIVIDE) e2=coverageArithmeticFactor )*
+ ;
+coverageArithmeticFactor
+ : e1=coverageValue
+ (op=OVERLAY e2=coverageValue )*
+ ;
+coverageValue
+ : e5=subsetExpr
+ | e2=unaryInducedExpr
+ | e4=scaleExpr
+ | e3=crsTransformExpr
+ | e1=coverageAtom
+ ;
+coverageAtom
+ : e2=scalarExpr
+ | e1=coverageVariable
+ | LPAREN e7=coverageExpr RPAREN
+ | e3=coverageConstantExpr
+ | e4=coverageConstructorExpr
+ | e5=setMetaDataExpr
+ | e6=rangeConstructorExpr
+ ;
+scalarExpr
+ : e1=metaDataExpr
+ | e2=condenseExpr
+ | e3=booleanScalarExpr
+ | e4=numericScalarExpr
+ | e5=stringScalarExpr
+ | LPAREN e6=scalarExpr RPAREN
+ ;
+metaDataExpr
+ : op=IDENTIFIER LPAREN e1=coverageExpr RPAREN
+ | op=IMAGECRS LPAREN e1=coverageExpr RPAREN
+ | op=IMAGECRSDOMAIN LPAREN e1=coverageExpr (COMMA e2=axisName)? RPAREN
+ | op=CRSSET LPAREN e1=coverageExpr RPAREN
+ | de=domainExpr
+ | op=NULLSET LPAREN e1=coverageExpr RPAREN
+ | op=INTERPOLATIONDEFAULT LPAREN e1=coverageExpr COMMA f1=fieldName RPAREN
+ | op=INTERPOLATIONSET LPAREN e1=coverageExpr COMMA f1=fieldName RPAREN
+ ;
+domainExpr
+ : DOMAIN LPAREN var=coverageVariable COMMA axis=axisName COMMA crs=crsName RPAREN
+ ;
+condenseExpr
+ : e1=reduceExpr
+ | e2=generalCondenseExpr
+ ;
+reduceExpr
+ : op=(ALL|SOME|COUNT|ADD|AVG|MIN|MAX) LPAREN e1=coverageExpr RPAREN
+ ;
+generalCondenseExpr
+ : CONDENSE op=condenseOpType OVER ail=axisIteratorList
+ (WHERE cond=booleanScalarExpr )?
+ (USING ce=coverageExpr)
+ ;
+axisIteratorList
+ : vn=variableName an=axisName LPAREN ie=intervalExpr RPAREN
+
+ (COMMA vn2=variableName an2=axisName LPAREN ie2=intervalExpr RPAREN
+ )*
+ ;
+intervalExpr
+ : lo=indexExpr COLON hi=indexExpr
+
+ | IMAGECRSDOMAIN LPAREN e1=coverageName COMMA e2=axisName RPAREN
+
+ ;
+coverageConstantExpr
+ : COVERAGE aname=coverageName OVER iter=axisIteratorList VALUE LIST LT values=constantList GT
+
+ ;
+constantList
+ : c=constant (SEMICOLON c=constant )*
+ ;
+coverageConstructorExpr
+ : COVERAGE coverage=coverageName OVER ail=axisIteratorList VALUES se=scalarExpr
+
+ ;
+setMetaDataExpr
+ : op=SETIDENTIFIER LPAREN s=stringConstant COMMA e1=coverageExpr RPAREN
+
+ | op=SETCRSSET LPAREN e1=coverageExpr COMMA crs=crsList RPAREN
+
+ | op=SETNULLSET LPAREN e1=coverageExpr COMMA rel=rangeExprList RPAREN
+
+ | op=SETINTERPOLATIONDEFAULT LPAREN e1=coverageExpr COMMA fn=fieldName COMMA im=interpolationMethod RPAREN
+
+ | op=SETINTERPOLATIONSET LPAREN e1=coverageExpr COMMA fn=fieldName COMMA iml=interpolationMethodList RPAREN
+
+ ;
+crsList
+ : LBRACE (crs=crsName (COMMA crs=crsName )* )? RBRACE
+ ;
+rangeExprList
+ : LBRACE (re1=rangeExpr (COMMA re2=rangeExpr )* )? RBRACE
+ ;
+interpolationMethodList
+ : LBRACE (e=interpolationMethod (COMMA e=interpolationMethod )*)? RBRACE
+ ;
+rangeExpr
+ : STRUCT LBRACE
+ (field=fieldName COLON expr=scalarExpr
+ (COLON field=fieldName COLON expr=scalarExpr )*
+ )? RBRACE
+ ;
+rangeConstructorExpr
+ : (STRUCT)? LBRACE field=fieldName COLON expr=coverageExpr
+ (SEMICOLON field=fieldName COLON expr=coverageExpr )* RBRACE
+ ;
+crsTransformExpr
+ : CRSTRANSFORM LPAREN e1=coverageExpr COMMA dcl=dimensionIntervalList COMMA fil=fieldInterpolationList RPAREN
+
+ ;
+fieldInterpolationList
+ : LBRACE elem=fieldInterpolationElement
+ (COMMA elem=fieldInterpolationElement ) * RBRACE
+ ;
+fieldInterpolationElement
+ : aname=fieldName method=interpolationMethod
+ ;
+unaryInducedExpr
+ : e6=fieldExpr
+ | e1=unaryArithmeticExpr
+ | e2=exponentialExpr
+ | e3=trigonometricExpr
+ | e4=booleanExpr
+ | e5=castExpr
+ | e7=rangeConstructorExpr
+ ;
+unaryArithmeticExpr
+ : op=(MINUS|PLUS) e1=coverageAtom
+ | op=(SQRT|ABS|RE|IM) LPAREN e2=coverageExpr RPAREN
+ ;
+exponentialExpr
+ : op=(EXP|LOG|LN) LPAREN e1=coverageExpr RPAREN
+ ;
+trigonometricExpr
+ : op=(SIN|COS|TAN|SINH|COSH|TANH|ARCSIN|ARCCOS|ARCTAN) LPAREN e1=coverageExpr RPAREN
+ ;
+booleanExpr
+ : op=NOT e1=coverageExpr
+ | op=BIT LPAREN e1=coverageExpr COMMA e2=indexExpr RPAREN
+ ;
+indexExpr
+ : e1=indexTerm
+ (op=(PLUS|MINUS) e2=indexTerm )*
+ ;
+indexTerm
+ : e1=indexFactor
+ ((op=(MULT|DIVIDE) e2=indexFactor ))*
+ ;
+indexFactor
+ : e=INTEGERCONSTANT
+ | op=ROUND LPAREN e1=numericScalarExpr RPAREN
+ | (LPAREN e2=indexExpr RPAREN )
+ ;
+stringScalarExpr
+// The first rule should be "metaDataExpr", but currently only a variable "identifier" is allowed.
+ : op=IDENTIFIER LPAREN e1=coverageExpr RPAREN
+ | e=STRING
+ ;
+scaleExpr
+ : SCALE LPAREN e1=coverageExpr COMMA dil=dimensionIntervalList COMMA fil=fieldInterpolationList RPAREN
+
+ ;
+subsetExpr
+ : e1=trimExpr
+ | e2=sliceExpr
+ | e3=extendExpr
+ ;
+trimExpr
+ : e1=coverageAtom LBRACKET dil=dimensionIntervalList RBRACKET
+ | TRIM LPAREN e2=coverageExpr COMMA LBRACE dil=dimensionIntervalList RBRACE RPAREN
+ ;
+sliceExpr
+ : e1=coverageAtom LBRACKET dpl=dimensionPointList RBRACKET
+ | SLICE LPAREN e2=coverageExpr COMMA LBRACE dpl=dimensionPointList RBRACE RPAREN
+ ;
+extendExpr
+ : EXTEND LPAREN e1=coverageExpr COMMA dil=dimensionIntervalList RPAREN
+ ;
+castExpr
+ : LPAREN e1=rangeType RPAREN e2=coverageExpr
+ ;
+rangeType
+ : type=(BOOLEAN|CHAR|SHORT|LONG|FLOAT|DOUBLE|COMPLEX|COMPLEX2)
+ | UNSIGNED type=(CHAR|SHORT|LONG)
+ ;
+fieldExpr
+ : e1=coverageAtom DOT e2=fieldName
+ ;
+// NOTE: The following boolean rules are equivalent to the grammar rules in document 08-068r2
+// They have been rewritten in order to prioritize the boolean operators
+booleanScalarExpr
+ : e1=booleanScalarTerm
+ (op=(OR|XOR) e2=booleanScalarTerm )*
+ ;
+booleanScalarTerm
+ : e1=booleanScalarNegation
+ (op=AND e2=booleanScalarNegation )*
+ ;
+booleanScalarNegation
+ : e1=booleanScalarAtom
+ | op=NOT e1=booleanScalarAtom
+ ;
+booleanScalarAtom
+ : LPAREN e1=booleanScalarExpr RPAREN
+ | s1=stringScalarExpr cop=compOp s2=stringScalarExpr
+ | n1=numericScalarExpr cop=compOp n2=numericScalarExpr
+ | e=BOOLEANCONSTANT
+ ;
+numericScalarExpr
+ : e1=numericScalarTerm
+ (op=(PLUS|MINUS) e2=numericScalarTerm )*
+ ;
+numericScalarTerm
+ : e1=numericScalarFactor
+ (op=(MULT|DIVIDE) e2=numericScalarFactor )*
+ ;
+numericScalarFactor
+ : LPAREN e1=numericScalarExpr RPAREN
+ | op=MINUS e10=numericScalarFactor
+ | op=ROUND LPAREN e1=numericScalarExpr RPAREN
+ | e=INTEGERCONSTANT
+ | e=FLOATCONSTANT
+ | e2=complexConstant
+ | e3=condenseExpr
+ | e4=variableName
+ ;
+compOp
+ : EQUALS
+ | NOTEQUALS
+ | LT
+ | GT
+ | LTE
+ | GTE
+ ;
+dimensionIntervalList
+ : elem=dimensionIntervalElement
+ (COMMA elem=dimensionIntervalElement )*
+ ;
+dimensionIntervalElement
+ : aname=axisName (COLON crs=crsName )?
+ LPAREN die=dimensionIntervalExpr RPAREN
+ ;
+dimensionIntervalExpr
+ : e1=scalarExpr COLON e2=scalarExpr
+ | DOMAIN LPAREN e3=coverageName COLON e4=axisName COLON e5=crsName RPAREN
+ ;
+dimensionPointList
+ : elem1=dimensionPointElement
+ (COMMA elem2=dimensionPointElement )*
+ ;
+dimensionPointElement
+ : aname=axisName LPAREN dpe=dimensionPoint RPAREN
+ | aname=axisName COLON crs=crsName LPAREN dpe=dimensionPoint RPAREN
+ ;
+dimensionPoint
+ : e1=scalarExpr
+ ;
+interpolationMethod
+ : LPAREN type=interpolationType COLON res=nullResistence RPAREN
+ ;
+interpolationType
+ : type=(NEAREST|LINEAR|QUADRATIC|CUBIC)
+ ;
+nullResistence
+ : resistance=(FULL|NONE|HALF|OTHER)
+ ;
+condenseOpType
+ : op=(PLUS|MULT|MAX|MIN|AND|OR)
+ ;
+fieldName
+ : name
+ ;
+constant
+ : e=(STRING|BOOLEANCONSTANT|INTEGERCONSTANT|FLOATCONSTANT)
+ | e1=complexConstant
+ ;
+complexConstant
+ : LPAREN re1=FLOATCONSTANT COMMA im1=FLOATCONSTANT RPAREN
+ ;
+stringConstant
+ : s=STRING
+ ;
+name
+ : var=(NAME | STRING | INTEGERCONSTANT)
+ ;
+crsName
+ : s=stringConstant
+ ;
+axisName
+ : type1=name
+ ;
+variableName
+ : var=VARIABLE_DOLLAR
+ ;
+coverageVariable
+ : var=NAME
+ ;
+coverageName
+ : name
+ ;
+
+
+/* Lexer rules */
+PLUS: '+';
+MINUS: '-';
+DIVIDE: '/';
+MULT: '*';
+EQUALS: '=';
+NOTEQUALS: '!=';
+LT: '<';
+GT: '>';
+LTE: '<=';
+GTE: '>=';
+DOT: '.';
+LPAREN: '(';
+RPAREN: ')';
+LBRACKET: '[';
+RBRACKET: ']';
+LBRACE: '{';
+RBRACE: '}';
+COMMA: ',';
+COLON: ':';
+SEMICOLON: ';';
+FOR: ('f'|'F')('o'|'O')('r'|'R');
+IN: ('i'|'I')('n'|'N');
+WHERE: ('w'|'W')('h'|'H')('e'|'E')('r'|'R')('e'|'E');
+RETURN: ('r'|'R')('e'|'E')('t'|'T')('u'|'U')('r'|'R')('n'|'N');
+STORE: ('s'|'S')('t'|'T')('o'|'O')('r'|'R')('e'|'E');
+ENCODE: ('e'|'E')('n'|'N')('c'|'C')('o'|'O')('d'|'D')('e'|'E');
+SQRT: ('s'|'S')('q'|'Q')('r'|'R')('t'|'T');
+SIN: ('s'|'S')('i'|'I')('n'|'N');
+COS: ('c'|'C')('o'|'O')('s'|'S');
+TAN: ('t'|'T')('a'|'A')('n'|'N');
+SINH: ('s'|'S')('i'|'I')('n'|'N')('h'|'H');
+COSH: ('c'|'C')('o'|'O')('s'|'S')('h'|'H');
+TANH: ('t'|'T')('a'|'A')('n'|'N')('h'|'H');
+ARCSIN: ('a'|'A')('r'|'R')('c'|'C')('s'|'S')('i'|'I')('n'|'N');
+ARCCOS: ('a'|'A')('r'|'R')('c'|'C')('c'|'C')('o'|'O')('s'|'S');
+ARCTAN: ('a'|'A')('r'|'R')('c'|'C')('t'|'T')('a'|'A')('n'|'N');
+EXP: ('e'|'E')('x'|'X')('p'|'P');
+LN: ('l'|'L')('n'|'N');
+LOG: ('l'|'L')('o'|'O')('g'|'G');
+ROUND: ('r'|'R')('o'|'O')('u'|'U')('n'|'N')('d'|'D');
+ABS: ('a'|'A')('b'|'B')('s'|'S');
+OVERLAY: ('o'|'O')('v'|'V')('e'|'E')('r'|'R')('l'|'L')('a'|'A')('y'|'Y');
+STRUCT: ('s'|'S')('t'|'T')('r'|'R')('u'|'U')('c'|'C')('t'|'T');
+RE: ('r'|'R')('e'|'E');
+IM: ('i'|'I')('m'|'M');
+AND: ('a'|'A')('n'|'N')('d'|'D');
+OR: ('o'|'O')('r'|'R');
+XOR: ('x'|'X')('o'|'O')('r'|'R');
+NOT: ('n'|'N')('o'|'O')('t'|'T');
+IDENTIFIER: ('i'|'I')('d'|'D')('e'|'E')('n'|'N')('t'|'T')('i'|'I')('f'|'F')('i'|'I')('e'|'E')('r'|'R');
+IMAGECRS: ('i'|'I')('m'|'M')('a'|'A')('g'|'G')('e'|'E')('c'|'C')('r'|'R')('s'|'S');
+IMAGECRSDOMAIN: ('i'|'I')('m'|'M')('a'|'A')('g'|'G')('e'|'E')('c'|'C')('r'|'R')('s'|'S')('d'|'D')('o'|'O')('m'|'M')('a'|'A')('i'|'I')('n'|'N');
+CRSSET: ('c'|'C')('r'|'R')('s'|'S')('s'|'S')('e'|'E')('t'|'T');
+DOMAIN: ('d'|'D')('o'|'O')('m'|'M')('a'|'A')('i'|'I')('n'|'N');
+NULLSET: ('n'|'N')('u'|'U')('l'|'L')('l'|'L')('s'|'S')('e'|'E')('t'|'T');
+NULLDEFAULT: ('n'|'N')('u'|'U')('l'|'L')('l'|'L')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+INTERPOLATIONDEFAULT: ('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+INTERPOLATIONSET: ('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('s'|'S')('e'|'E')('t'|'T');
+SETIDENTIFIER: ('s'|'S')('e'|'E')('t'|'T')('i'|'I')('d'|'D')('e'|'E')('n'|'N')('t'|'T')('i'|'I')('f'|'F')('i'|'I')('e'|'E')('r'|'R');
+SETNULLSET: ('s'|'S')('e'|'E')('t'|'T')('n'|'N')('u'|'U')('l'|'L')('l'|'L')('s'|'S')('e'|'E')('t'|'T');
+SETINTERPOLATIONDEFAULT: ('s'|'S')('e'|'E')('t'|'T')('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('f'|'F')('a'|'A')('u'|'U')('l'|'L')('t'|'T');
+SETINTERPOLATIONSET:('s'|'S')('e'|'E')('t'|'T')('i'|'I')('n'|'N')('t'|'T')('e'|'E')('r'|'R')('p'|'P')('o'|'O')('l'|'L')('a'|'A')('t'|'T')('i'|'I')('o'|'O')('n'|'N')('s'|'S')('e'|'E')('t'|'T');
+SETCRSSET: ('s'|'S')('e'|'E')('t'|'T')('c'|'C')('r'|'R')('s'|'S')('s'|'S')('e'|'E')('t'|'T');
+TRIM: ('t'|'T')('r'|'R')('i'|'I')('m'|'M');
+SLICE: ('s'|'S')('l'|'L')('i'|'I')('c'|'C')('e'|'E');
+EXTEND: ('e'|'E')('x'|'X')('t'|'T')('e'|'E')('n'|'N')('d'|'D');
+SCALE: ('s'|'S')('c'|'C')('a'|'A')('l'|'L')('e'|'E');
+CRSTRANSFORM: ('c'|'C')('r'|'R')('s'|'S')('t'|'T')('r'|'R')('a'|'A')('n'|'N')('s'|'S')('f'|'F')('o'|'O')('r'|'R')('m'|'M');
+COUNT: ('c'|'C')('o'|'O')('u'|'U')('n'|'N')('t'|'T');
+ADD: ('a'|'A')('d'|'D')('d'|'D');
+AVG: ('a'|'A')('v'|'V')('g'|'G');
+MAX: ('m'|'M')('a'|'A')('x'|'X');
+MIN: ('m'|'M')('i'|'I')('n'|'N');
+SOME: ('s'|'S')('o'|'O')('m'|'M')('e'|'E');
+ALL: ('a'|'A')('l'|'L')('l'|'L');
+COVERAGE: ('c'|'C')('o'|'O')('v'|'V')('e'|'E')('r'|'R')('a'|'A')('g'|'G')('e'|'E');
+OVER: ('o'|'O')('v'|'V')('e'|'E')('r'|'R');
+VALUE: ('v'|'V')('a'|'A')('l'|'L')('u'|'U')('e'|'E');
+VALUES: ('v'|'V')('a'|'A')('l'|'L')('u'|'U')('e'|'E')('s'|'S');
+LIST: ('l'|'L')('i'|'I')('s'|'S')('t'|'T');
+CONDENSE: ('c'|'C')('o'|'O')('n'|'N')('d'|'D')('e'|'E')('n'|'N')('s'|'S')('e'|'E');
+USING: ('u'|'U')('s'|'S')('i'|'I')('n'|'N')('g'|'G');
+NEAREST: ('n'|'N')('e'|'E')('a'|'A')('r'|'R')('e'|'E')('s'|'S')('t'|'T');
+LINEAR: ('l'|'L')('i'|'I')('n'|'N')('e'|'E')('a'|'A')('r'|'R');
+QUADRATIC: ('q'|'Q')('u'|'U')('a'|'A')('d'|'D')('r'|'R')('a'|'A')('t'|'T')('i'|'I')('c'|'C');
+CUBIC: ('c'|'C')('u'|'U')('b'|'B')('i'|'I')('c'|'C');
+FULL: ('f'|'F')('u'|'U')('l'|'L')('l'|'L');
+NONE: ('n'|'N')('o'|'O')('n'|'N')('e'|'E');
+HALF: ('h'|'H')('a'|'A')('l'|'L')('f'|'F');
+OTHER: ('o'|'O')('t'|'T')('h'|'H')('e'|'E')('r'|'R');
+PHI: ('p'|'P')('h'|'H')('i'|'I');
+BIT: ('b'|'B')('i'|'I')('t'|'T');
+UNSIGNED: ('u'|'U')('n'|'N')('s'|'S')('i'|'I')('g'|'G')('n'|'N')('e'|'E')('d'|'D');
+BOOLEAN: ('b'|'B')('o'|'O')('o'|'O')('l'|'L')('e'|'E')('a'|'A')('n'|'N');
+CHAR: ('c'|'C')('h'|'H')('a'|'A')('r'|'R');
+SHORT: ('s'|'S')('h'|'H')('o'|'O')('r'|'R')('t'|'T');
+LONG: ('l'|'L')('o'|'O')('n'|'N')('g'|'G');
+FLOAT: ('f'|'F')('l'|'L')('o'|'O')('a'|'A')('t'|'T');
+DOUBLE: ('d'|'D')('o'|'O')('u'|'U')('b'|'B')('l'|'L')('e'|'E');
+COMPLEX: ('c'|'C')('o'|'O')('m'|'M')('p'|'P')('l'|'L')('e'|'E')('x'|'X');
+COMPLEX2: ('c'|'C')('o'|'O')('m'|'M')('p'|'P')('l'|'L')('e'|'E')('x'|'X')'2';
+BOOLEANCONSTANT: (('t'|'T')('r'|'R')('u'|'U')('e'|'E'))|(('f'|'F')('a'|'A')('l'|'L')('s'|'S')('e'|'E'));
+INTEGERCONSTANT: (PLUS|MINUS)? ('0'..'9')+;
+FLOATCONSTANT: INTEGERCONSTANT ('.')('0'..'9'+)(('e'|'E')(('-'|'+')?)('0'..'9'+))?;
+STRING: '"' ( options {greedy=false;} : . )* '"' {setText(getText().substring(1, getText().length()-1));};
+NAME: ('a'..'z'|'A'..'Z'|'_')(('a'..'z'|'A'..'Z'|'0'..'9'|'_')*);
+VARIABLE_DOLLAR: '$'(('a'..'z'|'A'..'Z'|'0'..'9'|'_')*) {setText(getText().substring(1, getText().length())); } ;
+WHITESPACE: (' ' | '\t' | '\r' | '\n' | '\u000C')+ { skip(); } ;
diff --git a/petascope/src/petascope/wcps/server/cli/f_grammar.java b/petascope/src/petascope/wcps/server/cli/f_grammar.java
new file mode 100644
index 0000000..79dfca8
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/cli/f_grammar.java
@@ -0,0 +1,60 @@
+package petascope.wcps.server.cli;
+
+import petascope.wcps.grammar.*;
+import petascope.wcps.grammar.wcpsParser.*;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import org.antlr.runtime.ANTLRInputStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.RecognitionException;
+import org.apache.commons.io.FileUtils;
+
+/** Test the WCPS grammar parser (generated by ANTLR).
+ * Input the path that contains an Abstract Syntax query.
+ * Outputs the corresponding XML tree.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class f_grammar {
+
+ private static String query;
+ private static String path;
+
+ public static void main(String[] args) throws RecognitionException, IOException {
+ if (args.length != 1) {
+ System.err.println("AbstractGrammarGen: no parameter to specify input file !");
+ path = "test/test-tmp/29.test";
+ query = FileUtils.readFileToString(new File(path));
+ } else {
+ path = args[0];
+ query = FileUtils.readFileToString(new File(path));
+ }
+
+ System.out.println("Running with the following query: " + query);
+
+ String xmlString = runQuery(query);
+ System.out.println("Output XML: \n****************\n" + xmlString);
+
+ System.exit(0);
+
+ }
+
+ public static String runQuery(String query) throws IOException, RecognitionException {
+ InputStream stream = new ByteArrayInputStream(query.getBytes()); // defaults to ISO-1
+ ANTLRInputStream inputStream = new ANTLRInputStream(stream);
+// wcpsLexer lexer = new wcpsLexer( inputStream );
+ wcpsLexer lexer = new wcpsLexer(inputStream);
+
+ CommonTokenStream tokenStream = new CommonTokenStream(lexer);
+// wcpsParser parser = new wcpsParser(tokenStream);
+ wcpsParser parser = new wcpsParser(tokenStream);
+
+ wcpsRequest_return rrequest = parser.wcpsRequest();
+ WCPSRequest request = rrequest.value;
+
+ String result = request.toXML();
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/cli/grammar.java b/petascope/src/petascope/wcps/server/cli/grammar.java
new file mode 100644
index 0000000..bc053dc
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/cli/grammar.java
@@ -0,0 +1,65 @@
+package petascope.wcps.server.cli;
+
+import petascope.wcps.grammar.*;
+import petascope.wcps.grammar.wcpsParser.*;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import org.antlr.runtime.ANTLRInputStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.RecognitionException;
+
+/** Test the WCPS grammar parser (generated by ANTLR).
+ * Input an Abstract Syntax query.
+ * Outputs the corresponding XML tree.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class grammar {
+
+ static String query;
+
+ public static void main(String[] args) throws RecognitionException, IOException {
+ if (args.length != 1) {
+ System.err.println("AbstractGrammarGen: no query as parameter !");
+// query = "for a in (rgb) return " +
+// "condense + over $x x(1:10), $y y(25:75) " +
+// "using $x * (a[x($x), y($y)]).red";
+ query = "for c in (rgb) return encode(c[x:\"CRS:1\"(1:200)], \"jpeg\")";
+ } else {
+ query = args[0];
+ }
+
+ System.out.println("Running with the following query: " + query);
+
+ String xmlString = convertAbstractQueryToXml(query);
+ System.out.println("Output XML: \n****************\n" + xmlString);
+
+ System.exit(0);
+
+ }
+
+ /** Converts a WCPS abstract syntax query to an XML query
+ *
+ * @param query Abstract Syntax query
+ * @return String XML query
+ * @throws java.io.IOException
+ * @throws org.antlr.runtime.RecognitionException
+ */
+ public static String convertAbstractQueryToXml(String query) throws IOException, RecognitionException {
+ InputStream stream = new ByteArrayInputStream(query.getBytes()); // defaults to ISO-1
+ ANTLRInputStream inputStream = new ANTLRInputStream(stream);
+// wcpsLexer lexer = new wcpsLexer( inputStream );
+ wcpsLexer lexer = new wcpsLexer(inputStream);
+
+ CommonTokenStream tokenStream = new CommonTokenStream(lexer);
+// wcpsParser parser = new wcpsParser(tokenStream);
+ wcpsParser parser = new wcpsParser(tokenStream);
+
+ wcpsRequest_return rrequest = parser.wcpsRequest();
+ WCPSRequest request = rrequest.value;
+
+ String result = request.toXML();
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/cli/xml.java b/petascope/src/petascope/wcps/server/cli/xml.java
new file mode 100644
index 0000000..e115c8e
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/cli/xml.java
@@ -0,0 +1,155 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.cli;
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcps.server.core.WCPS;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import java.io.StringReader;
+import java.util.Properties;
+import org.xml.sax.InputSource;
+
+/**
+ * This is a small application around the WCPS core. It takes XML requests as files and runs them
+ * through WCPS. The resulting radaman queries are displayed, but not executed. This is very useful
+ * for testing whether your metadata is valid.
+ */
+public class xml {
+
+ private static WCPS wcps;
+ private static DbMetadataSource metadataSource;
+
+ private static void initMetadata() {
+ File cwd = new File(".");
+ System.out.println("Working in " + cwd.getAbsolutePath());
+ String pcSchemaFileName =
+ // "src/conf/" +
+ "xml" + File.separator + "ogc" + File.separator + "wcps"
+ + File.separator + "1.0.0" + File.separator + "wcpsProcessCoverages.xsd";
+ File pcSchemaFile = new File(pcSchemaFileName);
+
+ if (!pcSchemaFile.exists()) {
+ System.err.println("WCPS: could not find the WCPS ProcessCoverage schema ("
+ + pcSchemaFileName + ")");
+ System.exit(1);
+ }
+
+ metadataSource = null;
+
+ try {
+ Properties dbParams = new Properties();
+
+ dbParams.load(new FileInputStream("settings.properties"));
+ metadataSource =
+ new DbMetadataSource(dbParams.getProperty("metadata_driver"),
+ dbParams.getProperty("metadata_url"),
+ dbParams.getProperty("metadata_user"),
+ dbParams.getProperty("metadata_pass"), false);
+ wcps = new WCPS(pcSchemaFile, metadataSource);
+ } catch (Exception e) {
+ System.err.println("WCPS: could not initialize WCPS:");
+ e.printStackTrace(System.err);
+ System.exit(1);
+ }
+ }
+
+ public static void main(String[] args) {
+ if (args.length < 1) {
+ System.err.println("WCPS CLI: no input files");
+
+ System.err.println("\nWCPS CLI Usage: java wcps.server.cli.xml input.xml");
+ System.err.println("Where input.xml contains a ProcessCoverages Request ");
+// System.exit(1);
+
+ args = new String[1];
+ args[0] = "test/testcases-wcps_dollar/25.test.xml";
+ }
+ if (args.length > 1) {
+ System.err.println("WCPS: no input files");
+ System.exit(1);
+ }
+
+ initMetadata();
+
+ for (int i = 0; i < args.length; i++) {
+ File fileIn = null;
+ InputSource is = null;
+
+ try {
+ fileIn = new File(args[i]);
+ is = new InputSource(new FileInputStream(fileIn));
+ } catch (Exception fnfe) {
+ System.err.println("WCPS: " + args[i]
+ + ": no such file or directory" + fnfe);
+ System.exit(1);
+ }
+
+
+ String result = processCoverage(is, i);
+ if (result != null) {
+ System.out.println(result);
+ } else {
+ System.err.println("WCPS: " + args[i] + " failed");
+ System.exit(1);
+ }
+ }
+
+ metadataSource.close();
+ System.exit(0);
+
+ }
+
+ private static String processCoverage(InputSource is, int i) {
+ String result = null;
+
+ try {
+ ProcessCoveragesRequest r = wcps.pcPrepare("http://kahlua.eecs.jacobs-university.de:9001",
+ "RASSERVICE", is);
+ System.err.println("Request " + i);
+ String rasql = r.getRasqlQuery();
+ String mime = r.getMime();
+// result = "[" + mime + "] " + rasql;
+ result = rasql;
+ } catch (Exception e) {
+ System.err.println("WCPS: request " + i
+ + " failed with the following exception:");
+ e.printStackTrace(System.err);
+ }
+
+ return result;
+ }
+
+ /** Converts a WCPS XML query into a RasQL query string **/
+ public static String convertXmlToRasql(String query) {
+ String rasql = null;
+ if (metadataSource == null) {
+ initMetadata();
+ }
+ InputSource is = new InputSource(new StringReader(query));
+ rasql = processCoverage(is, 1);
+ return rasql;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/AxisIterator.java b/petascope/src/petascope/wcps/server/core/AxisIterator.java
new file mode 100644
index 0000000..7421448
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/AxisIterator.java
@@ -0,0 +1,111 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.math.BigInteger;
+import org.w3c.dom.*;
+
+public class AxisIterator implements IRasNode {
+
+ private String var, varTranslation;
+ private AxisName axis;
+ private NumericScalarExpr hi, lo;
+
+ public AxisIterator(Node node, XmlQuery xq, String newIteratorName) throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ System.err.println("Trying to parse AxisIterator ");
+
+ while (node != null) {
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("iteratorVar")) {
+ var = node.getTextContent();
+ // This variable will be referenced later on. Translate it.
+ xq.addReferenceVariable(var, newIteratorName);
+ varTranslation = xq.getReferenceVariableName(var);
+ } else if (nodeName.equals("axis")) {
+ axis = new AxisName(node, xq);
+ } else {
+ // Should contain the limits
+ // TODO: Implement ImageCrsDomainMetadataType class
+ if (lo == null) {
+ lo = new NumericScalarExpr(node, xq);
+ } else if (hi == null) {
+ hi = new NumericScalarExpr(node, xq);
+ } else {
+ throw new WCPSException("Unknown node in AxisIterator: " + nodeName);
+ }
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+ }
+
+ public String toRasQL() {
+ String result = varTranslation + " in [" + lo.toRasQL() + ":" + hi.toRasQL() + "]";
+ return result;
+ }
+
+ /** Sets a new name for the iterator variable, to be used in the rasql query**/
+ public void setVariableTranslation(String newName) {
+ varTranslation = newName;
+ }
+
+ /** Return the Higher bound for the axis iterator.
+ * This only works for constant expressions.
+ * TODO: implement arbitrary expressions.
+ * @return BigInteger
+ */
+ public BigInteger getHigh() {
+ return SDU.str2integer(hi.toRasQL()).get(0);
+ }
+
+ /** Return the Lower bound for the axis iterator.
+ * This only works for constant expressions.
+ * TODO: implement arbitrary expressions.
+ * @return BIgInteger
+ */
+ public BigInteger getLow() {
+ return SDU.str2integer(lo.toRasQL()).get(0);
+ }
+
+ /* Return the variable name used in this axis */
+ public String getVar() {
+ return var;
+ }
+
+ public String getAxisType() {
+ return axis.toRasQL();
+ }
+
+ /* Returns the m-interval that this axis iterates over in a string form */
+ public String getInterval() {
+ return lo.toRasQL() + ":" + hi.toRasQL();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/AxisName.java b/petascope/src/petascope/wcps/server/core/AxisName.java
new file mode 100644
index 0000000..5dd14e5
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/AxisName.java
@@ -0,0 +1,57 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.Collection;
+import org.w3c.dom.*;
+
+public class AxisName implements IRasNode {
+
+ private String name;
+
+ public AxisName(Node node, XmlQuery xq) throws WCPSException {
+ System.err.println("Trying axis node: " + node.getNodeName());
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node != null && node.getNodeName().equals("axis")) {
+ String axis = node.getTextContent();
+ // validate axis name
+ IDynamicMetadataSource meta = xq.getMetadataSource();
+ Collection<String> axisNames = meta.getAxisNames();
+ if (axisNames.contains(axis)) {
+ this.name = axis;
+ } else {
+ throw new WCPSException("Unknown axis name " + axis);
+ }
+ } else {
+ throw new WCPSException("Could not find an axis node !");
+ }
+ }
+
+ public String toRasQL() {
+ return name;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/BinaryOperationCoverageExpr.java b/petascope/src/petascope/wcps/server/core/BinaryOperationCoverageExpr.java
new file mode 100644
index 0000000..2d1fb96
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/BinaryOperationCoverageExpr.java
@@ -0,0 +1,125 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class BinaryOperationCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode first, second;
+ private CoverageExprPairType pair;
+ private CoverageInfo info;
+ private String operation;
+
+ public BinaryOperationCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ String nodeName = node.getNodeName();
+
+ System.err.println("Trying to parse binary operation: " + nodeName);
+ boolean okay = false; // will be true if the node is recognized
+
+ if (nodeName.equals("plus")) {
+ operation = "+";
+ okay = true;
+ }
+
+ if (nodeName.equals("minus")) {
+ operation = "-";
+ okay = true;
+ }
+
+ if (nodeName.equals("mult")) {
+ operation = "*";
+ okay = true;
+ }
+
+ if (nodeName.equals("div")) {
+ operation = "/";
+ okay = true;
+ }
+
+ if (nodeName.equals("and") || nodeName.equals("or") || nodeName.equals("xor")) {
+ operation = nodeName;
+ okay = true;
+ }
+
+ if (nodeName.equals("equals")) {
+ operation = "=";
+ okay = true;
+ }
+
+ if (nodeName.equals("lessThan")) {
+ operation = "<";
+ okay = true;
+ }
+
+ if (nodeName.equals("greaterThan")) {
+ operation = ">";
+ okay = true;
+ }
+
+ if (nodeName.equals("lessOrEqual")) {
+ operation = "<=";
+ okay = true;
+ }
+
+ if (nodeName.equals("greaterOrEqual")) {
+ operation = ">=";
+ okay = true;
+ }
+
+ if (nodeName.equals("notEqual")) {
+ operation = "!=";
+ okay = true;
+ }
+
+ if (nodeName.equals("overlay")) {
+ operation = "overlay";
+ okay = true;
+ }
+
+ if (!okay) {
+ throw new WCPSException("Unexpected binary operation : " + nodeName);
+ }
+
+ Node operand = node.getFirstChild();
+
+ while (operand.getNodeName().equals("#text")) {
+ operand = operand.getNextSibling();
+ }
+
+ pair = new CoverageExprPairType(operand, xq);
+ info = new CoverageInfo(((ICoverageInfo) pair).getCoverageInfo());
+ first = pair.getFirst();
+ second = pair.getSecond();
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ return "((" + first.toRasQL() + ")" + operation + "(" + second.toRasQL() + "))";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/BooleanScalarExpr.java b/petascope/src/petascope/wcps/server/core/BooleanScalarExpr.java
new file mode 100644
index 0000000..1cbe079
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/BooleanScalarExpr.java
@@ -0,0 +1,138 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class BooleanScalarExpr implements IRasNode {
+
+ private IRasNode first, second;
+ private String op;
+ private boolean simple; // true if the expression is just a value
+ private String value;
+
+ public BooleanScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ if (node == null) {
+ throw new WCPSException("Unexpected null node !");
+ }
+
+ String nodeName = node.getNodeName();
+
+ simple = false;
+
+ System.err.println("Parsing boolean scalar operation ...");
+
+ if (nodeName.equals("booleanConstant")) {
+ simple = true;
+ value = node.getFirstChild().getNodeValue();
+ } else if (nodeName.equals("booleanAnd")
+ || nodeName.equals("booleanOr")
+ || nodeName.equals("booleanXor")
+ || nodeName.equals("booleanLessThan")
+ || nodeName.equals("booleanLessOrEqual")
+ || nodeName.equals("booleanGreaterThan")
+ || nodeName.equals("booleanGreaterOrEqual")
+ || nodeName.equals("booleanEqualNumeric")
+ || nodeName.equals("booleanNotEqualNumeric")
+ || nodeName.equals("booleanEqualString")
+ || nodeName.equals("booleanNotEqualString")) {
+ // Logical operations
+ if (nodeName.equals("booleanAnd")
+ || nodeName.equals("booleanOr")
+ || nodeName.equals("booleanXor")) {
+ // Remove the "boolean" in front
+ op = nodeName.substring(7).toLowerCase();
+
+ Node child = node.getFirstChild();
+
+ first = new BooleanScalarExpr(child, xq);
+ child = child.getNextSibling();
+ second = new BooleanScalarExpr(child, xq);
+ } else // Boolean Comparison operations between numbers or strings
+ {
+ if (nodeName.equals("booleanLessThan") || nodeName.equals("booleanLessOrEqual")
+ || nodeName.equals("booleanGreaterThan") || nodeName.equals("booleanGreaterOrEqual")
+ || nodeName.equals("booleanEqualNumeric") || nodeName.equals("booleanNotEqualNumeric")) {
+ if (nodeName.equals("booleanLessThan")) {
+ op = "<";
+ }
+ if (nodeName.equals("booleanLessOrEqual")) {
+ op = "<=";
+ }
+ if (nodeName.equals("booleanGreaterThan")) {
+ op = ">";
+ }
+ if (nodeName.equals("booleanGreaterOrEqual")) {
+ op = ">=";
+ }
+ if (nodeName.equals("booleanEqualNumeric")) {
+ op = "=";
+ }
+ if (nodeName.equals("booleanNotEqualNumeric")) {
+ op = "!=";
+ }
+
+ Node child = node.getFirstChild();
+
+ first = new NumericScalarExpr(child, xq);
+ child = child.getNextSibling();
+ second = new NumericScalarExpr(child, xq);
+ } else {
+ if (nodeName.equals("booleanEqualString")) {
+ op = "=";
+ }
+ if (nodeName.equals("booleanNotEqualString")) {
+ op = "!=";
+ }
+
+ Node child = node.getFirstChild();
+
+ first = new StringScalarExpr(child, xq);
+ child = child.getNextSibling();
+ second = new StringScalarExpr(child, xq);
+ }
+ }
+
+ } else if (nodeName.equals("booleanNot")) {
+ op = "not";
+ first = new BooleanScalarExpr(node.getFirstChild(), xq);
+ } else {
+ throw new WCPSException("Unexpected Binary Expression node : "
+ + node.getNodeName());
+ }
+ System.err.println("*** Boolean Scalar Expr SUCCESS: " + node.getNodeName());
+ }
+
+ public String toRasQL() {
+ if (simple) {
+ return value;
+ }
+
+ if (op.equals("not")) {
+ return "not(" + first.toRasQL() + ")";
+ }
+
+ return "(" + first.toRasQL() + ")" + op + "(" + second.toRasQL() + ")";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CellDomainElement.java b/petascope/src/petascope/wcps/server/core/CellDomainElement.java
new file mode 100644
index 0000000..f5e069f
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CellDomainElement.java
@@ -0,0 +1,79 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.math.BigInteger;
+
+//A coverage axis in pixel coordinates. See the WCPS standard.
+public class CellDomainElement implements Cloneable {
+
+ private BigInteger hi;
+ private BigInteger lo;
+
+ public CellDomainElement(BigInteger lo, BigInteger hi) throws InvalidMetadataException {
+ if ((lo == null) || (hi == null)) {
+ throw new InvalidMetadataException(
+ "Invalid cell domain element: Bounds may not be null");
+ }
+
+ if (lo.compareTo(hi) == 1) {
+ throw new InvalidMetadataException(
+ "Invalid cell domain element: Lower bound cannot be larger than upper bound");
+ }
+
+ this.lo = lo;
+ this.hi = hi;
+
+ }
+
+ public CellDomainElement clone() {
+ try {
+ return new CellDomainElement(BigInteger.ZERO.add(lo),
+ BigInteger.ZERO.add(hi));
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException(
+ "Invalid metadata while cloning CellDomainElement. This is a software bug in WCPS.",
+ ime);
+ }
+
+ }
+
+ public boolean equals(CellDomainElement cde) {
+ return lo.equals(cde.lo) && hi.equals(cde.hi);
+
+ }
+
+ public BigInteger getHi() {
+ return hi;
+
+ }
+
+ public BigInteger getLo() {
+ return lo;
+ }
+
+ public String toString() {
+ String result = "CellDomainElement [" + lo + ", " + hi + "]";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ComplexConstant.java b/petascope/src/petascope/wcps/server/core/ComplexConstant.java
new file mode 100644
index 0000000..2d7312c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ComplexConstant.java
@@ -0,0 +1,121 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class ComplexConstant implements IRasNode {
+
+ private String re, im;
+
+ public ComplexConstant(String str) throws WCPSException {
+ boolean ok = true;
+ // We only accept the following String representation of a complex number: {re,im}
+ if (str.startsWith("{") && str.endsWith("}")) {
+ str = str.substring(1, str.length() - 2);
+ if (str.indexOf(",") != -1 && str.lastIndexOf(",") != str.indexOf(",")) {
+ int comma = str.indexOf(",");
+ re = str.substring(0, comma - 1);
+ im = str.substring(comma + 1, str.length() - comma - 1);
+ } else {
+ ok = false;
+ }
+ } else {
+ ok = false;
+ }
+ if (ok == false) {
+ throw new WCPSException("Could not parse Complex Constant !");
+ }
+
+ // parse the real part
+ try {
+ Integer real = Integer.parseInt(re);
+ } catch (NumberFormatException e) {
+ try {
+ Float real = Float.parseFloat(re);
+ } catch (NumberFormatException e2) {
+ throw new WCPSException("Could not parse float or integer "
+ + "number for real part of complex number:" + re);
+ }
+ }
+ // parse the imaginary part
+ try {
+ Integer imag = Integer.parseInt(im);
+ } catch (NumberFormatException e) {
+ try {
+ Float imag = Float.parseFloat(im);
+ } catch (NumberFormatException e2) {
+ throw new WCPSException("Could not parse float or integer "
+ + "number for imaginary part of complex number" + im);
+ }
+ }
+ }
+
+ public ComplexConstant(Node node, XmlQuery xq) throws WCPSException {
+ System.err.println("Parsing complex constant: " + node.getNodeName());
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ while (node != null) {
+ String name = node.getNodeName();
+ if (name.equals("re")) {
+ re = node.getNodeValue();
+ } else if (name.equals("im")) {
+ im = node.getNodeValue();
+ } else {
+ throw new WCPSException("Unknown node while processing complex constant: " + name);
+ }
+
+ node = node.getNextSibling();
+ }
+
+ // parse the real part
+ try {
+ Integer real = Integer.parseInt(re);
+ } catch (NumberFormatException e) {
+ try {
+ Float real = Float.parseFloat(re);
+ } catch (NumberFormatException e2) {
+ throw new WCPSException("Could not parse float or integer "
+ + "number for real part of complex number:" + re);
+ }
+ }
+ // parse the imaginary part
+ try {
+ Integer imag = Integer.parseInt(im);
+ } catch (NumberFormatException e) {
+ try {
+ Float imag = Float.parseFloat(im);
+ } catch (NumberFormatException e2) {
+ throw new WCPSException("Could not parse float or integer "
+ + "number for imaginary part of complex number" + im);
+ }
+ }
+ }
+
+ public String toRasQL() {
+ return "complex ( " + re + ", " + im + " ) ";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CondenseOperation.java b/petascope/src/petascope/wcps/server/core/CondenseOperation.java
new file mode 100644
index 0000000..08ac95c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CondenseOperation.java
@@ -0,0 +1,73 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class CondenseOperation implements IRasNode {
+
+ private String name;
+
+ public CondenseOperation(Node node, XmlQuery xq) throws WCPSException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ System.err.println("Parsing condense Operation: " + node.getNodeName());
+
+ String text = node.getNodeName();
+ this.name = formatOperation(text);
+
+ if (name == null) {
+ throw new WCPSException("Unknown condense operation: " + text);
+ }
+ }
+
+ private String formatOperation(String name) {
+ String shortOp = null;
+ if (name.equals("opPlus")) {
+ shortOp = "+";
+ }
+ if (name.equals("opMult")) {
+ shortOp = "*";
+ }
+ if (name.equals("opMin")) {
+ shortOp = "min";
+ }
+ if (name.equals("opMax")) {
+ shortOp = "max";
+ }
+ if (name.equals("opAnd")) {
+ shortOp = "and";
+ }
+ if (name.equals("opOr")) {
+ shortOp = "or";
+ }
+
+ return shortOp;
+ }
+
+ public String toRasQL() {
+ return name;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CondenseScalarExpr.java b/petascope/src/petascope/wcps/server/core/CondenseScalarExpr.java
new file mode 100644
index 0000000..d983b1c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CondenseScalarExpr.java
@@ -0,0 +1,98 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.Vector;
+import org.w3c.dom.*;
+
+public class CondenseScalarExpr implements IRasNode {
+
+ private CondenseOperation op;
+ private Vector<AxisIterator> iterators;
+ private IRasNode using;
+ private IRasNode where;
+ private String axisIteratorString;
+ private String newIteratorName;
+
+ public CondenseScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ if (node.getNodeName().equals("condense")) {
+ node = node.getFirstChild();
+ }
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ iterators = new Vector();
+ newIteratorName = xq.registerNewExpressionWithVariables();
+ System.err.println("Parsing Condense Scalar Expression: " + node.getNodeName());
+
+ while (node != null) {
+ String name = node.getNodeName();
+ if (op == null) {
+ op = new CondenseOperation(node, xq);
+ } else if (name.equals("iterator")) {
+ AxisIterator it = new AxisIterator(node.getFirstChild(), xq, newIteratorName);
+ iterators.add(it);
+ } else if (name.equals("where")) {
+ where = new BooleanScalarExpr(node.getFirstChild(), xq);
+ } else {
+ using = new CoverageExpr(node, xq);
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+
+ buildAxisIteratorDomain();
+ }
+
+ public String toRasQL() {
+ String result = "condense " + op.toRasQL() + " over ";
+ result += axisIteratorString;
+ if (where != null) {
+ result += where.toRasQL();
+ }
+ result += " using " + using.toRasQL();
+ return result;
+ }
+
+ /* Concatenates all the AxisIterators into one large multi-dimensional object,
+ * that will be used to build to RasQL query */
+ private void buildAxisIteratorDomain() {
+ axisIteratorString = "";
+ axisIteratorString += newIteratorName + " in [";
+
+ for (int i = 0; i < iterators.size(); i++) {
+ if (i > 0) {
+ axisIteratorString += ", ";
+ }
+ AxisIterator ai = iterators.elementAt(i);
+ axisIteratorString += ai.getInterval();
+ }
+
+ axisIteratorString += "]";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ConstantCoverageExpr.java b/petascope/src/petascope/wcps/server/core/ConstantCoverageExpr.java
new file mode 100644
index 0000000..6bdb4ae
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ConstantCoverageExpr.java
@@ -0,0 +1,164 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Vector;
+import org.w3c.dom.*;
+
+public class ConstantCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private String covName;
+ private Vector<AxisIterator> iterators;
+ private ConstantList valueList;
+ private CoverageInfo info;
+ private String axisIteratorString;
+ private int requiredListSize = 1;
+
+ public ConstantCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ iterators = new Vector();
+ System.err.println("Parsing Constant Coverage Expr: " + node.getNodeName());
+
+ while (node != null) {
+ String name = node.getNodeName();
+ if (name.equals("name")) {
+ covName = node.getTextContent();
+ } else if (name.equals("axisIterator")) {
+ AxisIterator it = new AxisIterator(node.getFirstChild(), xq, "temp");
+ iterators.add(it);
+ } else {
+ valueList = new ConstantList(node, xq);
+ node = valueList.getLastNode();
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+
+ buildMetadata(xq);
+ buildAxisIteratorDomain();
+
+ // Sanity check: dimensions should match number of constants in the list
+ if (valueList.getSize() != requiredListSize) {
+ throw new WCPSException("The number of constants in the list do "
+ + "not match the dimensions specified !");
+ }
+ // Sanity check: metadata should have already been build
+ if (info == null) {
+ throw new WCPSException("Could not build constant coverage metadata !!!");
+ }
+ }
+
+ public String toRasQL() {
+ String result = "< ";
+ result += axisIteratorString + " ";
+ result += valueList.toRasQL();
+ result += ">";
+
+ return result;
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ /* Concatenates all the AxisIterators into one large multi-dimensional object,
+ * that will be used to build to RasQL query. Also counts how many elements
+ * fit in the specified dimensions. */
+ private void buildAxisIteratorDomain() {
+ requiredListSize = 1;
+ axisIteratorString = "";
+ axisIteratorString += "[";
+
+ for (int i = 0; i < iterators.size(); i++) {
+ if (i > 0) {
+ axisIteratorString += ", ";
+ }
+ AxisIterator ai = iterators.elementAt(i);
+ axisIteratorString += ai.getInterval();
+ requiredListSize *= (ai.getHigh().intValue() - ai.getLow().intValue() + 1);
+ }
+
+ axisIteratorString += "]";
+
+ System.err.println("Axes for ConstantCoverage tell us that the constant"
+ + "list should have exactly " + requiredListSize + " elements !");
+ }
+
+ /** Builds full metadata for the newly constructed coverage **/
+ private void buildMetadata(XmlQuery xq) throws WCPSException {
+ List<CellDomainElement> cellDomainList = new LinkedList<CellDomainElement>();
+ List<RangeElement> rangeList = new LinkedList<RangeElement>();
+ HashSet<String> nullSet = new HashSet<String>();
+ String nullDefault = "0";
+ nullSet.add(nullDefault);
+ HashSet<InterpolationMethod> interpolationSet = new HashSet<InterpolationMethod>();
+ InterpolationMethod interpolationDefault = new InterpolationMethod("none", "none");
+ interpolationSet.add(interpolationDefault);
+ String coverageName = covName;
+ List<DomainElement> domainList = new LinkedList<DomainElement>();
+
+ Iterator<AxisIterator> i = iterators.iterator();
+ while (i.hasNext()) {
+ // Build domain metadata
+ AxisIterator ai = i.next();
+ cellDomainList.add(new CellDomainElement(ai.getLow(), ai.getHigh()));
+ String axisName = ai.getVar();
+ String axisType = ai.getAxisType();
+ String crs = DomainElement.WGS84_CRS;
+ HashSet<String> crsset = new HashSet<String>();
+ crsset.add(crs);
+ DomainElement domain = new DomainElement(axisName, axisType,
+ ai.getLow().doubleValue(), ai.getHigh().doubleValue(),
+ null, null, crsset, xq.getMetadataSource().getAxisNames());
+ domainList.add(domain);
+ }
+ // TODO: check element datatypes and their consistency
+ // "unsigned int" is default datatype
+ rangeList.add(new RangeElement("dynamic_type", "unsigned int"));
+
+ try {
+ Metadata metadata = new Metadata(cellDomainList, rangeList, nullSet,
+ nullDefault, interpolationSet, interpolationDefault,
+ coverageName, domainList, null);
+ // Let the top-level query know the full metadata about us
+ xq.getMetadataSource().addDynamicMetadata(covName, metadata);
+ info = new CoverageInfo(metadata);
+ } catch (InvalidMetadataException e) {
+ throw new WCPSException("Could not build coverage '" + covName
+ + "' metadata !", e);
+ }
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ConstantList.java b/petascope/src/petascope/wcps/server/core/ConstantList.java
new file mode 100644
index 0000000..cbbff16
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ConstantList.java
@@ -0,0 +1,104 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import org.w3c.dom.*;
+
+public class ConstantList implements IRasNode {
+
+ private ArrayList<String> list;
+ private String val;
+ private Node lastNode;
+
+ public ConstantList(Node node, XmlQuery xq) throws WCPSException {
+ list = new ArrayList<String>();
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ System.err.println("Trying to parse ConstantList ");
+
+ while (node != null) {
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("value")) {
+ val = node.getTextContent();
+ checkConstant(val);
+ list.add(val);
+ lastNode = node;
+ } else {
+ throw new WCPSException("Unknown node in ConstantList: " + nodeName);
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+
+ System.err.println("Parsed constant list with " + list.size() + " elements !");
+ }
+
+ private void checkConstant(String val) throws WCPSException {
+ boolean ok = false;
+ try {
+ Integer.parseInt(val);
+ ok = true;
+ } catch (NumberFormatException e1) {
+ }
+ try {
+ Float.parseFloat(val);
+ ok = true;
+ } catch (NumberFormatException e2) {
+ }
+ try {
+ new ComplexConstant(val);
+ ok = true;
+ } catch (WCPSException e1) {
+ }
+
+ if (ok == false) {
+ throw new WCPSException("'" + val + "' is not an integer, float, or complex constant !");
+ }
+ }
+
+ public String toRasQL() {
+ String result = list.get(0);
+ for (int i = 1; i < list.size(); i++) {
+ result += ", " + list.get(i);
+ }
+ return result;
+ }
+
+ /** Size of all elements in the constant list **/
+ public int getSize() {
+ return list.size();
+ }
+
+ /** Return the last node of the constant list. **/
+ public Node getLastNode() {
+ return lastNode;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ConstructCoverageExpr.java b/petascope/src/petascope/wcps/server/core/ConstructCoverageExpr.java
new file mode 100644
index 0000000..89343e8
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ConstructCoverageExpr.java
@@ -0,0 +1,161 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Vector;
+import org.w3c.dom.*;
+
+public class ConstructCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private String covName;
+ private Vector<AxisIterator> iterators;
+ private IRasNode values;
+ private CoverageInfo info;
+ private String axisIteratorString;
+ private String newIteratorName;
+
+ public ConstructCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ iterators = new Vector();
+ System.err.println("Parsing Construct Coverage Expr: " + node.getNodeName());
+ newIteratorName = xq.registerNewExpressionWithVariables();
+
+ while (node != null) {
+ String name = node.getNodeName();
+ if (name.equals("name")) {
+ covName = node.getTextContent();
+ } else if (name.equals("axisIterator")) {
+ AxisIterator it = new AxisIterator(node.getFirstChild(), xq, newIteratorName);
+ iterators.add(it);
+ // Top level structures need to know about these iterators
+ CoverageIterator dyn = new CoverageIterator(it.getVar(), covName);
+ xq.addDynamicCoverageIterator(dyn);
+ } else {
+ /* The iterator is probably used in the "values" section,
+ * so send the iterator to the top-level query */
+ if (covName != null && iterators.size() > 0) {
+ buildMetadata(xq);
+ } else {
+ throw new WCPSException("Cannot build coverage metadata !!!");
+ }
+ // And only then start parsing the "values" section
+ values = new ScalarExpr(node, xq);
+ }
+
+ node = node.getNextSibling();
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+ }
+
+ buildAxisIteratorDomain();
+
+ // Sanity check: metadata should have already been build
+ if (info == null) {
+ throw new WCPSException("Could not build coverage metadata !!!");
+ }
+ }
+
+ public String toRasQL() {
+ String result = "marray ";
+ result += axisIteratorString;
+ result += " values " + values.toRasQL();
+
+ return result;
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ /* Concatenates all the AxisIterators into one large multi-dimensional object,
+ * that will be used to build to RasQL query */
+ private void buildAxisIteratorDomain() {
+ axisIteratorString = "";
+ axisIteratorString += newIteratorName + " in [";
+
+ for (int i = 0; i < iterators.size(); i++) {
+ if (i > 0) {
+ axisIteratorString += ", ";
+ }
+ AxisIterator ai = iterators.elementAt(i);
+ axisIteratorString += ai.getInterval();
+ }
+
+ axisIteratorString += "]";
+ }
+
+ /** Builds full metadata for the newly constructed coverage **/
+ private void buildMetadata(XmlQuery xq) throws WCPSException {
+ List<CellDomainElement> cellDomainList = new LinkedList<CellDomainElement>();
+ List<RangeElement> rangeList = new LinkedList<RangeElement>();
+ HashSet<String> nullSet = new HashSet<String>();
+ String nullDefault = "0";
+ nullSet.add(nullDefault);
+ HashSet<InterpolationMethod> interpolationSet = new HashSet<InterpolationMethod>();
+ InterpolationMethod interpolationDefault = new InterpolationMethod("none", "none");
+ interpolationSet.add(interpolationDefault);
+ String coverageName = covName;
+ List<DomainElement> domainList = new LinkedList<DomainElement>();
+
+ Iterator<AxisIterator> i = iterators.iterator();
+ while (i.hasNext()) {
+ // Build domain metadata
+ AxisIterator ai = i.next();
+ cellDomainList.add(new CellDomainElement(ai.getLow(), ai.getHigh()));
+ String axisName = ai.getVar();
+ String axisType = ai.getAxisType();
+ String crs = DomainElement.WGS84_CRS;
+ HashSet<String> crsset = new HashSet<String>();
+ crsset.add(crs);
+ DomainElement domain = new DomainElement(axisName, axisType,
+ ai.getLow().doubleValue(), ai.getHigh().doubleValue(),
+ null, null, crsset, xq.getMetadataSource().getAxisNames());
+ domainList.add(domain);
+ }
+ // "unsigned int" is default datatype
+ rangeList.add(new RangeElement("dynamic_type", "unsigned int"));
+
+ try {
+ Metadata metadata = new Metadata(cellDomainList, rangeList, nullSet,
+ nullDefault, interpolationSet, interpolationDefault,
+ coverageName, domainList, null);
+ // Let the top-level query know the full metadata about us
+ xq.getMetadataSource().addDynamicMetadata(covName, metadata);
+ info = new CoverageInfo(metadata);
+ } catch (InvalidMetadataException e) {
+ throw new WCPSException("Could not build coverage '" + covName
+ + "' metadata !", e);
+ }
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CoverageExpr.java b/petascope/src/petascope/wcps/server/core/CoverageExpr.java
new file mode 100644
index 0000000..d9d9c70
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CoverageExpr.java
@@ -0,0 +1,179 @@
+ /*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.util.Iterator;
+
+public class CoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private String childInfo;
+ private CoverageInfo info;
+ private boolean scalarExpr = false;
+// private String var;
+ private boolean simpleCoverage; // True is the coverage is just a string
+
+ public CoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("CoverageExprType parsing error!");
+ }
+
+ String nodeName = node.getNodeName();
+
+ simpleCoverage = false;
+ System.err.println("CoverageExprType: node " + nodeName);
+
+ if (nodeName.equals("coverage")) {
+ simpleCoverage = true;
+ childInfo = node.getFirstChild().getNodeValue();
+
+ if (!xq.isIteratorDefined(childInfo)) {
+ throw new WCPSException("Iterator " + childInfo + " not defined!");
+ }
+
+ Iterator<String> coverages = xq.getCoverages(childInfo);
+
+ info = new CoverageInfo(xq.getMetadataSource().read(coverages.next()));
+
+ while (coverages.hasNext()) { // Check if all the coverages are compatible
+ CoverageInfo tmp = new CoverageInfo(
+ xq.getMetadataSource().read(
+ coverages.next()));
+
+ if (!tmp.isCompatible(info)) {
+ throw new WCPSException(
+ "Incompatible coverages within the same iterator");
+ }
+ }
+
+ System.err.println("Found simple coverage definition: " + childInfo + ", "
+ + info.toString());
+ } else if (nodeName.equals("crsTransform")) {
+ // TODO: implement CrsTransform class
+ child = new CrsTransformCoverageExpr(node, xq);
+ } else if (nodeName.equals("scale")) {
+ // TODO: implement class ScaleCoverageExprType
+ child = new ScaleCoverageExpr(node, xq);
+ } else if (nodeName.equals("construct")) {
+ child = new ConstructCoverageExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("const")) {
+ child = new ConstantCoverageExpr(node.getFirstChild(), xq);
+ } // else if (nodeName.equals("variableRef"))
+ // {
+ // child = new VariableReference(node, xq);
+ // }
+ else { // Try one of the groups
+ child = null;
+
+ if (child == null) {
+ try {
+ child = new SetMetadataCoverageExpr(node, xq);
+ System.err.println("Matched set metadata operation.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match set metadata operation: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+ if (child == null) {
+ try {
+ child = new InducedOperationCoverageExpr(node, xq);
+ System.err.println("Matched induced coverage expression operation.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match induced coverage expression operation: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ if (e.getMessage().equals("Method not implemented")) {
+ throw e;
+ }
+ }
+ }
+
+ if (child == null) {
+ try {
+ child = new SubsetOperationCoverageExpr(node, xq);
+ System.err.println("Matched subset operation.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match subset operation: "
+ + "\nRetrying");
+ child = null;
+ }
+ }
+
+ if (child == null) {
+ try {
+ child = new ScalarExpr(node, xq);
+ this.scalarExpr = true;
+ System.err.println("Matched scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match scalar expression: "
+ + "\nRetrying");
+ child = null;
+ }
+ }
+ }
+
+ if (!simpleCoverage && (child == null)) {
+ throw new WCPSException("Invalid coverage Expression, next node: "
+ + node.getNodeName());
+ }
+
+ if (info == null) {
+ System.err.println(node.getNodeName());
+ info = new CoverageInfo(((ICoverageInfo) child).getCoverageInfo());
+ }
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public boolean isScalarExpr()
+ {
+ return scalarExpr;
+ }
+
+ public ScalarExpr getScalarExpr()
+ {
+ ScalarExpr r = null;
+ if (scalarExpr)
+ r = (ScalarExpr) child;
+ return r;
+ }
+
+ public String toRasQL() {
+ if (simpleCoverage) {
+ return childInfo;
+ } else {
+ return child.toRasQL();
+ }
+ }
+};
diff --git a/petascope/src/petascope/wcps/server/core/CoverageExprPairType.java b/petascope/src/petascope/wcps/server/core/CoverageExprPairType.java
new file mode 100644
index 0000000..d52e74c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CoverageExprPairType.java
@@ -0,0 +1,103 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class CoverageExprPairType implements IRasNode, ICoverageInfo {
+
+ private IRasNode first, second;
+ private CoverageInfo info;
+ private boolean ok = false;
+
+ public CoverageExprPairType(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ String nodeName = node.getNodeName();
+
+ System.err.println("Trying to parse a coverage expression pair ... Starting at node "
+ + nodeName);
+
+ // Combination 1: CoverageExprType + ScalarExprType
+ if (ok == false) {
+ try {
+ first = new CoverageExpr(node, xq);
+ second = new ScalarExpr(node.getNextSibling(), xq);
+ info = new CoverageInfo(((ICoverageInfo) first).getCoverageInfo());
+ ok = true;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse CoverageExprType + ScalarExprType!");
+ }
+ }
+
+ // Combination 2: ScalarExprType + CoverageExprType
+ if (ok == false) {
+ try {
+ first = new ScalarExpr(node, xq);
+ second = new CoverageExpr(node.getNextSibling(), xq);
+ info = new CoverageInfo(((ICoverageInfo) second).getCoverageInfo());
+ ok = true;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse ScalarExprType + CoverageExprType!");
+ }
+ }
+
+ // Combination 3: CoverageExprType + CoverageExprType
+ if (ok == false) {
+ try {
+ first = new CoverageExpr(node, xq);
+ second = new CoverageExpr(node.getNextSibling(), xq);
+ info = new CoverageInfo(((ICoverageInfo) first).getCoverageInfo());
+ ok = true;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse a CoverageExprType + CoverageExprType!");
+ }
+ }
+
+
+
+ if (ok == false) {
+ throw new WCPSException("Could not parse a coverage expression pair !");
+ }
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ if (ok == true) {
+ return first.toRasQL() + second.toRasQL();
+ } else {
+ return " error ";
+ }
+ }
+
+ public IRasNode getFirst() {
+ return first;
+ }
+
+ public IRasNode getSecond() {
+ return second;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CoverageInfo.java b/petascope/src/petascope/wcps/server/core/CoverageInfo.java
new file mode 100644
index 0000000..d5eb447
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CoverageInfo.java
@@ -0,0 +1,168 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class CoverageInfo {
+
+ private List<CellDomainElement> cellDomains;
+ private List<DomainElement> domains;
+ private String coverageName;
+
+ public CoverageInfo(CoverageInfo other) {
+ cellDomains = new ArrayList<CellDomainElement>();
+ domains = new ArrayList<DomainElement>();
+ int N = other.getNumDimensions();
+
+ for (int i = 0; i < N; ++i) {
+ cellDomains.add(other.getCellDomainElement(i));
+ domains.add(other.getDomainElement(i));
+ }
+
+ coverageName = other.getCoverageName();
+ }
+
+ public CoverageInfo(Metadata m) {
+ cellDomains = new ArrayList<CellDomainElement>();
+ domains = new ArrayList<DomainElement>();
+ Iterator<CellDomainElement> itcde = m.getCellDomainIterator();
+
+ while (itcde.hasNext()) {
+ cellDomains.add(itcde.next());
+ }
+
+ Iterator<DomainElement> itde = m.getDomainIterator();
+
+ while (itde.hasNext()) {
+ domains.add(itde.next());
+ }
+
+ coverageName = m.getCoverageName();
+ }
+
+ public boolean isCompatible(CoverageInfo other) {
+ if (getNumDimensions() != other.getNumDimensions()) {
+ System.err.println("The number of dimensions doesn't match");
+ return false;
+ }
+
+ {
+ Iterator<CellDomainElement> it = cellDomains.iterator();
+ int index = 0;
+
+ while (it.hasNext()) {
+ CellDomainElement me, you;
+
+ me = it.next();
+ you = other.getCellDomainElement(index++);
+
+ if (!me.getHi().equals(you.getHi())) {
+ System.err.println("High values don't match: "
+ + me.getHi().toString() + ", "
+ + you.getHi().toString());
+ return false;
+ }
+
+ if (!me.getLo().equals(you.getLo())) {
+ System.err.println("Low values don't match: "
+ + me.getLo().toString() + ", "
+ + you.getLo().toString());
+ return false;
+ }
+ }
+ }
+ {
+ Iterator<DomainElement> it = domains.iterator();
+ int index = 0;
+
+ while (it.hasNext()) {
+ DomainElement me, you;
+
+ me = it.next();
+ you = other.getDomainElement(index++);
+
+ if (!me.getName().equals(you.getName())) {
+ System.err.println("Domain element names don't match: '"
+ + me.getName() + "' and '"
+ + you.getName() + "'.");
+ return false;
+ }
+
+ // if (me.getName() != you.getName()) return false;
+ }
+ }
+ return true;
+ }
+
+ int getNumDimensions() {
+ return cellDomains.size();
+ }
+
+ public CellDomainElement getCellDomainElement(int dim) {
+ return cellDomains.get(dim);
+ }
+
+ public DomainElement getDomainElement(int dim) {
+ return domains.get(dim);
+ }
+
+ public String getCoverageName() {
+ return coverageName;
+ }
+
+ public void removeDimension(int dim) {
+ cellDomains.remove(dim);
+ domains.remove(dim);
+ }
+
+ public void setDimension(int dim, CellDomainElement cde, DomainElement de) {
+ cellDomains.set(dim, cde);
+ domains.set(dim, de);
+ }
+
+ public void setCellDimension(int dim, CellDomainElement cde) {
+ cellDomains.set(dim, cde);
+ }
+
+ public int getDomainIndexByName(String name) throws WCPSException {
+ System.err.println("Searching for Domain name : " + name);
+ System.err.println("Available domain names are: " + domains.toString());
+
+ Iterator<DomainElement> it = domains.iterator();
+ int index = 0;
+
+ while (it.hasNext()) {
+ if (name.equals(it.next().getName())) {
+ return index;
+ }
+
+ index++;
+ }
+
+ System.err.println("ERROR: Axis name not found: " + name);
+ throw new WCPSException("Domain name not found: " + name);
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CoverageIterator.java b/petascope/src/petascope/wcps/server/core/CoverageIterator.java
new file mode 100644
index 0000000..570295e
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CoverageIterator.java
@@ -0,0 +1,94 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class CoverageIterator implements IRasNode {
+
+ private List<String> coverageNames;
+ private String iteratorName;
+ private boolean dynamic = false; // created from a Construct Coverage expr?
+
+ public CoverageIterator(Node x, XmlQuery xq) throws WCPSException {
+ IDynamicMetadataSource source = xq.getMetadataSource();
+ coverageNames = new ArrayList<String>();
+ if (!x.getNodeName().equals("coverageIterator")) {
+ throw new WCPSException("Invalid cast from " + x.getNodeName()
+ + " XML node to CoverageIterator node");
+ }
+
+ Node it = x.getFirstChild();
+ while (it != null) {
+ if (it.getNodeName().equals("#text")) {
+ it = it.getNextSibling();
+ continue;
+ }
+
+ if (it.getNodeName().equals("iteratorVar")) {
+ iteratorName = it.getFirstChild().getNodeValue();
+ System.err.println("*** Iterator variable : " + iteratorName);
+ } else if (it.getNodeName().equals("coverageName")) {
+ String cn = it.getFirstChild().getNodeValue();
+ System.err.println("*** Coverage reference : " + cn);
+ try {
+ if (!source.coverages().contains(cn)) {
+ throw new WCPSException("Unknown coverage " + cn);
+ }
+ } catch (ResourceException e) {
+ throw new WCPSException(
+ "Cannot load coverage information!", e);
+ }
+
+ coverageNames.add(cn);
+ }
+
+ it = it.getNextSibling();
+ }
+ }
+
+ public CoverageIterator(String iterator, String coverage) throws WCPSException {
+ coverageNames = new ArrayList<String>();
+ iteratorName = iterator;
+ coverageNames.add(coverage);
+ this.dynamic = true;
+ }
+
+ public Iterator<String> getCoverages() {
+ return coverageNames.iterator();
+ }
+
+ public String getIteratorName() {
+ return iteratorName;
+ }
+
+ public String toRasQL() {
+ // TODO(andreia) : How to translate multiple coverages?
+ return coverageNames.get(0) + " AS " + iteratorName;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/Crs.java b/petascope/src/petascope/wcps/server/core/Crs.java
new file mode 100644
index 0000000..e83bed7
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/Crs.java
@@ -0,0 +1,124 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import java.util.Iterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+public class Crs implements IRasNode {
+
+ Logger LOG = LoggerFactory.getLogger(Crs.class);
+ private String crsName;
+
+ public Crs(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ System.err.println("Parsing crs name ...");
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node != null && node.getNodeName().equals("srsName")) {
+ String val = node.getTextContent();
+ this.crsName = val;
+ if (crsName.equals(DomainElement.IMAGE_CRS) || crsName.equals(DomainElement.WGS84_CRS)) {
+ System.err.println("Found CRS: " + crsName);
+ } else {
+ throw new InvalidCrsException("Invalid CRS: '" + crsName + "'");
+ }
+ } else {
+ throw new WCPSException("Could not find a 'srsName' node !");
+ }
+ }
+
+ /***
+ * Converts an array of 4 coordinates (bounding box) expressed in the
+ * current CRS to pixel coordinates.
+ * @param u2 Left-most X point (CRS coordinate)
+ * @param u3 Right-most X point (CRS coordinate)
+ * @param v2 Lower-most Y point (CRS coordinate)
+ * @param v3 Upper-most Y point (CRS coordinate)
+ * @return array of integers, pixel coordinates that represent the given CRS
+ * coordinates.
+ */
+ public long[] convertToPixelCoordinates(Metadata meta, String axisName, Double u2, Double u3, Double v2, Double v3) throws NoApplicableCodeException {
+ Wgs84Crs crs = meta.getCrs();
+ long px0 = -1, px1 = -1, py0 = -1, py1 = -1;
+ // Convert bounding box values to pixel coordinates
+ if (crsName.equals(DomainElement.WGS84_CRS)) {
+ LOG.trace("Converting WGS84 axis {} interval to pixel coordinates ...", axisName);
+ /* Image coordinates */
+ Iterator<CellDomainElement> it = meta.getCellDomainIterator();
+ CellDomainElement X = it.next();
+ CellDomainElement Y = it.next();
+ if (X == null || Y == null) {
+ LOG.error("Could not find the X or Y axis for coverage: " + meta.getCoverageName());
+ throw new NoApplicableCodeException("Could not find the X or Y axis for coverage: " + meta.getCoverageName());
+ }
+ int x0 = X.getLo().intValue();
+ int x1 = X.getHi().intValue();
+ int y0 = Y.getLo().intValue();
+ int y1 = Y.getHi().intValue();
+
+ LOG.trace("Pixel Coordinates: X01 (" + x0 + "," + x1 + ") + Y01 (" + y0 + "," + y1 + ")");
+ /* CRS span */
+ double x2 = crs.getLow1();
+ double y2 = crs.getLow2();
+ double x3 = crs.getHigh1();
+ double y3 = crs.getHigh2();
+ LOG.trace("CRS Coordinates: X23 (" + x2 + "," + x3 + ") + Y23 (" + y2 + "," + y3 + ")");
+ /* For WGS84, the offset = (# pixels)/(CRS span) */
+ double oX = crs.getOffset1();
+ double oY = crs.getOffset2();
+
+ /* The actual conversion is below: */
+ if (axisName.equals("X")) {
+ px0 = Math.round((u2 - x2) / oX) + x0;
+ px1 = Math.round((u3 - u2) / oX) + px0;
+ LOG.debug("CRS Coordinates on axis X: U23 (" + u2 + "," + u3 + ")");
+ LOG.debug("Pixel Coordinates on axis X: U01 (" + px0 + "," + px1 + ") ");
+ }
+ if (axisName.equals("Y")) {
+ py0 = Math.round((y3 - v3) / oY) + y0;
+ py1 = Math.round((v3 - v2) / oY) + py0;
+ LOG.debug("CRS Coordinates on axis Y: V23 (" + v2 + "," + v3 + ")");
+ LOG.debug("Pixel Coordinates on axis Y: V01 (" + py0 + "," + py1 + ")");
+ }
+
+ }
+ long[] longCoord = {px0, px1, py0, py1};
+
+ return longCoord;
+ }
+
+ public String toRasQL() {
+ return crsName;
+ }
+
+ public String getName() {
+ return crsName;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/CrsTransformCoverageExpr.java b/petascope/src/petascope/wcps/server/core/CrsTransformCoverageExpr.java
new file mode 100644
index 0000000..42f900c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/CrsTransformCoverageExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+//TODO(smsorin): how do we do combine this ?
+public class CrsTransformCoverageExpr implements IRasNode, ICoverageInfo {
+
+ public CrsTransformCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException {
+ throw new WCPSException("Method not implemented");
+ }
+
+ public String toRasQL() {
+ return "";
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return null;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DbMetadataSource.java b/petascope/src/petascope/wcps/server/core/DbMetadataSource.java
new file mode 100644
index 0000000..90d6a77
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DbMetadataSource.java
@@ -0,0 +1,1174 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//~--- JDK imports ------------------------------------------------------------
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.math.BigInteger;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Savepoint;
+import java.sql.Statement;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The DbMetadataSource is a IMetadataSource that uses a relational database. It
+ * keeps a global connection which is reused on future requests, as well as between
+ * threads. Before each read, the connection is verified to be valid, and
+ * recreated if necessary. This IMetadataSource is not particularly efficient,
+ * because it accesses the database at least once for every read. To increase
+ * efficiency, wrap a CachedMetadataSource around this one.
+ *
+ */
+public class DbMetadataSource implements IMetadataSource {
+
+ private static Logger LOG = LoggerFactory.getLogger(DbMetadataSource.class);
+
+ /* Status variables */
+ private boolean initializing;
+ private boolean checkAtInit;
+
+ /* Contents of static tables */
+ private Map<Integer, String> axisTypes;
+ private Map<Integer, String> crss;
+ private Map<Integer, String> dataTypes;
+ private Map<Integer, String> interpolationTypes;
+ private Map<Integer, String> nullResistances;
+ private Map<String, String> supportedFormats;
+
+ /* Contents of static tables (reversed, for easy access if you
+ know the something's name and want to find out its id) */
+ private Map<String, Integer> revAxisTypes;
+ private Map<String, Integer> revCrss;
+ private Map<String, Integer> revDataTypes;
+ private Map<String, Integer> revInterpolationTypes;
+ private Map<String, Integer> revNullResistances;
+ private Map<String, String> revSupportedFormats; // Not used
+
+ /* Database access info */
+ private String driver;
+ private String pass;
+ private String url;
+ private String user;
+
+ /* Global database key variables */
+ private Connection conn;
+ private Savepoint savepoint;
+ private String query;
+
+ public DbMetadataSource(String driver, String url, String user, String pass) throws ResourceException, InvalidMetadataException {
+ this(driver, url, user, pass, true);
+ }
+
+ public DbMetadataSource(String driver, String url, String user, String pass, boolean checkAtInit) throws ResourceException, InvalidMetadataException {
+ try {
+ this.driver = driver;
+ Class.forName(driver).newInstance();
+ } catch (ClassNotFoundException e) {
+ throw new ResourceException("Metadata database error: Could not find JDBC driver: " + driver, e);
+ } catch (InstantiationException e) {
+ throw new ResourceException("Metadata database error: Could not instantiate JDBC driver: " + driver, e);
+ } catch (IllegalAccessException e) {
+ throw new ResourceException("Metadata database error: Access denied to JDBC driver: " + driver, e);
+ }
+
+ this.driver = driver;
+ this.url = url;
+ this.user = user;
+ this.pass = pass;
+ Statement s = null;
+
+ try {
+
+ /* Read contents of static metadata tables */
+ ensureConnection();
+
+ axisTypes = new HashMap<Integer, String>();
+ revAxisTypes = new HashMap<String, Integer>();
+ s = conn.createStatement();
+ ResultSet r = s.executeQuery("SELECT id, axisType FROM PS_AxisType");
+
+ while (r.next()) {
+ axisTypes.put(r.getInt("id"), r.getString("axisType"));
+ revAxisTypes.put(r.getString("axisType"), r.getInt("id"));
+ }
+
+ dataTypes = new HashMap<Integer, String>();
+ revDataTypes = new HashMap<String, Integer>();
+ r = s.executeQuery("SELECT id, dataType FROM PS_Datatype");
+
+ while (r.next()) {
+ dataTypes.put(r.getInt("id"), r.getString("dataType"));
+ revDataTypes.put(r.getString("dataType"), r.getInt("id"));
+ }
+
+ interpolationTypes = new HashMap<Integer, String>();
+ revInterpolationTypes = new HashMap<String, Integer>();
+ r = s.executeQuery("SELECT id, interpolationType FROM PS_InterpolationType");
+
+ while (r.next()) {
+ interpolationTypes.put(r.getInt("id"), r.getString("interpolationType"));
+ revInterpolationTypes.put(r.getString("interpolationType"), r.getInt("id"));
+ }
+
+ nullResistances = new HashMap<Integer, String>();
+ revNullResistances = new HashMap<String, Integer>();
+ r = s.executeQuery("SELECT id, nullResistance FROM PS_NullResistance");
+
+ while (r.next()) {
+ nullResistances.put(r.getInt("id"), r.getString("nullResistance"));
+ revNullResistances.put(r.getString("nullResistance"), r.getInt("id"));
+ }
+
+ crss = new HashMap<Integer, String>();
+ revCrss = new HashMap<String, Integer>();
+ r = s.executeQuery("SELECT id, name FROM PS_Crs");
+
+ while (r.next()) {
+ crss.put(r.getInt("id"), r.getString("name"));
+ revCrss.put(r.getString("name"), r.getInt("id"));
+ }
+
+ supportedFormats = new HashMap<String, String>();
+ revSupportedFormats = new HashMap<String, String>();
+ r = s.executeQuery("SELECT name, mimetype FROM PS_Format");
+
+ while (r.next()) {
+ supportedFormats.put(r.getString("name"), r.getString("mimetype"));
+ revSupportedFormats.put(r.getString("mimetype"), r.getString("name"));
+ }
+
+ s.close();
+
+ /* Debug checks for reverse static tables */
+// log(revAxisTypes.toString());
+// log(revCrss.toString());
+// log(revDataTypes.toString());
+// log(revInterpolationTypes.toString());
+// log(revNullResistances.toString());
+// log(revSupportedFormats.toString());
+
+ /* Check Metadata consistency at startup, if needed */
+ this.checkAtInit = checkAtInit;
+
+ if (checkAtInit) {
+ initializing = true;
+ boolean coveragesOk = false;
+
+ while (!coveragesOk) {
+ try {
+ Iterator<String> coverages = coverages().iterator();
+
+ while (coverages.hasNext()) {
+ read(coverages.next());
+ }
+ } catch (InvalidWcpsRequestException ire) {
+ throw (InvalidMetadataException) ire.getCause();
+ }
+
+ coveragesOk = true;
+ }
+
+ initializing = false;
+ }
+
+ } catch (SQLException sqle) {
+ if (s != null) {
+ try {
+ s.close();
+ } catch (SQLException e) {
+ }
+ }
+
+ close();
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+
+ }
+
+ public void close() {
+ if (conn != null) {
+ try {
+ conn.close();
+ } catch (SQLException sqle) {
+ }
+ conn = null;
+ }
+ }
+
+ /* List all available coverages */
+ @Override
+ public Set<String> coverages() throws ResourceException {
+ Statement s = null;
+ Set<String> coverages;
+
+ try {
+ ensureConnection();
+ s = conn.createStatement();
+
+ ResultSet r = s.executeQuery("SELECT name FROM PS_Coverage");
+
+ coverages = new HashSet<String>(r.getFetchSize());
+
+ while (r.next()) {
+ coverages.add(r.getString("name"));
+ }
+
+ s.close();
+
+ return coverages;
+ } catch (SQLException sqle) {
+ if (s != null) {
+ try {
+ s.close();
+ } catch (SQLException f) {
+ }
+ }
+
+ close();
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+
+ }
+
+ @Override
+ public String formatToMimetype(String format) {
+ return supportedFormats.get(format);
+ }
+
+ @Override
+ public Metadata read(String coverageName) throws InvalidWcpsRequestException, ResourceException {
+ LOG.debug("Reading metadata for coverage '{}'", coverageName);
+
+ if ((coverageName == null) || coverageName.equals("")) {
+ throw new InvalidWcpsRequestException("Cannot retrieve coverage with null or empty name");
+ }
+
+ Statement s = null;
+
+ try {
+ ensureConnection();
+ s = conn.createStatement();
+
+ ResultSet r = s.executeQuery("SELECT id, nullDefault, interpolationTypeDefault, nullResistanceDefault FROM PS_Coverage WHERE name = '" + coverageName + "'");
+
+ if (!r.next()) {
+ throw new InvalidWcpsRequestException("Coverage '" + coverageName + "' is not served by this server");
+ }
+
+ int coverage = r.getInt("id");
+ String nullDefault = r.getString("nullDefault");
+ String interpolationTypeDefault = interpolationTypes.get(r.getInt("interpolationTypeDefault"));
+ String nullResistanceDefault = nullResistances.get(r.getInt("nullResistanceDefault"));
+
+ r = s.executeQuery("SELECT lo, hi FROM PS_CellDomain WHERE coverage = '" + coverage + "' ORDER BY i ASC");
+ CellDomainElement X = null, Y = null, cell;
+ boolean twoDCoverage = true;
+ List<CellDomainElement> cellDomain = new ArrayList<CellDomainElement>(r.getFetchSize());
+
+ while (r.next()) {
+ cell = new CellDomainElement(BigInteger.valueOf(r.getInt("lo")), BigInteger.valueOf(r.getInt("hi")));
+ cellDomain.add(cell);
+ if (X == null) {
+ X = cell;
+ } else if (X != null && Y == null) {
+ Y = cell;
+ } else {
+ twoDCoverage = false;
+ }
+ }
+ if (X == null || Y == null) {
+ twoDCoverage = false;
+ }
+
+ r = s.executeQuery("SELECT name, type FROM PS_Range WHERE coverage = '" + coverage + "' ORDER BY i ASC");
+ List<RangeElement> range = new ArrayList<RangeElement>(r.getFetchSize());
+
+ while (r.next()) {
+ range.add(new RangeElement(r.getString("name"), dataTypes.get(r.getInt("type"))));
+ }
+
+ r = s.executeQuery("SELECT interpolationType, nullResistance FROM PS_InterpolationSet WHERE coverage = '" + coverage + "'");
+ Set<InterpolationMethod> interpolationSet = new HashSet<InterpolationMethod>(r.getFetchSize());
+
+ while (r.next()) {
+ interpolationSet.add(new InterpolationMethod(interpolationTypes.get(r.getInt("interpolationType")), nullResistances.get(r.getInt("nullResistance"))));
+ }
+
+ r = s.executeQuery("SELECT nullValue FROM PS_NullSet WHERE coverage = '" + coverage + "'");
+ Set<String> nullSet = new HashSet<String>(r.getFetchSize());
+
+ while (r.next()) {
+ nullSet.add(r.getString("nullValue"));
+ }
+
+ r = s.executeQuery("SELECT id, name, type, numLo, numHi, strLo, strHi FROM PS_Domain WHERE coverage = '" + coverage + "' ORDER BY i ASC");
+ List<DomainElement> domain = new ArrayList<DomainElement>(r.getFetchSize());
+ Statement ss = conn.createStatement();
+
+ while (r.next()) {
+ String strLo = r.getString("strLo");
+ String strHi = r.getString("strHi");
+
+ Double numLo = r.getDouble("numLo");
+
+ if (r.wasNull()) {
+ numLo = null;
+ }
+
+ Double numHi = r.getDouble("numHi");
+
+ if (r.wasNull()) {
+ numHi = null;
+ }
+
+ ResultSet rr = ss.executeQuery("SELECT crs FROM PS_CrsSet WHERE axis = '" + r.getInt("id") + "'");
+ Set<String> crsSet = new HashSet<String>(rr.getFetchSize());
+
+ while (rr.next()) {
+ crsSet.add(crss.get(rr.getInt("crs")));
+ }
+
+ DomainElement d = new DomainElement(r.getString("name"), axisTypes.get(r.getInt("type")),
+ numLo, numHi, strLo, strHi, crsSet, axisTypes.values());
+ domain.add(d);
+ }
+
+ String abstr = "";
+ String title = "";
+ String keywords = "";
+ r = s.executeQuery("SELECT title, abstract, keywords FROM PS_Descriptions WHERE coverage = '" + coverage + "'");
+ if (r.next()) {
+ abstr = r.getString("abstract");
+ title = r.getString("title");
+ keywords = r.getString("keywords");
+ }
+
+ /* WGS84 is the only CRS we understand (except IMAGE_CRS, of course) */
+ Wgs84Crs crs = null;
+ Double l1 = 0.0, l2 = 0.0, h1 = 0.0, h2 = 0.0;
+ Double o1 = null, o2 = null;
+ r = s.executeQuery("SELECT * FROM PS_CrsDetails WHERE coverage = '" + coverage + "'");
+ if (r.next()) {
+ /* Domain extent */
+ int x0 = X.getLo().intValue();
+ int y0 = Y.getLo().intValue();
+ int x1 = X.getHi().intValue();
+ int y1 = Y.getHi().intValue();
+ /* CRS Bounding box */
+ l1 = r.getDouble("low1");
+ l2 = r.getDouble("low2");
+ h1 = r.getDouble("high1");
+ h2 = r.getDouble("high2");
+ String off1 = r.getString("offset1");
+ String off2 = r.getString("offset2");
+ if (off1 != null) {
+ o1 = Double.parseDouble(off1);
+ }
+ if (off2 != null) {
+ o2 = Double.parseDouble(off2);
+ }
+ /* Compute axis offsets if not predefined */
+ if (o1 == null && o2 == null) {
+ o1 = (h1 - l1) / (double) (x1 - x0);
+ o2 = (h2 - l2) / (double) (y1 - y0);
+ LOG.debug("Calculated CRS axis offsets. For X: {}, for Y: {}", o1, o2);
+ LOG.debug(X.toString());
+ LOG.debug(Y.toString());
+ }
+ /* Only store CRS information if coverage is 2-D */
+ if (twoDCoverage == true) {
+ crs = new Wgs84Crs(l1, h1, l2, h2, o1, o2);
+ LOG.trace("Found CRS : ", crs.toString());
+ } else {
+ LOG.warn("Found CRS '{}', but coverage is not 2-dimensional. "
+ + "Ignoring CRS information.", crs.toString());
+ }
+ } else if (twoDCoverage) {
+ LOG.warn(" WGS84 bounding box missing for 2-D coverage '" + coverageName + "'...");
+ }
+
+ /* Done with SQL statements */
+ s.close();
+
+ /* Build the complete metadata object */
+ Metadata meta = new Metadata(cellDomain, range, nullSet, nullDefault, interpolationSet,
+ new InterpolationMethod(interpolationTypeDefault, nullResistanceDefault),
+ coverageName, domain, crs, title, abstr, keywords);
+ meta.setCoverageId(coverage);
+ return meta;
+ } catch (InvalidMetadataException ime) {
+ if (checkAtInit && !initializing) {
+ throw new ResourceException("Previously valid metadata is now invalid. The metadata for coverage '" + coverageName + "' has been modified incorrectly.", ime);
+ } else {
+ throw new InvalidWcpsRequestException("Coverage '" + coverageName + "' has invalid metadata", ime);
+ }
+ } catch (SQLException sqle) {
+ if (s != null) {
+ try {
+ s.close();
+ } catch (SQLException f) {
+ }
+ }
+
+ close();
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+
+ }
+
+ /** Write a coverage's metadata to the database. This function can be used
+ * for both inserting new coverages and updating coverage metadata.
+ *
+ * @param meta Metadata container for the information to be stored in the metadata database
+ * @param commit Boolean value, specifying if we want to commit immediately or not
+ */
+ private void write(Metadata meta, boolean commit) throws ResourceException {
+ String coverageName = meta.getCoverageName();
+ if (existsCoverageName(coverageName)) {
+ updateCoverageMetadata(meta, commit);
+ } else {
+ insertNewCoverageMetadata(meta, commit);
+ }
+ }
+
+ public void delete(Metadata meta, boolean commit) throws ResourceException {
+ String coverageName = meta.getCoverageName();
+ if (existsCoverageName(coverageName) == false) {
+ throw new ResourceException("Cannot delete inexistent coverage: " + coverageName);
+ }
+
+ /* Delete main coverage entry from "PS_Coverage". Auxiliary metadata are
+ * automatically deleted by the DB (via CASCADING) on
+ * deletion of the main entry in ps_coverage */
+ Statement s = null;
+ try {
+ s = conn.createStatement();
+ setQuery("DELETE FROM PS_Coverage WHERE name = '" + coverageName + "'");
+ int count = s.executeUpdate(query);
+ LOG.trace("Affected rows: " + count);
+ s.close();
+
+ if (commit) {
+ commitAndClose();
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ s.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ /**
+ * Check if there is metadata available for a given coverage name
+ * @param name coverage name
+ * @return true is coverage already exists
+ */
+ public boolean existsCoverageName(String name) {
+ boolean result = false;
+ Statement s = null;
+ try {
+ s = conn.createStatement();
+ setQuery("SELECT * FROM PS_Coverage WHERE name = '" + name + "'");
+ ResultSet r = s.executeQuery(query);
+ if (r.next()) {
+ result = true;
+ } else {
+ result = false;
+ }
+ s.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ s.close();
+ } catch (Exception e) {
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Check if there exists a coverage with a given ID in the metadata database.
+ * @param id coverage id
+ * @return true is coverage already exists
+ */
+ private boolean existsCoverageId(int id) {
+ boolean result = false;
+ Statement s = null;
+ try {
+ s = conn.createStatement();
+ ResultSet r = s.executeQuery(
+ "SELECT * FROM PS_Coverage WHERE id = '" + id + "'");
+ if (r.next()) {
+ result = true;
+ } else {
+ result = false;
+ }
+ s.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ s.close();
+ } catch (Exception e) {
+ }
+ }
+ System.out.println("Coverage with ID " + id + (result == false ? " does not " : "") + " exists.");
+ return result;
+ }
+
+ /** Update metadata for an existing coverage. All information may change (including
+ * name), but the ID of the tuple in PS_Coverage will stay the same.
+ *
+ * @param meta Metadata object, container of the new information.
+ * @param commit True if we want to commit immediately, false to delay commit indefinitely
+ */
+ public void updateCoverageMetadata(Metadata meta, boolean commit) throws ResourceException {
+ Statement s = null;
+ int coverageId = meta.getCoverageId();
+ int count = -1;
+ String coverageName = meta.getCoverageName();
+
+ try {
+ ensureConnection();
+ s = conn.createStatement();
+
+ String name = coverageName;
+ String nulldefault = meta.getNullDefault();
+ int interpolatiotypendefault = revInterpolationTypes.get(meta.getInterpolationDefault());
+ int nullresistancedefault = revNullResistances.get(meta.getNullResistanceDefault());
+
+ // Table PS_Coverage
+ setQuery("UPDATE PS_Coverage SET "
+ + "(name, nullDefault, interpolationTypeDefault, nullResistanceDefault) "
+ + " = ('" + name + "', '" + nulldefault + "', '"
+ + interpolatiotypendefault + "', '" + nullresistancedefault + "')"
+ + " WHERE id='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not update table PS_Coverage.");
+ }
+
+ // Table PS_CellDomain
+ /* Delete old data */
+ setQuery("DELETE FROM PS_CellDomain WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_CellDomain.");
+ }
+ /* Insert new data */
+ Iterator<CellDomainElement> cellIt = meta.getCellDomainIterator();
+ int i = 0;
+ while (cellIt.hasNext()) {
+ CellDomainElement cell = cellIt.next();
+ setQuery("INSERT INTO PS_CellDomain (coverage, i, lo, hi) VALUES "
+ + " ('" + coverageId + "', '" + i + "', '" + cell.getLo() + "', '"
+ + cell.getHi() + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert axis " + i + " for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_CellDomain");
+ }
+ i++;
+ }
+
+ // Table PS_Range
+ /* Delete old data */
+ setQuery("DELETE FROM PS_Range WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_Range.");
+ }
+ /* Insert new data */
+ Iterator<RangeElement> rangeIt = meta.getRangeIterator();
+ i = 0;
+ while (rangeIt.hasNext()) {
+ RangeElement range = rangeIt.next();
+ System.out.println(range);
+ int dataType = revDataTypes.get(range.getType());
+ setQuery("INSERT INTO PS_Range (coverage, i, name, type) VALUES "
+ + " ('" + coverageId + "', '" + i + "', '" + range.getName() + "', '"
+ + dataType + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert range " + range.getName()
+ + "( id " + i + " ) for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_Range");
+ }
+ i++;
+ }
+
+ // Table PS_InterpolationSet
+ /* Delete old data */
+ setQuery("DELETE FROM PS_InterpolationSet WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_InterpolationSet.");
+ }
+ /* Insert new data */
+ Iterator<InterpolationMethod> methodIt = meta.getInterpolationMethodIterator();
+ i = 0;
+ while (methodIt.hasNext()) {
+ InterpolationMethod method = methodIt.next();
+ int interp = revInterpolationTypes.get(method.getInterpolationType());
+ int nullRes = revNullResistances.get(method.getNullResistance());
+ setQuery("INSERT INTO PS_InterpolationSet (coverage, interpolationType, nullResistance) VALUES "
+ + " ('" + coverageId + "', '" + interp + "', '" + nullRes + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert interpolation method (" + method.getInterpolationType()
+ + ", " + method.getNullResistance() + " ) for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_InterpolationSet");
+ }
+ i++;
+ }
+
+ // Table PS_NullSet
+ /* Delete old data */
+ setQuery("DELETE FROM PS_NullSet WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_NullSet.");
+ }
+ /* Insert new data */
+ Iterator<String> nullIt = meta.getNullSetIterator();
+ while (nullIt.hasNext()) {
+ String nullValue = nullIt.next();
+ setQuery("INSERT INTO PS_NullSet (coverage, nullValue) VALUES "
+ + " ('" + coverageId + "', '" + nullValue + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert null value '" + nullValue
+ + "' for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_NullSet");
+ }
+ }
+
+ // Tables PS_Domain and PS_CrsSet
+ /* Delete old data */
+ setQuery("SELECT * FROM PS_Domain WHERE coverage='" + coverageId + "'");
+ ResultSet r1 = s.executeQuery(query);
+ Vector axes = new Vector(5);
+ while (r1.next()) {
+ int axisId = r1.getInt("id");
+ axes.add((Integer) axisId);
+ }
+ System.out.println(axes);
+ for (i = 0; i < axes.size(); i++) {
+ int axisId = ((Integer) axes.elementAt(i)).intValue();
+ setQuery("DELETE FROM PS_CrsSet WHERE axis='" + axisId + "'");
+ count = s.executeUpdate(query);
+ /* Do not worry about inexisting entries in CRS Sets: this implementation
+ does not really use CRSs. */
+// if (count <= 0)
+// throw new SQLException("Could not delete old entries from table PS_CrsSet.");
+
+ }
+
+ setQuery("DELETE FROM PS_Domain WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ if (count <= 0) {
+ throw new SQLException("Could not delete old entries from table PS_Domain.");
+ }
+ /* Insert new data */
+ Iterator<DomainElement> domIt = meta.getDomainIterator();
+ i = 0;
+ while (domIt.hasNext()) {
+ // Table PS_Domain
+ DomainElement dom = domIt.next();
+ int axisType = revAxisTypes.get(dom.getType());
+ Double numLo = dom.getNumLo();
+ Double numHi = dom.getNumHi();
+ String sNumLo = numLo == null ? "null" : "'" + numLo.toString() + "'";
+ String sNumHi = numHi == null ? "null" : "'" + numHi.toString() + "'";
+ String strLo = dom.getStrLo();
+ String strHi = dom.getStrHi();
+ if (strLo != null && strLo.equals("null") == false) {
+ strLo = "'" + strLo + "'";
+ }
+ if (strHi != null && strHi.equals("null") == false) {
+ strHi = "'" + strHi + "'";
+ }
+
+ String sqlQuery = "INSERT INTO PS_Domain "
+ + "(coverage, i, name, type, numLo, numHi, strLo, strHi) VALUES "
+ + "('" + coverageId + "', '" + i + "', '" + dom.getName() + "', '"
+ + axisType + "', " + sNumLo + ", " + sNumHi
+ + ", " + strLo + ", " + strHi + ")";
+ /* Need to get ID of the newly inserted tuple. Postgres has a cool construct (RETURNING),
+ * but we can also fall-back to another generic JDBC driver */
+ int axisId = -1;
+ if (driver.equals("org.postgresql.Driver")) {
+ /* RETURNING clause is not standard SQL, only PostgreSQL understands it*/
+ setQuery(sqlQuery + " RETURNING id");
+
+ ResultSet r = s.executeQuery(query);
+ if (r.next() == false) {
+ throw new SQLException("Could not insert domain element (i = " + i
+ + ", name=" + dom.getName() + ", type=" + dom.getType()
+ + ", numLo=" + dom.getNumLo() + ", numHi=" + dom.getNumHi()
+ + ", strLo=" + dom.getStrLo() + ", strHi=" + dom.getStrHi()
+ + ") for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_Domain");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Domain) */
+ axisId = r.getInt("id");
+ } else {
+ /* Fallback to specific driver support on returning autogenerated keys. */
+ String[] keys = new String[1];
+ keys[0] = "id";
+ int c = s.executeUpdate(sqlQuery, keys);
+ if (c <= 0) {
+ throw new SQLException("Could not insert domain element (i = " + i
+ + ", name=" + dom.getName() + ", type=" + dom.getType()
+ + ", numLo=" + dom.getNumLo() + ", numHi=" + dom.getNumHi()
+ + ", strLo=" + dom.getStrLo() + ", strHi=" + dom.getStrHi()
+ + ") for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_Domain");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Domain) */
+ ResultSet rr = s.getGeneratedKeys();
+ if (rr.next() == false) {
+ throw new SQLException("Could not retrieve ID of the newly insterted tuple in table PS_Domain.");
+ }
+ axisId = rr.getInt("id");
+ }
+ /* check ID */
+ if (axisId < 0) {
+ throw new SQLException("Generated ID (" + axisId
+ + ") for the tuple in PS_Domain is not valid !");
+ }
+
+ /* Increment axis number */
+ i++;
+
+ // Table PS_CrsSet
+ Set<String> crsSet = dom.getCrsSet();
+ System.out.println(crsSet);
+ Iterator<String> crsIt = crsSet.iterator();
+ while (crsIt.hasNext()) {
+ String crs = crsIt.next();
+ int crsId = revCrss.get(crs);
+ setQuery("INSERT INTO PS_CrsSet (axis, crs) VALUES "
+ + "('" + axisId + "', '" + crsId + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert Crs " + crs
+ + "for axis =" + axisId + " in table PS_CrsSet");
+ }
+ }
+ }
+
+ // Table PS_Descriptions
+ /* Delete old data */
+ setQuery("DELETE FROM PS_Descriptions WHERE coverage='" + coverageId + "'");
+ count = s.executeUpdate(query);
+ /* Coverage descriptions are not essential, do not throw an error if missing */
+// if (count <= 0)
+// throw new SQLException("Could not delete old data from table PS_Descriptions");
+ /* Insert new data */
+ String title = meta.getTitle();
+ String abstr = meta.getAbstract();
+ String keywords = meta.getKeywords();
+ if (title != null) {
+ title = "'" + title + "'";
+ }
+ if (abstr != null) {
+ abstr = "'" + abstr + "'";
+ }
+ if (keywords != null) {
+ keywords = "'" + keywords + "'";
+ }
+ setQuery("INSERT INTO PS_Descriptions (coverage, title, abstract, keywords)"
+ + " VALUES ('" + coverageId + "', " + title + ", " + abstr + ", " + keywords + ")");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert descriptive metadata in table "
+ + "PS_Descriptions for coverage " + coverageName + " (ID " + coverageId + ")");
+ }
+
+
+ s.close();
+
+ if (commit) {
+ commitAndClose();
+ }
+ } catch (SQLException sqle) {
+ /* Abort this transaction */
+ try {
+ if (s != null) {
+ s.close();
+ }
+ abortAndClose();
+ } catch (SQLException f) {
+ }
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+ }
+
+ /** Insert metadata for a new coverage.
+ *
+ * @param meta Metadata object, container of information
+ * @param commit Boolean value, specifying if we want to commit immediately or not
+ */
+ public void insertNewCoverageMetadata(Metadata meta, boolean commit) throws ResourceException {
+ Statement s = null;
+ String coverageName = meta.getCoverageName();
+ int coverageId = -1;
+
+ try {
+ ensureConnection();
+ s = conn.createStatement();
+
+ String name = coverageName;
+ /* FIXME: Table PS_COVERAGE: nullValue and CRS fields not USED !!! */
+// String nullvalue = "";
+// String crs = "";
+ String nulldefault = meta.getNullDefault();
+ int interpolatiotypendefault = revInterpolationTypes.get(meta.getInterpolationDefault());
+ int nullresistancedefault = revNullResistances.get(meta.getNullResistanceDefault());
+
+ // Table PS_Coverage
+ String sqlQuery = "INSERT INTO PS_Coverage "
+ + "(name, nullDefault, interpolationTypeDefault, nullResistanceDefault) "
+ + " VALUES ('" + name + "', '" + nulldefault + "', '"
+ + interpolatiotypendefault + "', '" + nullresistancedefault + "')";
+ /* Need to get ID of the newly inserted tuple. Postgres has a cool construct (RETURNING),
+ * but we can also fall-back to another generic JDBC driver */
+ if (driver.equals("org.postgresql.Driver")) {
+ /* RETURNING clause is not standard SQL, only PostgreSQL understands it*/
+ setQuery(sqlQuery + " RETURNING id");
+
+ ResultSet r = s.executeQuery(query);
+ if (r.next() == false) {
+ throw new SQLException("Could not insert new coverage in table PS_Coverage.");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Coverage) */
+ coverageId = r.getInt("id");
+ } else {
+ /* Fallback to specific driver support on returning autogenerated keys. */
+ String[] keys = new String[1];
+ keys[0] = "id";
+ int c = s.executeUpdate(sqlQuery, keys);
+ if (c <= 0) {
+ throw new SQLException("Could not insert new coverage in table PS_Coverage.");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Coverage) */
+ ResultSet rr = s.getGeneratedKeys();
+ if (rr.next() == false) {
+ throw new SQLException("Could not retrieve ID of the newly insterted tuple in table PS_Coverage.");
+ }
+ coverageId = rr.getInt("id");
+ }
+ /* check ID */
+ if (coverageId < 0) {
+ throw new SQLException("Generated ID (" + coverageId
+ + ") for the tuple in PS_Coverage is not valid !");
+ }
+
+ // Table PS_CellDomain
+ Iterator<CellDomainElement> cellIt = meta.getCellDomainIterator();
+ int i = 0;
+ while (cellIt.hasNext()) {
+ CellDomainElement cell = cellIt.next();
+ setQuery("INSERT INTO PS_CellDomain (coverage, i, lo, hi) VALUES "
+ + " ('" + coverageId + "', '" + i + "', '" + cell.getLo() + "', '"
+ + cell.getHi() + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert axis " + i + " for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_CellDomain");
+ }
+ i++;
+ }
+
+ // Table PS_Range
+ Iterator<RangeElement> rangeIt = meta.getRangeIterator();
+ i = 0;
+ while (rangeIt.hasNext()) {
+ RangeElement range = rangeIt.next();
+ System.out.println(range);
+ int dataType = revDataTypes.get(range.getType());
+ setQuery("INSERT INTO PS_Range (coverage, i, name, type) VALUES "
+ + " ('" + coverageId + "', '" + i + "', '" + range.getName() + "', '"
+ + dataType + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert range " + range.getName()
+ + "( id " + i + " ) for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_Range");
+ }
+ i++;
+ }
+
+ // Table PS_InterpolationSet
+ Iterator<InterpolationMethod> methodIt = meta.getInterpolationMethodIterator();
+ i = 0;
+ while (methodIt.hasNext()) {
+ InterpolationMethod method = methodIt.next();
+ int interp = revInterpolationTypes.get(method.getInterpolationType());
+ int nullRes = revNullResistances.get(method.getNullResistance());
+ setQuery("INSERT INTO PS_InterpolationSet (coverage, interpolationType, nullResistance) VALUES "
+ + " ('" + coverageId + "', '" + interp + "', '" + nullRes + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert interpolation method (" + method.getInterpolationType()
+ + ", " + method.getNullResistance() + " ) for coverage "
+ + coverageName + "( id " + coverageId + ") into table PS_InterpolationSet");
+ }
+ i++;
+ }
+
+ // Table PS_NullSet
+ Iterator<String> nullIt = meta.getNullSetIterator();
+ while (nullIt.hasNext()) {
+ String nullValue = nullIt.next();
+ setQuery("INSERT INTO PS_NullSet (coverage, nullValue) VALUES "
+ + " ('" + coverageId + "', '" + nullValue + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert null value '" + nullValue
+ + "' for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_NullSet");
+ }
+ }
+
+ Iterator<DomainElement> domIt = meta.getDomainIterator();
+ i = 0;
+ while (domIt.hasNext()) {
+ // Table PS_Domain
+ DomainElement dom = domIt.next();
+ int axisType = revAxisTypes.get(dom.getType());
+ Double numLo = dom.getNumLo();
+ Double numHi = dom.getNumHi();
+ String sNumLo = numLo == null ? "null" : "'" + numLo.toString() + "'";
+ String sNumHi = numHi == null ? "null" : "'" + numHi.toString() + "'";
+ String strLo = dom.getStrLo();
+ String strHi = dom.getStrHi();
+ if (strLo != null && strLo.equals("null") == false) {
+ strLo = "'" + strLo + "'";
+ }
+ if (strHi != null && strHi.equals("null") == false) {
+ strHi = "'" + strHi + "'";
+ }
+
+ sqlQuery = "INSERT INTO PS_Domain "
+ + "(coverage, i, name, type, numLo, numHi, strLo, strHi) VALUES "
+ + "('" + coverageId + "', '" + i + "', '" + dom.getName() + "', '"
+ + axisType + "', " + sNumLo + ", " + sNumHi
+ + ", " + strLo + ", " + strHi + ")";
+ /* Need to get ID of the newly inserted tuple. Postgres has a cool construct (RETURNING),
+ * but we can also fall-back to another generic JDBC driver */
+ int axisId = -1;
+ if (driver.equals("org.postgresql.Driver")) {
+ /* RETURNING clause is not standard SQL, only PostgreSQL understands it*/
+ setQuery(sqlQuery + " RETURNING id");
+
+ ResultSet r = s.executeQuery(query);
+ if (r.next() == false) {
+ throw new SQLException("Could not insert domain element (i = " + i
+ + ", name=" + dom.getName() + ", type=" + dom.getType()
+ + ", numLo=" + dom.getNumLo() + ", numHi=" + dom.getNumHi()
+ + ", strLo=" + dom.getStrLo() + ", strHi=" + dom.getStrHi()
+ + ") for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_Domain");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Domain) */
+ axisId = r.getInt("id");
+ } else {
+ /* Fallback to specific driver support on returning autogenerated keys. */
+ String[] keys = new String[1];
+ keys[0] = "id";
+ int c = s.executeUpdate(sqlQuery, keys);
+ if (c <= 0) {
+ throw new SQLException("Could not insert domain element (i = " + i
+ + ", name=" + dom.getName() + ", type=" + dom.getType()
+ + ", numLo=" + dom.getNumLo() + ", numHi=" + dom.getNumHi()
+ + ", strLo=" + dom.getStrLo() + ", strHi=" + dom.getStrHi()
+ + ") for coverage " + coverageName + "( id " + coverageId
+ + ") into table PS_Domain");
+ }
+ /* Retrieve the ID of the newly inserted tuple (PS_Domain) */
+ ResultSet rr = s.getGeneratedKeys();
+ if (rr.next() == false) {
+ throw new SQLException("Could not retrieve ID of the newly insterted tuple in table PS_Domain.");
+ }
+ axisId = rr.getInt("id");
+ }
+ /* check ID */
+ if (axisId < 0) {
+ throw new SQLException("Generated ID (" + axisId
+ + ") for the tuple in PS_Domain is not valid !");
+ }
+
+ /* Increment axis number */
+ i++;
+
+ // Table PS_CrsSet
+ Set<String> crsSet = dom.getCrsSet();
+ Iterator<String> crsIt = crsSet.iterator();
+ while (crsIt.hasNext()) {
+ String crs = crsIt.next();
+ int crsId = revCrss.get(crs);
+ setQuery("INSERT INTO PS_CrsSet (axis, crs) VALUES "
+ + "('" + axisId + "', '" + crsId + "')");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert Crs " + crs
+ + "for axis =" + axisId + " in table PS_CrsSet");
+ }
+ }
+ }
+
+ // Table PS_Descriptions
+ String title = meta.getTitle();
+ String abstr = meta.getAbstract();
+ String keywords = meta.getKeywords();
+ if (title != null) {
+ title = "'" + title + "'";
+ }
+ if (abstr != null) {
+ abstr = "'" + abstr + "'";
+ }
+ if (keywords != null) {
+ keywords = "'" + keywords + "'";
+ }
+ setQuery("INSERT INTO PS_Descriptions (coverage, title, abstract, keywords)"
+ + " VALUES ('" + coverageId + "', " + title + ", " + abstr + ", " + keywords + ")");
+ if (s.executeUpdate(query) <= 0) {
+ throw new SQLException("Could not insert descriptive metadata in table "
+ + "PS_Descriptions for coverage " + coverageName + " (ID " + coverageId + ")");
+ }
+
+ s.close();
+
+ if (commit) {
+ commitAndClose();
+ }
+ } catch (SQLException sqle) {
+ /* Abort this transaction */
+ try {
+ if (s != null) {
+ s.close();
+ }
+ abortAndClose();
+ } catch (SQLException f) {
+ }
+
+ throw new ResourceException("Metadata database error", sqle);
+ }
+
+ }
+
+ public void ensureConnection() throws SQLException {
+ synchronized (this) {
+ LOG.trace("Ensuring connection is valid...");
+// if( connection == null || !connection.isValid( CONNECTION_TIMEOUT ) ) { // Not implemented by PostgreSQL yet.
+ if ((conn == null) || conn.isClosed()) {
+ LOG.trace("*** Opening new DB connection !");
+ close();
+ openConnection();
+ LOG.trace("*** ok.");
+// try { throw new Exception(""); } catch (Exception e) {e.printStackTrace();}
+ }
+ }
+
+ }
+
+ public void openConnection() throws SQLException {
+ conn = DriverManager.getConnection(url, user, pass);
+ conn.setAutoCommit(false);
+ savepoint = conn.setSavepoint();
+ }
+
+ public void abortAndClose() throws SQLException {
+ if (conn != null) {
+ conn.rollback(savepoint);
+ conn.close();
+ conn = null;
+ }
+ }
+
+ public void commitAndClose() throws SQLException {
+ if (conn != null) {
+ conn.commit();
+ conn.close();
+ conn = null;
+ }
+ }
+
+ @Override
+ public Collection<String> getAxisNames() {
+ return axisTypes.values();
+ }
+
+ /* Logging function for SQL queries. */
+ private void setQuery(String q) {
+ this.query = q;
+ LOG.trace("SQL Query: {}", q);
+ }
+
+ /* Returns the available formatToMimetype formats, as stored in the metadata database */
+ public String[] getMimetypesList() {
+ return supportedFormats.values().toArray(new String[1]);
+ }
+
+ /* Translate a mime-type to a format name, if known to rasdaman. */
+ public String mimetypeToFormat(String mime) {
+ LOG.debug(revSupportedFormats.toString());
+ return revSupportedFormats.get(mime);
+ }
+
+ /**
+ * @return the dataTypes
+ */
+ public Collection<String> getDataTypes() {
+ return dataTypes.values();
+ }
+
+ /**
+ * @return the interpolationTypes
+ */
+ public Collection<String> getInterpolationTypes() {
+ return interpolationTypes.values();
+ }
+
+ /**
+ * @return the nullResistances
+ */
+ public Collection<String> getNullResistances() {
+ return nullResistances.values();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DimensionIntervalElement.java b/petascope/src/petascope/wcps/server/core/DimensionIntervalElement.java
new file mode 100644
index 0000000..e2aeef2
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DimensionIntervalElement.java
@@ -0,0 +1,221 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+public class DimensionIntervalElement implements IRasNode, ICoverageInfo {
+
+ Logger LOG = LoggerFactory.getLogger(DimensionIntervalElement.class);
+ private IRasNode child;
+ private CoverageInfo info = null;
+ private AxisName axis;
+ private Crs crs;
+ private ScalarExpr domain1, domain2; // lower and upper bound, or "DomainMetadataExprType" and null
+ private long coord1, coord2;
+ private int counter = 0; // counter for the domain vars
+ private Metadata meta = null; // metadata about the current coverage
+ private boolean finished = false;
+ private Node nextNode;
+ private boolean transformedCoordinates = false;
+
+ /**
+ * Constructs an element of a dimension interval.
+ * @param node XML Node
+ * @param xq WCPS Xml Query object
+ * @param covInfo CoverageInfo object about the Trim parent object
+ * @throws WCPSException
+ */
+ public DimensionIntervalElement(Node node, XmlQuery xq, CoverageInfo covInfo)
+ throws WCPSException, InvalidCrsException {
+
+ if (covInfo.getCoverageName() != null) {
+ // Add WGS84 CRS information from coverage metadata, may be useful
+ // for converting geo-coordinates to pixel-coordinates
+ String coverageName = covInfo.getCoverageName();
+ meta = xq.getMetadataSource().read(coverageName);
+ }
+
+ System.err.println("Trying to parse DimensionIntervalElement expression...");
+ String name;
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ while (node != null && finished == false) {
+ if (node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ continue;
+ }
+
+ name = node.getNodeName();
+ System.err.println("Current node is " + name);
+
+ // Try Axis
+ try {
+ axis = new AxisName(node, xq);
+ node = node.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse an axis!");
+ }
+
+ // Try CRS name
+ try {
+ crs = new Crs(node, xq);
+ node = node.getNextSibling();
+ if (axis == null) {
+ throw new WCPSException("Expected Axis node before CRS !");
+ }
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse a crs!");
+ }
+
+ // TODO: how to implement DomainMetadataExpr ?
+
+// // Try last thing
+// try
+// {
+// domain1 = new DomainMetadataExprType(node, xq);
+// counter = 1;
+// continue;
+// }
+// catch (WCPSException e)
+// {
+// System.err.println("Failed to parse domain metadata!");
+// }
+
+ // Then it must be a pair of nodes "lowerBound" + "upperBound"
+ if (node.getNodeName().equals("lowerBound")) {
+ counter = 2;
+ domain1 = new ScalarExpr(node.getFirstChild(), xq);
+ if (axis == null) {
+ throw new WCPSException("Expected <axis> node before <lowerBound> !");
+ }
+ } else if (node.getNodeName().equals("upperBound")) {
+ counter = 2;
+ domain2 = new ScalarExpr(node.getFirstChild(), xq);
+ if (axis == null) {
+ throw new WCPSException("Expected <lowerBound> node before <upperBound> !");
+ }
+ } else {
+ throw new WCPSException("Unexpected node: " + node.getFirstChild().getNodeName());
+ }
+
+ if (axis != null && counter == 1 && domain1 != null) {
+ finished = true;
+ }
+ if (axis != null && counter == 2 && domain1 != null && domain2 != null) {
+ finished = true;
+ }
+
+ if (finished == true) {
+ nextNode = node.getNextSibling();
+ }
+
+ node = node.getNextSibling();
+ }
+
+ if (finished == true) {
+ convertToPixelCoordinates();
+ }
+ }
+
+
+ /* If input coordinates are geo-, convert them to pixel coordinates. */
+ private void convertToPixelCoordinates() {
+ if (meta.getCrs() == null && crs != null && crs.getName().equals(DomainElement.WGS84_CRS)) {
+ throw new RuntimeException("Coverage '" + meta.getCoverageName()
+ + "' is not georeferenced with 'EPSG:4326' coordinate system.");
+ }
+ if (counter == 2 && crs != null && domain1.isSingleValue() && domain2.isSingleValue()) {
+ if (crs.getName().equals(DomainElement.WGS84_CRS)) {
+ LOG.debug("CRS is '{}' and should be equal to '{}'", crs.getName(), DomainElement.WGS84_CRS);
+ try {
+ this.transformedCoordinates = true;
+ // Convert to pixel coordinates
+ Double val1 = domain1.getSingleValue();
+ Double val2 = domain2.getSingleValue();
+ String axisName = axis.toRasQL().toUpperCase();
+ if (axisName.equals("X")) {
+ long[] pCoord = crs.convertToPixelCoordinates(meta, "X", val1, val2, null, null);
+ coord1 = pCoord[0];
+ coord2 = pCoord[1];
+ }
+ if (axisName.equals("Y")) {
+ long[] pCoord = crs.convertToPixelCoordinates(meta, "Y", null, null, val1, val2);
+ coord1 = pCoord[2];
+ coord2 = pCoord[3];
+ }
+ } catch (NoApplicableCodeException e) {
+ this.transformedCoordinates = false;
+ LOG.error("Error while transforming geo-coordinates to pixel coordinates."
+ + "The metadata is probably not valid.");
+ }
+ }
+ }
+ }
+
+ /* Not used */
+ public String toRasQL() {
+ return "<DimensionIntervalElement Not Converted to RasQL>";
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public Node getNextNode() {
+ return nextNode;
+ }
+
+ public String getAxisName() {
+ return this.axis.toRasQL();
+ }
+
+ public String getAxisCoords() {
+ return this.domain1.toRasQL() + " : " + this.domain2.toRasQL();
+ }
+
+ public String getLowCoord() {
+ if (transformedCoordinates) {
+ return String.valueOf(coord1);
+ } else {
+ return this.domain1.toRasQL();
+ }
+ }
+
+ public String getHighCoord() {
+ if (transformedCoordinates) {
+ return String.valueOf(coord2);
+ } else {
+ return this.domain2.toRasQL();
+ }
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DimensionIntervalList.java b/petascope/src/petascope/wcps/server/core/DimensionIntervalList.java
new file mode 100644
index 0000000..94e477c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DimensionIntervalList.java
@@ -0,0 +1,55 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.ArrayList;
+import java.util.List;
+import org.w3c.dom.*;
+
+public class DimensionIntervalList {
+
+ private ArrayList<IRasNode> list;
+
+ public DimensionIntervalList(Node node, XmlQuery xq, CoverageInfo info)
+ throws WCPSException, InvalidCrsException {
+ System.err.println("Parsing a Dimension Interval List ...");
+
+ while (node != null) {
+ list = new ArrayList<IRasNode>();
+ try {
+ System.err.println("Parsing one dimension interval element ...");
+ DimensionIntervalElement elem = new DimensionIntervalElement(node, xq, info);
+ node = elem.getNextNode();
+ list.add(elem);
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse this dimension interval element !");
+ System.err.println("Current node: " + node);
+ }
+ }
+ }
+
+ public List getAxisList() {
+ return list;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DimensionPointElement.java b/petascope/src/petascope/wcps/server/core/DimensionPointElement.java
new file mode 100644
index 0000000..b29dd8e
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DimensionPointElement.java
@@ -0,0 +1,130 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class DimensionPointElement implements IRasNode {
+
+ private IRasNode domain, child;
+ private AxisName axis;
+ private Crs crs;
+ private boolean finished = false;
+ private Node nextNode;
+
+ public DimensionPointElement(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ System.err.println("Trying to parse DimensionPointElement expression...");
+ String name;
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ while (node != null && finished == false) {
+ if (node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ continue;
+ }
+
+ name = node.getNodeName();
+ System.err.println("Current node is " + name);
+
+ // Try Axis
+ try {
+ axis = new AxisName(node, xq);
+ node = node.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse an axis!");
+ }
+
+ // Try CRS name
+ try {
+ crs = new Crs(node, xq);
+ node = node.getNextSibling();
+ if (axis == null) {
+ throw new WCPSException("Expected Axis node before CRS !");
+ }
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse a crs!");
+ }
+
+ // TODO: how to implement DomainMetadataExpr ?
+
+// // Try last thing
+// try
+// {
+// domain1 = new DomainMetadataExprType(node, xq);
+// counter = 1;
+// continue;
+// }
+// catch (WCPSException e)
+// {
+// System.err.println("Failed to parse domain metadata!");
+// }
+
+ // Then it must be a "slicingPosition"
+ if (node.getNodeName().equals("slicingPosition")) {
+ domain = new ScalarExpr(node.getFirstChild(), xq);
+ if (axis == null) {
+ throw new WCPSException("Expected <axis> node before <slicingPosition> !");
+ }
+ } else {
+ throw new WCPSException("Unexpected node: " + node.getFirstChild().getNodeName());
+ }
+
+ if (axis != null && domain != null) {
+ finished = true;
+ }
+
+ if (finished == true) {
+ nextNode = node.getNextSibling();
+ }
+
+ node = node.getNextSibling();
+ }
+ }
+
+ public String toRasQL() {
+ return child.toRasQL();
+ }
+
+ public Node getNextNode() {
+ return nextNode;
+ }
+
+ public String getAxisName() {
+ return this.axis.toRasQL();
+ }
+
+ public String getCrsName() {
+ return this.crs.toRasQL();
+ }
+
+ public String getSlicingPosition() {
+ return this.domain.toRasQL();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DomainElement.java b/petascope/src/petascope/wcps/server/core/DomainElement.java
new file mode 100644
index 0000000..3bb18f1
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DomainElement.java
@@ -0,0 +1,193 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * This is an axis in geographic coordinates. See the WCPS standard.
+ */
+public class DomainElement implements Cloneable {
+
+ public static final String WGS84_CRS = "EPSG:4326";
+ public static final String IMAGE_CRS = "CRS:1";
+ private Set<String> crss;
+ private String name;
+ private Double numHi;
+ private Double numLo;
+ private String strHi;
+ private String strLo;
+ private String type;
+ private Collection<String> allowedAxes;
+
+ public DomainElement(String name, String type, Double numLo, Double numHi, String strLo,
+ String strHi, Set<String> crss, Collection<String> axes)
+ throws InvalidMetadataException {
+ this.allowedAxes = axes;
+
+ if ((name == null) || (type == null)) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Element name and type cannot be null");
+ }
+
+ if (name.equals("")) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Element name cannot be empty");
+ }
+
+ if (allowedAxes.contains(type) == false) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Invalid element type: " + type
+ + ". Allowed element types are: " + allowedAxes.toString());
+ }
+
+ if ((numLo != null) && (numHi != null) && (strLo == null) && (strHi == null)) {
+ if (numLo.compareTo(numHi) == 1) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Lower integer bound cannot be larger than upper integer bound");
+ }
+
+ this.numLo = numLo;
+ this.numHi = numHi;
+ } else if ((strLo != null) && (numHi != null) && (numLo == null) && (numHi == null)) {
+ if (strLo.equals("") || strHi.equals("")) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: String bounds cannot be empty");
+ }
+
+ this.strLo = strLo;
+ this.strHi = strHi;
+ } else {
+ /* Allow both sources of info for time-axes */
+ if (type.equals("t")) {
+ this.strLo = strLo;
+ this.strHi = strHi;
+ this.numLo = numLo;
+ this.numHi = numHi;
+ } else {
+ throw new InvalidMetadataException(
+ "Invalid domain element: Integer bounds must both be non-null if string bounds are null, and vice versa at "
+ + name + ":" + type);
+ }
+ }
+
+ if ((type.equals("x") || type.equals("y")) && (numLo == null)) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: A spatial axis must have integer extent");
+ } else if (type.equals("temporal") && (strLo == null)) {
+ throw new InvalidMetadataException(
+ "Invalid domain element: A temporal axis must have string extent");
+ } else if (type.equals("t") && (numLo == null) || (numHi == null)) {
+ throw new InvalidMetadataException("Invalid domain element: A \"t\" axis must have integer extent and optionally, string extent");
+ }
+
+ this.name = name;
+ this.type = type;
+
+ if ((crss == null) || !crss.contains(IMAGE_CRS)) {
+// throw new InvalidMetadataException(
+// "Invalid domain element: CRS set does not contain image CRS '"
+// + IMAGE_CRS + "'");
+ crss.add(IMAGE_CRS);
+ }
+
+ this.crss = crss;
+
+ }
+
+ @Override
+ public DomainElement clone() {
+ Set<String> c = new HashSet<String>(crss.size());
+ Iterator<String> i = crss.iterator();
+
+ while (i.hasNext()) {
+ c.add(new String(i.next()));
+ }
+
+ try {
+ String newName = name == null ? null : new String(name);
+ String newType = type == null ? null : new String(type);
+ Double newNumLo = numLo == null ? null : new Double(numLo);
+ Double newNumHi = numHi == null ? null : new Double(numHi);
+ String newStrLo = strLo == null ? null : new String(strLo);
+ String newStrHi = strHi == null ? null : new String(strHi);
+ return new DomainElement(newName, newType, newNumLo, newNumHi, newStrLo, newStrHi, c, allowedAxes);
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException(
+ "Invalid metadata while cloning DomainElement. This is a software bug in WCPS.",
+ ime);
+ }
+
+ }
+
+ public boolean equals(DomainElement de) {
+ if ((numLo == null) && (de.numLo == null)) {
+ return strLo.equals(de.strLo) && strHi.equals(strHi)
+ && name.equals(de.name) && type.equals(de.type);
+ } else if ((strLo == null) && (de.strLo == null)) {
+ return numLo.equals(de.numLo) && numHi.equals(numHi)
+ && name.equals(de.name) && type.equals(de.type);
+ } else {
+ return false;
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Double getNumHi() {
+ return numHi;
+ }
+
+ public Double getNumLo() {
+ return numLo;
+ }
+
+ public String getStrHi() {
+ return strHi;
+ }
+
+ public String getStrLo() {
+ return strLo;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public Set<String> getCrsSet() {
+ return crss;
+ }
+
+ @Override
+ public String toString() {
+ String d = "Domain Element { Name: '" + name + "', Type: '" + type
+ + "', NumLow: '" + numLo + "', NumHi: '" + numHi + "', StrLow: '"
+ + strLo + "', StrHi: '" + strHi + "', CrsSet: '" + crss + "'}";
+ return d;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java b/petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java
new file mode 100644
index 0000000..2918f84
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/DynamicMetadataSource.java
@@ -0,0 +1,105 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * A IMetadataSource that allows WCPS to store information about on-the-fly
+ * constructed coverages (for example Construct Coverage expr).
+ * Needs another MetadataSource as a backend, to retrieve metadata about
+ * static coverages.
+ */
+public class DynamicMetadataSource implements IDynamicMetadataSource {
+ // Static coverages, served by the server at all times
+
+ private Set<String> staticCoverageNames;
+ // Dynamic coverages, built on-the-fly in a query
+ private Set<String> dynamicCoverageNames;
+ // Union of static and dynamic coverages
+ private Set<String> allCoverageNames;
+ // Metadata information for all available coverages
+ private Map<String, Metadata> metadata;
+ // Other metadata class that serves as backend
+ private IMetadataSource metadataSource;
+
+ public DynamicMetadataSource(IMetadataSource metadataSource)
+ throws ResourceException, InvalidMetadataException {
+ this.metadataSource = metadataSource;
+ staticCoverageNames = metadataSource.coverages();
+ dynamicCoverageNames = new HashSet<String>();
+ allCoverageNames = staticCoverageNames;
+ metadata = new HashMap<String, Metadata>();
+
+ // Init metadata for static coverages
+ Iterator<String> i = staticCoverageNames.iterator();
+ try {
+ while (i.hasNext()) {
+ String coverage = i.next();
+ metadata.put(coverage, metadataSource.read(coverage));
+ }
+ } catch (InvalidWcpsRequestException ire) {
+ throw (InvalidMetadataException) ire.getCause();
+ }
+ }
+
+ public Set<String> coverages() throws ResourceException {
+ return metadataSource.coverages();
+ }
+
+ public String formatToMimetype(String format) {
+ return metadataSource.formatToMimetype(format);
+ }
+
+ public Metadata read(String coverageName) throws InvalidWcpsRequestException, ResourceException {
+ if ((coverageName == null) || coverageName.equals("")) {
+ throw new InvalidWcpsRequestException(
+ "Cannot retrieve coverage with null or empty name");
+ }
+
+ if (!this.coverages().contains(coverageName)) {
+ throw new InvalidWcpsRequestException("Coverage '" + coverageName
+ + "' is not served by this server");
+ }
+
+ return metadataSource.read(coverageName);
+ }
+
+ public void addDynamicMetadata(String coverageName, Metadata meta) {
+ metadata.put(coverageName, meta);
+ dynamicCoverageNames.add(coverageName);
+ allCoverageNames = staticCoverageNames;
+ allCoverageNames.addAll(dynamicCoverageNames);
+ }
+
+ public Collection<String> getAxisNames() {
+ return metadataSource.getAxisNames();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/EncodeDataExpr.java b/petascope/src/petascope/wcps/server/core/EncodeDataExpr.java
new file mode 100644
index 0000000..2ed58ac
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/EncodeDataExpr.java
@@ -0,0 +1,96 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+// This is the equivalent of the "ProcessingExprType" complex XML type.
+public class EncodeDataExpr implements IRasNode {
+
+ private IRasNode coverageExprType;
+ private String extraParams;
+ private String format;
+ private String mime;
+ private Boolean store;
+
+ public EncodeDataExpr(Node node, XmlQuery request) throws WCPSException, InvalidCrsException {
+ Node child;
+ String nodeName;
+
+ for (child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ continue;
+ }
+
+ System.err.println("Encode : node : " + child.getNodeName());
+
+ if (nodeName.equals("format")) {
+ format = child.getFirstChild().getNodeValue();
+ mime = request.getMetadataSource().formatToMimetype(format);
+ continue;
+ }
+
+ if (nodeName.equals("extraParameters")) {
+ extraParams = child.getFirstChild().getNodeValue();
+ continue;
+ }
+
+ coverageExprType = new CoverageExpr(child, request);
+ }
+
+ Node _store = node.getAttributes().getNamedItem("store");
+
+ if (_store != null) {
+ store = _store.getNodeValue().equals("true");
+ }
+ }
+
+ public String getMime() {
+ return mime;
+ }
+
+ public String toRasQL() {
+ // TODO: cjucovschi - implement store
+
+ String result;
+
+ if (format.equals("raw")) {
+ result = coverageExprType.toRasQL();
+ } else {
+ result = format + "(" + coverageExprType.toRasQL();
+
+ if (extraParams != null) {
+ extraParams = '"' + extraParams + '"';
+ result = result + ", " + extraParams;
+ }
+
+ result = result + ")";
+ }
+
+ System.err.println("Returning EncodeExpression:" + result);
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ExtendCoverageExpr.java b/petascope/src/petascope/wcps/server/core/ExtendCoverageExpr.java
new file mode 100644
index 0000000..a711742
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ExtendCoverageExpr.java
@@ -0,0 +1,132 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.w3c.dom.*;
+
+public class ExtendCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private List<DimensionIntervalElement> axisList;
+ private CoverageExpr coverageExprType;
+ private CoverageInfo coverageInfo;
+ private String[] dim;
+ private int dims;
+ private DimensionIntervalElement elem;
+
+ public ExtendCoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+
+ Node child, axisNode;
+ String nodeName;
+
+ axisList = new ArrayList<DimensionIntervalElement>();
+
+ child = node.getFirstChild();
+ while (child != null) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ child = child.getNextSibling();
+ continue;
+ }
+
+ try {
+ System.err.println("Trying out an CoverageExprType group...");
+ coverageExprType = new CoverageExpr(child, xq);
+ coverageInfo = coverageExprType.getCoverageInfo();
+ child = child.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no CoverageExprType: " + nodeName);
+ }
+
+ try {
+ // Start a new axis and save it
+ elem = new DimensionIntervalElement(child, xq, coverageInfo);
+ axisList.add(elem);
+ child = elem.getNextNode();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no Dimension Interval ELement: " + child.getNodeName());
+ }
+
+ // else unknown element
+ throw new WCPSException("Unknown node for ExtendCoverage expression:" + child.getNodeName());
+ }
+
+ dims = coverageInfo.getNumDimensions();
+ dim = new String[dims];
+
+ for (int j = 0; j < dims; ++j) {
+ dim[j] = "*:*";
+ }
+
+
+ Iterator<DimensionIntervalElement> i = axisList.iterator();
+ DimensionIntervalElement axis;
+ int axisId;
+ int axisLo, axisHi;
+
+ while (i.hasNext()) {
+ axis = i.next();
+ axisId = coverageInfo.getDomainIndexByName(axis.getAxisName());
+ System.out.println("Axis ID: " + axisId);
+ System.out.println("Axis name: " + axis.getAxisName());
+ System.out.print("Axis coords: ");
+
+ axisLo = Integer.parseInt(axis.getLowCoord());
+ axisHi = Integer.parseInt(axis.getHighCoord());
+ dim[axisId] = axisLo + ":" + axisHi;
+ coverageInfo.setCellDimension(
+ axisId,
+ new CellDomainElement(
+ BigInteger.valueOf(axisLo), BigInteger.valueOf(axisHi)));
+ }
+
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return coverageInfo;
+ }
+
+ public String toRasQL() {
+ String result = "extend(" + coverageExprType.toRasQL() + ",[";
+
+ for (int j = 0; j < dims; ++j) {
+ if (j > 0) {
+ result += ",";
+ }
+
+ result += dim[j];
+ }
+
+ result += "])";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/FieldInterpolationElement.java b/petascope/src/petascope/wcps/server/core/FieldInterpolationElement.java
new file mode 100644
index 0000000..74af1cf
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/FieldInterpolationElement.java
@@ -0,0 +1,79 @@
+ /*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+
+public class FieldInterpolationElement implements IRasNode {
+
+ private FieldName name;
+ private InterpolationMethod interp;
+ private Node nextNode;
+
+ public FieldInterpolationElement(Node node, XmlQuery xq) throws WCPSException {
+
+ throw new InvalidWcpsRequestException("Currently, our implementation does not allow specifying " +
+ "interpolation methods or null resistances for the scale operation.");
+
+ /*
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("FieldInterpolationElementType parsing error!");
+ }
+
+ while (node != null)
+ {
+ String nodeName = node.getNodeName();
+ while (node.getNodeName().equals("#text"))
+ node = node.getNextSibling();
+
+ if (nodeName.equals("name")) {
+ this.name = new FieldName(node, xq);
+ node = node.getNextSibling();
+ continue;
+ }
+ else
+ {
+ interp = new InterpolationMethod(node, xq);
+ node = interp.getNextNode();
+ }
+ }
+ nextNode = node;
+
+ */
+ }
+
+ public Node getNextNode()
+ {
+ return nextNode;
+ }
+
+ public String toRasQL() {
+ // Since we only accept the default rasdaman interpolation methods, we do not need to specify it further
+ return "";
+ }
+};
diff --git a/petascope/src/petascope/wcps/server/core/FieldName.java b/petascope/src/petascope/wcps/server/core/FieldName.java
new file mode 100644
index 0000000..0f6f71d
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/FieldName.java
@@ -0,0 +1,52 @@
+ /*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class FieldName implements IRasNode {
+
+ private String name;
+
+ public FieldName(Node node, XmlQuery xq) throws WCPSException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("FieldNameType parsing error!");
+ }
+
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("name")) {
+ this.name = node.getTextContent();
+
+ System.err.println("Found field name: " + name);
+ }
+ }
+
+ public String toRasQL() {
+ return this.name;
+ }
+};
diff --git a/petascope/src/petascope/wcps/server/core/ICoverageInfo.java b/petascope/src/petascope/wcps/server/core/ICoverageInfo.java
new file mode 100644
index 0000000..b3aa956
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ICoverageInfo.java
@@ -0,0 +1,27 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+interface ICoverageInfo {
+
+ public CoverageInfo getCoverageInfo();
+}
diff --git a/petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java b/petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java
new file mode 100644
index 0000000..31e82a4
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/IDynamicMetadataSource.java
@@ -0,0 +1,33 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+/**
+ * A IDynamicMetadataSource is an IMetadataSource that can also add information
+ * about new coverages on-the-fly. This is useful for queries that construct
+ * new coverages (see ConstructCoverage expression) but are not stored in the
+ * database.
+ */
+public interface IDynamicMetadataSource extends IMetadataSource {
+
+ public void addDynamicMetadata(String coverageName, Metadata meta);
+}
diff --git a/petascope/src/petascope/wcps/server/core/IMetadataSource.java b/petascope/src/petascope/wcps/server/core/IMetadataSource.java
new file mode 100644
index 0000000..fb01453
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/IMetadataSource.java
@@ -0,0 +1,44 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * A IMetadataSource is anything that can read metadata for a given coverage
+ * name. It must be able to list all coverages which it knows, return Metadata
+ * for each one, and also map a format (e.g. "png") to its formatToMimetype
+ * (e.g. "image/png").
+ */
+public interface IMetadataSource {
+
+ public Set<String> coverages() throws ResourceException;
+
+ public String formatToMimetype(String format);
+
+ public Metadata read(String coverageName) throws InvalidWcpsRequestException, ResourceException;
+
+ public Collection<String> getAxisNames();
+}
diff --git a/petascope/src/petascope/wcps/server/core/IRasNode.java b/petascope/src/petascope/wcps/server/core/IRasNode.java
new file mode 100644
index 0000000..8bf7aae
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/IRasNode.java
@@ -0,0 +1,27 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+interface IRasNode {
+
+ public String toRasQL();
+}
diff --git a/petascope/src/petascope/wcps/server/core/InducedOperationCoverageExpr.java b/petascope/src/petascope/wcps/server/core/InducedOperationCoverageExpr.java
new file mode 100644
index 0000000..4e20c4c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/InducedOperationCoverageExpr.java
@@ -0,0 +1,88 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class InducedOperationCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private CoverageInfo info;
+ private String operation = "";
+
+ public InducedOperationCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ String nodeName = node.getNodeName();
+
+ System.err.println("Trying induced operation: " + nodeName);
+ boolean okay = false; // will be true if the node is recognized
+
+ if (nodeName.equals("rangeConstructor")) {
+ operation = nodeName;
+ child = new RangeCoverageExpr(node, xq);
+ info = new CoverageInfo((((ICoverageInfo) child).getCoverageInfo()));
+ } else { // Try one of the groups
+ child = null;
+
+ if (child == null) {
+ try {
+ child = new UnaryOperationCoverageExpr(node, xq);
+ info = new CoverageInfo((((ICoverageInfo) child).getCoverageInfo()));
+ System.err.println("*** Induced Operation SUCCESS: " + node.getNodeName());
+ } catch (WCPSException e) {
+ System.err.println("InducedOperation failed: " + node.getNodeName());
+ child = null;
+ if (e.getMessage().equals("Method not implemented")) {
+ throw e;
+ }
+ }
+ }
+
+ if (child == null) {
+ try {
+ child = new BinaryOperationCoverageExpr(node, xq);
+ info = new CoverageInfo((((ICoverageInfo) child).getCoverageInfo()));
+ System.err.println("*** Binary Operation SUCCESS: " + node.getNodeName());
+ } catch (WCPSException e) {
+ System.err.println("Binary operation failed: " + node.getNodeName());
+ child = null;
+ }
+ }
+
+ if (child == null) {
+ throw new WCPSException("Invalid induced coverage expression, next node: "
+ + node.getNodeName());
+ }
+ }
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ return child.toRasQL();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/InterpolationMethod.java b/petascope/src/petascope/wcps/server/core/InterpolationMethod.java
new file mode 100644
index 0000000..9b1cf65
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/InterpolationMethod.java
@@ -0,0 +1,84 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//A pair of an interpolation type and a null resistance. See the WCPS standard for an explanation of these.
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+
+public class InterpolationMethod implements Cloneable {
+
+ private String interpolationType;
+ private String nullResistance;
+
+ public InterpolationMethod(String interpolationType, String nullResistance)
+ throws InvalidMetadataException {
+ if ((interpolationType == null)
+ || !(interpolationType.equals("nearest") || interpolationType.equals("linear")
+ || interpolationType.equals("cubic")
+ || interpolationType.equals("quadratic")
+ || interpolationType.equals("none"))) {
+ throw new InvalidMetadataException("Invalid interpolation method: "
+ + interpolationType
+ + " is not a legal interpolation type");
+ }
+
+ this.interpolationType = interpolationType;
+
+ if ((nullResistance == null)
+ || !(nullResistance.equals("full") || nullResistance.equals("none")
+ || nullResistance.equals("half") || nullResistance.equals("other"))) {
+ throw new InvalidMetadataException("Invalid interpolation method: "
+ + nullResistance
+ + " is not a legal null resistance");
+ }
+
+ this.nullResistance = nullResistance;
+
+ }
+
+ public InterpolationMethod clone() {
+ try {
+ return new InterpolationMethod(interpolationType, nullResistance);
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException(
+ "Invalid metadata while cloning InterpolationMethod. This is a software bug in WCPS.",
+ ime);
+ }
+
+ }
+
+ public boolean equals(InterpolationMethod im) {
+ return interpolationType.equals(im.interpolationType)
+ && nullResistance.equals(im.nullResistance);
+
+ }
+
+ public String getInterpolationType() {
+ return interpolationType;
+
+ }
+
+ public String getNullResistance() {
+ return nullResistance;
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/Metadata.java b/petascope/src/petascope/wcps/server/core/Metadata.java
new file mode 100644
index 0000000..21dd264
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/Metadata.java
@@ -0,0 +1,704 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//~--- JDK imports ------------------------------------------------------------
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import petascope.wcs.server.core.TimeString;
+
+/**
+ * This class implements WCPS metadata. For information on what each field
+ * means, see the WCPS standard. This class provides extensive error cheching
+ * and well as various utility functions.
+ */
+public class Metadata implements Cloneable {
+
+ private List<CellDomainElement> cellDomain;
+ private String coverageName;
+ private int coverageId = -1; // Used when reading metadata from the DB
+ private List<DomainElement> domain;
+ private InterpolationMethod interpolationDefault;
+ private Set<InterpolationMethod> interpolationSet;
+ private String nullDefault;
+ private Set<String> nullSet;
+ private List<RangeElement> range;
+ private String titleStr = "";
+ private String abstractStr = "";
+ private String keywordsStr = "";
+ private Wgs84Crs crs = null;
+ private CellDomainElement cellX, cellY, cellT;
+ private DomainElement domX, domY, domT;
+
+ public Metadata(List<CellDomainElement> cellDomain, List<RangeElement> range, Set<String> nullSet, String nullDefault, Set<InterpolationMethod> interpolationSet, InterpolationMethod interpolationDefault, String coverageName, List<DomainElement> domain, Wgs84Crs crs, String title, String abstr, String keywords) throws InvalidMetadataException {
+ this(cellDomain, range, nullSet, nullDefault, interpolationSet, interpolationDefault, coverageName, domain, crs);
+ this.titleStr = title;
+ this.abstractStr = abstr;
+ this.keywordsStr = keywords;
+ }
+
+ public Metadata(List<CellDomainElement> cellDomain, List<RangeElement> range, Set<String> nullSet, String nullDefault, Set<InterpolationMethod> interpolationSet, InterpolationMethod interpolationDefault, String coverageName, List<DomainElement> domain, Wgs84Crs crs) throws InvalidMetadataException {
+ if ((cellDomain == null) || (range == null) || (coverageName == null) || (nullSet == null) || (interpolationSet == null)) {
+ throw new InvalidMetadataException("Cell domain, range list, "
+ + "coverage name, null set, and interpolation set cannot be null for coverage " + coverageName);
+ }
+
+ if (cellDomain.size() == 0) {
+ throw new InvalidMetadataException("Invalid cell domain: At least "
+ + "one element is required for coverage " + coverageName);
+ }
+
+ this.cellDomain = cellDomain;
+
+ if (range.size() == 0) {
+ throw new InvalidMetadataException("At least one range element is "
+ + "required for coverage " + coverageName);
+ }
+
+ this.range = new ArrayList<RangeElement>(range.size());
+ Iterator<RangeElement> ir = range.iterator();
+
+ while (ir.hasNext()) {
+ RangeElement next = ir.next();
+ Iterator<RangeElement> j = this.range.iterator();
+
+ while (j.hasNext()) {
+ if (j.next().getName().equals(next.getName())) {
+ throw new InvalidMetadataException("Duplicate range element"
+ + " name encountered for coverage " + coverageName);
+ }
+ }
+
+ this.range.add(next);
+ }
+
+ if (nullSet.size() == 0) {
+ throw new InvalidMetadataException("Invalid null set: At least one "
+ + "null value is required for coverage " + coverageName);
+ }
+
+ if (nullDefault == null) {
+ throw new InvalidMetadataException("Invalid null default: Null "
+ + "default cannot be null for coverage " + coverageName);
+ }
+
+ if (!nullSet.contains(nullDefault)) {
+ throw new InvalidMetadataException("Invalid null default: Default "
+ + "null value " + nullDefault + " is not part of the null set"
+ + " for coverage " + coverageName);
+ }
+
+ Iterator<String> ns = nullSet.iterator();
+
+ while (ns.hasNext()) {
+ String nullVal = ns.next();
+ List<String> nulls = SDU.str2string(nullVal);
+
+ if (nulls.size() != range.size()) {
+ throw new InvalidMetadataException("Invalid null value: "
+ + nullVal + " must have " + range.size() + " axes "
+ + "according to the range specified for coverage " + coverageName);
+ }
+
+ Iterator<String> i = nulls.iterator();
+ Iterator<RangeElement> j = range.iterator();
+
+ while (j.hasNext()) {
+ RangeElement re = j.next();
+
+ if (re.isBoolean()) {
+ SDU.str2boolean(i.next());
+ } else if (re.isIntegral()) {
+ SDU.str2integer(i.next());
+ } else if (re.isFloating()) {
+ SDU.str2double(i.next());
+ } else if (re.isComplex()) {
+ SDU.str2complex(i.next());
+ }
+ }
+ }
+
+ this.nullSet = nullSet;
+ this.nullDefault = nullDefault;
+
+ if (interpolationSet.size() == 0) {
+ throw new InvalidMetadataException("Invalid interpolation set: "
+ + "At least one interpolation method is required for "
+ + "coverage " + coverageName);
+ }
+
+ if (interpolationDefault == null) {
+ interpolationDefault = new InterpolationMethod("none", "none");
+ }
+
+ boolean defaultContainedInSet = false;
+ Iterator<InterpolationMethod> is = interpolationSet.iterator();
+
+ while (is.hasNext()) {
+ if (interpolationDefault.equals(is.next())) {
+ defaultContainedInSet = true;
+ }
+ }
+
+ if (!defaultContainedInSet) {
+ throw new InvalidMetadataException("Invalid interpolation default:"
+ + " Default interpolation method ("
+ + interpolationDefault.getInterpolationType() + ","
+ + interpolationDefault.getNullResistance() + ") is not part "
+ + "of the interpolation set for coverage " + coverageName);
+ }
+
+ this.interpolationSet = interpolationSet;
+ this.interpolationDefault = interpolationDefault;
+ this.crs = crs;
+
+ this.coverageName = coverageName;
+
+ if (domain != null) {
+ if (domain.size() != cellDomain.size()) {
+ throw new InvalidMetadataException("Domain and cell domain "
+ + "must have equal number of elements for coverage " + coverageName);
+ }
+
+ this.domain = new ArrayList<DomainElement>(domain.size());
+ Iterator<DomainElement> i = domain.iterator();
+ Iterator<CellDomainElement> ci = cellDomain.iterator();
+
+ while (i.hasNext() && ci.hasNext()) {
+ DomainElement next = i.next();
+ CellDomainElement cell = ci.next();
+ Iterator<DomainElement> j = this.domain.iterator();
+ if (next.getType().equals("x")) {
+ cellX = cell;
+ }
+ if (next.getType().equals("y")) {
+ cellY = cell;
+ }
+ if (next.getType().equals("t") // || next.getType().equals("temporal")
+ ) {
+ cellT = cell;
+ domT = next;
+ }
+
+ while (j.hasNext()) {
+ DomainElement previous = j.next();
+
+ // don't compare same objects
+ if (next == previous) {
+ continue;
+ }
+
+ if (previous.getName().equals(next.getName())) {
+ throw new InvalidMetadataException("Duplicate domain "
+ + "element name encountered for coverage " + coverageName);
+ }
+
+ if (previous.getType().equals("temporal") && next.getType().equals("temporal")) {
+ throw new InvalidMetadataException("Domain can contain"
+ + " at most one temporal axis for coverage " + coverageName);
+ }
+
+ if (previous.getType().equals("elevation") && next.getType().equals("elevation")) {
+ throw new InvalidMetadataException("Domain can contain"
+ + " at most one elevation axis for coverage " + coverageName);
+ }
+
+ if (previous.getType().equals("x") && next.getType().equals("x")) {
+ throw new InvalidMetadataException("Domain can contain"
+ + " at most one x axis for coverage " + coverageName);
+ }
+
+ if (previous.getType().equals("y") && next.getType().equals("y")) {
+ throw new InvalidMetadataException("Domain can contain"
+ + " at most one y axis for coverage " + coverageName);
+ }
+
+ if (next.getType().equals("x")) {
+ boolean l = false;
+ Iterator<DomainElement> k = domain.iterator();
+
+ while (k.hasNext()) {
+ if (k.next().getType().equals("y")) {
+ l = true;
+ }
+ }
+
+ if (l == false) {
+ throw new InvalidMetadataException("If domain "
+ + "contains a x axis, it must contain a y "
+ + "axis as well for coverage " + coverageName);
+ }
+ } else if (next.getType().equals("y")) {
+ boolean l = false;
+ Iterator<DomainElement> k = domain.iterator();
+
+ while (k.hasNext()) {
+ if (k.next().getType().equals("x")) {
+ l = true;
+ }
+ }
+
+ if (l == false) {
+ throw new InvalidMetadataException("If domain "
+ + "contains a y axis, it must contain a x "
+ + "axis as well for coverage " + coverageName);
+ }
+ }
+ }
+
+ this.domain.add(next);
+ }
+ }
+
+ }
+
+ @Override
+ public Metadata clone() {
+ try {
+ List<CellDomainElement> cd = new ArrayList<CellDomainElement>(cellDomain.size());
+ Iterator<CellDomainElement> i = cellDomain.iterator();
+
+ while (i.hasNext()) {
+ cd.add(i.next().clone());
+ }
+
+ List<RangeElement> r = new ArrayList<RangeElement>(range.size());
+ Iterator<RangeElement> j = range.iterator();
+
+ while (j.hasNext()) {
+ r.add(j.next().clone());
+ }
+
+ List<DomainElement> d = new ArrayList<DomainElement>(domain.size());
+ Iterator<DomainElement> k = domain.iterator();
+
+ while (k.hasNext()) {
+ d.add(k.next().clone());
+ }
+
+ Set<String> ns = new HashSet<String>(nullSet.size());
+ Iterator<String> l = nullSet.iterator();
+
+ while (l.hasNext()) {
+ ns.add(new String(l.next()));
+ }
+
+ Set<InterpolationMethod> is = new HashSet<InterpolationMethod>(interpolationSet.size());
+ Iterator<InterpolationMethod> m = interpolationSet.iterator();
+
+ while (m.hasNext()) {
+ is.add(m.next().clone());
+ }
+
+ return new Metadata(cd, r, ns, new String(nullDefault), is, interpolationDefault.clone(), new String(coverageName), d, crs, getAbstract(), getTitle(), getKeywords());
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException("Invalid metadata while cloning "
+ + "Metadata. This is a software bug in WCPS.", ime);
+ }
+
+ }
+
+// public CellDomainElement getCellDomain( int index ) {
+//
+// return cellDomain.get( index );
+//
+// }
+ protected void setCoverageId(int id) {
+ this.coverageId = id;
+ }
+
+ public int getCoverageId() {
+ return coverageId;
+ }
+
+ public String getCoverageName() {
+ return coverageName;
+ }
+
+ public String getAbstract() {
+ return abstractStr;
+ }
+
+ public String getTitle() {
+ return titleStr;
+ }
+
+ public String getKeywords() {
+ return keywordsStr;
+ }
+
+ public Iterator<CellDomainElement> getCellDomainIterator() {
+ return cellDomain.iterator();
+
+ }
+
+ public Iterator<DomainElement> getDomainIterator() {
+ return domain.iterator();
+ }
+
+ public Iterator<RangeElement> getRangeIterator() {
+ return range.iterator();
+ }
+
+ public Iterator<InterpolationMethod> getInterpolationMethodIterator() {
+ return interpolationSet.iterator();
+ }
+
+// public Iterator<CrsName> getCrsSetIterator()
+// {
+// return crsset.iterator();
+// }
+ public Iterator<String> getNullSetIterator() {
+ return nullSet.iterator();
+ }
+
+ public int getDimension() {
+ return cellDomain.size();
+ }
+
+ public int getDomainIndexByName(String name) {
+ Iterator<DomainElement> i = domain.iterator();
+
+ for (int index = 0; i.hasNext(); index++) {
+ if (i.next().getName().equals(name)) {
+ return index;
+ }
+ }
+
+ return -1;
+ }
+
+ public DomainElement getDomainByName(String name) {
+ Iterator<DomainElement> i = domain.iterator();
+
+ for (int index = 0; i.hasNext(); index++) {
+ DomainElement dom = i.next();
+ if (dom.getName().equals(name)) {
+ return dom;
+ }
+ }
+
+ return null;
+ }
+
+ public String getNullDefault() {
+ return nullDefault;
+
+ }
+
+ public Set<String> getNullSet() {
+ return nullSet;
+
+ }
+
+ public boolean isRangeBoolean() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isBoolean()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public boolean isRangeComplex() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isComplex()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public boolean isRangeIntegral() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isIntegral()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public boolean isRangeFloating() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isFloating()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public boolean isRangeNumeric() {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ if (!i.next().isNumeric()) {
+ return false;
+ }
+ }
+
+ return true;
+
+ }
+
+ public void setCoverageName(String coverageName) throws InvalidMetadataException {
+ if (coverageName == null) {
+ throw new InvalidMetadataException("Metadata transformation: Coverage name cannot be null");
+ }
+
+ this.coverageName = coverageName;
+
+ }
+
+// public void setCrs( String crs ) throws InvalidMetadataException {
+//
+// if( crs == null ) {
+// throw new InvalidMetadataException( "Metadata transformation: CRS cannot be null" );
+// }
+// if( !(crs.equals( "" ) || crs.startsWith( "urn:ogc:def:crs:EPSG::" )) ) {
+// throw new InvalidMetadataException( "Metadata transformation: Invalid CRS" );
+// }
+// this.crs = crs;
+//
+// }
+// public void setInterpolationMethodList( List<String> interpolationMethodList ) throws InvalidMetadataException {
+//
+// this.interpolationMethodList = interpolationMethodList;
+// Iterator<String> is = interpolationMethodList.iterator();
+// while( is.hasNext() ) {
+// String next = is.next();
+// if( !(next.equals( "nearest neighbor" ) || next.equals( "bilinear" ) || next.equals( "bicubic" ) || next.equals( "lost area" ) || next.equals( "barycentric" )) ) {
+// throw new InvalidMetadataException( "Metadata transformation: Invalid interpolation method" );
+// }
+// }
+//
+// }
+// public void setNullValue( String nullValue ) {
+//
+// this.nullValue = nullValue;
+//
+// }
+ public void setRangeType(String type) throws InvalidMetadataException {
+ Iterator<RangeElement> i = range.iterator();
+
+ while (i.hasNext()) {
+ i.next().setType(type);
+ }
+
+ }
+
+// public void setRangeType( List<String> types ) throws InvalidMetadataException {
+//
+// if( types.size() != range.size() ) {
+// throw new InvalidMetadataException( "Invalid range type: New type has " + types.size() + " elements, but range has " + range.size() + " elements" );
+// }
+// Iterator<RangeElement> i = range.iterator();
+// Iterator<String> j = types.iterator();
+// while( i.hasNext() ) {
+// i.next().setType( j.next() );
+// }
+//
+// }
+// public void updateCellDomain( int index, BigInteger lo, BigInteger hi ) throws InvalidMetadataException {
+//
+// cellDomain.set( index, new CellDomainElement( lo, hi ) );
+//
+// }
+// public void updateDomain( int index, Double numLo, Double numHi, String strLo, String strHi ) throws InvalidMetadataException {
+//
+// DomainElement old = domain.get( index );
+// domain.set( index, new DomainElement( old.getName(), old.getType(), numLo, numHi, strLo, strHi ) );
+//
+// }
+ public void updateNulls(Set<String> nullSet, String nullDefault) throws InvalidMetadataException {
+ if (nullSet.size() == 0) {
+ throw new InvalidMetadataException("Invalid null set: At least one null value is required");
+ }
+
+ if (nullDefault == null) {
+ nullDefault = "0";
+ }
+
+ if (!nullSet.contains(nullDefault)) {
+ throw new InvalidMetadataException("Invalid null default: Default null value " + nullDefault + " is not part of the null set");
+ }
+
+ this.nullSet = nullSet;
+ this.nullDefault = nullDefault;
+
+ }
+
+ public String getInterpolationDefault() {
+ return interpolationDefault.getInterpolationType();
+ }
+
+ public String getNullResistanceDefault() {
+ return interpolationDefault.getNullResistance();
+ }
+
+ public Wgs84Crs getCrs() {
+ return crs;
+ }
+
+ /**
+ * @return the X if it exists
+ */
+ public CellDomainElement getXCellDomain() {
+ return cellX;
+ }
+
+ /**
+ * @return the Y if it exists
+ */
+ public CellDomainElement getYCellDomain() {
+ return cellY;
+ }
+
+ /**
+ * @return the T if it exists
+ */
+ public CellDomainElement getTCellDomain() {
+ return cellT;
+ }
+
+ /**
+ * @param titleStr the titleStr to set
+ */
+ public void setTitle(String titleStr) {
+ this.titleStr = titleStr;
+ }
+
+ /**
+ * @param abstractStr the abstractStr to set
+ */
+ public void setAbstract(String abstractStr) {
+ this.abstractStr = abstractStr;
+ }
+
+ /**
+ * @param keywordsStr the keywordsStr to set
+ */
+ public void setKeywords(String keywordsStr) {
+ this.keywordsStr = keywordsStr;
+ }
+
+ /**
+ * @param cellDomain the cellDomain to set
+ */
+ public void setCellDomain(List<CellDomainElement> cellDomain) {
+ this.cellDomain = cellDomain;
+ }
+
+ /**
+ * @param domain the domain to set
+ */
+ public void setDomain(List<DomainElement> domain) {
+ this.domain = domain;
+ }
+
+ /**
+ * @param range the range to set
+ */
+ public void setRange(List<RangeElement> range) {
+ this.range = range;
+ }
+
+ /**
+ * @param interpolationSet the interpolationSet to set
+ */
+ public void setInterpolationSet(Set<InterpolationMethod> interpolationSet) {
+ this.interpolationSet = interpolationSet;
+ }
+
+ /**
+ * @param interpolationDefault the interpolationDefault to set
+ */
+ public void setDefaultInterpolation(InterpolationMethod interpolationDefault) {
+ this.interpolationDefault = interpolationDefault;
+ }
+
+ /**
+ * Returns the maximal time position of the current coverage in ISO 8601 format, as string.
+ * If there is no time-axis, returns null
+ */
+ public String getTimePeriodBeginning() {
+ if (domT == null) {
+ return null;
+ }
+ return domT.getStrLo();
+ }
+
+ /**
+ * Returns the minimal time position of the current coverage in ISO 8601 format, as string.
+ * If there is no time-axis, returns null
+ */
+ public String getTimePeriodEnd() {
+ if (domT == null) {
+ return null;
+ }
+ return domT.getStrHi();
+ }
+
+ /**
+ * Returns the time span of the current coverage, as described in the metadata (in miliseconds).
+ * If there is no metadata, returns -1.
+ * Note that this function returns the absolute difference. It is the administrator's
+ * responsibility to make sure that the metadata values are correct.
+ */
+ public long getTimeSpan() {
+ if (domT == null) {
+ return -1;
+ }
+ long result = TimeString.difference(getTimePeriodEnd(), getTimePeriodBeginning());
+ return Math.abs(result);
+ }
+
+ /* Returns the difference between the maximum and the minimum time axis index.
+ Returns -1 if there is no metadata. */
+ public long getTimeIndexesSpan() {
+ if (cellT == null) {
+ return -1;
+ }
+ BigInteger big = cellT.getHi().subtract(cellT.getLo());
+ return big.longValue();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/MetadataScalarExpr.java b/petascope/src/petascope/wcps/server/core/MetadataScalarExpr.java
new file mode 100644
index 0000000..233242d
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/MetadataScalarExpr.java
@@ -0,0 +1,37 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+// TODO: implement class MetadataScalarExprType
+public class MetadataScalarExpr implements IRasNode {
+
+ public MetadataScalarExpr(Node node, XmlQuery xq) throws WCPSException {
+ throw new WCPSException("Method not yet implemented !");
+ }
+
+ public String toRasQL() {
+ return "";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/NumericScalarExpr.java b/petascope/src/petascope/wcps/server/core/NumericScalarExpr.java
new file mode 100644
index 0000000..30ef3da
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/NumericScalarExpr.java
@@ -0,0 +1,173 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class NumericScalarExpr implements IRasNode {
+
+ private IRasNode first, second;
+ private String op, value;
+ private boolean twoChildren;
+ private double dvalue;
+
+ public NumericScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ twoChildren = false;
+ String nodeName = node.getNodeName();
+
+ op = "";
+
+ System.err.println("Trying to parse numeric scalar expression ...");
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (nodeName.equals("numericConstant")) {
+ twoChildren = false;
+ op = code(nodeName);
+ value = node.getFirstChild().getNodeValue();
+ try {
+ dvalue = Double.parseDouble(value);
+ } catch (NumberFormatException e) {
+ throw new WCPSException("Could not understand constant: " + value);
+ }
+ } else if (nodeName.equals("complexConstant")
+ || nodeName.equals("condense")
+ || nodeName.equals("reduce")) {
+ op = code(nodeName);
+ twoChildren = false;
+ if (nodeName.equals("complexConstant")) {
+ first = new ComplexConstant(node, xq);
+ }
+ if (nodeName.equals("condense")) {
+ first = new CondenseScalarExpr(node, xq);
+ }
+ if (nodeName.equals("reduce")) {
+ first = new ReduceScalarExpr(node, xq);
+ }
+ } else if (nodeName.equals("numericUnaryMinus")
+ || nodeName.equals("numericSqrt")
+ || nodeName.equals("numericAbs")) {
+ op = code(nodeName);
+ twoChildren = false;
+ first = new NumericScalarExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("numericAdd")
+ || nodeName.equals("numericMinus")
+ || nodeName.equals("numericMult")
+ || nodeName.equals("numericDiv")) {
+ try {
+ op = code(nodeName);
+ twoChildren = true;
+ Node child = node.getFirstChild();
+ first = new NumericScalarExpr(child, xq);
+ second = new NumericScalarExpr(child.getNextSibling(), xq);
+ } catch (WCPSException e) {
+ System.err.println("Failed to parse a numeric expression pair !");
+ }
+ } else if (nodeName.equals("variableRef")) {
+ try {
+ op = code(nodeName);
+ twoChildren = false;
+ first = new VariableReference(node, xq);
+ System.err.println("Matched variable reference: " + first.toRasQL());
+ } catch (WCPSException e) {
+ System.err.println("Failed to match variable reference: "
+ + e.toString());
+ }
+ } else {
+ throw new WCPSException("Unexpected Numeric Scalar Expression node : "
+ + node.getNodeName());
+ }
+ }
+
+ public String toRasQL() {
+ String result = "";
+ if (twoChildren == false)
+ {
+ if (op.equals("variable")) {
+ result = first.toRasQL();
+ } else if (op.equals("value")) {
+ result = value;
+ } else if (op.equals("-")) {
+ result = "-" + first.toRasQL();
+ } else if (op.equals("sqrt")) {
+ result = "sqrt(" + first.toRasQL() + ")";
+ } else if (op.equals("child")) {
+ result = first.toRasQL();
+ } else if (op.equals("abs")) {
+ result = "abs(" + first.toRasQL() + ")";
+ }
+ }else if (twoChildren == true) {
+ result = "(" + first.toRasQL() + ")" + op
+ + "(" + second.toRasQL() + ")";
+ } else {
+ return " error ";
+ }
+
+ return result;
+ }
+
+ private String code(String name) {
+ String op = "";
+ if (name.equals("numericConstant")) {
+ op = "value";
+ }
+ if (name.equals("numericUnaryMinus") || name.equals("numericMinus")) {
+ op = "-";
+ }
+ if (name.equals("numericAdd")) {
+ op = "+";
+ }
+ if (name.equals("numericMult")) {
+ op = "*";
+ }
+ if (name.equals("numericDiv")) {
+ op = "/";
+ }
+ if (name.equals("numericSqrt")) {
+ op = "sqrt";
+ }
+ if (name.equals("numericAbs")) {
+ op = "abs";
+ }
+ if (name.equals("condense") || name.equals("reduce")
+ || name.equals("complexConstant")) {
+ op = "child";
+ }
+ if (name.equals("variableRef")) {
+ op = "variable";
+ }
+
+ return op;
+ }
+
+ public boolean isSingleValue() {
+ return op.equals("value");
+ }
+
+ public double getSingleValue() {
+ return dvalue;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ProcessCoveragesRequest.java b/petascope/src/petascope/wcps/server/core/ProcessCoveragesRequest.java
new file mode 100644
index 0000000..36840cc
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ProcessCoveragesRequest.java
@@ -0,0 +1,252 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.grammar.WCPSRequest;
+import petascope.wcps.grammar.wcpsLexer;
+import petascope.wcps.grammar.wcpsParser;
+import petascope.wcps.grammar.wcpsParser.wcpsRequest_return;
+import java.io.IOException;
+import java.io.StringReader;
+import org.antlr.runtime.RecognitionException;
+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 org.w3c.dom.*;
+
+import org.xml.sax.SAXException;
+import rasj.RasGMArray;
+import rasj.RasImplementation;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.antlr.runtime.ANTLRStringStream;
+import org.antlr.runtime.CharStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.xml.sax.InputSource;
+
+/** A WCPS ProcessCoveragesRequest request provides a (just one) rasdaman query, that it executes.
+ *
+ * Internally, it relies on XmlRequest, which computes the RasQL query.
+ *
+ */
+public class ProcessCoveragesRequest {
+
+ private String database;
+ private IDynamicMetadataSource source;
+ private String url;
+ private WCPS wcps;
+ private String rasqlQuery;
+ private String mime;
+ private XmlQuery xmlQuery;
+
+ public ProcessCoveragesRequest(String url, String database, Node node, IDynamicMetadataSource source, WCPS wcps)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException, IOException, InvalidCrsException {
+ super();
+ this.source = source;
+ this.url = url;
+ this.database = database;
+ this.wcps = wcps;
+ Node child = node.getFirstChild();
+ this.rasqlQuery = null;
+
+ System.err.println("Parsing ProcessCoveragesRequest node: " + child.getNodeName());
+
+ if (child.getNodeName().equals("ProcessCoveragesRequest") == false) {
+ throw new WCPSException("The document contains an unrecognized node : "
+ + child.getNodeName());
+ }
+
+ child = child.getFirstChild();
+ while (child.getNodeName().equals("#text")) {
+ child = child.getNextSibling();
+ }
+
+ if (child.getNodeName().equals("query") == false) {
+ throw new WCPSException("Could not find node <query>: " + child.getNodeName());
+ }
+
+ // "child" is now the node <query>.
+ Node queryNode = child.getFirstChild();
+ while (queryNode.getNodeName().equals("#text")) {
+ queryNode = queryNode.getNextSibling();
+ }
+
+ /**
+ * The following code is essential. It handles the two cases:
+ * 1) the xml contains an <xmlSyntax> request
+ * 2) the xml contains an <abstractSyntax> request
+ */
+ if (queryNode.getNodeName().equals("xmlSyntax")) {
+ System.err.println("Found XML Syntax query");
+ this.xmlQuery = new XmlQuery(this.source);
+ xmlQuery.startParsing(queryNode);
+ } else if (queryNode.getNodeName().equals("abstractSyntax")) {
+ try {
+ String abstractQuery = queryNode.getFirstChild().getNodeValue();
+ System.err.println("Found Abstract Syntax query: " + abstractQuery);
+ String xmlString = abstractQueryToXmlQuery(abstractQuery);
+ InputSource xmlStringSource = new InputSource(new StringReader(xmlString));
+ System.err.println("Coverted the Abstract syntax query to an XML query:");
+ System.err.println("***********************************************");
+ System.err.println(xmlString);
+ System.err.println("***********************************************");
+ ProcessCoveragesRequest newRequest = wcps.pcPrepare(url, database, xmlStringSource);
+ this.xmlQuery = newRequest.getXmlRequestStructure();
+ } catch (RecognitionException e) {
+ throw new WCPSException("Abstract Syntax query is invalid: "
+ + e.getMessage());
+ }
+ } else {
+ throw new WCPSException("Error ! Unexpected node: " + queryNode.getNodeName());
+ }
+
+ // If everything went well, we now have a proper value for "xmlQuery"
+ this.rasqlQuery = xmlQuery.toRasQL();
+ System.err.println("Final RasQL query: " + rasqlQuery);
+ this.mime = xmlQuery.getMimeType();
+ }
+
+ public static String abstractQueryToXmlQuery(String abstractQuery) throws RecognitionException {
+ CharStream cs = new ANTLRStringStream(abstractQuery);
+ wcpsLexer lexer = new wcpsLexer(cs);
+ CommonTokenStream tokens = new CommonTokenStream();
+ tokens.setTokenSource(lexer);
+ wcpsParser parser = new wcpsParser(tokens);
+ wcpsRequest_return rrequest = parser.wcpsRequest();
+ WCPSRequest request = rrequest.value;
+ String xmlRequest = request.toXML();
+
+ return xmlRequest;
+ }
+
+ public String getMime() {
+ return mime;
+ }
+
+ private XmlQuery getXmlRequestStructure() {
+ return xmlQuery;
+ }
+
+ public String getRasqlQuery() {
+ return this.rasqlQuery;
+ }
+
+ public List<byte[]> execute() throws ResourceException {
+ ArrayList<byte[]> results = new ArrayList<byte[]>();
+
+ if (this.rasqlQuery != null) {
+ Implementation impl = new RasImplementation(url);
+ Database db = impl.newDatabase();
+
+ try {
+ db.open(database, Database.OPEN_READ_ONLY);
+ } catch (ODMGException odmge) {
+ try {
+ db.close();
+ } catch (ODMGException e) {
+ }
+
+ throw new ResourceException("Could not connect to rasdaman at "
+ + url + ", database "
+ + database, odmge);
+ }
+
+ Transaction tr = impl.newTransaction();
+
+ tr.begin();
+ OQLQuery q = impl.newOQLQuery();
+ DBag resultSet;
+
+ try {
+ q.create(this.getRasqlQuery());
+ resultSet = (DBag) q.execute();
+
+ if (resultSet != null) {
+ Iterator resultIterator = resultSet.iterator();
+
+ while (resultIterator.hasNext()) {
+ Object current = resultIterator.next();
+
+ try {
+ RasGMArray resultArray =
+ (RasGMArray) current;
+
+ results.add(resultArray.getArray());
+ } catch (ClassCastException e) { // not a RasGMarray
+ if (!mime.equals("text/plain")) {
+ throw new ResourceException(
+ "Incompatible mime and data type!");
+ }
+
+ System.err.println("result="
+ + current.toString());
+ results.add(current.toString().getBytes());
+
+ }
+
+
+ /*
+ * if (mime.equals("text/plain")) {
+ * System.err.println("dataType is :" + resultArray.getBaseTypeSchema().toString());
+ * }
+ */
+
+ }
+ }
+ } catch (QueryException qe) {
+ tr.commit();
+
+ try {
+ db.close();
+ } catch (ODMGException odmge) {
+ }
+
+ throw new ResourceException("Could not evaluate rasdaman query: '"
+ + getRasqlQuery() + "'. Cause: " + qe.getMessage(), qe);
+ }
+
+ tr.commit();
+
+ try {
+ db.close();
+ } catch (ODMGException odmge) {
+ }
+ }
+
+ if (mime.equals("text/plain")) {
+ }
+
+ return results;
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/RangeComponent.java b/petascope/src/petascope/wcps/server/core/RangeComponent.java
new file mode 100644
index 0000000..c94698c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/RangeComponent.java
@@ -0,0 +1,87 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+
+
+/**
+ * This is a component of a RangeStructure.
+ * @author Andrei Aiordachioaie
+ */
+public class RangeComponent implements IRasNode, ICoverageInfo {
+
+ private String field = null;
+ private CoverageInfo info = null;
+ private CoverageExpr expr = null;
+
+ public RangeComponent(Node node, XmlQuery xq)
+ throws WCPSException {
+
+ String nodeName = node.getNodeName();
+ if (nodeName.equals("component"))
+ node = node.getFirstChild();
+
+ while (node != null)
+ {
+ nodeName = node.getNodeName();
+ if (nodeName.equals("#text"))
+ {
+ node = node.getNextSibling();
+ continue;
+ }
+
+ if (nodeName.equals("field"))
+ this.field = node.getTextContent();
+ else
+ try
+ {
+ this.expr = new CoverageExpr(node, xq);
+ this.info = expr.getCoverageInfo();
+ }
+ catch (InvalidCrsException e2)
+ {}
+ catch (WCPSException e)
+ {
+ System.err.println("Could not match CoverageExpr inside RangeExpr. Next node: " + nodeName);
+ throw e;
+ }
+
+ node = node.getNextSibling();
+ }
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ String result = "";
+
+ if (this.expr != null)
+ result = expr.toRasQL();
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/RangeCoverageExpr.java b/petascope/src/petascope/wcps/server/core/RangeCoverageExpr.java
new file mode 100644
index 0000000..2be4d61
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/RangeCoverageExpr.java
@@ -0,0 +1,83 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.w3c.dom.*;
+
+public class RangeCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private CoverageInfo info = null;
+ List<IRasNode> components;
+
+ public RangeCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException {
+
+ components = new ArrayList<IRasNode>();
+
+ if (node.getNodeName().equals("rangeConstructor"))
+ node = node.getFirstChild();
+
+ if (node.getNodeName().equals("#text"))
+ node = node.getNextSibling();
+
+ String nodeName = node.getNodeName();
+ System.err.println("Trying to parse a range coverage expression... Starting at node "
+ + nodeName);
+
+ while (node != null) {
+ if (node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ continue;
+ }
+ if (node.getNodeName().equals("component")) {
+ RangeComponent elem = new RangeComponent(node, xq);
+ info = elem.getCoverageInfo();
+ components.add(elem);
+ }
+
+ node = node.getNextSibling();
+ }
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ // FIXME: Returns currently only the info for the last range component
+ return info;
+ }
+
+ public String toRasQL() {
+ String result = "";
+ int length = components.size();
+ for (int i = 0; i < length - 1; i++)
+ result += components.get(i).toRasQL() + ",";
+ result += components.get(length - 1).toRasQL();
+
+ result = "{ " + result + " }";
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/RangeElement.java b/petascope/src/petascope/wcps/server/core/RangeElement.java
new file mode 100644
index 0000000..29df3b6
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/RangeElement.java
@@ -0,0 +1,163 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//A single component of a coverage's range. See the WCPS standard for more information.
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+
+public class RangeElement implements Cloneable {
+
+ private String name;
+ private String type;
+
+ public RangeElement(String name, String type) throws InvalidMetadataException {
+ if ((name == null) || (type == null)) {
+ throw new InvalidMetadataException(
+ "Invalid range element: Element name and type cannot be null");
+ }
+
+ if (name.equals("")) {
+ throw new InvalidMetadataException(
+ "Invalid range element: Element name cannot be empty");
+ }
+
+ if (!(type.equals("boolean") || type.equals("char") || type.equals("unsigned char")
+ || type.equals("short") || type.equals("unsigned short") || type.equals("int")
+ || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigned long") || type.equals("float")
+ || type.equals("double") || type.equals("complex") || type.equals("complex2"))) {
+ throw new InvalidMetadataException(
+ "Invalid range element: Invalid element type:" + type);
+ }
+
+ this.name = name;
+ this.type = type;
+
+ }
+
+ public RangeElement clone() {
+ try {
+ return new RangeElement(new String(name), new String(type));
+ } catch (InvalidMetadataException ime) {
+ throw new RuntimeException(
+ "Invalid metadata while cloning RangeElement. This is a software bug in WCPS.",
+ ime);
+ }
+
+ }
+
+ public boolean equals(RangeElement re) {
+ return name.equals(re.type);
+
+ }
+
+ public String getName() {
+ return name;
+
+ }
+
+ public String getType() {
+ return type;
+
+ }
+
+ public boolean isBoolean() {
+ return type.equals("boolean");
+
+ }
+
+ public static boolean isBoolean(String type) {
+ return type.equals("boolean");
+
+ }
+
+ public boolean isComplex() {
+ return type.equals("complex") || type.equals("complex2");
+
+ }
+
+ public static boolean isComplex(String type) {
+ return type.equals("complex") || type.equals("complex2");
+
+ }
+
+ public boolean isIntegral() {
+ return type.equals("char") || type.equals("short") || type.equals("unsigned short")
+ || type.equals("int") || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigend long");
+
+ }
+
+ public static boolean isIntegral(String type) {
+ return type.equals("char") || type.equals("short") || type.equals("unsigned short")
+ || type.equals("int") || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigend long");
+
+ }
+
+ public boolean isFloating() {
+ return type.equals("float") || type.equals("double");
+
+ }
+
+ public static boolean isFloating(String type) {
+ return type.equals("float") || type.equals("double");
+
+ }
+
+ public boolean isNumeric() {
+ return type.equals("char") || type.equals("short") || type.equals("unsigned short")
+ || type.equals("int") || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigend long") || type.equals("float")
+ || type.equals("double") || type.equals("complex")
+ || type.equals("complex2");
+
+ }
+
+ public static boolean isNumeric(String type) {
+ return type.equals("char") || type.equals("short") || type.equals("unsigned short")
+ || type.equals("int") || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigend long") || type.equals("float")
+ || type.equals("double") || type.equals("complex")
+ || type.equals("complex2");
+
+ }
+
+ public void setType(String type) throws InvalidMetadataException {
+ if (!(type.equals("boolean") || type.equals("char") || type.equals("unsigned char")
+ || type.equals("short") || type.equals("unsigned short") || type.equals("int")
+ || type.equals("unsigned int") || type.equals("long")
+ || type.equals("unsigned long") || type.equals("float")
+ || type.equals("double") || type.equals("complex") || type.equals("complex2"))) {
+ throw new InvalidMetadataException(
+ "Invalid range element: Invalid element type:" + type);
+ }
+
+ this.type = type;
+
+ }
+
+ public String toString() {
+ String r = "Range Element { Name '" + name + "', Type '" + type + "'}";
+ return r;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/RangeField.java b/petascope/src/petascope/wcps/server/core/RangeField.java
new file mode 100644
index 0000000..9256661
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/RangeField.java
@@ -0,0 +1,54 @@
+ /*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.util.Iterator;
+
+public class RangeField implements IRasNode {
+
+ private String type;
+
+ public RangeField(Node node, XmlQuery xq) throws WCPSException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("RangeFieldType parsing error!");
+ }
+
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("type")) {
+ this.type = node.getTextContent();
+
+ System.err.println("Found range field type: " + type);
+ }
+ }
+
+ public String toRasQL() {
+ return this.type;
+ }
+};
diff --git a/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java b/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
new file mode 100644
index 0000000..d7e343c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
@@ -0,0 +1,68 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class ReduceScalarExpr implements IRasNode {
+
+ CoverageExpr expr;
+ String op;
+
+ public ReduceScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ if (node.getNodeName().equals("reduce")) {
+ node = node.getFirstChild();
+ }
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ System.err.println("Trying to parse ReduceScalarExpr ");
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("all") || nodeName.equals("some") || nodeName.equals("count")
+ || nodeName.equals("add") || nodeName.equals("avg") || nodeName.equals("min")
+ || nodeName.equals("max")) {
+ op = nodeName;
+
+ if (!op.equals("all") && !op.equals("some")) {
+ op = op + "_cells";
+ }
+
+ node = node.getFirstChild();
+
+ while ((node != null) && (node.getNodeName().equals("#text"))) {
+ node = node.getNextSibling();
+ }
+
+ expr = new CoverageExpr(node, xq);
+ } else {
+ throw new WCPSException("invalid ReduceScalarExprType node : " + nodeName);
+ }
+ }
+
+ public String toRasQL() {
+ return op + "(" + expr.toRasQL() + ")";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/SDU.java b/petascope/src/petascope/wcps/server/core/SDU.java
new file mode 100644
index 0000000..e69ecb2
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/SDU.java
@@ -0,0 +1,191 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.apache.commons.math.complex.Complex;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.math.BigInteger;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a static utility class, which provides encoding and decoding of various datatypes
+ * from/to strings. It also handles packing and unpacking of structures.
+ */
+public class SDU {
+
+ public static String boolean2str(List<Boolean> boolea) {
+ List<String> strings = new ArrayList<String>(boolea.size());
+ Iterator<Boolean> i = boolea.iterator();
+
+ while (i.hasNext()) {
+ strings.add(i.next().toString());
+ }
+
+ return string2str(strings);
+
+ }
+
+ public static String complex2str(List<Complex> complex) {
+ List<String> strings = new ArrayList<String>(complex.size());
+ Iterator<Complex> i = complex.iterator();
+
+ while (i.hasNext()) {
+ Complex c = i.next();
+
+ strings.add(c.getReal() + "#" + c.getImaginary());
+ }
+
+ return string2str(strings);
+
+ }
+
+ public static String double2str(List<Double> doubl) {
+ List<String> strings = new ArrayList<String>(doubl.size());
+ Iterator<Double> i = doubl.iterator();
+
+ while (i.hasNext()) {
+ strings.add(i.next().toString());
+ }
+
+ return string2str(strings);
+
+ }
+
+ public static String integer2str(List<BigInteger> integer) {
+ List<String> strings = new ArrayList<String>(integer.size());
+ Iterator<BigInteger> i = integer.iterator();
+
+ while (i.hasNext()) {
+ strings.add(i.next().toString());
+ }
+
+ return string2str(strings);
+
+ }
+
+ public static List<Boolean> str2boolean(String string) {
+ List<String> strings = str2string(string);
+
+ List<Boolean> booleans = new ArrayList<Boolean>(strings.size());
+ Iterator<String> i = strings.iterator();
+
+ while (i.hasNext()) {
+ booleans.add(new Boolean(i.next().equals("true")));
+ }
+
+ return booleans;
+
+ }
+
+ public static List<Complex> str2complex(String string) {
+ List<String> strings = str2string(string);
+
+ List<Complex> complexes = new ArrayList<Complex>(strings.size());
+ Iterator<String> i = strings.iterator();
+
+ while (i.hasNext()) {
+ String[] complex = i.next().split("#");
+
+ complexes.add(new Complex(new Double(complex[0]), new Double(complex[1])));
+ }
+
+ return complexes;
+
+ }
+
+ public static List<Double> str2double(String string) {
+ List<String> strings = str2string(string);
+
+ List<Double> doubles = new ArrayList<Double>(strings.size());
+ Iterator<String> i = strings.iterator();
+
+ while (i.hasNext()) {
+ doubles.add(new Double(i.next()));
+ }
+
+ return doubles;
+
+ }
+
+ public static List<BigInteger> str2integer(String string) {
+ List<String> strings = str2string(string);
+
+ List<BigInteger> integers = new ArrayList<BigInteger>(strings.size());
+ Iterator<String> i = strings.iterator();
+
+ while (i.hasNext()) {
+ integers.add(new BigInteger(i.next()));
+ }
+
+ return integers;
+
+ }
+
+ public static List<String> str2string(String string) {
+ List<String> strings;
+
+ if (string.startsWith("{") && string.contains(",") && string.endsWith("}")) {
+ String[] components = string.substring(1, string.length() - 1).split(",");
+
+ strings = new ArrayList<String>(components.length);
+
+ for (int i = 0; i < components.length; i++) {
+ strings.add(new String(components[i]));
+ }
+
+ return strings;
+ } else {
+ strings = new ArrayList<String>(1);
+ strings.add(new String(string));
+
+ return strings;
+ }
+
+ }
+
+ public static String string2str(List<String> strin) {
+ if (strin == null) {
+ return null;
+ }
+ if (strin.size() == 0) {
+ return "";
+ }
+
+ String string = "{";
+ Iterator<String> i = strin.iterator();
+
+ while (i.hasNext()) {
+ string += i.next() + (i.hasNext()
+ ? ","
+ : "}");
+ }
+
+ return string;
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ScalarExpr.java b/petascope/src/petascope/wcps/server/core/ScalarExpr.java
new file mode 100644
index 0000000..0ec20b6
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ScalarExpr.java
@@ -0,0 +1,171 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import java.math.BigInteger;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import org.w3c.dom.*;
+
+public class ScalarExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private CoverageInfo info;
+ private boolean singleNumericValue = false;
+ private double dvalue;
+
+ public ScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ // Try one of the groups
+ child = null;
+
+// TODO: Implement class MetadataScalarExprType
+// MetadataScalarExprType
+ if (child == null) {
+ try {
+ child = new MetadataScalarExpr(node, xq);
+ System.err.println("Matched metadata scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match metadata scalar expression: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+// BooleanScalarExprType
+ if (child == null) {
+ try {
+ child = new BooleanScalarExpr(node, xq);
+ System.err.println("Matched boolean scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match boolean scalar expression : "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+// NumericScalarExprType
+ if (child == null) {
+ try {
+ child = new NumericScalarExpr(node, xq);
+ singleNumericValue = ((NumericScalarExpr) child).isSingleValue();
+ dvalue = ((NumericScalarExpr) child).getSingleValue();
+ System.err.println("Matched numeric scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match numeric scalar expression : "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+// ReduceScalarExprType
+ if (child == null) {
+ try {
+ child = new ReduceScalarExpr(node, xq);
+ System.err.println("Matched reduce scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match reduce scalar expression: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+// StringScalarExprType
+ if (child == null) {
+ try {
+ child = new StringScalarExpr(node, xq);
+ System.err.println("Matched string scalar expression.");
+ } catch (WCPSException e) {
+ System.err.println("Failed to match string scalar expression: "
+ + e.toString() + "\nRetrying");
+ child = null;
+ }
+ }
+
+ // Error check
+ if (child == null) {
+ throw new WCPSException("Invalid coverage Expression, next node: "
+ + node.getNodeName());
+ }
+
+ Metadata meta = createScalarExprMetadata(xq);
+ info = new CoverageInfo(meta);
+ }
+
+ public String toRasQL() {
+ return child.toRasQL();
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ /** Builds full metadata for the newly constructed coverage **/
+ private Metadata createScalarExprMetadata(XmlQuery xq) throws WCPSException {
+ List<CellDomainElement> cellDomainList = new LinkedList<CellDomainElement>();
+ List<RangeElement> rangeList = new LinkedList<RangeElement>();
+ HashSet<String> nullSet = new HashSet<String>();
+ String nullDefault = "0";
+ nullSet.add(nullDefault);
+ HashSet<InterpolationMethod> interpolationSet = new HashSet<InterpolationMethod>();
+ InterpolationMethod interpolationDefault = new InterpolationMethod("none", "none");
+ interpolationSet.add(interpolationDefault);
+ String coverageName = "scalarExpr";
+ List<DomainElement> domainList = new LinkedList<DomainElement>();
+
+ // Build domain metadata
+ cellDomainList.add(new CellDomainElement(new BigInteger("1"), new BigInteger("1")));
+ String crs = DomainElement.IMAGE_CRS;
+ HashSet<String> crsset = new HashSet<String>();
+ crsset.add(crs);
+ Collection<String> allowedAxes = xq.getMetadataSource().getAxisNames();
+ DomainElement domain = new DomainElement("x", "x", 1.0, 1.0, null, null, crsset, allowedAxes);
+ domainList.add(domain);
+ // "unsigned int" is default datatype
+ rangeList.add(new RangeElement("dynamic_type", "unsigned int"));
+
+ try {
+ Metadata metadata = new Metadata(cellDomainList, rangeList, nullSet,
+ nullDefault, interpolationSet, interpolationDefault,
+ coverageName, domainList, null);
+ return metadata;
+ } catch (InvalidMetadataException e) {
+ throw new WCPSException("Could not build metadata for scalar expression !", e);
+ }
+ }
+
+ public boolean isSingleValue() {
+ return singleNumericValue;
+ }
+
+ public double getSingleValue() {
+ return dvalue;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/ScaleCoverageExpr.java b/petascope/src/petascope/wcps/server/core/ScaleCoverageExpr.java
new file mode 100644
index 0000000..feb7e3f
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/ScaleCoverageExpr.java
@@ -0,0 +1,149 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+
+
+public class ScaleCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private List<DimensionIntervalElement> axisList;
+ private CoverageExpr coverageExprType;
+ private CoverageInfo coverageInfo;
+ private String[] dim;
+ private int dims;
+ private DimensionIntervalElement elem;
+ private FieldInterpolationElement fieldInterp;
+
+ public ScaleCoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException
+ {
+ Node child;
+ String nodeName;
+
+ axisList = new ArrayList<DimensionIntervalElement>();
+
+ child = node.getFirstChild();
+ while (child != null) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ child = child.getNextSibling();
+ continue;
+ }
+
+ try {
+ System.err.println("Trying out an CoverageExprType group...");
+ coverageExprType = new CoverageExpr(child, xq);
+ coverageInfo = coverageExprType.getCoverageInfo();
+ child = child.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no CoverageExprType: " + nodeName);
+ }
+
+ try {
+ // Start a new axis and save it
+ elem = new DimensionIntervalElement(child, xq, coverageInfo);
+ axisList.add(elem);
+ child = elem.getNextNode();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no Dimension Interval ELement: " + child.getNodeName());
+ }
+
+ try {
+ fieldInterp = new FieldInterpolationElement(child, xq);
+ child = fieldInterp.getNextNode();
+ continue;
+ }
+ catch (InvalidWcpsRequestException e2)
+ {
+ throw e2;
+ }
+ catch (WCPSException e)
+ {
+ System.err.println("This was no Field Interpolation Element: " + child.getNodeName());
+ }
+
+ // else unknown element
+ throw new WCPSException("Unknown node for ScaleCoverageExpr expression:" + child.getNodeName());
+ }
+
+ dims = coverageInfo.getNumDimensions();
+ dim = new String[dims];
+
+ for (int j = 0; j < dims; ++j) {
+ dim[j] = "*:*";
+ }
+
+
+ Iterator<DimensionIntervalElement> i = axisList.iterator();
+
+ System.out.println("Axis List count:" + axisList.size());
+ DimensionIntervalElement axis;
+ int axisId;
+ int axisLo, axisHi;
+
+ while (i.hasNext()) {
+ axis = i.next();
+ axisId = coverageInfo.getDomainIndexByName(axis.getAxisName());
+ System.out.println("Axis ID: " + axisId);
+ System.out.println("Axis name: " + axis.getAxisName());
+ System.out.print("Axis coords: ");
+
+ axisLo = Integer.parseInt(axis.getLowCoord());
+ axisHi = Integer.parseInt(axis.getHighCoord());
+ dim[axisId] = axisLo + ":" + axisHi;
+ coverageInfo.setCellDimension(
+ axisId,
+ new CellDomainElement(
+ BigInteger.valueOf(axisLo), BigInteger.valueOf(axisHi)));
+ }
+
+ }
+
+ public String toRasQL() {
+ String result = "scale( " + coverageExprType.toRasQL() + ", [";
+
+ for (int j = 0; j < dims; ++j) {
+ if (j > 0) {
+ result += ",";
+ }
+
+ result += dim[j];
+ }
+
+ result += "] )";
+ return result;
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return coverageInfo;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/SetMetadataCoverageExpr.java b/petascope/src/petascope/wcps/server/core/SetMetadataCoverageExpr.java
new file mode 100644
index 0000000..1c6bad3
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/SetMetadataCoverageExpr.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+// TODO: Implement class SetMetadataCoverageExprType
+public class SetMetadataCoverageExpr implements IRasNode, ICoverageInfo {
+
+ public SetMetadataCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException {
+ throw new WCPSException("Method not implemented");
+ }
+
+ public String toRasQL() {
+ return "";
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return null;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/SliceCoverageExpr.java b/petascope/src/petascope/wcps/server/core/SliceCoverageExpr.java
new file mode 100644
index 0000000..6eeca36
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/SliceCoverageExpr.java
@@ -0,0 +1,131 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.w3c.dom.Node;
+
+public class SliceCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private List<DimensionPointElement> axisList;
+ private CoverageExpr coverageExprType;
+ private CoverageInfo coverageInfo = null;
+ private String[] dim;
+ private DimensionPointElement elem;
+ private int dims;
+
+ public SliceCoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ Node child = node.getFirstChild();
+ String nodeName;
+
+ axisList = new ArrayList<DimensionPointElement>();
+
+ while (child != null) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ child = child.getNextSibling();
+ continue;
+ }
+
+ try {
+ System.err.println("Trying out an CoverageExprType group...");
+ coverageExprType = new CoverageExpr(child, xq);
+ coverageInfo = coverageExprType.getCoverageInfo();
+ child = child.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no CoverageExprType: " + nodeName);
+ }
+
+ try {
+ // Start a new axis and save it
+ elem = new DimensionPointElement(child, xq);
+ axisList.add(elem);
+ child = elem.getNextNode();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no Dimension Point ELement: " + child.getNodeName());
+ }
+
+ // else unknown element
+ throw new WCPSException("Unknown node for TrimCoverage expression:" + child.getNodeName());
+ }
+
+ dims = coverageInfo.getNumDimensions();
+ dim = new String[dims];
+
+ for (int j = 0; j < dims; ++j) {
+ dim[j] = "*:*";
+ }
+
+ Iterator<DimensionPointElement> i = axisList.iterator();
+ DimensionPointElement axis;
+ int axisId;
+ int slicingPosInt;
+ String slicingPosStr;
+
+ while (i.hasNext()) {
+ axis = i.next();
+ /* TODO: BUG: This searches the axis types list using name, not type */
+ axisId = coverageInfo.getDomainIndexByName(axis.getAxisName());
+ slicingPosStr = axis.getSlicingPosition();
+ dim[axisId] = slicingPosStr;
+ // Slicing position can be a constant number or a variable reference
+ try {
+ slicingPosInt = Integer.parseInt(slicingPosStr);
+ } catch (NumberFormatException e) {
+ slicingPosInt = 1;
+ }
+ coverageInfo.setCellDimension(
+ axisId,
+ new CellDomainElement(
+ BigInteger.valueOf(slicingPosInt), BigInteger.valueOf(slicingPosInt)));
+
+ }
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return coverageInfo;
+ }
+
+ public String toRasQL() {
+ String result = "(" + coverageExprType.toRasQL() + ") [";
+
+ for (int j = 0; j < dims; ++j) {
+ if (j > 0) {
+ result += ",";
+ }
+
+ result += dim[j];
+ }
+
+ result += "]";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/StringScalarExpr.java b/petascope/src/petascope/wcps/server/core/StringScalarExpr.java
new file mode 100644
index 0000000..87fb23c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/StringScalarExpr.java
@@ -0,0 +1,63 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class StringScalarExpr implements IRasNode {
+
+ private String op, string;
+ private CoverageExpr cov;
+
+ public StringScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ while ((node != null) && (node.getNodeName().equals("#text"))) {
+ node = node.getNextSibling();
+ }
+
+ System.err.println("Parsing String Scalar expr : " + node.getNodeName());
+
+ if (node.getNodeName().equals("stringIdentifier")) {
+ Node child = node.getFirstChild();
+ cov = new CoverageExpr(child, xq);
+ op = "id";
+ } else if (node.getNodeName().equals("stringConstant")) {
+ op = "constant";
+ string = node.getNodeValue();
+ } else {
+ throw new WCPSException("Unknown String expr node: " + node.getNodeName());
+ }
+ }
+
+ public String toRasQL() {
+ String result = "";
+ if (op.equals("constant")) {
+ result = string;
+ }
+ if (op.equals("id")) {
+ result = cov.toRasQL();
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/SubsetOperationCoverageExpr.java b/petascope/src/petascope/wcps/server/core/SubsetOperationCoverageExpr.java
new file mode 100644
index 0000000..0b9d4fb
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/SubsetOperationCoverageExpr.java
@@ -0,0 +1,70 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+// TODO: Implement class SubsetOperation
+public class SubsetOperationCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private IRasNode child;
+ private CoverageInfo info = null;
+
+ public SubsetOperationCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node == null) {
+ throw new WCPSException("SubsetOperationCoverageExpr parsing error!");
+ }
+
+ String nodeName = node.getNodeName();
+
+ System.err.println("SubsetOperationCoverageExpr: node " + nodeName);
+
+ if (nodeName.equals("trim")) {
+ child = new TrimCoverageExpr(node, xq);
+ info = ((TrimCoverageExpr) child).getCoverageInfo();
+ } else if (nodeName.equals("extend")) {
+ child = new ExtendCoverageExpr(node, xq);
+ info = ((ExtendCoverageExpr) child).getCoverageInfo();
+ } else if (nodeName.equals("slice")) {
+ child = new SliceCoverageExpr(node, xq);
+ info = ((SliceCoverageExpr) child).getCoverageInfo();
+ } else {
+ throw new WCPSException("Failed to match SubsetOperation: " + nodeName);
+ }
+ }
+
+ public String toRasQL() {
+ return child.toRasQL();
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/TrimCoverageExpr.java b/petascope/src/petascope/wcps/server/core/TrimCoverageExpr.java
new file mode 100644
index 0000000..68ab8a9
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/TrimCoverageExpr.java
@@ -0,0 +1,133 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.math.BigInteger;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class TrimCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private List<DimensionIntervalElement> axisList;
+ private CoverageExpr coverageExprType;
+ private CoverageInfo coverageInfo;
+ private String[] dim;
+ private int dims;
+ private DimensionIntervalElement elem;
+
+ public TrimCoverageExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
+ Node child, axisNode;
+ String nodeName;
+
+ axisList = new ArrayList<DimensionIntervalElement>();
+
+ child = node.getFirstChild();
+ while (child != null) {
+ nodeName = child.getNodeName();
+
+ if (nodeName.equals("#text")) {
+ child = child.getNextSibling();
+ continue;
+ }
+
+ try {
+ System.err.println("Trying out an CoverageExprType group...");
+ coverageExprType = new CoverageExpr(child, xq);
+ coverageInfo = coverageExprType.getCoverageInfo();
+ child = child.getNextSibling();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no CoverageExprType: " + nodeName);
+ }
+
+ try {
+ // Start a new axis and save it
+ elem = new DimensionIntervalElement(child, xq, coverageInfo);
+ axisList.add(elem);
+ child = elem.getNextNode();
+ continue;
+ } catch (WCPSException e) {
+ System.err.println("This was no Dimension Interval ELement: " + child.getNodeName());
+ }
+
+ // else unknown element
+ throw new WCPSException("Unknown node for TrimCoverage expression:" + child.getNodeName());
+ }
+
+ dims = coverageInfo.getNumDimensions();
+ dim = new String[dims];
+
+ for (int j = 0; j < dims; ++j) {
+ dim[j] = "*:*";
+ }
+
+
+ Iterator<DimensionIntervalElement> i = axisList.iterator();
+
+ System.out.println("Axis List count:" + axisList.size());
+ DimensionIntervalElement axis;
+ int axisId;
+ int axisLo, axisHi;
+
+ while (i.hasNext()) {
+ axis = i.next();
+ axisId = coverageInfo.getDomainIndexByName(axis.getAxisName());
+ System.out.println("Axis ID: " + axisId);
+ System.out.println("Axis name: " + axis.getAxisName());
+ System.out.print("Axis coords: ");
+
+ axisLo = Integer.parseInt(axis.getLowCoord());
+ axisHi = Integer.parseInt(axis.getHighCoord());
+ dim[axisId] = axisLo + ":" + axisHi;
+ coverageInfo.setCellDimension(
+ axisId,
+ new CellDomainElement(
+ BigInteger.valueOf(axisLo), BigInteger.valueOf(axisHi)));
+ }
+
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return coverageInfo;
+ }
+
+ public String toRasQL() {
+ String result = coverageExprType.toRasQL() + "[";
+
+ for (int j = 0; j < dims; ++j) {
+ if (j > 0) {
+ result += ",";
+ }
+
+ result += dim[j];
+ }
+
+ result += "]";
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/UnaryOperationCoverageExpr.java b/petascope/src/petascope/wcps/server/core/UnaryOperationCoverageExpr.java
new file mode 100644
index 0000000..00b80ec
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/UnaryOperationCoverageExpr.java
@@ -0,0 +1,153 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class UnaryOperationCoverageExpr implements IRasNode, ICoverageInfo {
+
+ private CoverageExpr child;
+ private CoverageInfo info;
+ private String operation;
+ private String params;
+
+ public UnaryOperationCoverageExpr(Node node, XmlQuery xq)
+ throws WCPSException, InvalidCrsException {
+ String nodeName = node.getNodeName();
+
+ System.err.println("Trying to parse unary operation: " + nodeName);
+
+ if (nodeName.equals("unaryPlus")) {
+ operation = "+";
+ child = new CoverageExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("unaryMinus")) {
+ operation = "-";
+ child = new CoverageExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("sqrt") || nodeName.equals("abs")
+ || nodeName.equals("exp") || nodeName.equals("log") || nodeName.equals("ln")
+ || nodeName.equals("sin") || nodeName.equals("cos") || nodeName.equals("tan")
+ || nodeName.equals("sinh") || nodeName.equals("cosh")
+ || nodeName.equals("tanh") || nodeName.equals("arcsin")
+ || nodeName.equals("arccos") || nodeName.equals("arctan")
+ || nodeName.equals("not") || nodeName.equals("re") || nodeName.equals("im")) {
+ operation = nodeName;
+ child = new CoverageExpr(node.getFirstChild(), xq);
+ } else if (nodeName.equals("bit")) {
+ operation = "bit";
+ Node c = node.getFirstChild();
+
+ while (c != null) {
+ if (c.getNodeName().equals("#text")) {
+ c = c.getNextSibling();
+ continue;
+ }
+
+ if (c.getNodeName().equals("bitIndex")) {
+ try {
+ params = c.getFirstChild().getNodeValue();
+ int i = Integer.parseInt(params);
+ System.err.println("Found bitIndex = " + params);
+ } catch (NumberFormatException e) {
+ throw new WCPSException("Invalid Number as bitIndex: " + params);
+ }
+ } else {
+ child = new CoverageExpr(c, xq);
+ }
+
+ c = c.getNextSibling();
+ }
+ } else if (nodeName.equals("cast")) {
+ operation = "cast";
+ Node c = node.getFirstChild();
+
+ while (c != null) {
+ if (c.getNodeName().equals("#text")) {
+ c = c.getNextSibling();
+ continue;
+ }
+
+ if (c.getNodeName().equals("type")) {
+ RangeField typeNode = new RangeField(c, xq);
+ params = typeNode.toRasQL();
+ } else {
+ child = new CoverageExpr(c, xq);
+ }
+
+ c = c.getNextSibling();
+ }
+ } else if (nodeName.equals("fieldSelect")) {
+ operation = "select";
+ Node c = node.getFirstChild();
+
+ while (c != null) {
+ if (c.getNodeName().equals("#text")) {
+ c = c.getNextSibling();
+ continue;
+ }
+
+ if (c.getNodeName().equals("field")) {
+ FieldName nameNode = new FieldName(c.getFirstChild(), xq);
+ params = nameNode.toRasQL();
+ } else {
+ child = new CoverageExpr(c, xq);
+ }
+
+ c = c.getNextSibling();
+ }
+ } else {
+ throw new WCPSException("Unknown unary operation: " + nodeName);
+ }
+
+ info = new CoverageInfo(child.getCoverageInfo());
+ }
+
+ public CoverageInfo getCoverageInfo() {
+ return info;
+ }
+
+ public String toRasQL() {
+ if (operation.equals("sqrt") || operation.equals("abs") || operation.equals("exp")
+ || operation.equals("log") || operation.equals("ln") || operation.equals("sin")
+ || operation.equals("cos") || operation.equals("tan")
+ || operation.equals("sinh") || operation.equals("cosh")
+ || operation.equals("tanh") || operation.equals("arcsin")
+ || operation.equals("arccos") || operation.equals("arctan")
+ || operation.equals("not") || operation.equals("+") || operation.equals("-")) {
+ return operation + "(" + child.toRasQL() + ")";
+ } else if (operation.equals("cast")) {
+ // Use rasql's direct "type-casting" facility for constant scalar expressions
+ // For example, (char)1 does not work, but 1c is a valid expression.
+ if (child.isScalarExpr() && params.equals("char"))
+ return child.toRasQL() + "c";
+ else
+ return "(" + params + ")(" + child.toRasQL() + ")";
+ } else if (operation.equals("select")) {
+ return "(" + child.toRasQL() + ")." + params;
+ } else if (operation.equals("bit")) {
+ return "bit(" + child.toRasQL() + "," + params + ")";
+ }
+
+ return " error ";
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/VariableReference.java b/petascope/src/petascope/wcps/server/core/VariableReference.java
new file mode 100644
index 0000000..613d9e2
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/VariableReference.java
@@ -0,0 +1,56 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class VariableReference implements IRasNode {
+
+ private String name;
+ private String translatedName;
+
+ public VariableReference(Node node, XmlQuery xq) throws WCPSException {
+ System.err.println("Parsing variable reference: " + node.getNodeName());
+
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ if (node != null && node.getNodeName().equals("variableRef")) {
+ name = node.getTextContent();
+ translatedName = xq.getReferenceVariableName(name);
+ System.err.println("Variable " + name + " has been renamed into "
+ + translatedName);
+ } else {
+ throw new WCPSException("Could not find any variable reference !");
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String toRasQL() {
+ return translatedName;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/WCPS.java b/petascope/src/petascope/wcps/server/core/WCPS.java
new file mode 100644
index 0000000..34f7fb2
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/WCPS.java
@@ -0,0 +1,184 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.ResourceException;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.exceptions.InvalidWcpsRequestException;
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+import javax.xml.parsers.ParserConfigurationException;
+import org.w3c.dom.*;
+
+import org.xml.sax.*;
+import org.xml.sax.SAXException;
+
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * This is the WCPS entry point. Processing a ProcessCoverage request happens in two stages.
+The first stage is the various pcPrepare functions, where XML is parsed, metadata is loaded,
+and the request is translated into an instance of a ProcessCoverageRequest. This data structure,
+for the time being, is just a list of rasdaman queries (RasQuery). The second stage is pcExecute,
+which executes a ProcessCoverageRequests and returns data.
+ */
+public class WCPS {
+
+ private static final String SCHEMA_PACKAGE_PROCESSCOVERAGE = "wcps.xml.processcoverage";
+ private IMetadataSource metadataSource;
+ private IDynamicMetadataSource dynamicMetadataSource;
+ private DocumentBuilder wcpsDocumentBuilder;
+
+ public WCPS(File pcSchema, IMetadataSource metadataSource) throws WCPSException {
+ try {
+ System.out.println("WCPS: Loading and parsing XML Schema ...");
+ DocumentBuilderFactory dbconfig = DocumentBuilderFactory.newInstance();
+
+ dbconfig.setValidating(false); // use XML schema not DTD
+ dbconfig.setIgnoringComments(true); // comments are not relevant
+ dbconfig.setIgnoringElementContentWhitespace(true); // remve the ignorable whitespace
+// Schema wcpsProcessCoverageSchema =
+// SchemaFactory.newInstance(
+// XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(pcSchema);
+
+// dbconfig.setSchema(wcpsProcessCoverageSchema);
+
+ wcpsDocumentBuilder = dbconfig.newDocumentBuilder();
+ System.out.println("WCPS: Finished loading the schema !");
+ } catch (Exception e) {
+ throw new WCPSException(
+ "Error while loading the document builder interface!", e);
+ }
+
+ this.dynamicMetadataSource = new DynamicMetadataSource(metadataSource);
+ }
+
+ public WCPS(IMetadataSource metadataSource) throws ParserConfigurationException,
+ ResourceException, InvalidMetadataException {
+ this.dynamicMetadataSource = new DynamicMetadataSource(metadataSource);
+ wcpsDocumentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ }
+
+ public List<byte[]> pcExecute(String url, String database, ProcessCoveragesRequest pcRequest)
+ throws ResourceException {
+ throw new ResourceException("Mothod not implemented! pcExecute");
+
+ /*
+ * List<RasQuery> queries = pcRequest.getQueries();
+ * List<byte[]> results = new ArrayList<byte[]>( queries.size() );
+ * synchronized( this ) {
+ * Implementation impl = new RasImplementation( url );
+ * Database db = impl.newDatabase();
+ * try {
+ * db.open( database, Database.OPEN_READ_ONLY );
+ * }
+ * catch( ODMGException odmge ) {
+ * try {
+ * db.close();
+ * }
+ * catch (ODMGException e) {}
+ * throw new ResourceException( "Could not connect to rasdaman at " + url + ", database " +
+ * database, odmge );
+ * }
+ * Transaction tr = impl.newTransaction();
+ * tr.begin();
+ * Iterator<RasQuery> queryIterator = queries.iterator();
+ * while( queryIterator.hasNext() ) {
+ * String query = queryIterator.next().toString();
+ * OQLQuery q = impl.newOQLQuery();
+ * DBag resultSet;
+ * try {
+ * q.create( query );
+ * resultSet = (DBag) q.execute();
+ * if( resultSet != null ) {
+ * Iterator resultIterator = resultSet.iterator();
+ * while( resultIterator.hasNext() ) {
+ * RasGMArray result = (RasGMArray) resultIterator.next();
+ * results.add( result.getArray() );
+ * }
+ * }
+ * }
+ * catch (QueryException qe) {
+ * tr.commit();
+ * try {
+ * db.close();
+ * }
+ * catch (ODMGException odmge) {}
+ * throw new ResourceException ( "Could not evaluate rasdaman query: '" + query + "'", qe );
+ * }
+ * }
+ * tr.commit();
+ * try {
+ * db.close();
+ * }
+ * catch (ODMGException odmge) {}
+ * }
+ * return results;
+ */
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, File f)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(f));
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, InputStream is,
+ String systemId)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(is, systemId));
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, String uri)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(uri));
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, InputSource is)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(is));
+ }
+
+ public ProcessCoveragesRequest pcPrepare(String url, String database, InputStream is)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException,
+ IOException, InvalidCrsException {
+ return pcPrepare(url, database, wcpsDocumentBuilder.parse(is));
+ }
+
+ private ProcessCoveragesRequest pcPrepare(String url, String database, Document doc)
+ throws WCPSException, InvalidWcpsRequestException, ResourceException, SAXException, IOException, InvalidCrsException {
+ ProcessCoveragesRequest req = new ProcessCoveragesRequest(url, database, doc, dynamicMetadataSource, this);
+ return req;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/Wgs84Crs.java b/petascope/src/petascope/wcps/server/core/Wgs84Crs.java
new file mode 100644
index 0000000..e712ad6
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/Wgs84Crs.java
@@ -0,0 +1,123 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidMetadataException;
+
+/**
+ * Represents a WGS Coordinate Reference System (CRS) and its bounding box.
+ *
+ *
+ * @version 10.Sep 2009
+ * @author Andrei Aiordachioaie
+ */
+public class Wgs84Crs implements Cloneable {
+
+ private String name = "WGS84";
+ private Double low1, high1, low2, high2;
+ private Double offset1, offset2; // precomputed world-to-crs offsets
+
+ public Wgs84Crs(Double l1, Double h1, Double l2, Double h2, Double o1, Double o2)
+ throws InvalidMetadataException {
+ if ((l1 == null) || (h1 == null) || (l2 == null) || (h2 == null)) {
+ throw new InvalidMetadataException(
+ "Invalid WGS 84 bounding box: null element encountered.");
+ }
+ if ((o1 == null) || (o2 == null)) {
+ throw new InvalidMetadataException("Invalid WGS 84 offsets: null element encountered.");
+ }
+
+ low1 = l1;
+ low2 = l2;
+ high1 = h1;
+ high2 = h2;
+
+ offset1 = o1;
+ offset2 = o2;
+ }
+
+ public Wgs84Crs clone() {
+ try {
+ return new Wgs84Crs(new Double(getLow1()), new Double(getHigh1()),
+ new Double(getLow2()), new Double(getHigh2()),
+ new Double(getOffset1()), new Double(getOffset2()));
+ } catch (InvalidMetadataException e) {
+ return null;
+ }
+ }
+
+ public String toString() {
+ String d = "CRS '" + getName() + "' { Bounding Box [X(" + getLow1() + ", " + getHigh1() + "), "
+ + "Y(" + getLow2() + ", " + getHigh2() + ")], "
+ + "Offsets [X(" + getOffset1() + "), Y(" + getOffset2() + ")]}";
+ return d;
+ }
+
+ /**
+ * @return the low1
+ */
+ public Double getLow1() {
+ return low1;
+ }
+
+ /**
+ * @return the high1
+ */
+ public Double getHigh1() {
+ return high1;
+ }
+
+ /**
+ * @return the low2
+ */
+ public Double getLow2() {
+ return low2;
+ }
+
+ /**
+ * @return the high2
+ */
+ public Double getHigh2() {
+ return high2;
+ }
+
+ /**
+ * @return the offset1
+ */
+ public Double getOffset1() {
+ return offset1;
+ }
+
+ /**
+ * @return the offset2
+ */
+ public Double getOffset2() {
+ return offset2;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/core/XmlQuery.java b/petascope/src/petascope/wcps/server/core/XmlQuery.java
new file mode 100644
index 0000000..ed1a304
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/core/XmlQuery.java
@@ -0,0 +1,236 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.core;
+
+import petascope.wcps.server.exceptions.InvalidCrsException;
+import petascope.wcps.server.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class XmlQuery implements IRasNode {
+
+ private String mime;
+ private ArrayList<CoverageIterator> iterators;
+ private BooleanScalarExpr where;
+ private IRasNode coverageExpr;
+ private IDynamicMetadataSource meta;
+ private ArrayList<CoverageIterator> dynamicIterators;
+ /* Variables used in the XML query are renamed. The renaming is explained below.
+ *
+ * Variables declared in the same expression (construct, const, condense)
+ will be collapsed into one multidimensional variable name. For
+ "construct img over $px x(1:10), $py y(1:10) values ... ", the variables could
+ be translated as: $px -> "iteratorA[0]", $py -> "iteratorA[1]".
+ * Variables declared in different expression will have different prefixes,
+ built from "varPrefix" + "varStart".
+ *
+
+ * Used in condenser, construct and constant coverage expressions. */
+ // VariableIndexCount stores the dimensionality of each renamed variable
+ private HashMap<String, Integer> varDimension;
+ // VariableNewName is used to translate the old var name into the multi-dim var name
+ private HashMap<String, String> variableTranslator;
+ private String varPrefix = "i_";
+ private char varSuffix = 'i';
+
+ public String getMimeType() {
+ return mime;
+ }
+
+ public XmlQuery(IDynamicMetadataSource source) {
+ super();
+ this.meta = source;
+ iterators = new ArrayList<CoverageIterator>();
+ dynamicIterators = new ArrayList<CoverageIterator>();
+ variableTranslator = new HashMap<String, String>();
+ varDimension = new HashMap<String, Integer>();
+ }
+
+ public XmlQuery(Node node) throws WCPSException, InvalidCrsException {
+ iterators = new ArrayList<CoverageIterator>();
+ dynamicIterators = new ArrayList<CoverageIterator>();
+ variableTranslator = new HashMap<String, String>();
+ varDimension = new HashMap<String, Integer>();
+ this.startParsing(node);
+ }
+
+ public void startParsing(Node node) throws WCPSException, InvalidCrsException {
+ System.err.println("Processing XML Request: " + node.getNodeName());
+
+ Node x = node.getFirstChild();
+
+
+ while (x != null) {
+ if (x.getNodeName().equals("#text")) {
+ x = x.getNextSibling();
+ continue;
+ }
+
+ System.err.println("The current node is: " + x.getNodeName());
+
+ if (x.getNodeName().equals("coverageIterator")) {
+ iterators.add(new CoverageIterator(x, this));
+ } else if (x.getNodeName().equals("where")) {
+ where = new BooleanScalarExpr(x.getFirstChild(), this);
+ } else if (x.getNodeName().equals("encode")) {
+ EncodeDataExpr encode;
+
+ encode = new EncodeDataExpr(x, this);
+ coverageExpr = encode;
+ mime = encode.getMime();
+ } else {
+ // It has to be a scalar Expr
+ coverageExpr = new ScalarExpr(x, this);
+ mime = "text/plain";
+ }
+
+ x = x.getNextSibling();
+ }
+ }
+
+ public Boolean isIteratorDefined(String iteratorName) {
+ Iterator<CoverageIterator> it = iterators.iterator();
+ while (it.hasNext()) {
+ CoverageIterator tmp = it.next();
+ if (iteratorName.equals(tmp.getIteratorName())) {
+ return true;
+ }
+ }
+
+ it = dynamicIterators.iterator();
+ while (it.hasNext()) {
+ CoverageIterator tmp = it.next();
+ if (iteratorName.equals(tmp.getIteratorName())) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /* Stores information about dynamically created iterators, as metadata.
+ * For example, from a Construct Coverage expression.
+ */
+ public void addDynamicCoverageIterator(CoverageIterator i) {
+ dynamicIterators.add(i);
+ }
+
+ public Iterator<String> getCoverages(String iteratorName) throws WCPSException {
+ for (int i = 0; i < iterators.size(); ++i) {
+ if (iterators.get(i).getIteratorName().equals(iteratorName)) {
+ return iterators.get(i).getCoverages();
+ }
+ }
+
+ for (int i = 0; i < dynamicIterators.size(); ++i) {
+ if (dynamicIterators.get(i).getIteratorName().equals(iteratorName)) {
+ return dynamicIterators.get(i).getCoverages();
+ }
+ }
+
+ throw new WCPSException("Iterator " + iteratorName + " not defined");
+ }
+
+ public boolean isDynamicCoverage(String coverageName) {
+ for (int i = 0; i < dynamicIterators.size(); ++i) {
+ Iterator<String> iterator =
+ ((CoverageIterator) dynamicIterators.get(i)).getCoverages();
+ while (iterator.hasNext()) {
+ if (iterator.next().equals(coverageName)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /** Creates a new (translated) variable name for an expression that
+ * has referenceable variables.
+ * @return String a new variable name assigned
+ */
+ public String registerNewExpressionWithVariables() {
+ String name = varPrefix + varSuffix;
+ varDimension.put(name, 0);
+ varSuffix++;
+ return name;
+ }
+
+ /** Remember a variable that can be referenced in the future. This function
+ * assigns it a index code, that should then be used to reference that variable
+ * in the RasQL query.
+ *
+ * If the variable is already referenced, then this function does nothing.
+ * @param name Variable name
+ */
+ public boolean addReferenceVariable(String name, String translatedName) {
+ if (varDimension.containsKey(translatedName) == false) {
+ return false;
+ }
+
+ Integer index = varDimension.get(translatedName);
+ Integer newIndex = index + 1;
+ varDimension.put(translatedName, newIndex);
+ variableTranslator.put(name, translatedName + "[" + index + "]");
+
+ return true;
+ }
+
+ /** Retrieve the translated name assigned to a specific reference (scalar) variable */
+ public String getReferenceVariableName(String name) throws WCPSException {
+ String newName = variableTranslator.get(name);
+ return newName;
+ }
+
+ public String toRasQL() {
+ String result = "select " + coverageExpr.toRasQL() + " from ";
+ Iterator<CoverageIterator> it = iterators.iterator();
+ boolean first = true;
+
+ while (it.hasNext()) {
+ if (first) {
+ first = false;
+ } else {
+ result += ", ";
+ }
+
+ result += it.next().toRasQL();
+ }
+
+ if (where != null) {
+ result += " where " + where.toRasQL();
+ }
+
+ return result;
+ }
+
+ public IDynamicMetadataSource getMetadataSource() {
+ return meta;
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java b/petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java
new file mode 100644
index 0000000..f1381ca
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/InvalidCrsException.java
@@ -0,0 +1,29 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+public class InvalidCrsException extends Exception {
+
+ public InvalidCrsException(String message) {
+ super(message);
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java b/petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java
new file mode 100644
index 0000000..ac4d8d1
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/InvalidMetadataException.java
@@ -0,0 +1,36 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+/**
+ * Thrown when WCPS received a request, but could not evaluate it because the
+ * metadata for some coverage does not conform to the WCPS standard.
+ */
+public class InvalidMetadataException extends WCPSException {
+
+ private static final long serialVersionUID = 48924938L;
+
+ public InvalidMetadataException(String message) {
+ super(message, null);
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java b/petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java
new file mode 100644
index 0000000..d4d3449
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/InvalidWcpsRequestException.java
@@ -0,0 +1,38 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+/**
+ * This exception is throws whenever a user submits a request that is not valid in some way.
+ */
+public class InvalidWcpsRequestException extends WCPSException {
+
+ private static final long serialVersionUID = 65492846L;
+
+ public InvalidWcpsRequestException(String message) {
+ super(message, null);
+ }
+
+ public InvalidWcpsRequestException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/ResourceException.java b/petascope/src/petascope/wcps/server/exceptions/ResourceException.java
new file mode 100644
index 0000000..b7f7774
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/ResourceException.java
@@ -0,0 +1,40 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+/**
+ * This exception is thrown whenever some required resource is not available -
+ * a database connection, a file, etc.
+ */
+public class ResourceException extends WCPSException {
+
+ private static final long serialVersionUID = 45562458L;
+
+ public ResourceException(String message) {
+ super(message);
+ }
+
+ public ResourceException(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/exceptions/WCPSException.java b/petascope/src/petascope/wcps/server/exceptions/WCPSException.java
new file mode 100644
index 0000000..0a6779c
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/exceptions/WCPSException.java
@@ -0,0 +1,39 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.exceptions;
+
+/**
+ * This is the superclass of all WCPS exceptions.
+ */
+public class WCPSException extends Exception {
+
+ private static final long serialVersionUID = 113213254L;
+
+ public WCPSException(String message) {
+ super(message);
+ }
+
+ public WCPSException(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/servlet/WCPSServlet.java b/petascope/src/petascope/wcps/server/servlet/WCPSServlet.java
new file mode 100644
index 0000000..4a00969
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/servlet/WCPSServlet.java
@@ -0,0 +1,257 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.servlet;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+
+
+//This is the servlet interface of WCPS. It mostly consists of sanity checks and initialization,
+//the meat is onyl a few lines. The WCPS class does the actual work.
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcps.server.core.WCPS;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+
+//Note an important limitation: this will only return the first result if several are available.
+//The reason is that WCPS currently has no standardized way to return multiple byte streams to
+//the user.
+public class WCPSServlet extends HttpServlet {
+
+ private Properties dbParams;
+ private DbMetadataSource metadataSource;
+ private String rasdamanDatabase;
+ private String rasdamanUrl;
+ private WCPS wcps;
+ // path to the default HTML response of the servlet
+ private String servletHtmlPath = "/templates/wcps-servlet.html";
+ // String containing the HTML code for the default response
+ private String defaultHtmlResponse;
+
+ public void init() throws ServletException {
+ try {
+ dbParams = new Properties();
+ System.out.println("WCPS: loading database properties");
+ dbParams.load(
+ new FileInputStream(
+ getServletContext().getRealPath("/settings.properties")));
+ rasdamanUrl = dbParams.getProperty("rasdaman_url");
+ rasdamanDatabase = dbParams.getProperty("rasdaman_database");
+
+ System.out.println("WCPS: initializing metadata database");
+ metadataSource =
+ new DbMetadataSource(dbParams.getProperty("metadata_driver"),
+ dbParams.getProperty("metadata_url"),
+ dbParams.getProperty("metadata_user"),
+ dbParams.getProperty("metadata_pass"), false);
+
+ System.out.println("WCPS: initializing WCPS core");
+ wcps = new WCPS(
+ new File(getServletContext().getRealPath("/xml/ogc/wcps/1.0.0/wcpsProcessCoverages.xsd")),
+ // new CachedMetadataSource(metadataSource)); // removed metadata caching (andrei)
+ metadataSource);
+
+ servletHtmlPath = getServletContext().getRealPath(servletHtmlPath);
+ defaultHtmlResponse = FileUtils.readFileToString(new File(servletHtmlPath));
+
+ System.out.println("WCPS: initialization complete");
+ } catch (Exception e) {
+ System.out.println("WCPS: initialization error");
+ System.out.println("WCPS: closing metadata database");
+
+ if (metadataSource != null) {
+ metadataSource.close();
+ }
+
+ System.out.println("WCPS: done with init error");
+ throw new ServletException("WCPS initialization error", e);
+ }
+
+ }
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ System.out.println("WCPS: invoked with GET");
+ printUsage(response);
+ }
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ System.out.println("WCPS: invoked with POST");
+ OutputStream webOut = null;
+
+ try {
+ String xmlRequest = null;
+
+ if (ServletFileUpload.isMultipartContent(request)) {
+ @SuppressWarnings("unchecked")
+ Iterator<FileItem> fileItems =
+ (Iterator<FileItem>) (new ServletFileUpload(
+ new DiskFileItemFactory())).parseRequest(
+ request).iterator();
+
+ if (!fileItems.hasNext()) {
+ throw new IOException(
+ "Multipart POST request contains no parts");
+ }
+
+ FileItem fileItem = fileItems.next();
+
+ if (fileItems.hasNext()) {
+ throw new IOException(
+ "Multipart POST request contains too many parts");
+ }
+
+ if (!fileItem.isFormField()
+ && fileItem.getContentType().equals("text/xml")) {
+ xmlRequest = fileItem.getString();
+ }
+
+ if (xmlRequest == null) {
+ System.out.println(
+ "WCPS: no XML file was uploaded within multipart POST request");
+ printUsage(response);
+ return;
+ }
+
+ System.out.println(
+ "WCPS: received XML via a multipart POST request");
+ } else {
+ String xml = request.getParameter("xml");
+ String query = request.getParameter("query");
+
+ if (xml != null) {
+ System.out.println("WCPS: received XML via a 'xml' parameter in a POST request");
+ xmlRequest = xml;
+ } else if (query != null) {
+ System.out.println("WCPS: received the following query via a 'query' "
+ + "parameter in a POST request:");
+ System.out.println(query);
+
+ xmlRequest = ProcessCoveragesRequest.abstractQueryToXmlQuery(query);
+ System.out.println("WCPS: transformed the abstract syntax query into an XML query!");
+ } else {
+ System.out.println("WCPS: no request was received");
+ printUsage(response);
+ return;
+ }
+ }
+
+ System.out.println("WCPS: received the following request:");
+ System.out.println(xmlRequest);
+
+ System.out.println("WCPS: preparing request");
+ ProcessCoveragesRequest processCoverageRequest =
+ wcps.pcPrepare(rasdamanUrl, rasdamanDatabase, IOUtils.toInputStream(xmlRequest));
+
+ String query = processCoverageRequest.getRasqlQuery();
+ String mime = processCoverageRequest.getMime();
+
+ System.out.println("[" + mime + "] " + query);
+
+ System.out.println("Resulting RasQL query: " + query);
+
+ System.out.println("WCPS: executing request");
+
+ List<byte[]> results = processCoverageRequest.execute();
+
+ System.out.println("WCPS: setting response mimetype to " + mime);
+ response.setContentType(mime);
+ System.out.println("WCPS: returning response");
+ webOut = response.getOutputStream();
+ webOut.write(results.get(0));
+ System.out.println("WCPS: done");
+ } catch (Exception e) {
+ printError(response, "Error: " + e.getMessage(), e);
+ } finally {
+ if (webOut != null) {
+ try {
+ webOut.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+
+ public void destroy() {
+ super.destroy();
+
+ }
+
+ public String getServletInfo() {
+ return "Web Coverage Processing Service (Project PetaScope)";
+
+ }
+
+ private void printError(HttpServletResponse response, String message, Exception e)
+ throws IOException {
+ System.out.println("WCPS: error");
+ System.out.println("WCPS: setting response mimetype to text/html; charset=utf-8");
+ response.setContentType("text/html; charset=utf-8");
+ System.out.println("WCPS: returning the following error message");
+ e.printStackTrace(System.out);
+ System.out.println("WCPS: end of error message");
+ PrintWriter out = new PrintWriter(response.getOutputStream());
+
+ out.println(
+ "<html><head><title>Web Coverage Processing Service</title></head><body>");
+ out.println("<h1>An error has occured</h1>");
+ out.println("<p>" + message + "</p>");
+ out.println("<p>Stack trace:<br/><small>");
+ e.printStackTrace(out);
+ out.println("</small></p></body></html>");
+ out.close();
+ System.out.println("WCPS: done with error");
+ }
+
+ private void printUsage(HttpServletResponse response) throws IOException {
+ System.out.println("WCPS: setting response mimetype to text/html; charset=utf-8");
+ System.out.println("WCPS: returning usage message");
+ response.setContentType("text/html; charset=utf-8");
+ PrintWriter out = new PrintWriter(response.getOutputStream());
+
+ out.println(defaultHtmlResponse);
+
+ out.close();
+ System.out.println("WCPS: done nothing");
+
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/test/FullTestsOnline.java b/petascope/src/petascope/wcps/server/test/FullTestsOnline.java
new file mode 100644
index 0000000..2c2bdff
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/test/FullTestsOnline.java
@@ -0,0 +1,380 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.test;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.apache.commons.io.FileUtils;
+
+import petascope.wcps.server.cli.grammar;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.apache.commons.io.IOUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Runs all available testFiles against a deployed version of Petascope,
+ * available at some URL. In particular, here are the steps for each test:
+ * 1) Convert abstract syntax query to XML query
+ * 2) Convert XML query to a RasQL query
+ * 3) Send abstract syntax query to PetaScope WCPS
+ * 4) Send XML query to PetaScope WCPS
+ *
+ * Assumes that a testFiles succeeds if the server does not throw or display
+ * an error. Saves the intermediate results in a specified path.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class FullTestsOnline {
+
+ public static String PetascopeURL = "http://localhost:8080/PetaScope/earthlook";
+// public static String PetascopeURL = "http://localhost:8080/petascope/wcps/";
+// public static String PetascopeURL = "http://kahlua.eecs.jacobs-university.de:8080/petascope/earthlook";
+ // Tests are read from this folder
+ static String folder = "test/testcases-wcps/";
+ // How many testFiles we have to run
+ int numTests = 0;
+ // Files are written in this folder
+ static String outputFolder = "test/tmp/";
+ // How many successes?
+ int passCount = 0;
+ // message for testFiles
+ String[][] errors;
+ // success code
+ boolean[] ok;
+ // partial success codes
+ boolean[][] partialOk;
+ // queries
+ String[] queries;
+ String[] testNames;
+ // execution Times for XML queries
+ long[] xmlTimes;
+ // execution times for abstract sintax queries
+ long[] asTimes;
+
+ public FullTestsOnline() {
+ System.out.println("===========================");
+ System.out.println(" PetaScope Test Suite ");
+ System.out.println("===========================\n\n");
+ System.out.println("Testing URL: " + PetascopeURL);
+ System.out.println("Reading test files from: " + folder);
+ System.out.println("Writing output files to: " + outputFolder + "\n\n");
+
+ // Find out how many grammar testFiles we have to run
+ File dir = new File(folder);
+ TestFileFilter filter = new TestFileFilter();
+ testNames = dir.list(filter);
+ Arrays.sort(testNames);
+ numTests = testNames.length;
+// numTests = 1;
+
+ ok = new boolean[numTests];
+ partialOk = new boolean[5][numTests];
+ errors = new String[5][numTests];
+ queries = new String[numTests];
+ xmlTimes = new long[numTests];
+ asTimes = new long[numTests];
+ }
+
+ public void printResults() {
+ HashMap strMap = new HashMap<Boolean, String>();
+
+ strMap.put(true, "ok");
+ strMap.put(false, "failed");
+
+ System.out.println("\n \nRESULTS + EXECUTION TIMES\n");
+
+ for (int i = 0; i < numTests; i++) {
+ String tname = testNames[i];
+ tname = tname.substring(0, tname.length() - 5);
+
+ if (ok[i] == true) {
+ String time = (double) (asTimes[i] / 10) / 100 + " sec";
+ System.out.println("*** Test '" + tname + "' ok (" + time + ")");
+// System.out.println("\t" + queries[i]);
+ } else {
+ System.out.println("*** Test '" + tname + "' FAILED");
+ System.out.println("\t * Abstract Syntax -> Xml: " + strMap.get(partialOk[1][i]));
+ if (partialOk[1][i] == false) {
+ System.out.println("\t\t" + errors[1][i]);
+ }
+// System.out.println("\t * Xml -> RasQL: " + strMap.get(partialOk[2][i]));
+// if (partialOk[2][i] == false)
+// System.out.println("\t\t" + errors[2][i]);
+ System.out.println("\t * Running Abstract Syntax query: " + strMap.get(partialOk[3][i]));
+ if (partialOk[3][i] == false) {
+ System.out.println("\t\t" + errors[3][i]);
+ }
+ System.out.println("\t * Running XML query: " + strMap.get(partialOk[4][i]));
+ if (partialOk[4][i] == false) {
+ System.out.println("\t\t" + errors[4][i]);
+ }
+ }
+ }
+ System.out.println("\n\nRESULTS\n");
+ System.out.println("Tested PetaScope implementation from: " + PetascopeURL);
+ System.out.println("Tests succeeded: " + String.valueOf(passCount));
+ System.out.println("Tests failed: " + String.valueOf(numTests - passCount));
+
+ System.out.println("\nWARNING: a test is considered to have passed when the web server does not report"
+ + " any erorrs. A human has to inspect the semantics of the result. For this, the first three lines"
+ + " of the output from the web service are printed for each test. For example, if a query involves"
+ + " encoding a coverage in JPEG format, the first line needs to look like \"����JFIF��C\"");
+ }
+
+ public void runAllTests() {
+ String abstractQuery = "";
+ String xmlQuery = "";
+ String rasqlQuery = "";
+ String tname = "";
+ long start, end; // for measuring time
+
+ for (int i = 0; i < numTests; i++) {
+ ok[i] = false;
+ partialOk[1][i] = false;
+ partialOk[2][i] = true;
+ partialOk[3][i] = false;
+ partialOk[4][i] = false;
+ errors[1][i] = "";
+ errors[2][i] = "";
+ errors[3][i] = "";
+ errors[4][i] = "";
+
+ tname = testNames[i];
+ tname = tname.substring(0, tname.length() - 5);
+ File testFile = new File(folder + testNames[i]);
+ System.out.println("-------------------------------------------------");
+ System.out.println("\tTest '" + tname + "'...");
+ System.out.println("-------------------------------------------------");
+ // First of all: read file contents
+ try {
+ abstractQuery = FileUtils.readFileToString(testFile);
+ queries[i] = abstractQuery;
+ System.out.println("*** Query :\n" + abstractQuery);
+ } catch (IOException e) {
+ errors[1][i] = "Could not read file " + testFile.getName();
+
+ continue;
+ }
+ // Step 1: Convert abstract syntax query to XML query, and save files
+ try {
+ xmlQuery = grammar.convertAbstractQueryToXml(abstractQuery);
+ // Copy abstract syntax query to output folder
+ File abstractFile = new File(outputFolder + tname + ".test");
+
+ FileUtils.writeStringToFile(abstractFile, abstractQuery);
+ // Save XML query to a file in output folder
+ File xmlFile = new File(outputFolder + tname + ".xml");
+
+ FileUtils.writeStringToFile(xmlFile, xmlQuery);
+
+ partialOk[1][i] = true;
+ } catch (Exception e) {
+ errors[1][i] = e.getMessage();
+ }
+ // Step 2: Convert XML query to RasQL query, and save files
+// try
+// {
+// rasqlQuery = xml.convertXmlToRasql(xmlQuery);
+// // Save XML query to a file in output folder
+// File rasqlFile = new File(outputFolder + tname + ".rasql");
+// FileUtils.writeStringToFile(rasqlFile, rasqlQuery);
+//
+// partialOk[2][i] = true;
+// }
+// catch (Exception e)
+// {
+// errors[2][i] = e.getMessage();
+// }
+ // Step 3: Send abstract syntax query to PetaScope WCPS
+ try {
+ System.out.println("*** Results from abstract query :");
+ start = System.currentTimeMillis();
+ String err = runOneTest("query", abstractQuery, "GET");
+ end = System.currentTimeMillis();
+ asTimes[i] = end - start;
+
+ if (err == null) {
+ partialOk[3][i] = true;
+ } else {
+ errors[3][i] = err;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ // Step 4: Send XML query to PetaScope WCPS
+ try {
+ System.out.println("*** Results from XML query :");
+ start = System.currentTimeMillis();
+// String err = runOneTest("request", xmlQuery, "POST");
+ String err = runOneTest("", xmlQuery, "POST");
+ end = System.currentTimeMillis();
+ xmlTimes[i] = end - start;
+
+ if (err == null) {
+ partialOk[4][i] = true;
+ } else {
+ errors[4][i] = err;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ // Wrap up
+ ok[i] = partialOk[1][i] && partialOk[2][i] && partialOk[3][i] && partialOk[4][i];
+ if (ok[i] == true) {
+ passCount++;
+ }
+ }
+ }
+
+ /**
+ * Send an request to the WCPS server.
+ * Returns a message on error and null otherwise.
+ */
+ public String runOneTest(String param, String query, String method)
+ throws MalformedURLException, IOException {
+// System.out.println("--------------------");
+// System.out.println(query);
+// System.out.println("\t--------------------");
+
+ // connect to the servlet
+ URL servlet = new URL(PetascopeURL);
+ HttpURLConnection conn = (HttpURLConnection) servlet.openConnection();
+
+ // inform the connection that we will send output and accept input
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ // Don't use a cached version of URL connection.
+ conn.setUseCaches(false);
+ conn.setDefaultUseCaches(false);
+
+ // Default method is GET
+ if (method.equals("POST")) {
+ conn.setRequestMethod(method);
+ }
+
+ // For POST: We send binary data
+ if (method.equals("POST")) {
+// conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+// query = URLEncoder.encode(query, "UTF-8");
+ }
+
+ if (param.equals("") == false) {
+ param += "=";
+ }
+
+ String data = param + query;
+ DataOutputStream out = new DataOutputStream(conn.getOutputStream());
+
+ out.writeBytes(data);
+ out.flush();
+ out.close();
+
+ BufferedReader cgiOutput = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+ String line1 = cgiOutput.readLine();
+ String line2 = cgiOutput.readLine();
+ String line3 = cgiOutput.readLine();
+
+ System.out.println("\t" + line1);
+ System.out.println("\t" + line2);
+ System.out.println("\t" + line3);
+
+ if ((line1 != null) && (line2 != null) && (line3 != null)) {
+ StringBuffer output = new StringBuffer(line1 + line2 + line3);
+ while (cgiOutput.ready()) {
+ output.append(cgiOutput.readLine());
+ }
+
+ // Try to parse error message
+ if (line1.startsWith("<")) {
+ DocumentBuilder builder = null;
+ try {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true); // never forget this!
+ builder = domFactory.newDocumentBuilder();
+ Document doc = builder.parse(IOUtils.toInputStream(output.toString()));
+ Element rootElem = doc.getDocumentElement();
+ if (rootElem.getNodeName().endsWith("ExceptionReport")) {
+ return output.toString();
+ }
+ } catch (Exception e) {
+ }
+ }
+
+ }
+
+ return null;
+ }
+
+ /** Runs the full test suite on a deployed version of PetaScope.
+ * If command-line arguments are not provided, default values are used.
+ *
+ * @param args Can contain up to three parameters, in order: PetaScopeURL testFolder, outputFolder
+ */
+ public static void main(String args[]) {
+ if (args.length >= 1) {
+ FullTestsOnline.PetascopeURL = args[0];
+ }
+ if (args.length >= 2) {
+ FullTestsOnline.folder = args[1];
+ }
+ if (args.length == 3) {
+ FullTestsOnline.outputFolder = args[2];
+ }
+
+ FullTestsOnline tester = new FullTestsOnline();
+
+ tester.runAllTests();
+ tester.printResults();
+ }
+
+ /* Accept all files with extension TEST. */
+ private class TestFileFilter implements FilenameFilter {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("test")) {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/test/GrammarTest.java b/petascope/src/petascope/wcps/server/test/GrammarTest.java
new file mode 100644
index 0000000..f85a259
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/test/GrammarTest.java
@@ -0,0 +1,123 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.test;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import org.apache.commons.io.FileUtils;
+import petascope.wcps.server.cli.grammar;
+
+/**
+ * Runs the available tests for the abstract syntax grammar, by calling the CLI.
+ * Assumes test passes if no error is thrown from the grammar CLI.
+ * @author Andrei Aiordachioaie
+ */
+public class GrammarTest {
+ // Put new test cases in this folder following the current naming scheme
+
+ String folder = "test/testcases-wcps_dollar/";
+ // How many tests we have to run
+ int numTests = 0;
+ // tests
+ File[] tests;
+ // queries
+ String[] queries;
+ // success code
+ boolean[] ok;
+ // message for tests
+ String[] errors;
+ // How many successes?
+ int passCount = 0;
+
+ public void printResults() {
+
+ for (int i = 0; i < numTests; i++) {
+ String tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 5);
+ if (ok[i] == true) {
+ System.out.println("*** Test '" + tname + "' ok");
+// System.out.println("\t" + queries[i]);
+ } else {
+ System.out.println("*** Test '" + tname + "' FAILED");
+ System.out.println("\t" + queries[i]);
+ System.out.println("\t ERROR: " + errors[i]);
+ }
+ }
+ System.out.println("\n\nRESULTS\n");
+ System.out.println("Tests succeeded: " + String.valueOf(passCount));
+ System.out.println("Tests failed: " + String.valueOf(numTests - passCount));
+ }
+
+ public GrammarTest() {
+ // Find out how many tests we have to run
+ File dir = new File(folder);
+ System.out.println("Looking for tests in " + dir.getAbsolutePath() + "\n");
+ GrammarFileFilter filter = new GrammarFileFilter();
+ tests = dir.listFiles(filter);
+ numTests = tests.length;
+ ok = new boolean[numTests];
+ errors = new String[numTests];
+ queries = new String[numTests];
+ }
+
+ /* Accept all files with extension test. */
+ private class GrammarFileFilter implements FilenameFilter {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("test")) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public void runAllTests() {
+ String query = "";
+ for (int i = 0; i < numTests; i++) {
+ ok[i] = false;
+ try {
+ query = FileUtils.readFileToString(tests[i]);
+ queries[i] = query;
+ } catch (IOException e) {
+ errors[i] = "Could not read file " + tests[i].getName();
+ continue;
+ }
+ try {
+ grammar.convertAbstractQueryToXml(query);
+ ok[i] = true;
+ } catch (Exception e) {
+ errors[i] = e.getMessage();
+ }
+ if (ok[i] == true) {
+ passCount++;
+ }
+ }
+ }
+
+ public static void main(String args[]) {
+ GrammarTest tester = new GrammarTest();
+ tester.runAllTests();
+ tester.printResults();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/test/GrammarTestOnline.java b/petascope/src/petascope/wcps/server/test/GrammarTestOnline.java
new file mode 100644
index 0000000..6adf21b
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/test/GrammarTestOnline.java
@@ -0,0 +1,204 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.test;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLEncoder;
+import org.apache.commons.io.FileUtils;
+
+/** Runs the available Grammar tests against a deployed version of Petascope,
+ * available at some URL.
+ *
+ * Assumes that a tests succeeds if the server does not throw or display
+ * an error.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class GrammarTestOnline {
+ // Put new test cases in this folder
+// public final String PetascopeURL = "http://localhost:8080/PetaScope/WCPService";
+// public final String PetascopeURL = "http://localhost:8080/petascope/wcps/";
+
+ public final String PetascopeURL = "http://kahlua.eecs.jacobs-university.de:8080/petascope-new/wcps/";
+ String folder = "test/testcases-wcps/";
+ // How many tests we have to run
+ int numTests = 0;
+ // tests
+ File[] tests;
+ // queries
+ String[] queries;
+ // success code
+ boolean[] ok;
+ // message for tests
+ String[] errors;
+ // How many successes?
+ int passCount = 0;
+
+ public void printResults() {
+ System.out.println("\n \nRESULTS \n");
+
+ for (int i = 0; i < numTests; i++) {
+ String tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 5);
+ if (ok[i] == true) {
+ System.out.println("*** Test '" + tname + "' ok");
+// System.out.println("\t" + queries[i]);
+ } else {
+ System.out.println("*** Test '" + tname + "' FAILED");
+ System.out.println("\t" + queries[i]);
+ System.out.println("\t ERROR: " + errors[i]);
+ }
+ }
+ System.out.println("\n\nRESULTS\n");
+ System.out.println("Tested PetaScope implementation from: " + PetascopeURL);
+ System.out.println("Tests succeeded: " + String.valueOf(passCount));
+ System.out.println("Tests failed: " + String.valueOf(numTests - passCount));
+ }
+
+ public GrammarTestOnline() {
+ // Find out how many tests we have to run
+ File dir = new File(folder);
+ System.out.println("Looking for tests in " + dir.getAbsolutePath() + "\n");
+ TestFileFilter filter = new TestFileFilter();
+ tests = dir.listFiles(filter);
+ numTests = tests.length;
+// numTests = 3;
+ ok = new boolean[numTests];
+ errors = new String[numTests];
+ queries = new String[numTests];
+ }
+
+ /* Accept all files with extension TEST. */
+ private class TestFileFilter implements FilenameFilter {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("test")) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public void runAllTests() {
+ String query = "";
+ String tname = "";
+ for (int i = 0; i < numTests; i++) {
+ ok[i] = false;
+ tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 5);
+ System.out.println("Running test '" + tname + "'...");
+ try {
+ query = FileUtils.readFileToString(tests[i]);
+ queries[i] = query;
+ } catch (IOException e) {
+ errors[i] = "Could not read file " + tests[i].getName();
+ continue;
+ }
+ try {
+ String err = runOneTest("query", query);
+ if (err == null) {
+ ok[i] = true;
+ } else {
+ errors[i] = err;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ if (ok[i] == true) {
+ passCount++;
+ }
+ }
+ }
+
+ /** Send an XML request to the WCPS server. Hopefully it will succeed.
+ * Returns a message on error or null otherwise.
+ **/
+ public String runOneTest(String param, String query)
+ throws MalformedURLException, IOException {
+
+// System.out.println("--------------------");
+// System.out.println(query);
+// System.out.println("\t--------------------");
+
+ // connect to the servlet
+ URL servlet = new URL(PetascopeURL);
+ HttpURLConnection conn = (HttpURLConnection) servlet.openConnection();
+
+ // inform the connection that we will send output and accept input
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ // Don't use a cached version of URL connection.
+ conn.setUseCaches(false);
+ conn.setDefaultUseCaches(false);
+
+ // Send POST request
+ conn.setRequestMethod("POST");
+
+ // Specify the content type that we will send binary data
+ conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+
+ String data = param + "=" + URLEncoder.encode(query);
+ DataOutputStream out = new DataOutputStream(conn.getOutputStream());
+ out.writeBytes(data);
+ out.flush();
+ out.close();
+
+ BufferedReader cgiOutput = new BufferedReader(
+ new InputStreamReader(conn.getInputStream()));
+ String line1 = cgiOutput.readLine();
+ String line2 = cgiOutput.readLine();
+ String line3 = cgiOutput.readLine();
+ System.out.println("\t" + line1);
+ System.out.println("\t" + line2);
+ System.out.println("\t" + line3);
+
+ if (line1 != null && line2 != null && line3 != null
+ && line2.equals("<h1>An error has occured</h1>")) {
+ while (cgiOutput.ready()) {
+ System.out.println("\t" + cgiOutput.readLine());
+ }
+// System.out.println("Error executing query: ");
+ String error = line3.substring(10, line3.length() - 4);
+// System.out.println("\t" + error);
+ return error;
+ } else {
+ return null;
+ }
+
+ }
+
+ public static void main(String args[]) {
+ GrammarTestOnline tester = new GrammarTestOnline();
+ tester.runAllTests();
+ tester.printResults();
+ }
+}
diff --git a/petascope/src/petascope/wcps/server/test/XmlTestOnline.java b/petascope/src/petascope/wcps/server/test/XmlTestOnline.java
new file mode 100644
index 0000000..49aa958
--- /dev/null
+++ b/petascope/src/petascope/wcps/server/test/XmlTestOnline.java
@@ -0,0 +1,204 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcps.server.test;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.apache.commons.io.FileUtils;
+
+/** Runs the available XML tests against a deployed version of Petascope,
+ * available at some URL.
+ *
+ * Assumes that a tests succeeds if the server does not throw or display
+ * an error.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class XmlTestOnline {
+ // Put new test cases in this folder
+
+ public final String PetascopeURL = "http://localhost:8080/PetaScope/interface";
+// public final String PetascopeURL = "http://localhost:8080/petascope/wcps/";
+// public final String PetascopeURL = "http://kahlua.eecs.jacobs-university.de:8080/petascope-new/wcps/";
+ String folder = "test/testcases-wcps/";
+ // How many tests we have to run
+ int numTests = 0;
+ // tests
+ File[] tests;
+ // queries
+ String[] queries;
+ // success code
+ boolean[] ok;
+ // message for tests
+ String[] errors;
+ // How many successes?
+ int passCount = 0;
+
+ public void printResults() {
+ System.out.println("\n \nRESULTS \n");
+
+ for (int i = 0; i < numTests; i++) {
+ String tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 4);
+ if (ok[i] == true) {
+ System.out.println("*** Test '" + tname + "' ok");
+// System.out.println("\t" + queries[i]);
+ } else {
+ System.out.println("*** Test '" + tname + "' FAILED");
+// System.out.println("\t" + queries[i]);
+ System.out.println("\t ERROR: " + errors[i]);
+ }
+ }
+ System.out.println("\n\nRESULTS\n");
+ System.out.println("Tested PetaScope implementation from: " + PetascopeURL);
+ System.out.println("Tests succeeded: " + String.valueOf(passCount));
+ System.out.println("Tests failed: " + String.valueOf(numTests - passCount));
+ }
+
+ public XmlTestOnline() {
+ // Find out how many tests we have to run
+ File dir = new File(folder);
+ System.out.println("Looking for tests in " + dir.getAbsolutePath() + "\n");
+ XmlFileFilter filter = new XmlFileFilter();
+ tests = dir.listFiles(filter);
+ numTests = tests.length;
+// numTests = 1;
+ ok = new boolean[numTests];
+ errors = new String[numTests];
+ queries = new String[numTests];
+ }
+
+ /* Accept all files with extension XML. */
+ private class XmlFileFilter implements FilenameFilter {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("xml")) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public void runAllTests() {
+ String query = "";
+ String tname = "";
+ for (int i = 0; i < numTests; i++) {
+ ok[i] = false;
+ tname = tests[i].getName();
+ tname = tname.substring(0, tname.length() - 4);
+
+ try {
+ query = FileUtils.readFileToString(tests[i]);
+ queries[i] = query;
+ } catch (IOException e) {
+ e.printStackTrace();
+ errors[i] = "Could not read file " + tests[i].getName();
+ continue;
+ }
+ System.out.println("Running test '" + tname + "'...");
+ try {
+ String err = runOneTest("request", query);
+ if (err == null) {
+ ok[i] = true;
+ } else {
+ errors[i] = err;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ if (ok[i] == true) {
+ passCount++;
+ }
+ }
+ }
+
+ /** Send an XML request to the WCPS server. Hopefully it will succeed.
+ * Returns a message on error or null otherwise.
+ **/
+ public String runOneTest(String param, String xml)
+ throws MalformedURLException, IOException {
+
+// System.out.println("--------------------");
+// System.out.println(xml);
+// System.out.println("\t--------------------");
+
+ // connect to the servlet
+ URL servlet = new URL(PetascopeURL);
+ HttpURLConnection conn = (HttpURLConnection) servlet.openConnection();
+
+ // inform the connection that we will send output and accept input
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ // Don't use a cached version of URL connection.
+ conn.setUseCaches(false);
+ conn.setDefaultUseCaches(false);
+
+ // Send POST request
+ conn.setRequestMethod("POST");
+
+ // Specify the content type that we will send binary data
+ conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+
+ String service = "service=WCPS&";
+ String data = service + param + "=" + xml;
+ DataOutputStream out = new DataOutputStream(conn.getOutputStream());
+ out.writeBytes(data);
+ out.flush();
+ out.close();
+
+
+ BufferedReader cgiOutput = new BufferedReader(
+ new InputStreamReader(conn.getInputStream()));
+ String line1 = cgiOutput.readLine();
+ String line2 = cgiOutput.readLine();
+ String line3 = cgiOutput.readLine();
+ System.out.println("\t" + line1);
+ System.out.println("\t" + line2);
+ System.out.println("\t" + line3);
+
+ if (line1 != null && line2 != null && line3 != null
+ && line2.equals("<h1>An error has occured</h1>")) {
+ System.out.println("Error executing query: ");
+ String error = line3.substring(10, line3.length() - 4);
+ System.out.println("\t" + error);
+ return error;
+ } else {
+ return null;
+ }
+
+ }
+
+ public static void main(String args[]) {
+ XmlTestOnline tester = new XmlTestOnline();
+ tester.runAllTests();
+ tester.printResults();
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/WcsServer.java b/petascope/src/petascope/wcs/server/WcsServer.java
new file mode 100644
index 0000000..1918950
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/WcsServer.java
@@ -0,0 +1,249 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server;
+
+//~--- non-JDK imports --------------------------------------------------------
+import javax.servlet.ServletException;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import net.opengis.wcs.v_1_1_0.Capabilities;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptions;
+import net.opengis.wcs.v_1_1_0.DescribeCoverage;
+import net.opengis.wcs.v_1_1_0.GetCapabilities;
+import net.opengis.wcs.v_1_1_0.GetCoverage;
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.WCPS;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.wcs.server.core.convertGetCoverage;
+import petascope.wcs.server.core.executeDescribeCoverage;
+import petascope.wcs.server.core.executeGetCapabilities;
+
+import petascope.ConfigManager;
+import petascope.PetascopeXmlNamespaceMapper;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcs.server.exceptions.InternalComponentException;
+import petascope.wcs.server.exceptions.XmlStructuresException;
+
+/**
+ * The Web Coverage Service (WcsServer)
+ * This class provides methods for each of the WCS operations:
+ * - GetCapabilities
+ * - DescribeCoverage
+ * - GetCoverage
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WcsServer {
+
+ private static Logger LOG = LoggerFactory.getLogger(WcsServer.class);
+
+ /* Status variable */
+ private static Boolean ok;
+ private static Boolean printLog;
+ /* Globals */
+ private static Boolean printOutput;
+ private DbMetadataSource meta;
+
+ /**
+ * Public minimal constructor
+ * @param settingsPath path to the "settings.properties" file
+ */
+ public WcsServer(String settingsPath, DbMetadataSource source) throws ServletException {
+ ConfigManager.getInstance(settingsPath, null);
+ meta = source;
+ ok = true;
+ }
+
+ /**
+ * WcsServer GetCapabilities operation
+ */
+ public String GetCapabilities(String stringXml) throws WCSException {
+ String output = "Default output. ";
+
+ try {
+ // read the input XML
+ LOG.trace("Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0");
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ Object xml = unmarshaller.unmarshal(new StringReader(stringXml));
+
+ // Find out which class to execute ...
+ LOG.trace("It is a " + xml.getClass().getSimpleName() + " request.");
+
+ LOG.trace("Compiling data into XML format for GetCapabilities ... ");
+ GetCapabilities input = (GetCapabilities) xml;
+ Capabilities cap = new executeGetCapabilities(input, meta).get();
+
+
+ // Write the output
+ LOG.trace("MArshalling with context: " + cap.getClass().getPackage().getName());
+ final StringWriter writer = new StringWriter();
+ try {
+ context = JAXBContext.newInstance(cap.getClass());
+ final XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(writer);
+
+ final Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PetascopeXmlNamespaceMapper());
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.setProperty("jaxb.schemaLocation", "http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1.0/wcsGetCapabilities.xsd "
+ + "http://www.opengis.net/wcs/1.1/ows http://schemas.opengis.net/wcs/1.1.0/owsGetCapabilities.xsd");
+
+ marshaller.marshal(cap, xmlStreamWriter);
+ } catch (final Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ output = writer.toString();
+ LOG.trace("Done! User has the GetCapabilities result !");
+
+ } catch (javax.xml.bind.JAXBException ex) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex);
+ }
+
+ LOG.trace("---------------------OUTPUT--------------------------");
+ LOG.trace(output);
+ LOG.trace("-----------------------------------------------------");
+
+ return output;
+ }
+
+ /**
+ * WcsServer GetCoverage operation
+ */
+ public String GetCoverage(String stringXml, WCPS wcps) throws WCSException {
+ String output = "Default output. ";
+
+ try {
+ // read the input XML
+ LOG.trace("Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0");
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ Object xml = unmarshaller.unmarshal(new StringReader(stringXml));
+
+ LOG.trace("It is a " + xml.getClass().getSimpleName() + " request.");
+
+ // Convert the WcsServer into WCPS
+ LOG.trace("Converting to WCPS request ... please wait");
+ GetCoverage wcs = (GetCoverage) xml;
+
+ output = new convertGetCoverage(wcs, meta).get();
+ LOG.trace("Done! User has his WCPS request !");
+ } catch (JAXBException ex) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex);
+ } catch (WCPSException e) {
+ throw new InternalComponentException(e.getMessage(), e);
+ }
+
+ LOG.trace("---------------------OUTPUT--------------------------");
+ LOG.trace(output);
+ LOG.trace("-----------------------------------------------------");
+
+ return output;
+ }
+
+ /**
+ * WcsServer DescribeCoverage operation
+ */
+ public String DescribeCoverage(String stringXml) throws WCSException {
+ String output = "Default output. ";
+
+ try {
+ // read the input XML
+ LOG.trace("Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0");
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ Object xml = unmarshaller.unmarshal(new StringReader(stringXml));
+
+ LOG.trace("It is a " + xml.getClass().getSimpleName() + " request.");
+
+ LOG.trace("Querying the WCPS architecture for the details on this coverage ...");
+ DescribeCoverage input = (DescribeCoverage) xml;
+ CoverageDescriptions covs = new executeDescribeCoverage(input, meta).get();
+
+ // Write the output file
+ LOG.trace("Marshalling with context: " + covs.getClass().getPackage().getName());
+ final StringWriter writer = new StringWriter();
+ try {
+ context = JAXBContext.newInstance(covs.getClass());
+ final XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(writer);
+
+ final Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PetascopeXmlNamespaceMapper());
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.setProperty("jaxb.schemaLocation", "http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1.0/wcsDescribeCoverage.xsd "
+ + "http://www.opengis.net/wcs/1.1/ows http://schemas.opengis.net/wcs/1.1.0/owcsAll.xsd");
+
+ marshaller.marshal(covs, xmlStreamWriter);
+ } catch (final Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ output = writer.toString();
+ LOG.trace("Done! User has the DescribeCoverage result !");
+ } catch (JAXBException ex) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex);
+ }
+
+ LOG.trace("---------------------OUTPUT--------------------------");
+ LOG.trace(output);
+ LOG.trace("-----------------------------------------------------");
+
+ return output;
+ }
+
+ private String exceptionReportToXml(ExceptionReport report) {
+ String output = null;
+
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(
+ report.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8");
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ marshaller.marshal(report, System.err);
+ StringWriter strWriter = new StringWriter();
+
+ marshaller.marshal(report, strWriter);
+ output = strWriter.toString();
+ ok = true;
+ LOG.trace("Done marshalling Error Report.");
+ } catch (Exception e2) {
+ LOG.error("Error marshalling Exception Report.");
+ LOG.error("Stack trace: " + e2);
+ }
+
+ return output;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/cli/CLI.java b/petascope/src/petascope/wcs/server/cli/CLI.java
new file mode 100644
index 0000000..e6312d5
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/cli/CLI.java
@@ -0,0 +1,179 @@
+package petascope.wcs.server.cli;
+
+import petascope.wcs.server.core.executeGetCapabilities;
+import petascope.wcs.server.exceptions.WCSException;
+import petascope.wcs.server.core.convertGetCoverage;
+import petascope.wcs.server.core.executeDescribeCoverage;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import net.opengis.wcs.v_1_1_0.Capabilities;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptions;
+import net.opengis.wcs.v_1_1_0.DescribeCoverage;
+import net.opengis.wcs.v_1_1_0.GetCapabilities;
+import net.opengis.wcs.v_1_1_0.GetCoverage;
+//import wcs.server.core.ProcessCoverage;
+
+/**
+ * Command Line Interface class, for testing the WCS Server operation
+ * Converts an WCS XML input file into a WCPS XML input file.<br />
+ * Settings are read from the file "input-output.txt", in the current folder.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class CLI {
+
+ private static final String settingsFile = "input-output.txt";
+ private static String inputFile;
+ private static String outputFile;
+ private static String metadataSettingsFile;
+ private static Boolean ok;
+ private static Boolean printOutput;
+ private static Boolean printLog = true;
+
+ public static void log(String msg) {
+ if (printLog) {
+ System.out.println(msg);
+ }
+ }
+
+ public static boolean init() {
+ ok = true;
+ printOutput = true;
+
+ Properties set = new Properties();
+ try {
+ set.load(new FileInputStream(settingsFile));
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ ok = false;
+ }
+
+ inputFile = set.getProperty("inputFile");
+ outputFile = set.getProperty("outputFile");
+ metadataSettingsFile = set.getProperty("metadataSettingsFile");
+ printOutput = Boolean.parseBoolean(set.getProperty("printOutputFile"));
+ printLog = Boolean.parseBoolean(set.getProperty("printLogMessages"));
+
+ return ok;
+ }
+
+ /**
+ * Converts a WCS XML input file into a WCPS XML input file
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ if (!init()) {
+ return;
+ }
+ /*
+ try
+ {
+ // read the input XML
+ log(">>> Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0");
+ Unmarshaller unmarshaller = context.createUnmarshaller() ;
+ Object xml = unmarshaller.unmarshal(new FileInputStream(inputFile));
+ // Find out which class to execute ...
+ log(">>> It is a " + xml.getClass().getSimpleName() + " request.");
+ if (xml instanceof GetCoverage)
+ {
+ //Convert the WCS into WCPS
+ log(">>> Converting to WCPS ... please wait");
+ GetCoverage wcs = (GetCoverage) xml;
+ ProcessCoverage wcps = new convertGetCoverage(wcs, metadataSettingsFile).get();
+ // Write the output WCPS request
+ try {
+ log(">>> Writing the WCPS XML request");
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(wcps.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ if (printOutput)
+ marshaller.marshal(wcps, System.out);
+ marshaller.marshal(wcps, new FileOutputStream(outputFile));
+ } catch (javax.xml.bind.JAXBException ex) {
+ // XXXTODO Handle exception
+ java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
+ ex.printStackTrace();
+ }
+ }
+ else
+ if (xml instanceof GetCapabilities)
+ {
+ log(">>> Compiling data into XML format for GetCapabilities ... ");
+ GetCapabilities input = (GetCapabilities) xml;
+ Capabilities cap = new executeGetCapabilities(input, metadataSettingsFile).get();
+ // Write the output file (WCS)
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(cap.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ if (printOutput)
+ marshaller.marshal(cap, System.out);
+ marshaller.marshal(cap, new FileOutputStream(outputFile));
+
+ } catch (javax.xml.bind.JAXBException ex) {
+ // XXXTODO Handle exception
+ java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
+ ex.printStackTrace();
+ }
+ }
+ else
+ if (xml instanceof DescribeCoverage)
+ {
+ log(">>> Querying the WCPS architecture for the details on this coverage ...");
+ DescribeCoverage input = (DescribeCoverage) xml;
+ CoverageDescriptions output = new executeDescribeCoverage(input, metadataSettingsFile).get();
+ // Write the output file (WCS)
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(output.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ if (printOutput)
+ marshaller.marshal(output, System.out);
+ marshaller.marshal(output, new FileOutputStream(outputFile));
+ } catch (javax.xml.bind.JAXBException ex) {
+ // XXXTODO Handle exception
+ java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
+ ex.printStackTrace();
+ }
+ }
+ else
+ throw new Exception("ERROR ! Unrecognized request type " + xml.getClass().getSimpleName());
+ }
+ catch (WCSException e)
+ {
+ ExceptionReport report = e.getReport();
+ try {
+ javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(report.getClass().getPackage().getName());
+ javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ if (printOutput)
+ marshaller.marshal(report, System.err);
+ marshaller.marshal(report, new FileOutputStream(outputFile));
+ } catch (javax.xml.bind.JAXBException ex) {
+ // XXXTODO Handle exception
+ java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
+ ex.printStackTrace();
+ }
+ catch (Exception e2)
+ {
+ e2.printStackTrace();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ log(">>> Done !");
+ */
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/core/TimeString.java b/petascope/src/petascope/wcs/server/core/TimeString.java
new file mode 100644
index 0000000..668614e
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/core/TimeString.java
@@ -0,0 +1,223 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import org.joda.time.format.ISODateTimeFormat;
+
+/**
+ * Represents a Time object, according to ISO 8601, and utility methods.
+ *
+ * @author Gulius Caesar
+ */
+public class TimeString {
+
+ private static DateTimeFormatter DTF = ISODateTimeFormat.dateTime();
+ private DateTime dateTime;
+ private long milliseconds;
+ private String strTime;
+
+ /* Default constructor */
+ public TimeString(String timeStr) throws IllegalArgumentException {
+ strTime = timeStr;
+ dateTime = parse(strTime);
+ milliseconds = parseMillis(strTime);
+ }
+
+ public DateTime getDateTime() {
+ return dateTime;
+ }
+
+ public long getMilliseconds() {
+ return milliseconds;
+ }
+
+ public long subtract(String newString) throws IllegalArgumentException {
+ long newD = parseMillis(newString);
+ long res = milliseconds - newD;
+
+ return res;
+ }
+
+ public double divide(String newString) throws IllegalArgumentException {
+ long newD = parseMillis(newString);
+ double result = milliseconds * new Double(1.0) / newD;
+
+ return result;
+ }
+
+ /** ******************** Static methods ***************** */
+
+ /*
+ * Subtraction Method, calculates the difference in milliseconds between two dates
+ */
+ public static long difference(String bigDate, String smallDate) throws IllegalArgumentException {
+ long smallD = parseMillis(smallDate);
+ long bigD = parseMillis(bigDate);
+ long result = bigD - smallD;
+
+ return result;
+ }
+
+ /**
+ * Division of one Date by the other.
+ */
+ public static double division(String IAmDivided, String IDivide) throws IllegalArgumentException {
+ long iad = parseMillis(IAmDivided);
+ long id = parseMillis(IDivide);
+ double result = iad * new Double(1.0) / id;
+
+ return result;
+ }
+
+ /*
+ * Division of a millisecond-Date-respresentation by a number.
+ */
+ public static double division(String InputDate, long Divisor) throws IllegalArgumentException {
+ long ID = parseMillis(InputDate);
+
+ double result = ID * new Double(1.0) / Divisor;
+
+ return result;
+
+ }
+
+ /**
+ * Date to millisecond parser. Accepts the standard ISO 8601 + shorter codes.
+ * @return long number of miliseconds
+ */
+ public static long parseMillis(String TString) throws IllegalArgumentException {
+ long Millis;
+ int NumberOfSymbols = TString.length();
+
+ switch (NumberOfSymbols) {
+ case 24:
+ DTF = ISODateTimeFormat.dateTime();
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 22:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SS");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 19:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 16:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 13:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 10:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 7:
+ DTF = DateTimeFormat.forPattern("yyyy-MM");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ case 4:
+ DTF = DateTimeFormat.forPattern("yyyy");
+ Millis = DTF.parseMillis(TString);
+
+ break;
+ default:
+ throw new IllegalArgumentException("Unknown DateTime format.");
+ }
+
+ return Millis;
+ }
+
+ /**
+ *
+ * @param TString string containing date
+ * @return joda DateTime corresponding to the input string
+ * @throws IllegalArgumentException
+ */
+ public static DateTime parse(String str) throws IllegalArgumentException {
+ DateTime date;
+ int NumberOfSymbols = str.length();
+
+ System.out.println("Parsing date '" + str + "', with length " + str.length());
+
+ switch (NumberOfSymbols) {
+ case 24:
+ DTF = ISODateTimeFormat.dateTime();
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 22:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SS");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 19:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 16:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 13:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 10:
+ DTF = DateTimeFormat.forPattern("yyyy-MM-dd");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 7:
+ DTF = DateTimeFormat.forPattern("yyyy-MM");
+ date = DTF.parseDateTime(str);
+
+ break;
+ case 4:
+ DTF = DateTimeFormat.forPattern("yyyy");
+ date = DTF.parseDateTime(str);
+
+ break;
+ default:
+ throw new IllegalArgumentException("Unknown DateTime format.");
+ }
+
+ return date;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/core/convertGetCoverage.java b/petascope/src/petascope/wcs/server/core/convertGetCoverage.java
new file mode 100644
index 0000000..7d4a951
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/core/convertGetCoverage.java
@@ -0,0 +1,498 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+import petascope.wcs.server.exceptions.WCSException;
+import net.opengis.gml.v_3_1_1.TimePositionType;
+import net.opengis.ows.v_1_0_0.BoundingBoxType;
+import net.opengis.wcs.v_1_1_0.DomainSubsetType;
+import net.opengis.wcs.v_1_1_0.GetCoverage;
+import net.opengis.wcs.v_1_1_0.GridCrsType;
+import net.opengis.wcs.v_1_1_0.RangeSubsetType;
+import net.opengis.wcs.v_1_1_0.TimePeriodType;
+
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.ProcessCoveragesRequest;
+import petascope.wcps.server.exceptions.WCPSException;
+import petascope.wcps.server.core.DomainElement;
+
+import petascope.ConfigManager;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.antlr.runtime.RecognitionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcps.server.core.Metadata;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.InvalidTemporalMetadataException;
+import petascope.wcs.server.exceptions.MissingParameterValueException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+/**
+ * This class takes a WCS GetCoverage XML request and converts this request into
+ * a WCPS ProcessCoverages XML request. It is the user's responsibility to pass
+ * the WCPS request to a WCPS server in order to view to result.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class convertGetCoverage {
+
+ private static Logger LOG = LoggerFactory.getLogger(convertGetCoverage.class);
+ // Trimming
+ private boolean xAxisTrim = false;
+ private boolean yAxisTrim = false;
+ // Time Trimming
+ private boolean timeTrim = false;
+ // Time Slicing
+ private boolean timeSlice = false;
+
+ /* WCPS requests */
+ private String abstractRequest;
+ // Range Composition (field combination)
+ private boolean combineFields;
+
+ /* Value variables, used for building the WCPS abstract syntax query */
+ private String coverageName;
+ private List<String> fields;
+ private boolean finished;
+ // Output
+ private String format;
+
+ /* The Configuration Manager */
+ private DbMetadataSource meta;
+ private boolean store;
+ private String time1, time2;
+ private String timePos;
+ private GetCoverage wcs;
+ private long px0, px1, py0, py1; // Bounding box subsetting
+ private String crsName; // for bounding box
+ private String xmlRequest;
+ private Metadata covMeta;
+
+ /**
+ * Default constructor
+ * @param cov GetCoverage object, the input WCS request for retrieving a coverage
+ * @param path Path to the "settings.properties" file
+ */
+ public convertGetCoverage(GetCoverage cov, DbMetadataSource source)
+ throws WCSException, WCPSException {
+ /* Init Config Manager and global */
+ ConfigManager globals = ConfigManager.getInstance();
+ /* Setup objects */
+ wcs = cov;
+ finished = false;
+
+ meta = source;
+ }
+
+ /**
+ * * Retrieves the WCPS request object that is
+ * equivalent to the WCS request. If it is not yet converted, it will
+ * perform the conversion.
+ *
+ * @return a WCPS abstract syntax query as a string
+ * @throws wcs.server.core.WCSException
+ */
+ public String get() throws WCSException {
+ try {
+ if (!finished) {
+ process();
+ }
+
+ /* Convert the abstract syntax query to a ProcessCoveragesRequest */
+ LOG.debug("Converting WCPS abstract query '{}' to xml", abstractRequest);
+ xmlRequest = ProcessCoveragesRequest.abstractQueryToXmlQuery(abstractRequest);
+ LOG.debug("Resulting XML query is: \n{}", xmlRequest);
+ } catch (RecognitionException re) {
+ throw new NoApplicableCodeException("Internal error: Generated abstract syntax query was not valid.", re);
+ }
+
+ return xmlRequest;
+ }
+
+ /**
+ * Converts WCS node 1 (Coverage Identifier) to WCPS info
+ * @throws wcs_web_service.WCSException
+ */
+ private void readField1() throws WCSException {
+ coverageName = wcs.getIdentifier().getValue();
+ }
+
+ /**
+ * Converts WCS node 2 (Domain subsetting) to WCPS info
+ * @throws wcs_web_service.WCSException
+ */
+ private void readField2() throws WCSException {
+ if (!wcs.isSetDomainSubset()) {
+ throw new MissingParameterValueException("DomainSubset");
+ }
+ if (!wcs.getDomainSubset().isSetBoundingBox()) {
+ throw new MissingParameterValueException("BoundingBox");
+ }
+
+ DomainSubsetType domain = wcs.getDomainSubset();
+
+ // DomainSubset->BoundingBox
+ if (domain.isSetBoundingBox()) {
+ BoundingBoxType bbox = (BoundingBoxType) domain.getBoundingBox().getValue();
+
+ /* We only understand two CRSs: WGS84 and IMAGE_CRS */
+ /* TODO: Implement CRS transformations */
+ crsName = bbox.getCrs();
+ if (crsName != null) {
+ if (crsName.equals(DomainElement.IMAGE_CRS)) {
+ LOG.trace("CRS: NATIVE_IMAGE_CRS");
+ } else if (crsName.equals(DomainElement.WGS84_CRS)) {
+ LOG.trace("CRS: WGS84");
+ } else {
+ throw new InvalidParameterValueException("BoundingBox.crs. Explanation: "
+ + "CRS '" + crsName + "' not available on this server.");
+ }
+ } else {
+ LOG.debug("CRS: None specified for bounding box");
+ LOG.debug("CRS: Using default IMAGE_CRS");
+ crsName = DomainElement.IMAGE_CRS;
+ }
+
+ /* BBox declarations */
+ if (bbox.getLowerCorner().size() != 2) {
+ throw new InvalidParameterValueException("LowerCorner. Explanation: "
+ + "BoundingBox -> LowerCorner should have exactly two "
+ + "values, not " + bbox.getLowerCorner().size());
+ }
+ if (bbox.getUpperCorner().size() != 2) {
+ throw new InvalidParameterValueException("UpperCorner. Explanation: "
+ + "BoundingBox -> UpperCorner should have exactly two "
+ + "values, not " + bbox.getUpperCorner().size());
+ }
+
+ xAxisTrim = true;
+ int u2 = bbox.getLowerCorner().get(0).intValue();
+ int u3 = bbox.getUpperCorner().get(0).intValue();
+ LOG.trace("Added X-axis trimming ! (DomainSubset->BoundingBox): " + u2 + " ... "
+ + u3);
+
+ yAxisTrim = true;
+ int v2 = bbox.getLowerCorner().get(1).intValue();
+ int v3 = bbox.getUpperCorner().get(1).intValue();
+ LOG.trace("Added Y-axis trimming ! (DomainSubset->BoundingBox): " + v2 + " ... "
+ + v3);
+
+ /* Use bounding-box values as they are given */
+ px0 = u2;
+ py0 = v2;
+ px1 = u3;
+ py1 = v3;
+
+ if (crsName.equals(DomainElement.IMAGE_CRS) == false
+ && crsName.equals(DomainElement.WGS84_CRS) == false) {
+ throw new NoApplicableCodeException("Unknown CRS: " + crsName);
+ }
+ }
+
+ // DomainSubset->TemporalSubset
+ if (domain.isSetTemporalSubset()) {
+ // TemporalSubset is of type TimeSequenceType = choice(gml:TimePosition, wcs:TimePeriodType)
+ Object one = domain.getTemporalSubset().getTimePositionOrTimePeriod().get(0);
+
+ LOG.trace("Inside TemporalSubset there is " + one.getClass());
+ if (one instanceof net.opengis.gml.v_3_1_1.TimePositionType) {
+ // TemporalSubset = gml:TimePosition
+ // use WCPS:slice
+ timeSlice = true;
+
+ TimePositionType pos = (TimePositionType) one;
+
+
+ /* Default syntax is ISO 8601.
+ However, we also accept direct time-axis coordinates, as a fail-back solution. */
+ timePos = parseTimePosition(pos);
+ LOG.trace("Added time-axis slicing ! ( DomainSubset->TemporalSubset->gml:TimePositionType): position "
+ + timePos);
+ } else if (one instanceof net.opengis.wcs.v_1_1_0.TimePeriodType) {
+ // TemporalSubset = wcs:TimePeriodType
+ timeTrim = true;
+
+ TimePeriodType period = (TimePeriodType) one;
+
+ TimePositionType pos1 = period.getBeginPosition();
+ TimePositionType pos2 = period.getEndPosition();
+
+ /* Default syntax is ISO 8601.
+ However, we also accept direct time-axis coordinates, as a fail-back solution. */
+ time1 = parseTimePosition(pos1);
+ time2 = parseTimePosition(pos2);
+
+ LOG.trace("Added time-axis trimming ! ( DomainSubset->TemporalSubset->wcs:TimePeriodType): "
+ + time1 + " ... " + time2);
+ }
+ }
+ }
+
+ /**
+ * Converts WCS node 3 (Range subsetting) to WCPS info
+ */
+ private void readField3() throws WCSException {
+ if (wcs.isSetRangeSubset()) {
+ RangeSubsetType range = wcs.getRangeSubset();
+
+ combineFields = true;
+ fields = new ArrayList<String>();
+
+ Iterator<RangeSubsetType.FieldSubset> it = range.getFieldSubset().iterator();
+
+ while (it.hasNext()) {
+ RangeSubsetType.FieldSubset field = it.next();
+
+ fields.add(field.getIdentifier().getValue());
+ LOG.trace("RangeSubsetType->FieldSubset->Identifier is "
+ + field.getIdentifier().getValue());
+ LOG.trace("RangeSubsetType->FieldSubset->Interpolation is "
+ + field.getInterpolationType());
+ /* NOTE: We ignore interpolation instructions (optional) */
+ /* NOTE: We ignore axis subset lists (optional) */
+ }
+
+ }
+ }
+
+ /**
+ * Converts WCS node 4 (Output) to WCPS info
+ * @throws wcs_web_service.WCSException
+ */
+ private void readField4() throws WCSException {
+ if (!wcs.isSetOutput()) {
+ throw new MissingParameterValueException("Output");
+ }
+ LOG.trace("Format: " + wcs.getOutput().getFormat());
+
+ if (wcs.getOutput().isSetGridCRS()) {
+ GridCrsType crs = wcs.getOutput().getGridCRS();
+
+ throw new NoApplicableCodeException("Currently, the Output->GridCRS node is not supported !");
+ }
+
+ String wcsMimeFormat = wcs.getOutput().getFormat();
+
+ format = meta.mimetypeToFormat(wcsMimeFormat);
+ LOG.trace("New format: " + format);
+ if ((format == null) || format.equals("")) {
+ throw new InvalidParameterValueException("Output format");
+ }
+
+ LOG.trace("issetstore = " + wcs.getOutput().isSetStore());
+ LOG.trace("isstore = " + wcs.getOutput().isStore());
+ store = false;
+ if (wcs.getOutput().isSetStore() && wcs.getOutput().isStore()) {
+ store = true;
+ }
+
+ /* WCPS does not support "store=true" */
+ if (store) {
+ throw new InvalidParameterValueException("Output Store. Explanation: "
+ + "Cannot store result image on server.");
+ }
+ }
+
+ /**
+ * Performs the conversion of the WCS request into a WCPS abstract syntax request.
+ * @throws wcs_web_service.WCSException
+ */
+ @SuppressWarnings("static-access")
+ public void process() throws WCSException {
+ /** * Processing starts here ... with the nodes of the WCS * */
+ // Service Description
+ LOG.debug("WCS service: \"" + wcs.SERVICE + "\"");
+ LOG.debug("WCS version: \"" + wcs.VERSION + "\"");
+ if (!wcs.SERVICE.equalsIgnoreCase("WCS")) {
+ throw new InvalidParameterValueException("Service. Explanation: "
+ + "Only the WCS service is supported.");
+ }
+ if (!wcs.VERSION.equals("1.1.0")) {
+ throw new InvalidParameterValueException("Version. Explanation: "
+ + "Only WCS Version 1.1.0 is currently supported.");
+ }
+
+ // First of all, error checking: is the coverage offered by the server?
+ if (!wcs.isSetIdentifier()) {
+ throw new MissingParameterValueException("Identifier");
+ }
+ try {
+ if (!meta.existsCoverageName(wcs.getIdentifier().getValue())) {
+ throw new InvalidParameterValueException("Identifier. Explanation: "
+ + "Coverage " + wcs.getIdentifier().getValue()
+ + " is not served by this server.");
+ }
+ covMeta = meta.read(wcs.getIdentifier().getValue());
+ } catch (WCPSException e) {
+ throw new InvalidParameterValueException("Identifier. Explanation: "
+ + "Coverage " + wcs.getIdentifier().getValue()
+ + " is not served by this server.");
+ }
+
+
+ // Convert all the child nodes of WCS GetCoverage XML node
+ LOG.trace("*** Reading WCS node 1 ... ");
+ readField1();
+ LOG.trace("*** Reading WCS node 2 ...");
+ readField2();
+ LOG.trace("*** Reading WCS node 3 ...");
+ readField3();
+ LOG.trace("*** Reading WCS node 4 ...");
+ readField4();
+ LOG.trace("*** Assembling WCPS abstract syntax query ...");
+ assembleFinalWcpsQuery();
+
+ /* Done building WCPS abstract query. */
+ finished = true;
+ LOG.trace("Done Converting WCS GetCoverage into WCPS ProcessCoverage.");
+ }
+
+ /**
+ * Constructs the WCPS abstract syntax query from the information gathered
+ * by <code>readField*()</code> functions.
+ */
+ private void assembleFinalWcpsQuery() {
+ // Bind variable "c" to the coverage name
+ String forClause = "for c in (" + coverageName + ") ";
+ // Base processing is done on the coverage variable
+ String processing = "c";
+
+ if (xAxisTrim && yAxisTrim) {
+ // Bounding box subsetting
+ String xAxis = "x:\"" + crsName + "\" (" + px0 + ":" + px1 + ")";
+ String yAxis = "y:\"" + crsName + "\" (" + py0 + ":" + py1 + ")";
+ String tAxis = "t(" + time1 + ":" + time2 + ")";
+
+ if (timeTrim) {
+ processing = "trim( " + processing + ", {" + xAxis + ", " + yAxis + ", " + tAxis
+ + "} )";
+ } else {
+ processing = "trim( " + processing + ", {" + xAxis + ", " + yAxis + "} )";
+ }
+ }
+ if (timeSlice) {
+ // Time slicing
+ String tAxis = "t(" + timePos + ")";
+
+ processing = "slice( " + processing + ", {" + tAxis + "} )";
+ }
+ if (combineFields) {
+ // Only one field means we have a "field select" statement
+ if (fields.size() == 1) {
+ String field = fields.get(0);
+
+ processing = "(" + processing + ")." + field;
+ } else // Multiple fields translate into a "range constructor" statement
+ {
+ String newProc = "";
+ Iterator<String> it = fields.iterator();
+
+ while (it.hasNext()) {
+ String field = it.next();
+
+ if (newProc.length() > 0) {
+ newProc += "; ";
+ }
+ newProc += field + ":" + processing;
+ }
+ processing = "struct { " + newProc + " }";
+ }
+ }
+ // Set the output format
+ processing = "encode(" + processing + ", \"" + format + "\")";
+
+ // Build the final query
+ String returnClause = "return " + processing;
+
+ abstractRequest = forClause + returnClause;
+ }
+
+ /** Convert a time-position JAXB object into a numerical index we can use for the
+ * time subsetting.
+ * @param pos TimePositionType object
+ * @return String representation of integer time
+ * @throws WCSException if the contents of the time position is not an integer or an ISO8601 string
+ */
+ private String parseTimePosition(TimePositionType pos) throws WCSException {
+ String result;
+
+ LOG.trace("TimePosition has length " + pos.getValue().size());
+ if (pos.getValue().size() != 1) {
+ throw new InvalidParameterValueException("TimePosition. Explanation: "
+ + "The TimePosition element should have exactly one item, and not "
+ + pos.getValue().size());
+ }
+ String timeStr = pos.getValue().get(0);
+
+ LOG.debug("Parsing time position: " + timeStr);
+ try {
+ // ISO 8601 parsing
+ TimeString ts = new TimeString(timeStr);
+ LOG.debug("Found time position (ISO 8601): " + timeStr);
+ if (ts.subtract(covMeta.getTimePeriodBeginning()) < 0
+ || TimeString.difference(covMeta.getTimePeriodEnd(), timeStr) < 0) {
+ throw new InvalidParameterValueException("TimePosition: value " + timeStr
+ + " is outside this coverage's time range.");
+ }
+ String begin = covMeta.getTimePeriodBeginning();
+ if (begin == null) {
+ throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName()
+ + "' has no time axis beginning or end in table PS_Domain.");
+ }
+ long diff1 = ts.subtract(begin);
+ LOG.trace("Selected time span (ISO 8601, in ms) : " + diff1);
+ long diff2 = covMeta.getTimeSpan();
+ if (diff2 == -1) {
+ throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName()
+ + "' has no time axis beginning or end in table PS_Domain.");
+ }
+ LOG.trace("Coverage " + covMeta.getCoverageName() + " has time span (ISO 8601, in ms) : " + diff2);
+ LOG.trace("Coverage " + covMeta.getCoverageName() + " has time indexes span : " + covMeta.getTimeIndexesSpan());
+ Double dIndex = covMeta.getTimeIndexesSpan() * diff1 * new Double(1.0) / diff2;
+ if (dIndex == -1) {
+ throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName()
+ + "' has no time axis.");
+ }
+ LOG.trace("Computed time axis index: " + dIndex);
+ long timeIndex = dIndex.longValue();
+
+ result = String.valueOf(timeIndex);
+ } catch (IllegalArgumentException e) {
+ LOG.warn("Time position '" + timeStr + "' was not in ISO 8601 format. Trying to parse integer...");
+ try {
+ Integer tPos = Integer.parseInt(timeStr);
+ LOG.debug("Found time position in integer coordinates: " + tPos);
+ result = tPos.toString();
+ } catch (NumberFormatException e2) {
+ throw new InvalidParameterValueException("TimePosition: " + timeStr, e2);
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java b/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java
new file mode 100644
index 0000000..6df74a8
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java
@@ -0,0 +1,275 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+import petascope.wcs.server.exceptions.WCSException;
+import net.opengis.ows.v_1_0_0.BoundingBoxType;
+import net.opengis.wcs.ows.v_1_1_0.DomainMetadataType;
+import net.opengis.wcs.ows.v_1_1_0.InterpolationMethodType;
+import net.opengis.wcs.ows.v_1_1_0.InterpolationMethods;
+import net.opengis.wcs.ows.v_1_1_0.UnNamedDomainType;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptionType;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptions;
+import net.opengis.wcs.v_1_1_0.CoverageDomainType;
+import net.opengis.wcs.v_1_1_0.DescribeCoverage;
+import net.opengis.wcs.v_1_1_0.FieldType;
+import net.opengis.wcs.v_1_1_0.RangeType;
+import net.opengis.wcs.v_1_1_0.SpatialDomainType;
+
+import petascope.wcps.server.core.*;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.Iterator;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+import net.opengis.ows.v_1_0_0.KeywordsType;
+import net.opengis.wcs.ows.v_1_1_0.AnyValue;
+import net.opengis.wcs.v_1_1_0.TimeSequenceType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+/**
+ * This class takes a WCS DescribeCoverage XML request and executes request,
+ * building the corresponding XML respose.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class executeDescribeCoverage {
+
+ private static Logger LOG = LoggerFactory.getLogger(executeDescribeCoverage.class);
+ private boolean finished;
+ private DescribeCoverage input;
+ private DbMetadataSource meta;
+ private CoverageDescriptions output;
+
+ /**
+ * Default constructor
+ * @param cap DescribeCoverage object, a WCS (or WCPS) request
+ * @param metadataDbPath Path to the "dbparams.properties" file
+ */
+ public executeDescribeCoverage(DescribeCoverage cap, DbMetadataSource source)
+ throws WCSException {
+ input = cap;
+ output = new CoverageDescriptions();
+ finished = false;
+ meta = source;
+ }
+
+ /**
+ * Main method of this class. Retrieves the response to the DescribeCoverage
+ * request given to the constructor. If needed, it also calls <b>process()</b>
+ * @return a CoverageDescriptions object.
+ * @throws wcs_web_service.WCSException
+ */
+ public CoverageDescriptions get() throws WCSException {
+ if (finished == false) {
+ process();
+ }
+ if (finished == false) {
+ throw new NoApplicableCodeException("Could not execute the GetCapabilities request! "
+ + "Please see the other errors...");
+ }
+
+ return output;
+ }
+
+ /**
+ * Computes the response to the DescribeCoverage request given to the constructor.
+ */
+ public void process() throws WCSException {
+ String name;
+
+ for (int i = 0; i < input.getIdentifier().size(); i++) {
+ name = input.getIdentifier().get(i);
+ output.getCoverageDescription().add(getCoverageDescription(name));
+ }
+ finished = true;
+ }
+
+ /**
+ * Retrieve details for one coverage.
+ * @param name Name of the coverage
+ * @return CoverageDescriptionType object, that can just be plugged in the respose object
+ */
+ private CoverageDescriptionType getCoverageDescription(String name) throws WCSException {
+ LOG.trace("Building coverage description for coverage '" + name + "' ...");
+ CoverageDescriptionType desc = new CoverageDescriptionType();
+
+ // Error checking: is the coverage available?
+ if (meta.existsCoverageName(name) == false) {
+ throw new InvalidParameterValueException("Identifier. Explanation: Coverage "
+ + name + " is not served by this server !");
+ }
+
+ // Read all coverage metadata
+ Metadata cov = null;
+
+ try {
+ cov = meta.read(name);
+ } catch (Exception e) {
+ throw new NoApplicableCodeException("Metadata for coverage " + name + " is not valid.");
+ }
+
+ desc.setIdentifier(name);
+ desc.setTitle(cov.getTitle());
+ desc.setAbstract(cov.getAbstract());
+
+ KeywordsType keyword = new KeywordsType();
+ Iterator<String> keys = SDU.str2string(cov.getKeywords()).iterator();
+ while (keys.hasNext()) {
+ String k = keys.next();
+ keyword.getKeyword().add(k);
+ }
+ desc.getKeywords().add(keyword);
+
+ // Coverage Domain
+ CoverageDomainType domain = null;
+ Double lo1 = 0.0, lo2 = 0.0, hi1 = 0.0, hi2 = 0.0;
+
+ /* Default Bounding Box (uses IMAGE_CRS): use image size */
+ BoundingBoxType bbox = new BoundingBoxType();
+ CellDomainElement X = cov.getXCellDomain();
+ CellDomainElement Y = cov.getYCellDomain();
+ if (X != null && Y != null) {
+ lo1 = X.getLo().doubleValue();
+ hi1 = X.getHi().doubleValue();
+ lo2 = Y.getLo().doubleValue();
+ hi2 = Y.getHi().doubleValue();
+
+ bbox.setCrs(DomainElement.IMAGE_CRS);
+
+ bbox.getLowerCorner().add(lo1);
+ bbox.getLowerCorner().add(lo2);
+ bbox.getUpperCorner().add(hi1);
+ bbox.getUpperCorner().add(hi2);
+ } else {
+ throw new NoApplicableCodeException("Internal error: Could "
+ + "not find X and Y cell domain extents.");
+ }
+
+ /* Try to use WGS84 bounding box, if available */
+ Wgs84Crs crs = cov.getCrs();
+ BoundingBoxType bbox84 = new BoundingBoxType();
+ bbox84.setCrs(DomainElement.WGS84_CRS);
+ if (crs != null) {
+ lo1 = crs.getLow1().doubleValue();
+ hi1 = crs.getHigh1().doubleValue();
+ lo2 = crs.getLow2().doubleValue();
+ hi2 = crs.getHigh2().doubleValue();
+
+ bbox84.getLowerCorner().add(lo1);
+ bbox84.getLowerCorner().add(lo2);
+ bbox84.getUpperCorner().add(hi1);
+ bbox84.getUpperCorner().add(hi2);
+
+ bbox = bbox84;
+ }
+
+ domain = new CoverageDomainType();
+ SpatialDomainType spatial = new SpatialDomainType();
+ spatial.getBoundingBox().add(new JAXBElement<BoundingBoxType>(
+ new QName("http://www.opengis.net/ows", "BoundingBox", XMLConstants.DEFAULT_NS_PREFIX),
+ BoundingBoxType.class, bbox));
+ domain.setSpatialDomain(spatial);
+
+
+ /* Find a time-axis if exists */
+ CellDomainElement T = cov.getTCellDomain();
+ if (T != null) {
+ LOG.trace("Found time-axis for coverage: [" + T.getLo() + ", " + T.getHi() + "]");
+ TimeSequenceType temporal = new TimeSequenceType();
+ temporal.getTimePositionOrTimePeriod().add(T.getLo().intValue());
+ temporal.getTimePositionOrTimePeriod().add(T.getHi().intValue());
+ domain.setTemporalDomain(temporal);
+ }
+
+ desc.setDomain(domain);
+
+ // The coverage Range
+ RangeType wcsRange = new RangeType();
+ Iterator<RangeElement> rangeIt = cov.getRangeIterator();
+
+ while (rangeIt.hasNext()) {
+ RangeElement range = rangeIt.next();
+ FieldType field = new FieldType();
+
+ field.setIdentifier(range.getName());
+ UnNamedDomainType domtype = new UnNamedDomainType();
+ AnyValue anyVal = new AnyValue();
+ domtype.setAnyValue(anyVal);
+ DomainMetadataType dommeta = new DomainMetadataType();
+
+ dommeta.setValue(range.getType());
+ domtype.setDataType(dommeta);
+ field.setDefinition(domtype);
+
+ InterpolationMethods interp = new InterpolationMethods();
+
+ InterpolationMethodType meth = new InterpolationMethodType();
+
+ meth.setValue(cov.getInterpolationDefault());
+ meth.setNullResistance(cov.getNullResistanceDefault());
+ interp.setDefaultMethod(meth);
+
+ Iterator<InterpolationMethod> interpIt = cov.getInterpolationMethodIterator();
+
+ while (interpIt.hasNext()) {
+ InterpolationMethod wcpsInterp = interpIt.next();
+
+ meth = new InterpolationMethodType();
+ meth.setValue(wcpsInterp.getInterpolationType());
+ meth.setNullResistance(wcpsInterp.getNullResistance());
+ if ((wcpsInterp.getInterpolationType().equals(interp.getDefaultMethod().getValue()) == false) || (wcpsInterp.getNullResistance().equals(interp.getDefaultMethod().getNullResistance()) == false)) {
+ interp.getOtherMethod().add(meth);
+ }
+ }
+
+ field.setInterpolationMethods(interp);
+ wcsRange.getField().add(field);
+ }
+ desc.setRange(wcsRange);
+
+ // Supported formats for GetCoverage: known rasdaman encoders
+ String[] mimetypes = meta.getMimetypesList();
+
+ for (int i = 0; i < mimetypes.length; i++) {
+ String format = mimetypes[i];
+ desc.getSupportedFormat().add(format);
+ }
+
+ // Available CRSs for current coverage
+ desc.getSupportedCRS().add(DomainElement.IMAGE_CRS);
+ if (cov.getCrs() != null) {
+ desc.getSupportedCRS().add(DomainElement.WGS84_CRS);
+ }
+
+ LOG.trace("Done building the Coverage Description for coverage '" + name + "'.");
+
+ return desc;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java b/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java
new file mode 100644
index 0000000..aaa84c0
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java
@@ -0,0 +1,295 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.core;
+
+import petascope.wcs.server.exceptions.WCSException;
+import java.sql.SQLException;
+import java.util.Iterator;
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+import net.opengis.ows.v_1_0_0.CodeType;
+import net.opengis.ows.v_1_0_0.ContactType;
+import net.opengis.ows.v_1_0_0.OnlineResourceType;
+import net.opengis.ows.v_1_0_0.ResponsiblePartySubsetType;
+import net.opengis.ows.v_1_0_0.ServiceProvider;
+import net.opengis.wcs.ows.v_1_1_0.AllowedValues;
+import net.opengis.wcs.ows.v_1_1_0.DCP;
+import net.opengis.wcs.ows.v_1_1_0.DomainType;
+import net.opengis.wcs.ows.v_1_1_0.HTTP;
+import net.opengis.wcs.ows.v_1_1_0.Operation;
+import net.opengis.wcs.ows.v_1_1_0.OperationsMetadata;
+import net.opengis.wcs.ows.v_1_1_0.ServiceIdentification;
+import net.opengis.wcs.ows.v_1_1_0.ValueType;
+import net.opengis.wcs.v_1_1_0.Capabilities;
+import net.opengis.wcs.v_1_1_0.Contents;
+import net.opengis.wcs.v_1_1_0.CoverageSummaryType;
+import net.opengis.wcs.v_1_1_0.GetCapabilities;
+import petascope.wcps.server.core.DbMetadataSource;
+import petascope.wcps.server.core.Metadata;
+import petascope.wcps.server.exceptions.ResourceException;
+
+import javax.xml.XMLConstants;
+import net.opengis.ows.v_1_0_0.AddressType;
+import net.opengis.wcs.ows.v_1_1_0.RequestMethodType;
+import petascope.ConfigManager;
+import petascope.wcs.server.exceptions.InternalSqlException;
+import petascope.wcs.server.exceptions.InvalidParameterValueException;
+import petascope.wcs.server.exceptions.NoApplicableCodeException;
+
+/**
+ * This class takes a WCS GetCapabilities XML request and executes request,
+ * building the corresponding XML respose.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class executeGetCapabilities {
+
+ private GetCapabilities input;
+ private Capabilities output;
+ private boolean finished;
+ private DbMetadataSource meta;
+
+ /**
+ * Default constructor
+ * @param cap GetCapabilities object, a WCS (or WCPS) request
+ * @param metadataDbPath Path to the "dbparams.properties" file
+ */
+ public executeGetCapabilities(GetCapabilities cap, DbMetadataSource source) throws WCSException {
+ input = cap;
+ output = new Capabilities();
+ meta = source;
+ finished = false;
+ }
+
+ /**
+ * Main method of this class. Retrieves the response to the GetCapabilities
+ * request given to the constructor. If needed, it also calls <b>process()</b>
+ * @return a Capabilities object.
+ * @throws wcs_web_service.WCSException
+ */
+ public Capabilities get() throws WCSException {
+ if (finished == false) {
+ process();
+ }
+ if (finished == false) {
+ throw new NoApplicableCodeException("Could not execute the GetCapabilities request! "
+ + "Please see the other errors...");
+ }
+ return output;
+ }
+
+ /**
+ * Computes the response to the GetCapabilities request given to the constructor.
+ * @throws wcs_web_service.WCSException
+ */
+ public void process() throws WCSException {
+ if (!input.SERVICE.equalsIgnoreCase("WCS")) {
+ throw new InvalidParameterValueException("Service");
+ }
+
+ try {
+ buildField1(); // Service Identification
+ buildField2(); // Service Provider
+ buildField3(); // Operations Metadata
+ buildField4(); // Contents
+
+ finishBuild(); // Add the remaining required attributes
+ finished = true;
+ } catch (SQLException se) {
+ finished = false;
+ throw new InternalSqlException(se.getMessage(), se);
+ }
+
+ }
+
+ /**
+ * Builds the output node "Service Identification"
+ */
+ private void buildField1() {
+ ServiceIdentification ident = new ServiceIdentification();
+ ident.setTitle("PetaScope");
+ ident.setAbstract("PetaScope is a suite of OGC web-services comprising of "
+ + "WCS, WCS-T and WCPS. It has been developed at Jacobs University, and "
+ + "is mentained by the Jacobs University. Copyright Peter Baumann");
+ CodeType code = new CodeType();
+ code.setValue("WCS");
+ ident.setServiceType(code);
+ ident.getServiceTypeVersion().add("1.1.0");
+ ident.setFees("NONE");
+
+ output.setServiceIdentification(ident);
+ }
+
+ /**
+ * Builds the output node "Service Provider"
+ */
+ private void buildField2() {
+ ServiceProvider prov = new ServiceProvider();
+ prov.setProviderName("Jacobs University Bremen");
+ OnlineResourceType site = new OnlineResourceType();
+ site.setHref("http://www.petascope.org/");
+ prov.setProviderSite(site);
+ ResponsiblePartySubsetType resp = new ResponsiblePartySubsetType();
+ resp.setIndividualName("Prof. Dr. Peter Baumann");
+ CodeType role = new CodeType();
+ role.setValue("Project Leader");
+ resp.setRole(role);
+ ContactType contact = new ContactType();
+ AddressType addr = new AddressType();
+ addr.getElectronicMailAddress().add("p.baumann@jacobs-university.de");
+ addr.setCountry("Germany");
+ addr.setCity("Bremen");
+ addr.setPostalCode("28717");
+ contact.setAddress(addr);
+ resp.setContactInfo(contact);
+ prov.setServiceContact(resp);
+
+ output.setServiceProvider(prov);
+ }
+
+ /**
+ * Builds the output node "Operations Metadata"
+ * @throws java.sql.SQLException
+ */
+ private void buildField3() throws SQLException {
+ OperationsMetadata opmeta = new OperationsMetadata();
+
+ Operation op1 = new Operation();
+ op1.setName("GetCapabilities");
+ DomainType postE = new DomainType();
+ postE.setName("PostEncoding");
+ AllowedValues val1 = new AllowedValues();
+ ValueType valX = new ValueType();
+ valX.setValue("XML");
+ val1.getValueOrRange().add(valX);
+ postE.setAllowedValues(val1);
+ op1.getConstraint().add(postE);
+
+ DomainType store = new DomainType();
+ store.setName("store");
+ AllowedValues val2 = new AllowedValues();
+ ValueType v = new ValueType();
+ v.setValue("false");
+ val2.getValueOrRange().add(v);
+ store.setAllowedValues(val2);
+ op1.getParameter().add(store);
+ DCP dcp = new DCP();
+ HTTP http = new HTTP();
+ RequestMethodType post = new RequestMethodType();
+ post.setHref(ConfigManager.PETASCOPE_SERVLET_URL);
+ post.setType("simple");
+ http.getGetOrPost().add(new JAXBElement<RequestMethodType>(
+ new QName("http://www.opengis.net/wcs/1.1/ows", "Post",
+ XMLConstants.DEFAULT_NS_PREFIX), RequestMethodType.class, post));
+ dcp.setHTTP(http);
+ op1.getDCP().add(dcp);
+ DomainType paramOnlyXml = new DomainType();
+ paramOnlyXml.setName("Format");
+ AllowedValues vals = new AllowedValues();
+ ValueType val = new ValueType();
+ val.setValue("text/xml");
+ vals.getValueOrRange().add(val);
+ paramOnlyXml.setAllowedValues(vals);
+ op1.getParameter().add(paramOnlyXml);
+ opmeta.getOperation().add(op1);
+
+ Operation op2 = new Operation();
+ op2.setName("GetCoverage");
+ op2.getConstraint().add(postE); // POST Encoding accepts only XML
+ op2.getParameter().add(store); // Store parameter: not implemented
+ op2.getDCP().add(dcp); // HTTP request URL
+ op2.getConstraint().add(paramOnlyXml);
+ opmeta.getOperation().add(op2);
+
+ Operation op3 = new Operation();
+ op3.setName("DescribeCoverage");
+ op3.getConstraint().add(postE); // POST Encoding accepts only XML
+ op3.getParameter().add(store); // Store parameter: not implemented
+ op3.getDCP().add(dcp); // HTTP request URL
+ op3.getConstraint().add(paramOnlyXml);
+ opmeta.getOperation().add(op3);
+
+ Operation op4 = new Operation();
+ op4.setName("ProcessCoverages");
+ op4.getConstraint().add(postE); // POST Encoding accepts only XML
+ op4.getParameter().add(store); // Store parameter: not implemented
+ op4.getDCP().add(dcp); // HTTP request URL
+ op4.getConstraint().add(paramOnlyXml);
+ opmeta.getOperation().add(op4);
+
+ Operation op5 = new Operation();
+ op5.setName("Transaction");
+ op5.getConstraint().add(postE); // POST Encoding accepts only XML
+ op5.getParameter().add(store); // Store parameter: not implemented
+ op5.getDCP().add(dcp); // HTTP request URL
+ op5.getConstraint().add(paramOnlyXml);
+ opmeta.getOperation().add(op5);
+
+ output.setOperationsMetadata(opmeta);
+ }
+
+ /**
+ * Builds the output node "Contents"
+ * @throws java.sql.SQLException
+ */
+ private void buildField4() {
+ Contents cont = new Contents();
+ Iterator<String> coverages = null;
+
+ try {
+ coverages = meta.coverages().iterator();
+ } catch (ResourceException e) {
+ }
+ while (coverages.hasNext()) {
+ Metadata metadata = null;
+ try {
+ metadata = meta.read(coverages.next());
+ } catch (Exception e) {
+ }
+ String covName = metadata.getCoverageName();
+ CoverageSummaryType sum = new CoverageSummaryType();
+ sum.setAbstract(metadata.getAbstract());
+ sum.setTitle(metadata.getTitle());
+
+ // code holds the coverage value
+ CodeType code = new CodeType();
+ code.setValue(covName);
+ // code is encapsulated in JAXBElement "jelem"
+ JAXBElement<String> jelem =
+ new JAXBElement<String>(
+ new QName("http://www.opengis.net/wcs/1.1", "Identifier", XMLConstants.DEFAULT_NS_PREFIX),
+ String.class, covName);
+ // Insert "jelem" into this coveragesummary
+ sum.getRest().add(jelem);
+
+ // Add this CoverageSummary to the list of coverage summaries, to make up the Contents
+ cont.getCoverageSummary().add(sum);
+ }
+
+ output.setContents(cont);
+ }
+
+ private void finishBuild() {
+ /* WCS Standard Version ! */
+ output.setVersion("1.1.0");
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java b/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java
new file mode 100644
index 0000000..70cb368
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ActionNotSupportedException extends WCSException
+{
+ private final static String error = "ActionNotSupported";
+
+ public ActionNotSupportedException(String message)
+ {
+ super(error, message);
+ }
+
+ public ActionNotSupportedException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java b/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java
new file mode 100644
index 0000000..118eda1
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class BadResponseHandlerException extends WCSException
+{
+ private static final String error = "BadResponseHandler";
+
+ public BadResponseHandlerException(String message)
+ {
+ super(error, message);
+ }
+
+ public BadResponseHandlerException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java b/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java
new file mode 100644
index 0000000..610f1d6
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InputOutputException extends WCSException
+{
+ private static final String error = "InputOutputError";
+
+ public InputOutputException(String message)
+ {
+ super(error, message);
+ }
+
+ public InputOutputException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java b/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java
new file mode 100644
index 0000000..3680dae
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InternalComponentException extends WCSException
+{
+ private static final String error = "InternalComponentError";
+
+ public InternalComponentException(String message)
+ {
+ super(error, message);
+ }
+
+ public InternalComponentException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java b/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java
new file mode 100644
index 0000000..1ae95ce
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InternalSqlException extends WCSException
+{
+ private static final String error = "InternalSQLError";
+
+ public InternalSqlException(String message)
+ {
+ super(error, message);
+ }
+
+ public InternalSqlException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java
new file mode 100644
index 0000000..ae863c2
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidParameterValueException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public InvalidParameterValueException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidParameterValueException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java
new file mode 100644
index 0000000..a324837
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidPropertyValueException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public InvalidPropertyValueException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidPropertyValueException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java
new file mode 100644
index 0000000..9c17239
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidRequestException extends WCSException
+{
+ private static final String error = "InvalidRequest";
+
+ public InvalidRequestException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidRequestException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java
new file mode 100644
index 0000000..41b2241
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidServiceConfigurationException extends WCSException
+{
+ private final static String error = "ActionNotSupported";
+
+ public InvalidServiceConfigurationException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidServiceConfigurationException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java
new file mode 100644
index 0000000..d075084
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class InvalidTemporalMetadataException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public InvalidTemporalMetadataException(String message)
+ {
+ super(error, message);
+ }
+
+ public InvalidTemporalMetadataException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java b/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java
new file mode 100644
index 0000000..22f7897
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class MaliciousQueryException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public MaliciousQueryException(String message)
+ {
+ super(error, message);
+ }
+
+ public MaliciousQueryException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java b/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java
new file mode 100644
index 0000000..7ff6aa4
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class MissingParameterValueException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public MissingParameterValueException(String message)
+ {
+ super(error, message);
+ }
+
+ public MissingParameterValueException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java b/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java
new file mode 100644
index 0000000..e0cff7a
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class MultiBandImagesNotSupportedException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public MultiBandImagesNotSupportedException(String message)
+ {
+ super(error, message);
+ }
+
+ public MultiBandImagesNotSupportedException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java b/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java
new file mode 100644
index 0000000..0e23528
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class NoApplicableCodeException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public NoApplicableCodeException(String message)
+ {
+ super(error, message);
+ }
+
+ public NoApplicableCodeException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java b/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java
new file mode 100644
index 0000000..5cec9ce
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class NodeParsingNotImplementedException extends WCSException
+{
+ private static final String error = "NodeParsingNotImplemented";
+
+ public NodeParsingNotImplementedException(String message)
+ {
+ super(error, message);
+ }
+
+ public NodeParsingNotImplementedException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java b/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java
new file mode 100644
index 0000000..c3f8d25
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class NotEnoughStorageException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public NotEnoughStorageException(String message)
+ {
+ super(error, message);
+ }
+
+ public NotEnoughStorageException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java b/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java
new file mode 100644
index 0000000..9f42df1
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RasdamanRequestFailedException extends WCSException
+{
+ private final static String error = "InvalidParameterValue";
+
+ public RasdamanRequestFailedException(String message)
+ {
+ super(error, message);
+ }
+
+ public RasdamanRequestFailedException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java b/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java
new file mode 100644
index 0000000..6bbb3e3
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RasdamanUnavailableException extends WCSException
+{
+ private final static String error = "InvalidParameterValue";
+
+ public RasdamanUnavailableException(String message)
+ {
+ super(error, message);
+ }
+
+ public RasdamanUnavailableException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java b/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java
new file mode 100644
index 0000000..05ec45b
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ServletConnectionException extends WCSException
+{
+ private static final String error = "InvalidParameterValue";
+
+ public ServletConnectionException(String message)
+ {
+ super(error, message);
+ }
+
+ public ServletConnectionException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java b/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java
new file mode 100644
index 0000000..934fb47
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class UnsupportedCombinationException extends WCSException
+{
+ private final static String error = "UnsupportedCombination";
+
+ public UnsupportedCombinationException(String message)
+ {
+ super(error, message);
+ }
+
+ public UnsupportedCombinationException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/WCSException.java b/petascope/src/petascope/wcs/server/exceptions/WCSException.java
new file mode 100644
index 0000000..556cf03
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/WCSException.java
@@ -0,0 +1,148 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+
+
+package petascope.wcs.server.exceptions;
+
+//~--- non-JDK imports --------------------------------------------------------
+
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+import net.opengis.ows.v_1_0_0.ExceptionType;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.Arrays;
+import petascope.ConfigManager;
+
+/**
+ * Private Exception superclass for the WCS server.
+ * This class can return an error report, than can be marshalled into a
+ * WCS-standard compliant XML structure describing the error that has happened.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WCSException extends Exception
+{
+// private static Logger LOG = LoggerFactory.getLogger(WCSException.class);
+
+ /*
+ private String[] errorCodes =
+ {
+ "MissingParameterValue", "InvalidParameterValue", "NoApplicableCode",
+ "UnsupportedCombination", "NotEnoughStorage",
+ "MaliciousQuery", "ActionNotSupported", "XmlStructuresError",
+ "BadResponseHandler", "MultiBandImagesNotSupported", "RasdamanUnavailable",
+ "ServletConnectionError", "XmlInputNotValid", "InvalidPropertyValue",
+ "InternalWcpsError", "InternalSqlError", "RasdamanRequestFailed",
+ "NodeParsingNotImplemented", "IOConnectionError", "InvalidTemporalMetadata",
+ "InvalidRequestString"
+ };
+ */
+ private ExceptionType item;
+ private ExceptionReport report;
+ private String errorCode;
+ private String errorDetail = "";
+
+ /**
+ * Default (minimal) constructor
+ * @param error Error Code
+ * @param detail Detailed message about the error
+ */
+ protected WCSException(String error, String detail)
+ {
+ super();
+ errorCode = error;
+ errorDetail = detail;
+
+ createReport();
+ }
+
+ /**
+ * Convenience Constructor
+ * @param error Error Code
+ * @param detail Detailed message about the error
+ * @param e The cause of the current exception.
+ */
+ protected WCSException(String error, String detail, Exception e)
+ {
+ super(e);
+ errorCode = error;
+ errorDetail = detail;
+ createReport();
+ }
+
+ private void createReport()
+ {
+ report = new ExceptionReport();
+ report.setLanguage(ConfigManager.WCST_LANGUAGE);
+ report.setVersion(ConfigManager.WCST_VERSION);
+
+ item = new ExceptionType();
+ item.setExceptionCode(errorCode);
+ item.setLocator(errorDetail);
+ report.getException().add(item);
+ }
+
+ /** Return the error code.
+ *
+ * @return
+ */
+ public String getErrorCode()
+ {
+ return errorCode;
+ }
+
+ /** Return the detailed error message.
+ *
+ * @return
+ */
+ public String getErrorDetail()
+ {
+ return errorDetail;
+ }
+
+ /**
+ * Retrieves a data structure that can be later marshalled into a XML
+ * "ExceptionReport" document.
+ * @return ExceptionReport object
+ */
+ public ExceptionReport getReport()
+ {
+ return report;
+ }
+
+ /**
+ * Adds text to this exception's detail message.
+ * @param msg
+ */
+ public void appendErrorDetail(String msg)
+ {
+ this.errorDetail += msg;
+ createReport();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return this.errorDetail;
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java b/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java
new file mode 100644
index 0000000..f1dcde8
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WcsRuntimeException extends WCSException
+{
+ private static final String error = "RuntimeException";
+
+ public WcsRuntimeException(String message)
+ {
+ super(error, message);
+ }
+
+ public WcsRuntimeException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java b/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java
new file mode 100644
index 0000000..e9ea6ea
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class XmlNotValidException extends WCSException
+{
+ private static final String error = "XmlDocumentNotValid";
+
+ public XmlNotValidException(String message)
+ {
+ super(error, message);
+ }
+
+ public XmlNotValidException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java b/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java
new file mode 100644
index 0000000..66c244b
--- /dev/null
+++ b/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcs.server.exceptions;
+
+/**
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class XmlStructuresException extends WCSException
+{
+ private static final String error = "XmlStructuresError";
+
+ public XmlStructuresException(String message)
+ {
+ super(error, message);
+ }
+
+ public XmlStructuresException(String message, Exception e)
+ {
+ super(error, message, e);
+ }
+}
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml
new file mode 100644
index 0000000..c1224e7
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/requestDescribeCoverage.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:DescribeCoverage xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 ../wcsAll.xsd'
+ service="WCS" version="2.0.0">
+ <wcs:id gml:id="rgb"/>
+</wcs:DescribeCoverage>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml b/petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml
new file mode 100644
index 0000000..b7966cb
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/requestGetCapabilities.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:GetCapabilities xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:ows='http://www.opengis.net/ows/1.1'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 ../wcsAll.xsd'
+ service="WCS" version="2.0.0">
+ <ows:AcceptVersions>
+ <ows:Version>2.0.0</ows:Version>
+ </ows:AcceptVersions>
+</wcs:GetCapabilities>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml
new file mode 100644
index 0000000..5195d36
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/requestGetCoverage.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:GetCoverage xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/wcs/2.0 ../wcsAll.xsd"
+ service="WCS" version="2.0.0">
+ <wcs:id gml:id="rgb"/>
+ <wcs:trimDimension>
+ <wcs:dimension>x</wcs:dimension>
+ <wcs:trimLow>200</wcs:trimLow>
+ <wcs:trimHigh>299</wcs:trimHigh>
+ </wcs:trimDimension>
+ <wcs:trimDimension>
+ <wcs:dimension>y</wcs:dimension>
+ <wcs:trimLow>200</wcs:trimLow>
+ <wcs:trimHigh>300</wcs:trimHigh>
+ </wcs:trimDimension>
+</wcs:GetCoverage>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml
new file mode 100644
index 0000000..544e62f
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/responseDescribeCoverage.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:CoverageDescriptions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 ../wcsAll.xsd'>
+ <wcs:CoverageDescription gml:id="coverage1">
+ <domainSet>
+ <Grid dimension="2" gml:id="grid1">
+ <limits>
+ <GridEnvelope>
+ <!-- This is a 5-by-3 matrix -->
+ <low>1 1</low>
+ <high>5 3</high>
+ </GridEnvelope>
+ </limits>
+ <axisLabels>xAxis yAxis</axisLabels>
+ </Grid>
+ </domainSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="RangeStructure1">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Band1" uom="W/cm^2">
+ <gml:name>band1</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsignedByte</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <wcs:ServiceParameters>
+ <wcs:supportedCrsList></wcs:supportedCrsList>
+ <wcs:supportedFormatList>application/xml</wcs:supportedFormatList>
+ </wcs:ServiceParameters>
+ </wcs:CoverageDescription>
+</wcs:CoverageDescriptions>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml
new file mode 100644
index 0000000..c5485e9
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCapabilities.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:Capabilities xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:ows='http://www.opengis.net/ows/1.1'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/ows/1.1'
+ xmlns:xlink='http://www.w3.org/1999/xlink'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 ../wcsAll.xsd' version="2.0.0">
+ <ServiceIdentification>
+ <Title>petascope</Title>
+ <Abstract>WCS Server developed at jacobs University</Abstract>
+ <ServiceType>OGC WCS</ServiceType>
+ <ServiceTypeVersion>2.0.0</ServiceTypeVersion>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:protocol:post</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:netcdf</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0</Profile>
+ </ServiceIdentification>
+ <ServiceProvider>
+ <ProviderName>Jacobs University Bremen</ProviderName>
+ <ProviderSite xlink:href="http://www.jacobs-university.de/"/>
+ <ServiceContact>
+ <IndividualName>Mr. X</IndividualName>
+ <PositionName>Developer</PositionName>
+ <ContactInfo>
+ <Phone>
+ <Voice></Voice>
+ </Phone>
+ </ContactInfo>
+ </ServiceContact>
+ </ServiceProvider>
+ <OperationsMetadata>
+ <Operation name="GetCapabilities">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://server:port/GetCapabilitiesURL"/>
+ </HTTP>
+ </DCP>
+ </Operation>
+ <Operation name="DescribeCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://server:port/DescribeCoverageURL"/>
+ </HTTP>
+ </DCP>
+ </Operation>
+ <Operation name="GetCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://server:port/GetCoverageURL"/>
+ </HTTP>
+ </DCP>
+ </Operation>
+ </OperationsMetadata>
+ <wcs:Contents>
+ <wcs:id gml:id="coverage1"/>
+ <wcs:id gml:id="coverage2"/>
+ <wcs:id gml:id="coverage3"/>
+ </wcs:Contents>
+</wcs:Capabilities>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml
new file mode 100644
index 0000000..a4c6fd3
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/responseGetCoverage.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:GridCoverage xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0/gml ../gml/gmlwcsAll.xsd' gml:id="coverage1">
+ <domainSet>
+ <Grid dimension="2" gml:id="grid1">
+ <limits>
+ <GridEnvelope>
+ <!-- This is a 5-by-3 matrix -->
+ <low>1 1</low>
+ <high>5 3</high>
+ </GridEnvelope>
+ </limits>
+ <axisLabels>xAxis yAxis</axisLabels>
+ </Grid>
+ </domainSet>
+ <rangeSet>
+ <DataBlock>
+ <rangeParameters/>
+ <tupleList>
+ 1 2 3 4 5
+ 6 7 8 9 10
+ 11 12 13 14 15
+ </tupleList>
+ </DataBlock>
+ </rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="RangeStructure1">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Band1" uom="W/cm^2">
+ <gml:name>band1</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsignedByte</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+</gmlwcs:GridCoverage>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml
new file mode 100644
index 0000000..047caed
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/wcsDescribeCoverage.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:CoverageDescriptions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 http://localhost:8080/PetaScope/schemas/wcsAll.xsd'>
+ <wcs:CoverageDescription gml:id="rgb">
+ <domainSet>
+ <Grid dimension="2" gml:id="gridrgb">
+ <limits>
+ <GridEnvelope>
+ <low>0 0 </low>
+ <high>399 343 </high>
+
+ </GridEnvelope>
+ </limits>
+ <axisLabels>x y </axisLabels>
+ </Grid>
+ </domainSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="rangeStructure-rgb">
+ <gmlwcs:rangeField>
+
+ <gmlwcs:RangeField gml:id="range-1-red" uom="none">
+ <gml:name>red</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+ <gmlwcs:nilValueList></gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-green" uom="none">
+ <gml:name>green</gml:name>
+
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+ <gmlwcs:nilValueList></gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-blue" uom="none">
+ <gml:name>blue</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+
+ <gmlwcs:nilValueList></gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <wcs:ServiceParameters>
+ <wcs:supportedCrsList/>
+ <wcs:supportedFormatList>application/xml</wcs:supportedFormatList>
+
+ </wcs:ServiceParameters>
+ </wcs:CoverageDescription>
+
+</wcs:CoverageDescriptions>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml
new file mode 100644
index 0000000..3d33e03
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCapabilities.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:Capabilities xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:ows='http://www.opengis.net/ows/1.1'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/ows/1.1'
+ xmlns:xlink='http://www.w3.org/1999/xlink'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 http://localhost:8080/PetaScope/schemas/wcsAll.xsd' version="2.0.0">
+ <ServiceIdentification>
+ <Title>WCS 2.0 Coverage Server @ Jacobs University</Title>
+ <Abstract>WCS 2.0 Server developed at jacobs University</Abstract>
+ <ServiceType>OGC WCS</ServiceType>
+ <ServiceTypeVersion>2.0.0</ServiceTypeVersion>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:protocol:post</Profile>
+
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0</Profile>
+ </ServiceIdentification>
+ <ServiceProvider>
+ <ProviderName>Jacobs University Bremen</ProviderName>
+ <ows:ProviderSite xlink:href="http://www.petascope.org/"/>
+ <ServiceContact>
+
+ <ows:IndividualName>Prof. Dr. Peter Baumann</ows:IndividualName>
+ <ows:ContactInfo>
+ <ows:Address>
+ <ows:City>Bremen</ows:City>
+ <ows:PostalCode>28717</ows:PostalCode>
+ <ows:Country>Germany</ows:Country>
+ <ows:ElectronicMailAddress>p.baumann@jacobs-university.de</ows:ElectronicMailAddress>
+
+ </ows:Address>
+ </ows:ContactInfo>
+ <ows:Role>Project Leader</ows:Role>
+ </ServiceContact>
+ </ServiceProvider>
+ <OperationsMetadata>
+ <Operation name="GetCapabilities">
+ <DCP>
+
+ <HTTP>
+ <Get xlink:href="http://localhost:8080/PetaScope/earthlook"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+ </AllowedValues>
+
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+ <Operation name="DescribeCoverage">
+
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://localhost:8080/PetaScope/earthlook"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+
+ <Operation name="GetCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="http://localhost:8080/PetaScope/earthlook"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+
+ </OperationsMetadata>
+ <wcs:Contents>
+ <wcs:id gml:id="NIR"/>
+ <wcs:id gml:id="Waha_SEGY"/>
+ <wcs:id gml:id="mr"/>
+ <wcs:id gml:id="climate_clouds"/>
+ <wcs:id gml:id="rgb"/>
+ <wcs:id gml:id="climate_earth"/>
+ <wcs:id gml:id="climate_temperature"/>
+ <wcs:id gml:id="Modis"/>
+ <wcs:id gml:id="TP"/>
+ <wcs:id gml:id="whatevereeeee"/>
+ <wcs:id gml:id="Boonsville_SEGY"/>
+ <wcs:id gml:id="mowglie"/>
+ <wcs:id gml:id="NN3_2"/>
+ <wcs:id gml:id="NN3_3"/>
+ <wcs:id gml:id="NN3_1"/>
+ <wcs:id gml:id="NN3_6"/>
+ <wcs:id gml:id="NN3_7"/>
+ <wcs:id gml:id="NN3_4"/>
+ <wcs:id gml:id="NN3_10"/>
+ <wcs:id gml:id="NN3_5"/>
+ <wcs:id gml:id="nrg"/>
+ <wcs:id gml:id="NN3_11"/>
+ <wcs:id gml:id="NN3_8"/>
+ <wcs:id gml:id="NN3_9"/>
+ </wcs:Contents>
+ <wcs:WcsServiceMetadata />
+
+</wcs:Capabilities>
diff --git a/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml
new file mode 100644
index 0000000..371a714
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/Examples/wcsGetCoverage.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:GridCoverage xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0/gml http://kahlua.eecs.jacobs-university.de:8080/petascope/schemas/gml/gmlwcsAll.xsd' gml:id="rgb0.2964005133273092">
+ <domainSet>
+ <Grid dimension="2" gml:id="grid-rgb">
+ <limits>
+ <GridEnvelope>
+ <low>200 200</low>
+ <high>219 209</high>
+ </GridEnvelope>
+
+ </limits>
+ <axisLabels>x y</axisLabels>
+ </Grid>
+ </domainSet>
+ <rangeSet>
+ <DataBlock>
+ <rangeParameters/>
+ <tupleList>
+
+ 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
+ </tupleList>
+ </DataBlock>
+ </rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="rangeStructure-1">
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-red">
+ <gml:name>red</gml:name>
+
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+ <gmlwcs:nilValueList>0</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-green">
+ <gml:name>green</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+
+ <gmlwcs:nilValueList>0</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="range-1-blue">
+ <gml:name>blue</gml:name>
+ <gmlwcs:dataType>urn:ogc:def:dataType:OGC:1.1:unsigned int</gmlwcs:dataType>
+ <gmlwcs:nilValueList>0</gmlwcs:nilValueList>
+
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+</gmlwcs:GridCoverage>
diff --git a/petascope/src/petascope/wcs2/schemas/SchemaServlet.java b/petascope/src/petascope/wcs2/schemas/SchemaServlet.java
new file mode 100644
index 0000000..231d7a5
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/SchemaServlet.java
@@ -0,0 +1,96 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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 <code>GET</code> and <code>POST</code> 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 <code>GET</code> 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 <code>POST</code> 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
new file mode 100644
index 0000000..994917e
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityConversion.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Conversion xmlns="http://www.opengis.net/gml/3.2"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
+ gml:id="IdentityConversion2D">
+ <!-- Example for a 2-D CRS identity conversion as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <identifier codeSpace="urn:ogc:def:method:WCS-SWG:2.0:">IdentityConversion2D</identifier>
+ <name>Identity Conversion 2D</name>
+ <remarks>none provided </remarks>
+ <scope>not known</scope>
+ <method xlink:href="urn:ogc:def:method:WCS-SWG:2.0:IdentityMethod2D"/>
+</Conversion>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml
new file mode 100644
index 0000000..949036f
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/2dIdentityMethod.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<OperationMethod xmlns="http://www.opengis.net/gml/3.2"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
+ gml:id="IdentityMethod2D">
+ <!-- Example for a 2-D CRS identity transformation as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <identifier codeSpace="urn:ogc:def:method:WCS-SWG:2.0:">IdentityMethod2D</identifier>
+ <name>Identity Method 2D</name>
+ <remarks>Method for use by a Coordinate Conversion for the identity transformation of two coordinates </remarks>
+ <methodFormula>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
+ </methodFormula>
+ <sourceDimensions>2</sourceDimensions>
+ <targetDimensions>2</targetDimensions>
+</OperationMethod>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml
new file mode 100644
index 0000000..519a5a5
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRangeStructure.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:rangeStructure
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/wcs/2.0/gml ../gmlwcsAll.xsd">
+ <!-- Example for a coverage range structure as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- It models the red, green, and blue channel of a Landsat scene. Pixels are defined as unsigned 8-bit quantities where 0 and 255 denote null values. -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <gmlwcs:RangeStructure gml:id="RGB">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Red" uom="W/cm^2">
+ <gml:name>red</gml:name>
+ <gmlwcs:dataType>UnsignedChar</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Green" uom="W/cm^2">
+ <gml:name>green</gml:name>
+ <gmlwcs:dataType>UnsignedChar</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="Blue" uom="W/cm^2">
+ <gml:name>blue</gml:name>
+ <gmlwcs:dataType>UnsignedChar</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+</gmlwcs:rangeStructure>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml
new file mode 100644
index 0000000..9514ae7
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleRectifiedGridCoverage.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:RectifiedGridCoverage
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/wcs/2.0/gml ../gmlwcsAll.xsd"
+ gml:id="Coverage1">
+ <!-- Example for a domain set for a rectified grid coverage as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <gml:domainSet>
+ <gml:RectifiedGrid gml:id="RectifiedGrid1" dimension="2" srsName="urn:ogc:def:crs:EPSG::4326">
+ <gml:limits>
+ <gml:GridEnvelope>
+ <gml:low>0 0</gml:low>
+ <gml:high>9999 9999</gml:high>
+ </gml:GridEnvelope>
+ </gml:limits>
+ <gml:axisLabels>column row</gml:axisLabels>
+ <gml:origin>
+ <gml:Point gml:id="Origin1" srsName="urn:ogc:def:crs:EPSG::4326">
+ <gml:pos>99.9 99.9</gml:pos>
+ </gml:Point>
+ </gml:origin>
+ <gml:offsetVector>1 0</gml:offsetVector>
+ <gml:offsetVector>0 1</gml:offsetVector>
+ </gml:RectifiedGrid>
+ </gml:domainSet>
+ <gml:rangeSet>
+ <gml:File>
+ <gml:rangeParameters xlink:href="TBDurl"/>
+ <gml:fileReference>TBDurlOfFile</gml:fileReference>
+ <gml:fileStructure>TBD</gml:fileStructure>
+ </gml:File>
+ </gml:rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="RangeStructure1">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="White" uom="W/cm^2">
+ <gml:name>white</gml:name>
+ <gmlwcs:dataType>UnsignedChar</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <gml:coverageFunction>
+ <gml:GridFunction>
+ <gml:sequenceRule axisOrder="+1 +2">Linear</gml:sequenceRule>
+ <gml:startPoint>0 0</gml:startPoint>
+ </gml:GridFunction>
+ </gml:coverageFunction>
+</gmlwcs:RectifiedGridCoverage>
+
diff --git a/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml
new file mode 100644
index 0000000..bc9de96
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/Examples/exampleReferenceablGridCoverage.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:ReferenceableGridCoverage
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/wcs/2.0/gml ../gmlwcsAll.xsd"
+ gml:id="Coverage1">
+ <!-- Example for a domain set for a rectified grid coverage containing a ReferencedGridByTransformation as defined in the GML 3.2.1 Application Schema for WCS 2.0 -->
+ <!-- Last updated 2010-01-11 -->
+ <!-- =============================================== -->
+ <gml:domainSet>
+ <gmlwcs:ReferencedGridByTransformation gml:id="ReferencedGrid1" dimension="2" srsName="InternalCRS1">
+ <gml:limits>
+ <gml:GridEnvelope>
+ <gml:low>0 0</gml:low>
+ <gml:high>9999 9999</gml:high>
+ </gml:GridEnvelope>
+ </gml:limits>
+ <gml:axisLabels>Column Row</gml:axisLabels>
+ <gmlwcs:gridCRS>
+ <gml:DerivedCRS gml:id="InternalCRS1">
+ <gml:identifier codeSpace="">InternalCRS1</gml:identifier>
+ <gml:scope>not known</gml:scope>
+ <gml:definedByConversion xlink:href="urn:ogc:coordinateOperation:WCS:2.0:IdentityConversion2D"/>
+ <gml:baseCRS xlink:href="urn:ogc:crs:OGC:1.0:Image:AAA999"/>
+ <gml:derivedCRSType codeSpace="">image</gml:derivedCRSType>
+ <gml:usesCS xlink:href="urn:ogc:def:cs:OGC:1.0:GridCS2d"/>
+ </gml:DerivedCRS>
+ </gmlwcs:gridCRS>
+ <gmlwcs:transformation xlink:href="TBDurl"/>
+ </gmlwcs:ReferencedGridByTransformation>
+ </gml:domainSet>
+ <gml:rangeSet>
+ <gml:File>
+ <gml:rangeParameters xlink:href="TBDurl"/>
+ <gml:fileReference>TBDurlOfFile</gml:fileReference>
+ <gml:fileStructure>TBD</gml:fileStructure>
+ </gml:File>
+ </gml:rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="Panchromatic">
+ <gmlwcs:rangeField >
+ <gmlwcs:RangeField gml:id="White" uom="w/cm^2">
+ <gml:name>white</gml:name>
+ <gmlwcs:dataType>unsignedInteger</gmlwcs:dataType>
+ <gmlwcs:nilValueList>000 255</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <gml:coverageFunction>
+ <gml:GridFunction>
+ <gml:sequenceRule axisOrder="+1 +2">Linear</gml:sequenceRule>
+ <gml:startPoint>0 0</gml:startPoint>
+ </gml:GridFunction>
+ </gml:coverageFunction>
+</gmlwcs:ReferenceableGridCoverage>
+
diff --git a/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd b/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd
new file mode 100644
index 0000000..ae0d949
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/gmlwcsAll.xsd
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:wcsgml="http://www.opengis.net/wcs/2.0/gml"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ elementFormDefault="qualified" version="1.0.0">
+ <annotation>
+ <appinfo>gmlwcsAll.xsd</appinfo>
+ <documentation>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/.
+ </documentation>
+ </annotation>
+ <!-- ========================================================= -->
+ <!-- Includes and imports -->
+ <!-- ========================================================= -->
+ <include schemaLocation="wcsCoverage.xsd"/>
+ <include schemaLocation="wcsGrids.xsd"/>
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd b/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd
new file mode 100644
index 0000000..5643a1d
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/wcsCoverage.xsd
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="1.0.0">
+ <annotation>
+ <appinfo source="urn:x-ogc:specification:wcs:gml-app-schema:schema-xsd:coverage:3.2.1">coverage.xsd</appinfo>
+ <documentation>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/.
+ </documentation>
+ </annotation>
+ <!-- ============================= -->
+ <!-- Includes and imports -->
+ <!-- ============================= -->
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+ <!-- ============================= -->
+ <!-- Body of this schema -->
+ <!-- ============================= -->
+ <element name="AbstractCoverage" type="gmlwcs:CoverageType" abstract="true" substitutionGroup="gml:AbstractCoverage">
+ <annotation>
+ <documentation>Extends gml:AbstractCoverage as needed for WCS 2.0, by adding a rangeStructure property. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="CoverageType">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoverageType">
+ <sequence>
+ <element ref="gmlwcs:rangeStructure"/>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="GridCoverage" type="gmlwcs:CoverageType" substitutionGroup="gmlwcs:AbstractCoverage">
+ <annotation>
+ <documentation>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.
+ </documentation>
+ <documentation>Since this GridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <element name="RectifiedGridCoverage" type="gmlwcs:CoverageType" substitutionGroup="gmlwcs:AbstractCoverage">
+ <annotation>
+ <documentation>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.
+ </documentation>
+ <documentation>Since this RectifiedGridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <element name="ReferenceableGridCoverage" type="gmlwcs:CoverageType" substitutionGroup="gmlwcs:AbstractCoverage">
+ <annotation>
+ <documentation>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.</documentation>
+ <documentation>This equivalent of this element is being added to GML 3.2.1 by approved Change Request 07-112r3. </documentation>
+ <documentation>Since this ReferenceableGridCoverage uses the gmlwcs:CoverageType, it can be used for both discrete and continuous coverages. </documentation>
+ </annotation>
+ </element>
+ <!-- =============================================================
+ RangeStructure defines the structure of a coverage in WCS 2.0
+ ============================================================= -->
+ <element name="rangeStructure" type="gmlwcs:RangeStructurePropertyType">
+ <annotation>
+ <documentation>The rangeStructure property includes or references the RangeStructure, introduced for coverage definitions used by WCS 2.0. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="RangeStructurePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gmlwcs:RangeStructure"/>
+ </sequence>
+ <attributeGroup ref="gml:OwnershipAttributeGroup"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="RangeStructure" type="gmlwcs:RangeStructureType" substitutionGroup="gml:AbstractGML">
+ <annotation>
+ <documentation>The RangeStructure element describes the structure of a coverage's range, introduced for coverage definitions used by WCS 2.0. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="RangeStructureType">
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element ref="gmlwcs:rangeField" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="rangeField" type="gmlwcs:RangeFieldPropertyType">
+ <annotation>
+ <documentation>The RangeField property includes or references one RangeField element. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="RangeFieldPropertyType">
+ <sequence minOccurs="0">
+ <element name="RangeField" type="gmlwcs:RangeFieldType"/>
+ </sequence>
+ <attributeGroup ref="gml:OwnershipAttributeGroup"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="RangeField" type="gmlwcs:RangeFieldType" substitutionGroup="gml:AbstractGML">
+ <annotation>
+ <documentation>The RangeField element describes the structure of one Field of a coverage's range. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="RangeFieldType">
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <annotation>
+ <documentation>The gml:name should be used for the unique identifier of this RangeField. </documentation>
+ </annotation>
+ <sequence>
+ <element name="dataType" type="gmlwcs:DataType"/>
+ <element ref="gmlwcs:nilValueList"/>
+ </sequence>
+ <attribute name="uom" type="gml:UomIdentifier" use="optional">
+ <annotation>
+ <documentation>Identifier of the Unit of Measure applicable to values of this RangeField. </documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================= -->
+ <complexType name="DataType">
+ <simpleContent>
+ <restriction base="gml:CodeType">
+ <attribute name="codeSpace" type="anyURI" use="optional" default="http://schemas.opengis.net/wcs/2.0/gml/wcsDataTypeIdentifiers.xml">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <!-- ============================================================= -->
+ <element name="nilValueList" type="gml:doubleList">
+ <annotation>
+ <documentation>List of the specific values of this RangeField that are used to designate non-valid values. </documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml b/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml
new file mode 100644
index 0000000..bf10663
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/wcsDataTypeIdentifiers.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Dictionary xmlns="http://www.opengis.net/gml/3.2"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
+ gml:id="DataTypeIdentifiers">
+ <description>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/.
+ </description>
+ <identifier codeSpace="">DataTypeIdentifiers</identifier>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="boolean">
+ <description>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"). </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">boolean</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="integer">
+ <description>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. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">long</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedInteger">
+ <description>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. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedInteger</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="byte">
+ <description>Positive or negative integer number with values between -128 anf 127. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">byte</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedByte">
+ <description>Non-negative integer number with values between 0 and 255. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedByte</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="short">
+ <description>Positive or negative integer number with values between -32768 and 32767, which allows for a representation with 16 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">short</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedShort">
+ <description>Non-negative integer number with values between 0 and 65535, which allows for a representation with 16 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedShort</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="int">
+ <description>Positive or negative integer number with values between -2147483648 and 2147483647, which allows for a representation with 32 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">int</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedInt">
+ <description>Non-negative integer number with values between 0 and 4294967295, which allows for a representation with 32 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedInt</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="long">
+ <description>Positive or negative integer number with values between -9223372036854775808 and 9223372036854775807, which allows for a representation with 64 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">long</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="unsignedLong">
+ <description>Non-negative integer number with values between 0 and 18446744073709551616, which allows for a representation with 64 bits. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">unsignedLong</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="float">
+ <description>Single-precision floating point number according to IEEE 754-1985. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">double</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="double">
+ <description>Double-precision floating point number according to IEEE 754-1985. </description>
+ <identifier codeSpace="urn:ogc:def:dataType:OGC:1.1">double</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+</Dictionary>
+
diff --git a/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd b/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd
new file mode 100644
index 0000000..587e25d
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/gml/wcsGrids.xsd
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="1.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsGrids.xsd</appinfo>
+ <documentation>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/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- Includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+ <!-- ============================================================== -->
+ <!-- Elements and types -->
+ <!-- ============================================================== -->
+ <element name="AbstractReferenceableGrid" type="gmlwcs:AbstractReferenceableGridType" abstract="true" substitutionGroup="gml:Grid">
+ <annotation>
+ <documentation>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.
+ </documentation>
+ <documentation>This element and its type are copied from approved Change Request 07-112r3, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractReferenceableGridType" abstract="true">
+ <complexContent>
+ <extension base="gml:GridType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="referenceableGridProperty" type="gmlwcs:ReferenceableGridPropertyType">
+ <annotation>
+ <documentation>This element and its type are copied from approved Change Request 07-112r3, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="ReferenceableGridPropertyType">
+ <sequence>
+ <element ref="gmlwcs:AbstractReferenceableGrid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ <attributeGroup ref="gml:OwnershipAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="ReferencedGridByTransformation" type="gmlwcs:ReferencedGridByTransformationType" substitutionGroup="gmlwcs:AbstractReferenceableGrid">
+ <annotation>
+ <documentation>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. </documentation>
+ <documentation>This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="ReferencedGridByTransformationType">
+ <complexContent>
+ <extension base="gmlwcs:AbstractReferenceableGridType">
+ <sequence>
+ <element ref="gmlwcs:gridCRS" minOccurs="0">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ </element>
+ <choice maxOccurs="unbounded">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ <element name="transformation" type="gml:TransformationPropertyType"/>
+ <element name="concatenatedOperation" type="gml:ConcatenatedOperationPropertyType"/>
+ </choice>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="gridCRS" type="gmlwcs:GridCRSPropertyType">
+ <annotation>
+ <documentation>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. </documentation>
+ <documentation>This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="GridCRSPropertyType">
+ <sequence>
+ <element ref="gml:AbstractCRS"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="ParameterValue" type="gmlwcs:ParameterValueType" substitutionGroup="gml:AbstractGeneralParameterValue">
+ <annotation>
+ <documentation>Extends gml:ParameterValue to also allow values that are a gml:Geometry or a gml:vector. </documentation>
+ <documentation>This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="ParameterValueType">
+ <complexContent>
+ <extension base="gml:AbstractGeneralParameterValueType">
+ <sequence>
+ <choice>
+ <element ref="gml:value"/>
+ <element ref="gml:dmsAngleValue"/>
+ <element ref="gml:stringValue"/>
+ <element ref="gml:integerValue"/>
+ <element ref="gml:booleanValue"/>
+ <element ref="gml:valueList"/>
+ <element ref="gml:integerValueList"/>
+ <element ref="gml:valueFile"/>
+ <element ref="gmlwcs:geometryValue"/>
+ <element ref="gmlwcs:vectorValue"/>
+ </choice>
+ <element ref="gml:operationParameter"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="geometryValue" type="gml:GeometryPropertyType">
+ <annotation>
+ <documentation>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. </documentation>
+ <documentation>This element and its type are copied from Change Request 09-091r1, which adds them to GML 3.2.1. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="vectorValue" type="gml:VectorType">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="SimpleMultiPoint" type="gmlwcs:SimpleMultiPointType" substitutionGroup="gml:AbstractGeometricAggregate">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="SimpleMultiPointType">
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <element name="positions" type="gml:DirectPositionListType"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsAll.xsd b/petascope/src/petascope/wcs2/schemas/wcsAll.xsd
new file mode 100644
index 0000000..21f0e83
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsAll.xsd
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsAll.xsd</appinfo>
+ <documentation>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/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/wcs/2.0/gml" schemaLocation="gml/gmlwcsAll.xsd"/>
+ <include schemaLocation="wcsGetCoverage.xsd"/>
+ <include schemaLocation="wcsDescribeCoverage.xsd"/>
+ <include schemaLocation="wcsGetCapabilities.xsd"/>
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd b/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd
new file mode 100644
index 0000000..c1d5b33
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsCommon.xsd
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:ows="http://www.opengis.net/ows/1.1"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsContents.xsd</appinfo>
+ <appinfo>
+ <GMLProfileSchema>http://schemas.opengis.net/wcs/2.0/gml/gmlwcsAll.xsd</GMLProfileSchema>
+ </appinfo>
+ <documentation>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/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+ <import namespace="http://www.opengis.net/ows/1.1" schemaLocation="http://schemas.opengis.net/ows/1.1.0/owsAll.xsd"/>
+ <!-- ============================================================== -->
+ <!-- elements and types -->
+ <!-- ============================================================== -->
+ <complexType name="RequestBaseType">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ <sequence/>
+ <attribute name="service" type="string" use="required" fixed="WCS">
+ <annotation>
+ <documentation>Service type identifier, where the value is the OWS type abbreviation. For WCS operation requests, the value is "WCS". </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="version" type="wcs:VersionStringType" use="required">
+ <annotation>
+ <documentation>Specification version for WCS version and operation. See Version parameter Subclause 7.3.1 of OWS Common for more information. </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ <simpleType name="VersionStringType">
+ <restriction base="string">
+ <pattern value="2\.0\.\d+"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="id" type="wcs:CoverageIdType">
+ <annotation>
+ <documentation>This element is a wrapper for the gml:id attribute. Needed to allow lists of identifiers. </documentation>
+ </annotation>
+ </element>
+ <complexType name="CoverageIdType">
+ <attribute ref="gml:id"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="ServiceParameters" type="wcs:ServiceParametersType"/>
+ <complexType name="ServiceParametersType">
+ <sequence>
+ <element name="supportedCrsList" type="wcs:CrsListType"/>
+ <element name="supportedFormatList" type="wcs:FormatListType"/>
+ </sequence>
+ </complexType>
+
+ <simpleType name="CrsListType">
+ <list itemType="anyURI"/>
+ </simpleType>
+ <simpleType name="FormatListType">
+ <list itemType="ows:MimeType"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="WcsServiceMetadata" type="wcs:ServiceMetadataType"/>
+ <complexType name="ServiceMetadataType">
+ <sequence>
+ <!-- nothing defined here, it is a container for potential additions done by extensions -->
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Contents" type="wcs:ContentsType"/>
+ <complexType name="ContentsType">
+ <sequence>
+ <element ref="wcs:id" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+</schema>
+
diff --git a/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd b/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd
new file mode 100644
index 0000000..c3c4ec3
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsDescribeCoverage.xsd
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsDescribeCoverage.xsd</appinfo>
+ <appinfo>
+ <GMLProfileSchema>http://schemas.opengis.net/wcs/2.0/gml/gmlwcsAll.xsd</GMLProfileSchema>
+ </appinfo>
+ <documentation>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/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"></import>
+ <import namespace="http://www.opengis.net/wcs/2.0/gml" schemaLocation="gml/gmlwcsAll.xsd"/>
+ <include schemaLocation="wcsCommon.xsd"/>
+ <!-- ============================================================== -->
+ <!-- elements and types -->
+ <!-- ============================================================== -->
+ <element name="DescribeCoverage" type="wcs:DescribeCoverageType">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ </element>
+ <complexType name="DescribeCoverageType">
+ <complexContent>
+ <extension base="wcs:RequestBaseType">
+ <sequence>
+ <element ref="wcs:id" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of identifiers of desired coverages. A client can obtain identifiers by a prior GetCapabilities request, or from a third-party source. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="request" type="string" fixed="DescribeCoverage"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="CoverageDescriptions" type="wcs:CoverageDescriptionsType">
+ <annotation>
+ <documentation>Response from a WCS DescribeCoverage operation, containing one or more coverage descriptions. </documentation>
+ </annotation>
+ </element>
+ <complexType name="CoverageDescriptionsType">
+ <sequence>
+ <element name="CoverageDescription" type="wcs:CoverageDescriptionType" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="CoverageDescriptionType">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractFeatureType">
+ <sequence>
+ <element ref="gml:domainSet"/>
+ <element ref="gmlwcs:rangeStructure"/>
+ <element ref="wcs:ServiceParameters"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml b/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml
new file mode 100644
index 0000000..eff982d
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsExtensions.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Dictionary
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://www.opengis.net/gml/3.2"
+ xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"
+ gml:id="WcsExtensions">
+ <description>
+ 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/.
+ </description>
+ <identifier codeSpace="">WcsExtensions</identifier>
+ <!-- ===================================================== -->
+ <!-- data model extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_dataModel_nilValues">
+ <description>WCS 2.0 extension defining handling of nil values in a coverage. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:dataModel:nilValues">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_dataModel_uncertainty">
+ <description>WCS 2.0 extension defining handling of uncertainty in a coverage. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:dataModel:uncertainty">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- service model extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_metadata">
+ <description>WCS 2.0 extension defining advanced service metadata concepts. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:metadata">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_scaling">
+ <description>WCS 2.0 extension defining scaling and interpolation of coverages. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:scaling">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_crs">
+ <description>WCS 2.0 extension defining coordinate reference system (CRS) handling within coverages. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:crs">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_wcst">
+ <description>WCS 2.0 extension defining transactional (ie, update) services. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_serviceModel_wcps">
+ <description>WCS 2.0 extension defining coverage processing services. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- protocol binding extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_protocol_get">
+ <description>WCS 2.0 extension defining the HTTP GET / KVP protocol encoding. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:protocol:get">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_protocol_post">
+ <description>WCS 2.0 extension defining the HTTP POST / XML protocol encoding. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:protocol:post">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_protocol_soap">
+ <description>WCS 2.0 extension defining the SOAP protocol encoding. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:protocol:soap">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- coverage encoding format extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_coverageFormat_gml">
+ <description>WCS 2.0 extension defining use of the GML coverage encoding format. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:gml">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_coverageFormat_geotiff">
+ <description>WCS 2.0 extension defining use of the GeoTIFF coverage encoding format. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:geotiff">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_coverageFormat_netcdf">
+ <description>WCS 2.0 extension defining use of the NetCDF coverage encoding format. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:coverageFormat:netcdf">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+ <!-- ===================================================== -->
+ <!-- usability extensions -->
+ <!-- ===================================================== -->
+ <dictionaryEntry>
+ <Definition gml:id="wcs_usability_multilinguality">
+ <description>WCS 2.0 extension defining multilingual access to a WCS. </description>
+ <identifier codeSpace="urn:ogc:def:extension:OGC-WCS:2.0:usability:multilinguality">1.0</identifier>
+ </Definition>
+ </dictionaryEntry>
+</Dictionary>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd b/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd
new file mode 100644
index 0000000..9996063
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsGetCapabilities.xsd
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:ows="http://www.opengis.net/ows/1.1"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsGetCapabilities.xsd</appinfo>
+ <documentation>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/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/ows/1.1" schemaLocation="http://schemas.opengis.net/ows/1.1.0/owsAll.xsd"/>
+ <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+ <include schemaLocation="wcsCommon.xsd"/>
+ <!-- ============================================================== -->
+ <!-- elements and types -->
+ <!-- ============================================================== -->
+ <element name="GetCapabilities" type="wcs:GetCapabilitiesType">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ </element>
+ <complexType name="GetCapabilitiesType">
+ <complexContent>
+ <extension base="ows:GetCapabilitiesType">
+ <sequence/>
+ <attribute name="request" type="string" fixed="GetCapabilities"/>
+ <attribute name="service" type="ows:ServiceType" use="required" fixed="WCS"/>
+ <attribute name="version" type="wcs:VersionStringType" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Capabilities" type="wcs:CapabilitiesType">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ </element>
+ <complexType name="CapabilitiesType">
+ <complexContent>
+ <extension base="ows:CapabilitiesBaseType">
+ <sequence>
+ <element ref="wcs:Contents"/>
+ <element ref="wcs:WcsServiceMetadata" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd b/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd
new file mode 100644
index 0000000..57ef8ed
--- /dev/null
+++ b/petascope/src/petascope/wcs2/schemas/wcsGetCoverage.xsd
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/2.0"
+ xmlns:wcs="http://www.opengis.net/wcs/2.0"
+ xmlns:gml="http://www.opengis.net/gml/3.2"
+ xmlns:gmlwcs="http://www.opengis.net/wcs/2.0/gml"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="2.0.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsGetCoverage.xsd</appinfo>
+ <documentation>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/.
+ </documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- includes and imports -->
+ <!-- ============================================================== -->
+ <import namespace="http://www.opengis.net/wcs/2.0/gml" schemaLocation="gml/gmlwcsAll.xsd"/>
+ <include schemaLocation="wcsCommon.xsd"/>
+ <!-- ============================================================== -->
+ <!-- elements and types -->
+ <!-- ============================================================== -->
+ <element name="GetCoverage" type="wcs:GetCoverageType">
+ <annotation>
+ <documentation>Request to a WCS to perform the GetCoverage operation. This operation allows a client to retrieve a subset of one coverage. </documentation>
+ </annotation>
+ </element>
+ <complexType name="GetCoverageType">
+ <complexContent>
+ <extension base="wcs:RequestBaseType">
+ <sequence>
+ <element ref="wcs:id">
+ <annotation>
+ <documentation>Identifier of the coverage that this GetCoverage operation request shall draw from. </documentation>
+ </annotation>
+ </element>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="trimDimension" type="wcs:DimensionTrimType"/>
+ <element name="sliceDimension" type="wcs:DimensionSliceType"/>
+ </choice>
+ </sequence>
+ <attribute name="request" type="string" fixed="GetCoverage"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================= -->
+ <!-- Domain subset types and elements -->
+ <!-- ======================================================= -->
+ <complexType name="DimensionSubsetType" abstract="true">
+ <annotation>
+ <documentation>Definition of the desired subset of the domain of the coverage. This is either a Trim operation, or a Slice operation.</documentation>
+ </annotation>
+ <sequence>
+ <element name="dimension" type="NCName"/>
+ </sequence>
+ </complexType>
+ <!-- ======================================================= -->
+ <complexType name="DimensionTrimType">
+ <annotation>
+ <documentation>Describes the trimming of a coverage's domain axis, between two values.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="wcs:DimensionSubsetType">
+ <sequence>
+ <element name="trimLow" type="double" minOccurs="0"/>
+ <element name="trimHigh" type="double" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================= -->
+ <complexType name="DimensionSliceType">
+ <annotation>
+ <documentation>Describes the slicing of a coverage's domain axis at a particular point.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="wcs:DimensionSubsetType">
+ <sequence>
+ <element name="slicePoint" type="double"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================= -->
+</schema>
+
diff --git a/petascope/src/petascope/wcs2/server/Wcs2Server.java b/petascope/src/petascope/wcs2/server/Wcs2Server.java
new file mode 100644
index 0000000..f7d11eb
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/Wcs2Server.java
@@ -0,0 +1,119 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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
new file mode 100644
index 0000000..d292ad7
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/ops/DescribeCoverage.java
@@ -0,0 +1,203 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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 = "<wcs:CoverageDescription ", endtag = "</wcs:CoverageDescription>";
+ int start = DescribeCoverageResponse.indexOf(starttag);
+ int end = DescribeCoverageResponse.indexOf(endtag);
+
+ coverageDescriptionTemplate = DescribeCoverageResponse.substring(start, end + endtag.length());
+ String newResponse = DescribeCoverageResponse.substring(0, start - 1) + DescribeCoverageResponse.substring(end + endtag.length());
+
+ DescribeCoverageResponse = newResponse;
+
+ /* Find the RangeComponent template string */
+ starttag = "<gmlwcs:rangeField";
+ endtag = "</gmlwcs:rangeField>";
+ start = coverageDescriptionTemplate.indexOf(starttag);
+ end = coverageDescriptionTemplate.indexOf(endtag);
+ rangeComponentTemplate = coverageDescriptionTemplate.substring(start, end + endtag.length());
+ String newTemplate = coverageDescriptionTemplate.substring(0, start - 1) + coverageDescriptionTemplate.substring(end + endtag.length());
+
+ coverageDescriptionTemplate = newTemplate;
+ }
+
+ @Override
+ public String execute(String stringXml) throws WCSException {
+ String output;
+ String desc = "";
+
+ String listOfCoverageDescriptions = "";
+ int start, end;
+
+ start = stringXml.indexOf("gml:id=\"");
+ while (start != -1) {
+ end = stringXml.substring(start + 8).indexOf("\"");
+ String coverageId = stringXml.substring(start + 8, start + 8 + end);
+
+ stringXml = stringXml.substring(start + 8 + end + 1);
+ start = stringXml.indexOf("gml:id=\"");
+
+ // Describe "coverageId"
+ if (meta.existsCoverageName(coverageId)) {
+ Metadata cov = null;
+
+ // Read in coverage metadata
+ try {
+ cov = meta.read(coverageId);
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ throw new NoApplicableCodeException("Metadata for coverage '" + coverageId + "' is not valid.");
+ }
+
+ // Analyze the grid components and their values
+ Iterator<DomainElement> it = cov.getDomainIterator();
+ Iterator<CellDomainElement> 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<RangeElement> it3 = cov.getRangeIterator();
+ Iterator<String> 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<String> nullVals = new HashSet<String>();
+ Iterator<String> it4 = cov.getNullSetIterator();
+ while (it4.hasNext()) {
+ List<String> 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
new file mode 100644
index 0000000..b1d58d5
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/ops/GetCapabilities.java
@@ -0,0 +1,84 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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<String> it;
+
+ try {
+ it = meta.coverages().iterator();
+ xmlListOfCoverages = "";
+ while (it.hasNext()) {
+ xmlListOfCoverages += "<wcs:id gml:id=\"" + it.next() + "\"/>";
+ }
+ } 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
new file mode 100644
index 0000000..788beec
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/ops/GetCoverage.java
@@ -0,0 +1,528 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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 = "<gmlwcs:rangeField", endtag = "</gmlwcs:rangeField>";
+ int start = GetCoverageResponse.indexOf(starttag);
+ int end = GetCoverageResponse.indexOf(endtag);
+ rangeComponentTemplate = GetCoverageResponse.substring(start, end + endtag.length());
+ String newTemplate = GetCoverageResponse.substring(0, start - 1) + GetCoverageResponse.substring(end + endtag.length());
+ GetCoverageResponse = newTemplate;
+
+ /* init XML parser */
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true); // never forget this!
+ try {
+ builder = domFactory.newDocumentBuilder();
+ } catch (Exception e) {
+ throw new NoApplicableCodeException("Error initializing XML parser", e);
+ }
+ }
+
+ @Override
+ public String execute(String stringXml) throws WCSException {
+ String output;
+ Metadata cov;
+
+ try {
+ doc = builder.parse(IOUtils.toInputStream(stringXml));
+ cov = readCoverageMetadata();
+ } catch (SAXException e) {
+ throw new XmlNotValidException("Could not parse input request.", e);
+ } catch (IOException e) {
+ throw new InputOutputException("Could not read input request", e);
+ } catch (XPathExpressionException e) {
+ throw new InternalComponentException("Invalid XPath expression", e);
+ }
+
+ // Analyze input and build trim/slice info structures
+ String subsetting = computeRequestSubsettingLimits(cov);
+ String coverageName = cov.getCoverageName();
+
+ // Evaluate all bands and then perform string processing to get coverage data
+ String coverageData = buildCoverageData(cov, subsetting);
+
+ // Build response xml document
+ output = buildOutputXml(coverageData, cov);
+
+ return output;
+ }
+
+ private NodeList evalXPathList(String query, Object context) throws WCSException {
+ try {
+ LOG.debug("Evaluating XPath: {}", query);
+ XPath xpath = xpathFactory.newXPath();
+
+ xpath.setNamespaceContext(new WcsNamespaceContext());
+ NodeList result = (NodeList) xpath.evaluate(query, context, XPathConstants.NODESET);
+
+ for (int i = 0; i < result.getLength(); i++) {
+ LOG.trace("Result {}: {}", i, result.item(i).getNodeValue());
+ }
+
+ return (NodeList) result;
+ } catch (XPathExpressionException e) {
+ LOG.error("Could not execute XPath expression '{}'", query);
+
+ throw new WcsRuntimeException("Could not execute XPath expression", e);
+ }
+ }
+
+ private String getCoverageName(Document doc) throws WCSException {
+ NodeList nodes = evalXPathList("//wcs:id/@gml:id", doc);
+
+ if (nodes.getLength() != 1) {
+ LOG.error("Could not retrieve coverage name from XML document.");
+
+ return null;
+ }
+
+ return nodes.item(0).getNodeValue();
+ }
+
+ private Metadata readCoverageMetadata() throws WCSException, XPathExpressionException {
+ String coverageId = getCoverageName(doc);
+
+ if (meta.existsCoverageName(coverageId)) {
+ try {
+ Metadata cov = meta.read(coverageId);
+
+ return cov;
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ throw new NoApplicableCodeException("Metadata for coverage '"
+ + coverageId + "' is not valid.");
+ }
+ } else {
+ throw new InvalidParameterValueException("gml:id");
+ }
+ }
+
+ /** Computes the domain of the new coverage, and returns a string that can be
+ * used to do subsetting on the original coverage. Also computes the low, high
+ * and the axis labels for the new coverage.
+ *
+ * @param coverage
+ * @return
+ * @throws WCSException
+ */
+ private String computeRequestSubsettingLimits(Metadata coverage) throws WCSException {
+ int dims = coverage.getDimension(), i = 0;
+ String[] limits = new String[dims];
+ BigInteger[] high = new BigInteger[dims];
+ BigInteger[] low = new BigInteger[dims];
+ String[] axesLabels = new String[dims];
+ boolean[] sliced = new boolean[dims];
+ boolean[] trimmed = new boolean[dims];
+
+ Iterator<CellDomainElement> it = coverage.getCellDomainIterator();
+ Iterator<DomainElement> 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<RangeElement> 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<String> nullVals = new HashSet<String>();
+ Iterator<String> it = coverage.getNullSetIterator();
+ while (it.hasNext()) {
+ List<String> 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<RangeElement> 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
new file mode 100644
index 0000000..527b80a
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/ops/WcsOperation.java
@@ -0,0 +1,35 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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
new file mode 100644
index 0000000..c431723
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/templates/DescribeCoverageTemplate.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:CoverageDescriptions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 {wcsSchemaUrl}/wcsAll.xsd'>
+ {listOfCoverageDescriptions}
+ <wcs:CoverageDescription gml:id="{coverageId}">
+ <domainSet>
+ <Grid dimension="{gridDimension}" gml:id="{gridId}">
+ <limits>
+ <GridEnvelope>
+ <low>{low}</low>
+ <high>{high}</high>
+ </GridEnvelope>
+ </limits>
+ <axisLabels>{axisLabels}</axisLabels>
+ </Grid>
+ </domainSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="{rangeStructureId}">
+ {rangeFields}
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="{rangeFieldId}">
+ <gml:name>{fieldName}</gml:name>
+ <gmlwcs:dataType>{datatype}</gmlwcs:dataType>
+ <gmlwcs:nilValueList>{nilValues}</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+ <wcs:ServiceParameters>
+ <wcs:supportedCrsList/>
+ <wcs:supportedFormatList>{supportedFormats}</wcs:supportedFormatList>
+ </wcs:ServiceParameters>
+ </wcs:CoverageDescription>
+</wcs:CoverageDescriptions>
diff --git a/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml b/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml
new file mode 100644
index 0000000..86631bf
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/templates/GetCapabilitiesTemplate.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wcs:Capabilities xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:ows='http://www.opengis.net/ows/1.1'
+ xmlns:wcs='http://www.opengis.net/wcs/2.0'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/ows/1.1'
+ xmlns:xlink='http://www.w3.org/1999/xlink'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0 {wcsSchemaUrl}/wcsAll.xsd' version="2.0.0">
+ <ServiceIdentification>
+ <Title>WCS 2.0 Coverage Server @ Jacobs University</Title>
+ <Abstract>WCS 2.0 Server developed at jacobs University</Abstract>
+ <ServiceType>OGC WCS</ServiceType>
+ <ServiceTypeVersion>2.0.0</ServiceTypeVersion>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:protocol:post</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcps:1.0</Profile>
+ <Profile>urn:ogc:def:extension:OGC-WCS:2.0:serviceModel:wcst:1.0</Profile>
+ </ServiceIdentification>
+ <ServiceProvider>
+ <ProviderName>Jacobs University Bremen</ProviderName>
+ <ows:ProviderSite xlink:href="http://www.petascope.org/"/>
+ <ServiceContact>
+ <ows:IndividualName>Prof. Dr. Peter Baumann</ows:IndividualName>
+ <ows:ContactInfo>
+ <ows:Address>
+ <ows:City>Bremen</ows:City>
+ <ows:PostalCode>28717</ows:PostalCode>
+ <ows:Country>Germany</ows:Country>
+ <ows:ElectronicMailAddress>p.baumann@jacobs-university.de</ows:ElectronicMailAddress>
+ </ows:Address>
+ </ows:ContactInfo>
+ <ows:Role>Project Leader</ows:Role>
+ </ServiceContact>
+ </ServiceProvider>
+ <OperationsMetadata>
+ <Operation name="GetCapabilities">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="{URL}"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+ <Operation name="DescribeCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="{URL}"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+ <Operation name="GetCoverage">
+ <DCP>
+ <HTTP>
+ <Get xlink:href="{URL}"/>
+ </HTTP>
+ </DCP>
+ <Parameter name="Format">
+ <AllowedValues>
+ <Value>text/xml</Value>
+ </AllowedValues>
+ </Parameter>
+ <Constraint name="PostEncoding">
+ <AllowedValues>
+ <Value>XML</Value>
+ </AllowedValues>
+ </Constraint>
+ </Operation>
+ </OperationsMetadata>
+ <wcs:Contents>
+ {Coverages}
+ </wcs:Contents>
+ <wcs:WcsServiceMetadata />
+
+</wcs:Capabilities>
diff --git a/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml b/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml
new file mode 100644
index 0000000..9b76cc9
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/templates/GetCoverageTemplate.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmlwcs:GridCoverage xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:gml='http://www.opengis.net/gml/3.2'
+ xmlns='http://www.opengis.net/gml/3.2'
+ xmlns:gmlwcs='http://www.opengis.net/wcs/2.0/gml'
+ xsi:schemaLocation='http://www.opengis.net/wcs/2.0/gml {wcsSchemaUrl}/gml/gmlwcsAll.xsd' gml:id="{coverageId}">
+ <domainSet>
+ <Grid dimension="{gridDimension}" gml:id="{gridId}">
+ <limits>
+ <GridEnvelope>
+ <low>{low}</low>
+ <high>{high}</high>
+ </GridEnvelope>
+ </limits>
+ <axisLabels>{axisLabels}</axisLabels>
+ </Grid>
+ </domainSet>
+ <rangeSet>
+ <DataBlock>
+ <rangeParameters/>
+ <tupleList>
+ {coverageData}
+ </tupleList>
+ </DataBlock>
+ </rangeSet>
+ <gmlwcs:rangeStructure>
+ <gmlwcs:RangeStructure gml:id="{rangeStructureId}">
+ {rangeFields}
+ <gmlwcs:rangeField>
+ <gmlwcs:RangeField gml:id="{rangeFieldId}">
+ <gml:name>{fieldName}</gml:name>
+ <gmlwcs:dataType>{datatype}</gmlwcs:dataType>
+ <gmlwcs:nilValueList>{nilValues}</gmlwcs:nilValueList>
+ </gmlwcs:RangeField>
+ </gmlwcs:rangeField>
+ </gmlwcs:RangeStructure>
+ </gmlwcs:rangeStructure>
+</gmlwcs:GridCoverage>
diff --git a/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java b/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java
new file mode 100644
index 0000000..a021851
--- /dev/null
+++ b/petascope/src/petascope/wcs2/server/templates/WcsNamespaceContext.java
@@ -0,0 +1,58 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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
new file mode 100644
index 0000000..0440d9c
--- /dev/null
+++ b/petascope/src/petascope/wcst/server/WcstServer.java
@@ -0,0 +1,249 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.server;
+
+//~--- non-JDK imports --------------------------------------------------------
+import petascope.ConfigManager;
+import net.opengis.ows.v_1_0_0.ExceptionReport;
+
+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;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+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;
+
+/**
+ * The Web Coverage Service, with the Transactional extension (WcstServer)
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class WcstServer {
+
+ private static Logger LOG = LoggerFactory.getLogger(WcstServer.class);
+ private static Boolean finished;
+ private boolean synchronous = true;
+ private String responseHandler;
+ private DbMetadataSource meta;
+
+ /**
+ * Public minimal constructor
+ */
+ public WcstServer(DbMetadataSource source) throws WCSException {
+ finished = false;
+ meta = source;
+
+ /* 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);
+ }
+ cfg = ConfigManager.WCST_DEFAULT_INTERPOLATION;
+ if (source.getInterpolationTypes().contains(cfg) == false) {
+ throw new InvalidPropertyValueException("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);
+ }
+ }
+
+ /**
+ * Web service operation
+ */
+ public String Transaction(String stringXml) {
+ // Actual contents of these two strings do not matter
+ String output = "Default output. ";
+ String errmsg = "No error. ";
+
+ finished = false;
+ try {
+ try {
+ // Check if Firewall allows the query
+ if (ServiceFirewall.reject(stringXml)) {
+ throw new MaliciousQueryException("WCS-T Service Firewall "
+ + "refused to run possibly malitious query.");
+ }
+
+ // read the input XML
+ LOG.debug("Reading the input XML file ... ");
+ JAXBContext context = JAXBContext.newInstance(
+ TransactionType.class.getPackage().getName());
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ Object xml = unmarshaller.unmarshal(new StringReader(stringXml));
+
+ if (xml instanceof JAXBElement) {
+ xml = ((JAXBElement) xml).getValue();
+ }
+
+ TransactionType input = (TransactionType) xml;
+
+ /**
+ * We can work in both asynchronous and synchronous mode.
+ *
+ * If we are in async mode, we generate an acknowledgement that
+ * we have received the Transaction request. Next, when we finish processing,
+ * we send the output (as a String) to the specified responseHandler.
+ *
+ * In synchronous mode, we just do the processing and output
+ * the result.
+ */
+ if (input.getResponseHandler() == null) {
+ synchronous = true;
+ responseHandler = null;
+ } else {
+ synchronous = false;
+ responseHandler = input.getResponseHandler();
+ }
+
+ executeTransaction exec = new executeTransaction(input, meta);
+
+ /** Synchronous operation */
+ if (synchronous == true) {
+ TransactionResponseType response = exec.get();
+ JAXBElement jaxbOutput =
+ new JAXBElement(
+ new QName("http://www.opengis.net/wcs/1.1/wcst",
+ "TransactionResponse", XMLConstants.DEFAULT_NS_PREFIX),
+ TransactionResponseType.class, response);
+
+ // Write the output xml to a string
+ LOG.debug("Marshalling with context: " + response.getClass().getPackage().getName());
+ final StringWriter writer = new StringWriter();
+ try {
+ context = JAXBContext.newInstance(response.getClass());
+ final XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(writer);
+
+ final Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PetascopeXmlNamespaceMapper());
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.setProperty("jaxb.schemaLocation", "http://www.opengis.net/wcs/1.1/wcst http://schemas.opengis.net/wcst/ "
+ + "http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd");
+ marshaller.marshal(jaxbOutput, xmlStreamWriter);
+ } catch (final Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ output = writer.toString();
+ LOG.debug("Done! User has the TransactionResponse result !");
+ } else /** Asynchronous operation */
+ {
+ /* (1) Create acknowledgement that we received the request */
+ AcknowledgementType ack = new AcknowledgementType();
+ GregorianCalendar c = new GregorianCalendar();
+
+ c.setTime(new Date());
+ XMLGregorianCalendar date2 = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
+
+ ack.setTimeStamp(date2);
+ ack.setOperationRequest(input);
+ ack.setRequestId(exec.generateRequestId());
+ JAXBElement jaxbOutput = new JAXBElement(new QName("", "Acknowledgement"),
+ TransactionResponseType.class, ack);
+
+ /* (2) Write the acknowledgement to a string */
+ JAXBContext jaxbCtx = JAXBContext.newInstance(
+ ack.getClass().getPackage().getName());
+ Marshaller marshaller = jaxbCtx.createMarshaller();
+
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ StringWriter strWriter = new StringWriter();
+
+ marshaller.marshal(jaxbOutput, strWriter);
+ output = strWriter.toString();
+ 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,
+ responseHandler);
+
+ execAsync.start();
+ }
+ finished = true;
+
+ } catch (JAXBException e) {
+ throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", e);
+ } catch (DatatypeConfigurationException e) {
+ throw new XmlStructuresException("Could not build request acknowledgement. ", e);
+ }
+ } catch (WCSException e) {
+ LOG.info("Caught WCST Exception");
+ ExceptionReport report = e.getReport();
+
+ try {
+ JAXBContext jaxbCtx = JAXBContext.newInstance(
+ report.getClass().getPackage().getName());
+ Marshaller marshaller = jaxbCtx.createMarshaller();
+
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ StringWriter strWriter = new StringWriter();
+
+ 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 !");
+ } catch (JAXBException e2) {
+ errmsg = e2.getMessage();
+ LOG.error("Could not build XML error report. Stack trace: " + e2);
+ }
+ }
+
+ if (finished == false) {
+ output = errmsg;
+ }
+
+ return output;
+ }
+}
diff --git a/petascope/src/petascope/wcst/server/servlet/wcstServlet.java b/petascope/src/petascope/wcst/server/servlet/wcstServlet.java
new file mode 100644
index 0000000..51f11d3
--- /dev/null
+++ b/petascope/src/petascope/wcst/server/servlet/wcstServlet.java
@@ -0,0 +1,161 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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;
+
+/** Servlet interface for the WCS-Transactional server.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class wcstServlet extends HttpServlet {
+
+ private String defaultHtmlResponse;
+ private String relativeServletHtmlPath = "/templates/wcst-servlet.html";
+ private String servletHtmlPath;
+ private String relativeSettingsPath = "/settings.properties";
+ private WcstServer server;
+ private DbMetadataSource metadataSource;
+
+ @Override
+ public void init() throws ServletException {
+ // Initialize the configuration manager. Now all classes can read the settings.
+ String settingsPath = getServletContext().getRealPath(relativeSettingsPath);
+ ConfigManager config = ConfigManager.getInstance(settingsPath, getServletContext().getRealPath("/"));
+
+ try {
+ metadataSource = new DbMetadataSource(
+ ConfigManager.METADATA_DRIVER, ConfigManager.METADATA_URL,
+ ConfigManager.METADATA_USER, ConfigManager.METADATA_PASS, false);
+ } catch (Exception e) {
+ throw new ServletException("Metadata Database Error.", e);
+ }
+
+ // Initialize the WCS-T server with proper metadata
+ try {
+ server = new WcstServer(metadataSource);
+ } catch (WCSException e) {
+ throw new ServletException(e);
+ }
+
+ // Load the servlet HTML response
+ servletHtmlPath = getServletContext().getRealPath(relativeServletHtmlPath);
+ try {
+ defaultHtmlResponse = FileUtils.readFileToString(new File(servletHtmlPath));
+ } catch (IOException e) {
+ throw new ServletException(e);
+ }
+ }
+
+ /**
+ * Handles the HTTP <code>GET</code> method.
+ * @param request wcstServlet request
+ * @param response wcstServlet response
+ * @throws ServletException if a wcstServlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ System.out.println("WCS-T: invoked with GET");
+ printUsage(response);
+ }
+
+ /**
+ * Handles the HTTP <code>POST</code> method.
+ * @param request wcstServlet request
+ * @param response wcstServlet response
+ * @throws ServletException if a wcstServlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ // Select the operation
+ int op = -1;
+
+ if (request.getParameter("TransactionXML") != null) {
+ op = 4;
+ }
+
+ // Convert the WCS request into a WCPS request
+ try {
+ // initialize WebService operation arguments here
+ String inputXml, outputXml;
+ PrintWriter out;
+
+ switch (op) {
+ case 4:
+ inputXml = request.getParameter("TransactionXML");
+ outputXml = server.Transaction(inputXml);
+ out = new PrintWriter(response.getOutputStream());
+ out.write(outputXml);
+ out.flush();
+
+ break;
+ default:
+ throw new Exception("No valid operation specified !");
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ throw new ServletException("WCS-T servlet error !", e);
+ }
+ }
+
+ /**
+ * Returns a short description of the wcstServlet.
+ * @return a String containing wcstServlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "WCS-T Extension. Petascope version " + ConfigManager.PETASCOPE_VERSION;
+ }
+
+ private void printUsage(HttpServletResponse response) throws IOException {
+ System.out.println("WCS-T: returning usage message");
+ response.setContentType("text/html; charset=utf-8");
+ PrintWriter out = new PrintWriter(response.getOutputStream());
+
+ out.println(defaultHtmlResponse);
+
+ out.close();
+ System.out.println("WCS-T: done nothing");
+
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/ServiceFirewall.java b/petascope/src/petascope/wcst/transaction/ServiceFirewall.java
new file mode 100644
index 0000000..28f6dc0
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/ServiceFirewall.java
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class ServiceFirewall {
+
+ private static long lastQueryTime = 0;
+ /* Queries should not occur more often than this period (in seconds) */
+ private static final double MIN_QUERY_PERIOD = 10;
+
+ /** Do we reject a certain query through the firewall?
+ *
+ * @param query Query string
+ * @return boolean
+ */
+ public static boolean reject(String query) {
+ boolean result = true;
+
+ /* Check query period */
+ long currentTime = System.currentTimeMillis();
+ if (((currentTime - lastQueryTime) / 1000) >= MIN_QUERY_PERIOD) {
+ result = false;
+ }
+ lastQueryTime = currentTime;
+
+ return result;
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java b/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java
new file mode 100644
index 0000000..804c9bb
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/executeAsyncTransaction.java
@@ -0,0 +1,162 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wcst.transaction;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLEncoder;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+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 wcst.transaction.schema.TransactionResponseType;
+
+/**
+ * This class processes asynchronously an WCS Transaction request.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class executeAsyncTransaction extends Thread {
+
+ private static Logger LOG = LoggerFactory.getLogger(executeAsyncTransaction.class);
+ private String responseHandler;
+ private executeTransaction exec;
+
+ /**
+ * Default constructor.
+ * @param exec a synchroneous executeTransaction object
+ * @param responseHandler destination URL that should receive the processed output
+ */
+ public executeAsyncTransaction(executeTransaction exec, String responseHandler) {
+ this.responseHandler = responseHandler;
+ this.exec = exec;
+ }
+
+ /** Run the current thread. */
+ public void run() {
+ 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();
+ 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 ...");
+ JAXBContext jaxbCtx = JAXBContext.newInstance(output.getClass().getPackage().getName());
+ Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ StringWriter strWriter = new StringWriter();
+
+ marshaller.marshal(jaxbOutput, strWriter);
+ outString = strWriter.toString();
+
+ /* (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.");
+ } catch (IOException ex) {
+ LOG.error("Stack trace: " + ex);
+ throw new InputOutputException("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 !");
+ }
+ } catch (WCSException e) {
+ LOG.error("Caught WCS Exception: " + e);
+ ExceptionReport report = e.getReport();
+ try {
+ /* Build the error report */
+ JAXBContext jaxbCtx = JAXBContext.newInstance(report.getClass().getPackage().getName());
+ Marshaller marshaller = jaxbCtx.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ StringWriter strWriter = new StringWriter();
+ marshaller.marshal(report, strWriter);
+ outString = strWriter.toString();
+ 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);
+ } catch (IOException e2) {
+ LOG.error("Stack trace: " + e2);
+ }
+ }
+ }
+
+ /** Send string data to a URL end-point. Use this function to send the output
+ *
+ * @param content
+ * @param destinationUrl
+ * @throws MalformedURLException
+ * @throws IOException
+ */
+ private void sendPostRequest(String content, String destinationUrl) throws MalformedURLException, IOException {
+ LOG.debug("sendPostRequest() ... to URL: " + destinationUrl);
+
+ // connect to the destination
+ URL servlet = new URL(destinationUrl);
+ HttpURLConnection conn = (HttpURLConnection) servlet.openConnection();
+
+ // inform the connection that we will send output and will not accept input
+ conn.setDoInput(false);
+ conn.setDoOutput(true);
+
+ // Don't use a cached version of URL connection.
+ conn.setUseCaches(false);
+ conn.setDefaultUseCaches(false);
+
+ // Send POST request
+ conn.setRequestMethod("POST");
+
+ // Specify the content type that we will send binary data
+ conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+
+ String data = "xml=" + URLEncoder.encode(content);
+ DataOutputStream out = new DataOutputStream(conn.getOutputStream());
+
+ out.writeBytes(data);
+ out.flush();
+ out.close();
+
+ LOG.debug("Sent request to URL.");
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/executeTransaction.java b/petascope/src/petascope/wcst/transaction/executeTransaction.java
new file mode 100644
index 0000000..ed02780
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/executeTransaction.java
@@ -0,0 +1,1152 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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;
+import net.opengis.wcs.v_1_1_0.CoverageDescriptionType;
+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.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;
+import java.util.Iterator;
+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;
+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.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 wcst.transaction.schema.CodeType;
+import wcst.transaction.schema.CoverageType;
+import wcst.transaction.schema.KeywordsType;
+import wcst.transaction.schema.LanguageStringType;
+import wcst.transaction.schema.ManifestType;
+import wcst.transaction.schema.ReferenceType;
+import wcst.transaction.schema.TransactionResponseType;
+import wcst.transaction.schema.TransactionType;
+import petascope.wcst.transaction.tools.RasdamanUtils;
+
+/**
+ * This class takes a WCS-T Transaction XML request and executes the request,
+ * building the corresponding XML respose. Use this class for synchronous processing.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class executeTransaction {
+
+ private static Logger LOG = LoggerFactory.getLogger(executeTransaction.class);
+// private static boolean printLog = true;
+ private boolean finished;
+ private TransactionType input;
+ protected TransactionResponseType output;
+ private RasdamanUtils rasUtils;
+ private String requestId;
+ private DbMetadataSource metaDb;
+ private HashSet<String> newCoverages;
+
+ /**
+ * Default constructor. Initialize internal variables.
+ * @param tr Transaction object, a WCS-T request
+ * @param metadataDbPath Path to the "dbparams.properties" file
+ */
+ public executeTransaction(TransactionType tr, DbMetadataSource source) throws WCSException {
+ input = tr;
+ output = new TransactionResponseType();
+ finished = false;
+ metaDb = source;
+ newCoverages = new HashSet<String>();
+
+ String server = ConfigManager.RASDAMAN_URL;
+ String db = ConfigManager.RASDAMAN_DATABASE;
+
+ rasUtils = new RasdamanUtils(server, db);
+ rasUtils.init();
+
+ // In case no-one will ever call this method and we need it
+ generateRequestId();
+ }
+
+ /**
+ * Generate a new Request ID string, and return it. If the transaction request
+ * does not include a request ID, the last generated string will be used.
+ * @return String Request ID
+ */
+ public String generateRequestId() {
+ requestId = String.valueOf(UUID.randomUUID());
+ return requestId;
+ }
+
+ /**
+ * Main method of this class: Computes the response to the TransactionResponse
+ * request given to the constructor. If needed, it also calls <b>process()</b>
+ * @return a TransactionResponse object.
+ * @throws WCSException
+ */
+ public TransactionResponseType get() throws WCSException {
+ try {
+ if (finished == false) {
+ metaDb.ensureConnection();
+ process();
+ }
+ } catch (SQLException e) {
+ throw new InternalSqlException("Could not ensure connection to database is valid", e);
+ }
+ if (finished == false) {
+ throw new NoApplicableCodeException("Could not execute the Transaction request! "
+ + "Please see the other errors...");
+ }
+
+ return output;
+ }
+
+ /**
+ * Computes the response to the Transaction request given to the constructor.
+ */
+ public void process() throws WCSException {
+ if (!input.getService().equalsIgnoreCase("WCS")) {
+ throw new InvalidParameterValueException("Service. Explanation: Service must be \"WCS\" !");
+ }
+ if (!input.getVersion().equalsIgnoreCase("1.1")) {
+ throw new InvalidParameterValueException("Service. Explanation: Service Version must be \"1.1\" !");
+ }
+
+ // Set the output request ID
+ String reqID = input.getRequestId();
+ if (reqID == null) {
+ reqID = "Request_" + requestId;
+ generateRequestId();
+ }
+ output.setRequestId(reqID);
+
+ // All actions succeed or fail as one group.
+ try {
+ ManifestType covs = input.getInputCoverages();
+ List l = covs.getReferenceGroup();
+
+ for (int i = 0; i < l.size(); i++) {
+ // This object is the XML element "InputCoverages"
+ Object obj = ((JAXBElement) l.get(i)).getValue();
+ CoverageType cov = (CoverageType) obj;
+
+ // Each action adds something to the output XML document
+ processInputCoverageNode(cov);
+ }
+
+ finished = true;
+
+ /* Commit rasdaman changes */
+ try {
+ LOG.debug("Commit rasdaman changes ...");
+ rasUtils.commitAndClose();
+ LOG.debug("Rasdaman coverages saved successfully !");
+ } catch (ODMGException e) {
+ throw new InternalComponentException("Could not commit Rasdaman changes !", e);
+ }
+
+ /* Commit metadata changes */
+ try {
+ LOG.debug("Commit metadata changes ...");
+ metaDb.commitAndClose();
+ LOG.debug("Metadata has been saved !");
+ } catch (SQLException e) {
+ throw new InternalSqlException("Could not commit metadata changes", e);
+ }
+ } catch (WCSException e) {
+ // One action failed, therefore all actions have failed
+
+ /* Abort metadata changes */
+ finished = false;
+ try {
+ LOG.debug("Rolling back metadata database changes ...");
+ metaDb.abortAndClose();
+ LOG.debug("Metadata rollback completed!");
+ } catch (SQLException ex) {
+ LOG.error("Could not rollback metadata changes.");
+ e.appendErrorDetail(" Could not rollback metadata changes!");
+ }
+
+ /* Abort rasdaman changes */
+ try {
+ LOG.debug("Aborting rasdaman changes ...");
+ rasUtils.abortAndClose();
+ LOG.debug("Rasdaman changes aborted !");
+ } catch (ODMGException ex) {
+ LOG.error("Could not abort rasdaman changes.");
+ e.appendErrorDetail(" Could not rollback rasdaman changes!");
+ }
+
+ throw e;
+ }
+ }
+
+ /**
+ * Delete a coverage from the Rasdaman server.
+ * @param identifier Name of coverage
+ * @throws Exception
+ */
+ private void deleteCoverageFromRasdaman(String identifier) throws Exception {
+ try {
+ LOG.trace("Deleting coverage from Rasdaman ...");
+ rasUtils.deleteCollection(identifier);
+ 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);
+ }
+ }
+
+ /**
+ * Insert pixel data for a coverage into RasDaMan DB system
+ *
+ * @param identifier Identifier of the coverage
+ * @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...");
+ try {
+ rasUtils.insertGrayImageAsArray(identifier, img);
+ 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);
+ }
+ }
+
+ /** Load a BufferedImage from a ReferenceType object.
+ *
+ * @param pixels Reference object
+ * @return available image
+ * @throws WCSException
+ */
+ private BufferedImage loadPixelsReference(ReferenceType pixels) throws WCSException {
+ 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. "
+ + "Explanation: URL " + url.toString() + " is not valid.");
+ }
+
+ try {
+ img = ImageIO.read(url);
+ if (img == null) {
+ throw new IOException("Empty stream while reading image.");
+ }
+ } catch (IOException e) {
+ LOG.error(e.getMessage());
+ throw new InputOutputException("Reference Pixels. Explanation: "
+ + "Could not read image from URL '" + url, e);
+ }
+
+ return img;
+ }
+
+ /**
+ * Load a Coverage Description XML object from a Reference
+ *
+ * @param identifier Name of coverage
+ * @param desc Reference to a CoverageDescriptions xml
+ * @return coverage description
+ * @throws WCSException
+ */
+ private CoverageDescriptionType loadDescriptionReference(String identifier,
+ ReferenceType desc) throws WCSException {
+ URL url = null;
+ String xmlString = null;
+ CoverageDescriptions descs = null;
+ CoverageDescriptionType desc0 = null;
+
+ // Load the URL
+ try {
+ url = new URL(desc.getHref());
+ } catch (MalformedURLException e) {
+ LOG.error("URL " + url.toString() + " is not valid !");
+ throw new InvalidParameterValueException("Reference pixels. Explanation: "
+ + "URL " + url.toString() + " is not valid.");
+ }
+
+ // Read the contents of the URL
+ try {
+ URLConnection conn = url.openConnection();
+ BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ xmlString = IOUtils.toString(in);
+ } catch (IOException ex) {
+ throw new InputOutputException("Description Reference. Explanation: error loading the "
+ + "coverage description from URL " + url.toString(), ex);
+ }
+
+ // Unmarshall the XML string into a Java Object
+ try {
+ JAXBContext jaxbCtx = JAXBContext.newInstance(CoverageDescriptions.class.getPackage().getName());
+ Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
+ Object obj = unmarshaller.unmarshal(new StringReader(xmlString));
+
+ if (obj instanceof JAXBElement) {
+ descs = (CoverageDescriptions) ((JAXBElement) obj).getValue();
+ } else if (obj instanceof CoverageDescriptions) {
+ descs = (CoverageDescriptions) obj;
+ } else {
+ LOG.error("Coverage description metadata is not a valid xml document.");
+ throw new XmlNotValidException("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);
+ }
+
+ // Filter by coverage name
+ desc0 = null;
+ Iterator<CoverageDescriptionType> i = descs.getCoverageDescription().iterator();
+
+ while (i.hasNext()) {
+ CoverageDescriptionType d = i.next();
+
+ if (d.getIdentifier().equals(identifier)) {
+ desc0 = d;
+ break;
+ }
+ }
+
+ if (desc0 == null) {
+ throw new InvalidRequestException("Could not find a CoverageDescription for coverage: " + identifier);
+ }
+
+ return desc0;
+ }
+
+ private CoverageSummaryType loadSummaryReference(ReferenceType pixels) throws WCSException {
+ URL url = null;
+ String xmlString = null;
+ CoverageSummaryType xml = null;
+
+ try {
+ url = new URL(pixels.getHref());
+ } catch (MalformedURLException e) {
+ throw new InvalidParameterValueException("Reference summary. Explanation: URL is not valid.", e);
+ }
+
+ // Read the contents of the URL
+ try {
+ URLConnection conn = url.openConnection();
+ BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ xmlString = IOUtils.toString(in);
+ } catch (IOException ex) {
+ throw new InputOutputException("Summary Reference. Explanation: "
+ + "Error loading the " + "coverage summary from URL " + url.toString(), ex);
+ }
+
+ // Unmarshall the XML string into a Java Object
+ try {
+ JAXBContext jaxbCtx = JAXBContext.newInstance(CoverageSummaryType.class.getPackage().getName());
+ Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
+ Object obj = unmarshaller.unmarshal(new StringReader(xmlString));
+
+ if (obj instanceof JAXBElement) {
+ xml = (CoverageSummaryType) ((JAXBElement) obj).getValue();
+ } else if (obj instanceof CoverageSummaryType) {
+ xml = (CoverageSummaryType) obj;
+ } else {
+ throw new XmlNotValidException("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);
+ }
+
+ return xml;
+ }
+
+ /**
+ * Updates the coverage metadata: textual descriptions. The title and the abstract
+ * could be specified in multiple languages, but we only store english.
+ *
+ * @param meta Metadata object to be modified
+ * @param summary summary object, that contains title, abstract and coverage keywords
+ * @return modified metadata object
+ */
+ private Metadata updateMetadataWithSummary(Metadata meta,
+ CoverageSummaryType summary) throws WCSException {
+ LOG.debug("Updating metadata with values from Coverage Summary...");
+
+ String title = null, abstr = null, keywords = null;
+
+ title = summary.getTitle();
+ abstr = summary.getAbstract();
+ List<net.opengis.ows.v_1_0_0.KeywordsType> keywordL = summary.getKeywords();
+ List<String> kList = new ArrayList<String>();
+ Iterator i = keywordL.iterator();
+
+ while (i.hasNext()) {
+ KeywordsType keywordInMultipleLangs = (KeywordsType) i.next();
+ String keyword = filterAcceptedLanguage(keywordInMultipleLangs.getKeyword());
+
+ kList.add(keyword);
+ }
+ keywords = SDU.string2str(kList);
+
+ meta.setTitle(title);
+ meta.setKeywords(keywords);
+ meta.setAbstract(abstr);
+
+ return meta.clone();
+ }
+
+ /**
+ * Retrieve only the string in the accepted language from a multiple-language list
+ *
+ * @param list List of strings in several languages
+ * @return String in the accepted language, or null if none is found
+ */
+ private String filterAcceptedLanguage(List<LanguageStringType> list) {
+ String result = null;
+ Iterator i = list.iterator();
+
+ while (i.hasNext()) {
+ LanguageStringType a = (LanguageStringType) i.next();
+
+ if (a.getLang().equals(ConfigManager.WCST_LANGUAGE)) {
+ result = a.getValue();
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Partially updates a Rasdaman coverage with pixels from pixHref. Info about
+ * the bounding box is available from descHref.
+ *
+ * @param identifier ID of the coverage to be updates
+ * @param pixHref URL for the pixels data
+ * @param descHref URL for the metadata
+ */
+ private void insertSomePixelsIntoRasdaman(String identifier, String pixHref, String descHref) {
+ // TODO: Implement !
+ LOG.error("Partial update is not yet implemented");
+ throw new UnsupportedOperationException("Partial Rasdaman update is not yet implemented.");
+ }
+
+ /**
+ * Inserts default metadata values for the given coverage.
+ *
+ * @param identifier ID of the coverage
+ * @param img The image, fetched from external reference
+ * @throws WCSException on error
+ */
+ private Metadata createNewCoverageMetadata(String identifier, BufferedImage img)
+ throws InvalidMetadataException {
+ Metadata m = null;
+ LOG.debug("Creating metadata with default values...");
+
+ // TODO: When we accept multi-band images, update nullDefault
+ String nullDefault = "0";
+
+ // Cell domains
+ BigInteger lowX = new BigInteger("0");
+ BigInteger highX = new BigInteger(String.valueOf(img.getHeight() - 1));
+ BigInteger lowY = new BigInteger("0");
+ BigInteger highY = new BigInteger(String.valueOf(img.getWidth() - 1));
+ CellDomainElement cellX = new CellDomainElement(lowX, highX);
+ CellDomainElement cellY = new CellDomainElement(lowY, highY);
+ List<CellDomainElement> cellList = new ArrayList<CellDomainElement>(2);
+ cellList.add(cellX);
+ cellList.add(cellY);
+
+ // Domains
+ Set<String> crsSet = new HashSet<String>(1);
+ 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());
+ List<DomainElement> domList = new ArrayList<DomainElement>(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);
+ List<RangeElement> rList = new ArrayList<RangeElement>(1);
+ rList.add(range);
+
+ // Interpolation methods: only the default
+ String interpMeth = ConfigManager.WCST_DEFAULT_INTERPOLATION;
+ String nullRes = ConfigManager.WCST_DEFAULT_NULL_RESISTANCE;
+ InterpolationMethod interp = new InterpolationMethod(interpMeth, nullRes);
+ Set<InterpolationMethod> interpList = new HashSet<InterpolationMethod>(1);
+ interpList.add(interp);
+
+ // Null sets
+ /* TODO: update for multi-band images */
+ String nullVal = "0";
+ Set<String> nullSet = new HashSet<String>(1);
+ nullSet.add(nullVal);
+
+ // Descriptions
+ String abstr = null;
+ String title = "Coverage " + identifier;
+ String keywords = null;
+
+
+ m =
+ new Metadata(cellList, rList, nullSet, nullDefault, interpList,
+ interp, identifier, domList, null, title, abstr, keywords);
+
+ LOG.debug("Done creating default metadata");
+ return m;
+ }
+
+ /**
+ * Processes one <Coverage> node from the input XML
+ *
+ * @param elem the JAXB node equivalent to the <Coverage> node
+ */
+ private void processInputCoverageNode(CoverageType elem) throws WCSException {
+ if (elem.getAction() == null) {
+ throw new InvalidParameterValueException("Action. Explanation: "
+ + "Every <Coverage> node must contain an <Action> child node.");
+ }
+
+ String action = elem.getAction().getValue();
+ String identifier = null;
+ List references = null;
+
+ if (elem.getIdentifier() == null) {
+ throw new InvalidParameterException("Identifier");
+ }
+
+ identifier = elem.getIdentifier().getValue();
+ references = elem.getAbstractReferenceBase();
+
+ if (action.equalsIgnoreCase("Add")) {
+ actionAddCoverage(identifier, references);
+ } else if (action.equalsIgnoreCase("UpdateMetadata")) {
+ actionUpdateMetadata(identifier, references);
+ } else if (action.equalsIgnoreCase("Delete")) {
+ actionDeleteCoverage(identifier, references);
+ } else if (action.equalsIgnoreCase("UpdateAll")) {
+ actionUpdateAll(identifier, references);
+ } else if (action.equalsIgnoreCase("UpdateDataPart")) {
+ throw new ActionNotSupportedException("Action \"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. */
+// actionUpdateDataPart(identifier, references);
+ }
+ }
+
+ /**
+ * Performs the action "UpdateAll", as part of the Transaction operation
+ *
+ * @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 ...");
+ actionUpdateDataPart(identifier, references);
+ actionUpdateMetadata(identifier, references);
+ LOG.trace("Finished action Update All!");
+ }
+
+ /**
+ * Updates the Metadata DB with the information contained in the CoverageDescriptions XML object
+ *
+ * @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...");
+
+ /* (B) Table ps_descriptions: Update coverage title, abstract, keywords */
+ String title = desc.getTitle();
+ String abstr = desc.getAbstract();
+ String keywords = desc.getKeywords().toString();
+
+ meta.setAbstract(abstr);
+ meta.setKeywords(keywords);
+ meta.setTitle(title);
+
+ /* (C) Table ps_range: Update field name, types, and interpolation methods */
+
+ if (desc.getRange() != null) {
+ Set<InterpolationMethod> interpSet = new HashSet<InterpolationMethod>();
+ RangeType range = desc.getRange();
+ List<FieldType> fields = range.getField();
+ try {
+ LOG.debug("Updating range information...");
+ Iterator<FieldType> i = fields.iterator();
+ ArrayList<RangeElement> rangeList = new ArrayList<RangeElement>();
+
+ 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);
+ interpSet.add(interp);
+
+ Iterator<InterpolationMethodType> 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.setInterpolationSet(interpSet);
+ }
+
+ /* (D) Table ps_coverage: Update default interpolation method and null resistance */
+
+ /*
+ * We store interpolation methods at coverage level, not field level.
+ * So we only look at the interpolation method list of the first field,
+ * 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);
+ }
+ }
+
+ /* (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<JAXBElement<? extends BoundingBoxType>> 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());
+ }
+ } 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 ...");
+ /*
+ try
+ {
+ List<Object> list =
+ desc.getDomain().getTemporalDomain().getTimePositionOrTimePeriod();
+ if (list.size() == 1)
+ {
+ Object obj = list.get(0);
+ if (obj instanceof TimePeriodType)
+ {
+ TimePeriodType period = (TimePeriodType) obj;
+ TimePositionType start = period.getBeginPosition();
+ TimePositionType end = period.getEndPosition();
+ }
+ }
+ else
+ {
+ throw new WCSException("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);
+ }
+ */
+ 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.");
+ }
+
+ /* (F) Table ps_crss: Update supported CRS */
+ // TODO later ... we don't support CRSs as of yet
+
+ return meta;
+ }
+
+ /**
+ * Performs the action "UpdateDataPart", as part of the Transaction operation
+ *
+ * @param identifier
+ * @param references
+ */
+ private void actionUpdateDataPart(String identifier, List references) throws WCSException {
+ 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);
+ }
+
+ // Obtain the references
+ ReferenceType pixels, desc;
+
+ pixels = getPixelsRef(references);
+ desc = getDescriptionRef(references);
+
+ // References check. We are updating a coverage values, mandatory are: pixels, description
+ if (pixels == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("pixels") + "'");
+ }
+ if (desc == null) {
+ throw new MissingParameterValueException("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);
+ }
+ }
+
+ /**
+ * Performs the action "UpdateMetadata", as part of the Transaction operation
+ *
+ * @param identifier
+ * @param references
+ * @throws wcs.server.core.WCSException
+ */
+ private void actionUpdateMetadata(String identifier, List references) throws WCSException {
+ 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);
+ }
+
+ // Obtain the references
+ ReferenceType descRef, summRef;
+
+ descRef = getDescriptionRef(references);
+ summRef = getSummaryRef(references);
+
+ // References check. We are updating metadata, mandatory is only the description
+ if (descRef == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("description") + "'");
+ }
+
+ LOG.trace("Loading reference: coverage description ...");
+ CoverageDescriptionType desc = loadDescriptionReference(identifier, descRef);
+
+ CoverageSummaryType summ = null;
+
+ if (summRef != null) {
+ LOG.trace("Loading reference: coverage summary ...");
+ summ = loadSummaryReference(summRef);
+ }
+
+ LOG.trace("Done loading references !");
+
+ // (2) Do the actual processing
+ try {
+ Metadata oldMeta = m;
+ Metadata newMeta = updateMetadataWithDescription(oldMeta, desc);
+ if (summ != null) {
+ Metadata tempMeta = newMeta;
+ newMeta = updateMetadataWithSummary(newMeta, summ);
+ }
+
+ metaDb.updateCoverageMetadata(m, false);
+ } catch (Exception e) {
+ throw new NoApplicableCodeException("Error while updating metadata.", e);
+ }
+
+ LOG.trace("Finished action Update Metadata !");
+ }
+
+ /**
+ * Performs the action "Add", as part of the Transaction operation
+ *
+ * @param identifier
+ * @param references
+ * @throws wcs.server.core.WCSException
+ */
+ private void actionAddCoverage(String identifier, List references) throws WCSException {
+ LOG.trace("Executing action AddCoverage ...");
+
+ // Obtain the references
+ ReferenceType pixelsRef, descRef, summRef;
+
+ pixelsRef = getPixelsRef(references);
+ descRef = getDescriptionRef(references);
+ summRef = getSummaryRef(references);
+
+ // References check. We are adding a coverage, mandatory are: pixels, description
+ if (pixelsRef == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("pixels") + "'");
+ }
+ if (descRef == null) {
+ throw new MissingParameterValueException("Reference role='" + getUrnCode("description") + "'");
+ }
+
+ LOG.trace("Loading reference: coverage pixels ...");
+ BufferedImage img = loadPixelsReference(pixelsRef);
+
+ LOG.trace("Loading reference: coverage description ...");
+ CoverageDescriptionType desc = loadDescriptionReference(identifier, descRef);
+
+ CoverageSummaryType summ = null;
+
+ if (summRef != null) {
+ LOG.trace("Loading reference: coverage summary ...");
+ summ = loadSummaryReference(summRef);
+ }
+
+ LOG.trace("Done loading references !");
+
+ /**
+ * (1) Check coverage name
+ */
+ boolean changeId = false;
+
+ if (newCoverages.contains(identifier)) {
+ throw new InvalidParameterValueException("Identifier: You cannot use the same identifier twice.");
+ }
+
+ if (metaDb.existsCoverageName(identifier)) {
+ changeId = true;
+ LOG.warn("Changing coverage identifier since coverage '" + identifier + "' already exists !");
+ }
+
+ // Generate new coverage name ?
+ while (changeId) {
+ identifier = "coverage_" + Integer.toString((new Random()).nextInt());
+ changeId = metaDb.existsCoverageName(identifier);
+ }
+
+ /**
+ * (2) Do the actual processing. Stores the image in rasdaman.
+ */
+ try {
+ /* Currently we only support one-band (gray-scale) images. */
+ if (img.getColorModel().getNumComponents() != 1) {
+ throw new MultiBandImagesNotSupportedException(
+ "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);
+ }
+
+ /**
+ * (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);
+ }
+
+ /**
+ * (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 !");
+ }
+
+ /**
+ * Performs the action "Delete", as part of the Transaction operation
+ *
+ * @param identifier
+ * @param references
+ * @throws wcs.server.core.WCSException
+ */
+ private void actionDeleteCoverage(String identifier, List references) throws WCSException {
+ LOG.trace("Executing action Delete Coverage ...");
+
+ if (metaDb.existsCoverageName(identifier) == false) {
+ throw new InvalidParameterValueException("Identifier");
+ }
+
+ // (2) Do the actual processing
+ try {
+ Metadata m = metaDb.read(identifier);
+ deleteCoverageFromRasdaman(identifier);
+ metaDb.delete(m, false);
+ } catch (Exception e) {
+ throw new NoApplicableCodeException("Error while deleting coverage.", e);
+ }
+
+ // 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 Delete !");
+ }
+
+ /**
+ * Retrieve the full URN code of a string
+ *
+ * @param key Internal representation of a URN code
+ * @return the URN code
+ */
+ private String getUrnCode(String key) throws WCSException {
+ if (key.equalsIgnoreCase("pixels")) {
+ return "urn:ogc:def:role:WCS:1.1:Pixels";
+ }
+ if (key.equalsIgnoreCase("description")) {
+ return "urn:ogc:def:role:WCS:1.1:CoverageDescription";
+ }
+ if (key.equalsIgnoreCase("summary")) {
+ return "urn:ogc:def:role:WCS:1.1:CoverageSummary";
+ }
+ if (key.equalsIgnoreCase("transform")) {
+ return "urn:ogc:def:role:WCS:1.1:GeoreferencingTransformation";
+ }
+ if (key.equalsIgnoreCase("other")) {
+ return "urn:ogc:def:role:WCS:1.1:OtherSource";
+ }
+
+ throw new InternalComponentException("Unknown URN key '" + key + "'");
+ }
+
+ /**
+ * Get the Pixels Reference
+ *
+ * @param references List of References
+ * @return the Pixels Reference
+ */
+ private ReferenceType getPixelsRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("pixels", references);
+
+ return result;
+ }
+
+ /**
+ * Get the Coverage Description Reference
+ *
+ * @param references List of References
+ * @return the Coverage Description Reference
+ */
+ private ReferenceType getDescriptionRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("description", references);
+
+ return result;
+ }
+
+ /**
+ * Get the Coverage Summary Reference
+ *
+ * @param references List of References
+ * @return the Coverage Summary Reference
+ */
+ private ReferenceType getSummaryRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("summary", references);
+
+ return result;
+ }
+
+ /**
+ * Get the Georeferencing Transform Reference
+ *
+ * @param references List of References
+ * @return the Georeferencing Transform Reference
+ */
+ private ReferenceType getTransformRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("transform", references);
+
+ return result;
+ }
+
+ /**
+ * Get the "Other" Reference
+ *
+ * @param references List of References
+ * @return the "Other" Reference
+ */
+ private ReferenceType getOtherRef(List references) throws WCSException {
+ ReferenceType result = searchReferenceList("other", references);
+
+ return result;
+ }
+
+ /**
+ * Search a references list for a particular term
+ * @param key internal name of reference
+ * @param references List of references
+ * @return a Reference object
+ */
+ private ReferenceType searchReferenceList(String key, List references) throws WCSException {
+ String urn = getUrnCode(key);
+ Iterator i = references.iterator();
+
+ while (i.hasNext()) {
+ Object obj = i.next();
+ JAXBElement jelem = (JAXBElement) obj;
+ ReferenceType ref = (ReferenceType) jelem.getValue();
+ String role = ref.getRole();
+
+ if (role.equalsIgnoreCase(urn)) {
+ return ref;
+ }
+ }
+
+ return null;
+ }
+
+ private Metadata updateImageCrsBoundingBox(Metadata meta, BoundingBoxType bbox) throws WCSException, InvalidMetadataException {
+ List<Double> lower = bbox.getLowerCorner();
+ List<Double> upper = bbox.getUpperCorner();
+
+ if (lower.size() != 2) {
+ throw new InvalidParameterException("LowerCorner. Explanation: Should contain only two numbers.");
+ }
+ if (upper.size() != 2) {
+ throw new InvalidParameterException("UpperCorder. Explanation: Should contain only two numbers.");
+ }
+ long loX = lower.get(0).longValue();
+ long loY = lower.get(1).longValue();
+ long hiX = upper.get(0).longValue();
+ long hiY = upper.get(1).longValue();
+
+ CellDomainElement cellX = new CellDomainElement(BigInteger.valueOf(loX), BigInteger.valueOf(hiX));
+ CellDomainElement cellY = new CellDomainElement(BigInteger.valueOf(loY), BigInteger.valueOf(hiY));
+
+ List<CellDomainElement> list = new ArrayList<CellDomainElement>();
+ list.add(cellX);
+ list.add(cellY);
+
+ meta.setCellDomain(list);
+ return meta.clone();
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java b/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java
new file mode 100644
index 0000000..53ba581
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/tools/RasdamanUtils.java
@@ -0,0 +1,472 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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 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;
+
+/**
+ * Utility class for doing various tasks that involve the Rasdaman server.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class RasdamanUtils {
+
+ Implementation myApp = null;
+ Database myDb = null;
+ Transaction myTa = null;
+ private String base;
+ private String server;
+
+ /**
+ * Simple constructor
+ *
+ * @param s server string
+ * @param b database name
+ */
+ public RasdamanUtils(String s, String b) {
+ this.server = s;
+ this.base = b;
+ }
+
+ public void log(String msg) {
+ System.err.flush();
+ System.out.println("Rasdaman Utils: " + msg);
+ System.out.flush();
+ }
+
+ /**
+ * Opens a new connection to the Rasdaman server, and starts a new transaction.
+ * @throws WCSException on connection error
+ */
+ public void init() throws WCSException {
+ try {
+ if (myApp == null) {
+ myApp = new RasImplementation(server);
+ }
+ if (myDb == null) {
+ myDb = myApp.newDatabase();
+ log("Opening database...");
+ myDb.open(base, Database.OPEN_READ_WRITE);
+ }
+ if (myTa == null) {
+ log("Beginning new transaction ...");
+ myTa = myApp.newTransaction();
+ myTa.begin();
+ }
+ } catch (ODMGException e) {
+ throw new InternalComponentException("Could not connect to the Rasdaman server !", e);
+ }
+ }
+
+ public void commitAndClose() throws ODMGException {
+ if (myTa != null) {
+ log("Commiting transaction ...");
+ myTa.commit();
+ myTa = null;
+ }
+ if (myDb != null) {
+ log("Closing database...");
+ myDb.close();
+ myDb = null;
+ }
+ log("Finished !");
+ }
+
+ public void abortAndClose() throws ODMGException {
+ if (myTa != null) {
+ log("Aborting transaction...");
+ myTa.abort();
+ myTa = null;
+ }
+ if (myDb != null) {
+ log("Closing database...");
+ myDb.close();
+ myDb = null;
+ }
+ log("Finished !");
+ }
+
+ public BufferedImage loadCoverage(String name) throws Exception {
+ init();
+
+ log("Running Load Coverage " + name + " query!");
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("select jpeg(" + name + ") from " + name);
+ DBag resultSet = (DBag) myQu.execute();
+
+ if (resultSet != null) {
+ log("Query successful !");
+ Iterator iter = resultSet.iterator();
+
+ if (iter.hasNext()) {
+ RasGMArray result = (RasGMArray) iter.next();
+ byte[] ba = result.getArray();
+ ByteArrayInputStream bas = new ByteArrayInputStream(ba);
+ com.sun.image.codec.jpeg.JPEGImageDecoder decoder = com.sun.image.codec.jpeg.JPEGCodec.createJPEGDecoder(bas);
+ BufferedImage bufImg = null;
+
+ try {
+ bufImg = decoder.decodeAsBufferedImage();
+ } catch (Exception e) {
+ System.err.println("Error decoding the image !!!");
+ }
+
+ commitAndClose();
+
+ return bufImg;
+ }
+ }
+
+ abortAndClose();
+
+ return null;
+ }
+
+ public RasGMArray createMDD() throws RasResultIsNoIntervalException {
+ // create 2-D MDD with cell length 1, i.e., type “byte”:
+ RasGMArray myMDD = new RasGMArray(new RasMInterval("[1:400,1:400]"), 1);
+ // byte container for array data, matching in size:
+ byte[] mydata = new byte[160000];
+
+ // initialize array as grid of gray and black stripes:
+ for (int y = 0; y < 400; y++) {
+ for (int x = 0; x < 400; x++) {
+ mydata[y * 399 + x] = (byte) ((y % 4) > 1
+ ? 80
+ : 0);
+ }
+ }
+ // now insert byte array into MDD object
+ // (sets only the pointer, no copying takes place!):
+ myMDD.setArray(mydata);
+
+ return myMDD;
+ }
+
+ public void insertGrayImageAsArray(String name) throws ODMGException {
+ try {
+ init();
+
+ log("Creating grey image ...");
+ RasGMArray myMDD = createMDD();
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("create collection " + name + " GreySet");
+ // set the object type name (used for server type checking):
+ myMDD.setObjectTypeName("GreyImage");
+ // finally, execute “create collection” statement:
+ log("Creating collection '" + name + "'");
+ myQu.execute();
+ // now create the insert statement:
+ myQu.create("insert into " + name + " values $1");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Inserting data into the collection");
+ myQu.execute();
+ log("Done !");
+
+ commitAndClose();
+ } catch (Exception e) {
+ e.printStackTrace();
+ abortAndClose();
+ }
+ }
+
+ public void updateGrayImageWithArray(String name, BufferedImage img, int x1, int y1, int x2,
+ int y2) {
+ try {
+ log("Building query for updating gray image ...");
+ RasGMArray myMDD = createMddFromImage(img);
+
+ myMDD.setObjectTypeName("GreyImage");
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+ // Where to insert new image
+ String interval = String.valueOf(x1) + ":" + String.valueOf(x2) + ","
+ + String.valueOf(y1) + ":" + String.valueOf(y2);
+ // Size of new image
+ String interval2 = String.valueOf(0) + ":" + String.valueOf(x2 - x1) + ","
+ + String.valueOf(0) + ":" + String.valueOf(y2 - y1);
+
+ myQu.create("update " + name + " AS c SET c[" + interval + "] "
+ + "assign maaray x in [" + interval2 + "] values $1");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Updating image ...");
+ myQu.execute();
+ log("Done !");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void insertGrayImageAsArray(String name, BufferedImage img) throws ODMGException, InternalComponentException {
+ log("Creating grey image ...");
+ RasGMArray myMDD = createMddFromImage(img);
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("create collection " + name + " GreySet");
+ // set the object type name (used for server type checking):
+ myMDD.setObjectTypeName("GreyImage");
+ // finally, execute “create collection” statement:
+ log("Creating collection '" + name + "'");
+ myQu.execute();
+ // now create the insert statement:
+ myQu.create("insert into " + name + " values $1");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Inserting data into the collection");
+ myQu.execute();
+ log("Done !");
+ }
+
+ public void insertColorImageAsArray(String name, BufferedImage img) throws ODMGException {
+ try {
+ log("Creating grey image ...");
+ RasGMArray myMDD = createMddFromImage(img);
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("create collection " + name + " RGBSet");
+ // set the object type name (used for server type checking):
+ myMDD.setObjectTypeName("RGBImage");
+ // finally, execute “create collection” statement:
+ log("Creating collection '" + name + "'");
+ myQu.execute();
+ // now create the insert statement:
+ myQu.create("insert into " + name + " values $1");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Inserting data into the collection");
+ myQu.execute();
+ log("Done !");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void insertImageAsJpeg(String name, byte[] img, int maxX, int maxY) throws ODMGException {
+ try {
+ init();
+
+ log("Creating image from bytes ...");
+ RasGMArray myMDD = createRasArrayFromBytes(img, maxX, maxY);
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("create collection " + name + " GreySet");
+ // set the object type name (used for server type checking):
+ myMDD.setObjectTypeName("GreyImage");
+ // finally, execute “create collection” statement:
+ log("Creating collection '" + name + "'");
+ myQu.execute();
+ // now create the insert statement:
+ myQu.create("insert into " + name + " values inv_jpeg($1)");
+ // let the server generate a new OID for the object to be
+ // inserted, and remember this OID locally:
+ String myNewOID = myApp.getObjectId(myMDD);
+
+ // bind the MDD value which substitutes formal parameter $1:
+ myQu.bind(myMDD);
+ // …and ship the complete statement to the server:
+ log("Inserting data into the collection");
+ myQu.execute();
+ log("Done !");
+
+ commitAndClose();
+ } catch (Exception e) {
+ System.out.flush();
+ e.printStackTrace();
+ System.err.flush();
+ abortAndClose();
+ }
+ }
+
+ private RasGMArray createRasArrayFromBytes(byte[] bytes, int maxX, int maxY)
+ throws RasResultIsNoIntervalException {
+ // create 2-D MDD with cell length 1, i.e., type “byte”:
+ String strX = String.valueOf(maxX), strY = String.valueOf(maxY);
+ String interval = "[1:" + strX + "],1:" + strY + "]";
+ // FIXME: maybe change cell type?
+ int cellType = 1;
+
+ // create the RasGMArray object
+ RasGMArray myMDD = new RasGMArray(new RasMInterval(interval), cellType);
+
+ myMDD.setArray(bytes);
+
+ return myMDD;
+ }
+
+ public void deleteCollection(String name)
+ throws ODMGException, ODMGException, ODMGException, Exception {
+ try {
+// init();
+
+ log("Creating query...");
+ // set up query object for collection creation:
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create("drop collection " + name);
+ // finally, execute “create collection” statement:
+ log("Executing deletion query...");
+ myQu.execute();
+ // now create the insert statement:
+ log("Query finished !");
+
+// commitAndClose();
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ throw e;
+// abortAndClose();
+ }
+ }
+
+ public void printAllCollections() throws ODMGException {
+ String query = "select r from RAS_COLLECTIONNAMES as r";
+
+// init();
+
+ log("Querying for all available collections ...");
+ OQLQuery myQu = myApp.newOQLQuery();
+
+ myQu.create(query);
+
+ DBag resultSet = (DBag) myQu.execute();
+
+ if (resultSet != null) {
+ Iterator iter = resultSet.iterator();
+
+ while (iter.hasNext()) {
+ RasGMArray result = (RasGMArray) iter.next();
+ byte[] ba = result.getArray();
+ String name = new String(ba);
+
+ if (name.endsWith("\u0000")) {
+ name = name.substring(0, name.length() - (new String("\u0000")).length());
+ }
+
+ System.out.println("* " + name);
+ }
+ }
+
+// commitAndClose();
+ }
+
+ public RasGMArray createMddFromImage(BufferedImage img) throws InternalComponentException {
+ String interval = null;
+ try {
+ int cols = img.getWidth();
+ int rows = img.getHeight();
+ // create 2-D MDD with cell length 1, i.e., type “byte”:
+ interval = "[1:" + cols + ",1:" + rows + "]";
+ int cellType = 1;
+
+ // create the RasGMArray object
+ RasGMArray myMDD = new RasGMArray(new RasMInterval(interval), cellType);
+ DataBuffer db = img.getData().getDataBuffer();
+ byte[] bytes = new byte[cols * rows];
+
+
+ System.out.println("Processing image with size: " + interval);
+ System.out.println("Created vector with size: " + cols * rows);
+ System.out.println("Processing data with size: " + db.getSize());
+ int i = 0;
+
+ /*
+ * Java image data-types store an image as a 1-D array, reading the
+ * image row-wise. Rasdaman stores the image column-wise. So we need to
+ * convert between the two representations.
+ */
+ for (int c = 0; c < cols; c++) {
+ for (int r = 0; r < rows; r++) {
+ bytes[i++] = (byte) db.getElem(r * cols + c);
+ }
+ }
+ myMDD.setArray(bytes);
+
+ return myMDD;
+ } catch (RasResultIsNoIntervalException e) {
+ throw new InternalComponentException("Illegal Interval String: " + interval, e);
+ }
+ }
+
+ public BufferedImage convertImageToGray(BufferedImage img) {
+ BufferedImage image = new BufferedImage(img.getWidth(), img.getHeight(),
+ BufferedImage.TYPE_BYTE_GRAY);
+ Graphics g = image.getGraphics();
+
+ g.drawImage(img, 0, 0, null);
+ g.dispose();
+
+ return image;
+ }
+}
diff --git a/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java b/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java
new file mode 100644
index 0000000..54c00eb
--- /dev/null
+++ b/petascope/src/petascope/wcst/transaction/tools/TestRasdamanUtils.java
@@ -0,0 +1,202 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+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
+ * main() function and see what happens.
+ *
+ * @author Andrei Aiordachioaie
+ */
+public class TestRasdamanUtils {
+
+ private static RasdamanUtils myUtils;
+
+ public static void main(String[] args) throws ODMGException, RasResultIsNoIntervalException, IOException, Exception {
+// myUtils = new RasdamanUtils("http://kahlua.eecs.jacobs-university.de" + ":7001", "RASBASE");
+ myUtils = new RasdamanUtils("http://localhost" + ":7001", "RASBASE");
+
+ myUtils.init();
+
+ /* Try to comment/uncomment lines below ... */
+// myUtils.insertGrayImageAsArray("andreiTest1");
+// myUtils.loadCoverage("mr");
+// myUtils.printAllCollections();
+// testLoadRasdaman("andreiTest1");
+// testLoadRasdaman("andreiFlickrColor");
+// insertImageFromInternet("andreiFlickr1", "http://farm4.static.flickr.com/3347/3500129555_137c537e75_m.jpg");
+ myUtils.deleteCollection("andreiFlickrColor");
+// myUtils.commitAndClose();
+// myUtils.deleteCollection("flickr1");
+
+// updateImageFromInternet("andreiFlickr1", "http://localhost/peta/car.jpeg");
+
+// insertImageFromInternet("andreiFlickrColor", "http://localhost/peta/flickr1.jpg");
+
+// try
+// {
+// myUtils.deleteCollection("andreiFlickrColor");
+// myUtils.commitAndClose();
+// }
+// catch (Exception e)
+// {
+// e.printStackTrace();
+// myUtils.abortAndClose();
+// }
+
+// System.err.println("---------------------");
+// insertImageFromInternet("andreiWedding1", "http://farm3.static.flickr.com/2483/3758629356_d551cd5e6e.jpg");
+// System.err.println("---------------------");
+// testLoadRasdaman("andreiWedding1");
+
+ /* Stop commenting/uncommenting lines here */
+
+ try {
+ myUtils.commitAndClose();
+ } catch (Exception e) {
+ e.printStackTrace();
+ myUtils.abortAndClose();
+ }
+
+// understandColorImage("http://localhost/peta/flickr1.jpg");
+ }
+
+ private static void insertImageFromInternet(String identifier, String href) {
+ try {
+ // Step 1: fetch the image from Internet
+ URL url = new URL(href);
+ BufferedImage img0 = ImageIO.read(url);
+ BufferedImage img = myUtils.convertImageToGray(img0);
+
+ // Display image for check
+ displayImage(identifier, img);
+
+ // Step 2: Insert image into rasdaman
+ myUtils.insertGrayImageAsArray(identifier, img);
+// myUtils.insertColorImageAsArray(identifier, img);
+ } catch (Exception e) {
+ System.err.println("Error: " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ private static void updateImageFromInternet(String identifier, String href) {
+ try {
+ // Step 1: fetch the image from Internet
+ URL url = new URL(href);
+ BufferedImage img0 = ImageIO.read(url);
+ BufferedImage img = myUtils.convertImageToGray(img0);
+
+ // Display image for check
+ displayImage(identifier, img);
+
+ // Step 2: Update image into rasdaman
+ myUtils.updateGrayImageWithArray(identifier, img, 0, 0, img.getWidth(), img.getHeight());
+ } catch (Exception e) {
+ System.err.println("Error: " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ private static void testLoadRasdaman(String identifier) {
+ try {
+ BufferedImage img = myUtils.loadCoverage(identifier);
+
+ if (img == null) {
+ throw new Exception("Did not receive image from MyRasUtils !");
+ }
+ displayImage(identifier, img);
+ } catch (Exception e) {
+ System.err.println("Error !");
+ e.printStackTrace();
+ }
+ }
+
+ public static void displayImage(String name, BufferedImage img) {
+ JFrame f = new JFrame("Image " + name);
+
+ f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ f.getContentPane().add(new ShowImage(img));
+ f.setSize(img.getWidth() + 50, img.getHeight() + 50);
+ f.setVisible(true);
+ }
+
+ private static void understandColorImage(String href) {
+ String identifier = "image1";
+ try {
+ // Step 1: fetch the image from Internet
+ URL url = new URL(href);
+ BufferedImage img0 = ImageIO.read(url);
+ BufferedImage img = myUtils.convertImageToGray(img0);
+
+ // Display image for check
+ displayImage(identifier, img);
+
+ // Step 2: Insert image into rasdaman
+ System.out.println(img); // gray-image
+ System.out.println(img0); // color image
+ } catch (Exception e) {
+ System.err.println("Error: " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Panel to display loaded image
+ *
+ *
+ * @version 09.Jul 2009
+ * @author Andrei Aiordachioaie
+ */
+ public static class ShowImage extends Panel {
+
+ BufferedImage image;
+
+ public ShowImage(BufferedImage img) {
+ this.image = img;
+ }
+
+ public void paint(Graphics g) {
+ if (image != null) {
+ g.drawImage(image, 0, 0, null);
+ }
+ }
+ }
+}
diff --git a/petascope/src/petascope/wps/server/WpsServer.java b/petascope/src/petascope/wps/server/WpsServer.java
new file mode 100644
index 0000000..ccfb8ca
--- /dev/null
+++ b/petascope/src/petascope/wps/server/WpsServer.java
@@ -0,0 +1,126 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+package petascope.wps.server;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.antlr.runtime.RecognitionException;
+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;
+
+/**
+ *
+ * @author Michael Owonibi
+ */
+public class WpsServer {
+
+ private static Logger LOG = LoggerFactory.getLogger(WpsServer.class);
+ public String request = null;
+
+ public WpsServer(HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws URISyntaxException, IOException, InputOutputException, RecognitionException {
+
+ if ((httpRequest.getParameter("Request") != null) && httpRequest.getParameter("Request").equalsIgnoreCase("GetCapabilities")) {
+ GetCapabilities(httpResponse);
+ }
+
+ if ((((httpRequest.getParameter("version") != null) && httpRequest.getParameter("version").equalsIgnoreCase("1.0.0")) || ((httpRequest.getParameter("Version") != null) && httpRequest.getParameter("Version").equalsIgnoreCase("1.0.0")))) {
+
+ if ((httpRequest.getParameter("Request") != null) && httpRequest.getParameter("Request").equalsIgnoreCase("DescribeProcess") && (httpRequest.getParameter("identifier") != null) && httpRequest.getParameter("identifier").equalsIgnoreCase("ProcessCoverages")) {
+ DescribeProcess(httpResponse);
+ } else if ((httpRequest.getParameter("Request") != null) && httpRequest.getParameter("Request").equalsIgnoreCase("Execute") && (httpRequest.getParameter("identifier") != null) && httpRequest.getParameter("identifier").equalsIgnoreCase("ProcessCoverages")) {
+
+ String wpsRequest = httpRequest.getParameter("DataInputs");
+ wpsRequest = wpsRequest.substring(1, (wpsRequest.length() - 1));
+ int pos = -1;
+ pos = wpsRequest.indexOf("=");
+ if (wpsRequest.substring(0, pos).equalsIgnoreCase("WcpsAbstractSyntax")) {
+ wpsRequest = wpsRequest.substring(pos + 1, wpsRequest.length());
+
+ wpsRequest = ProcessCoveragesRequest.abstractQueryToXmlQuery(wpsRequest);
+ System.out.println("WPS request is :" + wpsRequest);
+ request = wpsRequest;
+ }
+ }
+ }
+ }
+
+ public void GetCapabilities(HttpServletResponse httpResponse) throws URISyntaxException, IOException, InputOutputException {
+ URI GetCapabilitiesURI = this.getClass().getResource("../templates/GetCapabilities.xml").toURI();
+ String GetCapabilitiesResponse = loadFile(GetCapabilitiesURI);
+ LOG.info("Executing operation GetCapabilities...");
+ System.out.println("GetCapabilities Response is " + GetCapabilitiesResponse);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(GetCapabilitiesResponse);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ public void DescribeProcess(HttpServletResponse httpResponse) throws URISyntaxException, IOException, InputOutputException {
+ URI DesribeProcessURI = this.getClass().getResource("../templates/DescribeProcess.xml").toURI();
+ String DescribeProcessResponse = loadFile(DesribeProcessURI);
+ LOG.info("Executing operation DescribeProcess...");
+ System.out.println("DescribeProcess Document is " + DescribeProcessResponse);
+ PrintWriter out;
+ try {
+ out = httpResponse.getWriter();
+ httpResponse.setContentType("text/xml; charset=utf-8");
+ out.write(DescribeProcessResponse);
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new InputOutputException(e.getMessage(), e);
+ }
+ }
+
+ private String loadFile(URI fileUri) throws IOException {
+ InputStream is = null;
+ String contents = null;
+ try {
+ LOG.debug("Loading file: " + fileUri);
+ File f = new File(fileUri);
+ is = new FileInputStream(f);
+ contents = IOUtils.toString(is);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException ex) {
+ }
+ }
+ return contents;
+ }
+}
diff --git a/petascope/src/petascope/wps/templates/DescribeProcess.xml b/petascope/src/petascope/wps/templates/DescribeProcess.xml
new file mode 100644
index 0000000..ff61fab
--- /dev/null
+++ b/petascope/src/petascope/wps/templates/DescribeProcess.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wps:ProcessDescriptions xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WPS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd">
+ <ProcessDescription wps:processVersion="1"
+ storeSupported="true" statusSupported="false">
+ <ows:Identifier>ProcessCoverages</ows:Identifier>
+ <ows:Title>ProcessCoverages Request</ows:Title>
+ <ows:Abstract> ProcessCoverages is a WPS process that provides a means of specifying server-side extraction and analysis of coverages containing sensor,image, and statistics data
+ </ows:Abstract>
+ <ows:Metadata xlink:title="coverage"/>
+ <ows:Metadata xlink:title="coverage processing"/>
+ <ows:Metadata xlink:title="WCS"/>
+ <wps:Profile>
+ urn:ogc:wps:1.0.0:ProcessCoverages
+ </wps:Profile>
+ <DataInputs>
+ <Input minOccurs="1" maxOccurs="1">
+ <ows:Identifier>
+ AbstractWcpsQuery
+ </ows:Identifier>
+ <ows:Title>
+ WCPS ProcessCoverages Request
+ </ows:Title>
+ <ows:Abstract> WCPS query</ows:Abstract>
+ <LiteralData>
+ <ows:DataType ows:reference=
+ "http://www.w3.org/TR/xmlschema2/#string">
+ string
+ </ows:DataType>
+ <ows:AnyValue/>
+ </LiteralData>
+ </Input>
+ </DataInputs>
+ <ProcessOutputs>
+ <Output>
+ <ows:Identifier>
+ ProcessCoveragesResultList
+ </ows:Identifier>
+ <ows:Title>WCPS Query</ows:Title>
+ <ows:Abstract>WCPS Query</ows:Abstract>
+ <ComplexOutput>
+ <Default>
+ <Format>
+ <MimeType>image/tiff</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ </Default>
+ <Supported>
+ <Format>
+ <MimeType>image/tiff</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>image/netcdf</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>image/hdf4.0</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>image/png</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>image/nitf</MimeType>
+ <Encoding>base64</Encoding>
+ </Format>
+ <Format>
+ <MimeType>text/plain</MimeType>
+ <Encoding>UTF-8</Encoding>
+ </Format>
+ </Supported>
+ </ComplexOutput>
+ </Output>
+ </ProcessOutputs>
+ </ProcessDescription>
+</wps:ProcessDescriptions>
diff --git a/petascope/src/petascope/wps/templates/GetCapabilities.xml b/petascope/src/petascope/wps/templates/GetCapabilities.xml
new file mode 100644
index 0000000..27a9ac7
--- /dev/null
+++ b/petascope/src/petascope/wps/templates/GetCapabilities.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wps:Capabilities service="WPS" version="1.0.0" xml:lang="en-US" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsGetCapabilities_response.xsd" updateSequence="1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <ows:ServiceIdentification>
+ <ows:Title> Coverage Processing in WPS</ows:Title>
+ <ows:Abstract>Coverage Processing using WPS</ows:Abstract>
+ <ows:Keywords>
+ <ows:Keyword>WCPS</ows:Keyword>
+ <ows:Keyword>ProcessCoverages</ows:Keyword>
+ </ows:Keywords>
+ <ows:ServiceType>WPS</ows:ServiceType>
+ <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
+ </ows:ServiceIdentification>
+ <ows:ServiceProvider>
+ <ows:ProviderName>Jacobs University</ows:ProviderName>
+<ows:ProviderSite xlink:href="http://www.jacobs-university.de"/>
+ </ows:ServiceProvider>
+
+ <ows:OperationsMetadata>
+ <ows:Operation name="GetCapabilities">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://kahlua.eecs.jacobs-university.de:8080/PetaScope/earthlook"/>
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+ <ows:Operation name="DescribeProcess">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://kahlua.eecs.jacobs-university.de:8080/PetaScope/earthlook"/>
+
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+ <ows:Operation name="Execute">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://kahlua.eecs.jacobs-university.de:8080/PetaScope/earthlook"/>
+ <ows:Post xlink:href="http://kahlua.eecs.jacobs-university.de:8080/PetaScope/earthlook"/>
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+ </ows:OperationsMetadata>
+
+
+ <wps:ProcessOfferings>
+ <wps:Process wps:processVersion="1.0.0">
+ <ows:Identifier>ProcessCoverages</ows:Identifier>
+ <ows:Title>WCPS Coverage Processing</ows:Title>
+<ows:Abstract>Expression for Server-side Coverage Processing</ows:Abstract>
+ </wps:Process>
+ </wps:ProcessOfferings>
+
+ <wps:Languages>
+ <wps:Default>
+ <ows:Language>en-US</ows:Language>
+ </wps:Default>
+ <wps:Supported>
+ <ows:Language>en-US</ows:Language>
+ </wps:Supported>
+ </wps:Languages>
+
+
+
+</wps:Capabilities>
+
diff --git a/petascope/templates/index.jsp b/petascope/templates/index.jsp
new file mode 100644
index 0000000..1fe281e
--- /dev/null
+++ b/petascope/templates/index.jsp
@@ -0,0 +1,27 @@
+<%--
+ Document : WAR Application index entry point
+ Created on : Apr 21, 2009, 7:47:47 AM
+ Author : Andrei Aiordachioaie
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>PetaScope Implementation</title>
+ </head>
+ <body>
+ <div align="center"><h1>PetaScope Implementation</h1></div>
+
+ <br/>
+ Please choose the service that you want to use:
+ <ul>
+ <li><a href="./wcps">WCPS</a> (the Web Coverage Processing Service).
+ <li><a href="./wcst">WCS-T</a> (the Web Coverage Service Transactional extension).
+ </ul>
+
+ </body>
+</html>
diff --git a/petascope/templates/interface-servlet.html b/petascope/templates/interface-servlet.html
new file mode 100644
index 0000000..6cd41ed
--- /dev/null
+++ b/petascope/templates/interface-servlet.html
@@ -0,0 +1,73 @@
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>PetaScope Web Client</title>
+ </head>
+ <body>
+
+<h1>PetaScope Client Interface</h1>
+
+<p>
+ Please submit one of the following request types:
+ <ul>
+ <li><a href="#proc">ProcessCoverages</a> (WCPS 1.0)</li>
+ <li><a href="#tran">Transaction</a> (WCS-T 1.0)</li>
+ <br />
+ <li><a href="#cap">GetCapabilities</a> (WCS 1.1, WCS 2.0)</li>
+
+ <li><a href="#desc">DescribeCoverage</a> (WCS 1.1, WCS 2.0)</li>
+ <li><a href="#get">GetCoverage</a> (WCS 1.1, WCS 2.0)</li>
+ </ul>
+</p>
+
+
+
+<ol>
+ <li>
+ <p>A <a name="proc"><strong>ProcessCoverage</strong></a> request. <br/>
+ Enter a ProcessCoverage XML request in the text area below.</p>
+ <form action="" method="post">
+ <textarea cols="64" rows="16" name="request"></textarea>
+ <input value="Send" type="submit" />
+ </form>
+ </li>
+
+ <li>
+ <p>A <a name="tran"><strong>Transaction</strong></a> request. <br/>
+ Enter a Transaction XML request in the text area below.</p>
+ <form action="" method="post">
+ <textarea cols="64" rows="16" name="request"></textarea>
+ <input value="Send" type="submit" />
+ </form>
+ </li>
+
+ <li>
+ <p>A <a name="cap"><strong>GetCapabilities</strong></a> request. <br/>
+ Enter a GetCapabilities XML request in the text area below.</p>
+ <form action="" method="post">
+ <textarea cols="64" rows="16" name="request"></textarea>
+ <input value="Send" type="submit" />
+ </form>
+ </li>
+
+ <li>
+ <p>A <a name="desc"><strong>DescribeCoverage</strong></a> request. <br/>
+ Enter a DescribeCoverage XML request in the text area below.</p>
+ <form action="" method="post">
+ <textarea cols="64" rows="16" name="request"></textarea>
+ <input value="Send" type="submit" />
+ </form>
+ </li>
+
+ <li>
+ <p>A <a name="get"><strong>GetCoverage</strong></a> request. <br/>
+ Enter a GetCoverage XML request in the text area below.</p>
+ <form action="" method="post">
+ <textarea cols="64" rows="16" name="request"></textarea>
+ <input value="Send" type="submit" />
+ </form>
+ </li>
+</ol>
+
+</body>
+</html>
diff --git a/petascope/templates/wcps-servlet.html b/petascope/templates/wcps-servlet.html
new file mode 100644
index 0000000..ec7cd44
--- /dev/null
+++ b/petascope/templates/wcps-servlet.html
@@ -0,0 +1,32 @@
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Web Coverage Processing Service</title>
+ </head>
+ <body>
+
+<h1>PetaScope Implementation (WCPS)</h1>
+
+<p>There are 3 ways to invoke this service:</p>
+
+<p>1. Enter a ProcessCoverage request in WCPS abstract syntax and submit it as a POST request with a parameter named <b>query</b>. You can use the form below.</p>
+<form action="" method="post">
+ <textarea cols="64" rows="4" name="query"></textarea>
+ <input value="Send" type="submit">
+</form>
+
+<p>2. Upload a ProcessCoverage XML request as a multupart/form-data POST request containing a file. You can use the form below.</p>
+<form action="" method="post" enctype="multipart/form-data">
+ <input accept="text/xml" size="64" name="xmlfile" type="file">
+ <input value="Send" type="submit">
+</form>
+
+<p>3. Enter a ProcessCoverage XML request and submit it as a POST request with a parameter named <b>xml</b>. You can use the form below.</p>
+<form action="" method="post">
+ <textarea cols="64" rows="16" name="xml"></textarea>
+ <input value="Send" type="submit">
+</form>
+
+
+</body>
+</html>
diff --git a/petascope/templates/wcst-servlet.html b/petascope/templates/wcst-servlet.html
new file mode 100644
index 0000000..9a3b9de
--- /dev/null
+++ b/petascope/templates/wcst-servlet.html
@@ -0,0 +1,18 @@
+<html>
+ <head>
+ <title>WCS Transaction Extension (Jacobs University)</title>
+ </head>
+<body>
+
+ <h1>WCS-Transaction Extension (Jacobs University)</h1>
+ Please enter a Transaction XML request in box below ... <br />
+
+ <h3>Transaction operation</h3>
+ <form action="" method="POST">Please enter a WCS Transaction XML request:<br />
+ <textarea name="TransactionXML" rows="15" cols="80"></textarea> <br />
+ <input type="submit" value="Submit" />
+ </form>
+<br /> <hr />
+
+</body>
+</html>
diff --git a/petascope/test/antlr.sh b/petascope/test/antlr.sh
new file mode 100755
index 0000000..13c274d
--- /dev/null
+++ b/petascope/test/antlr.sh
@@ -0,0 +1,5 @@
+#! /bin/bash
+
+# This script opens the ANTLRWorks editor, and the WCPS grammar in it, for editing.
+java -Xms128m -Xmx300m -jar ../lib/antlrworks-1.2.3.jar ../src/java/grammar/wcps.g
+
diff --git a/petascope/test/full-test-online.sh b/petascope/test/full-test-online.sh
new file mode 100755
index 0000000..2356719
--- /dev/null
+++ b/petascope/test/full-test-online.sh
@@ -0,0 +1,14 @@
+#! /bin/bash
+# Command-line utility for testing PetaScope WCPS
+# Usage: ./full-test-online.sh [URL] [testFolder] [outputFolder]
+# Parameters:
+# * URL: the URL of the PetaScope implementation. Defaults to the new implementation on kahlua
+# * testFolder: the folder that contains abstract syntax query test cases (extension ".test")
+# * outputFolder: the folder where the script should save intermediate and output files.
+#
+# WARNING: if you use relative paths for the folders, they should be relative to the project folder, not to the test folder !
+
+CLASSPATH=.:lib/wcps-all.jar:lib/jaxb-api.jar:lib/jaxb-impl.jar:lib/postgresql-8.3-604.jdbc4.jar:lib/jsr173_api.jar:lib/rasj.jar:lib/commons-math-1.1.jar:lib/antlrworks-1.2.3.jar:lib/commons-io-1.3.2.jar
+
+# cd .. && make jar && java -cp $CLASSPATH wcps.server.test.FullTestsOnline $1 $2 $3
+cd .. && java -cp $CLASSPATH wcps.server.test.FullTestsOnline $1 $2 $3
diff --git a/petascope/test/test-grammar-remote.sh b/petascope/test/test-grammar-remote.sh
new file mode 100755
index 0000000..d325761
--- /dev/null
+++ b/petascope/test/test-grammar-remote.sh
@@ -0,0 +1,5 @@
+#! /bin/bash
+
+CLASSPATH=.:lib/wcps-all.jar:lib/jaxb-api.jar:lib/jaxb-impl.jar:lib/postgresql-8.3-604.jdbc4.jar:lib/jsr173_api.jar:lib/rasj.jar:lib/commons-math-1.1.jar:lib/antlrworks-1.2.3.jar:lib/commons-io-1.3.2.jar
+
+cd .. && make jar && java -cp $CLASSPATH wcps.server.test.GrammarTestOnline
diff --git a/petascope/test/test-xml-remote.sh b/petascope/test/test-xml-remote.sh
new file mode 100755
index 0000000..b0860d4
--- /dev/null
+++ b/petascope/test/test-xml-remote.sh
@@ -0,0 +1,5 @@
+#! /bin/bash
+
+CLASSPATH=.:lib/wcps-all.jar:lib/jaxb-api.jar:lib/jaxb-impl.jar:lib/postgresql-8.3-604.jdbc4.jar:lib/jsr173_api.jar:lib/rasj.jar:lib/commons-math-1.1.jar:lib/antlrworks-1.2.3.jar:lib/commons-io-1.3.2.jar
+
+cd .. && make jar && java -cp $CLASSPATH wcps.server.test.XmlTestOnline
diff --git a/petascope/test/testcases-wcps/01-just_trim.rasql b/petascope/test/testcases-wcps/01-just_trim.rasql
new file mode 100644
index 0000000..e84cc38
--- /dev/null
+++ b/petascope/test/testcases-wcps/01-just_trim.rasql
@@ -0,0 +1 @@
+select png(c[0:450,0:300]) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/01-just_trim.test b/petascope/test/testcases-wcps/01-just_trim.test
new file mode 100644
index 0000000..5ba949b
--- /dev/null
+++ b/petascope/test/testcases-wcps/01-just_trim.test
@@ -0,0 +1 @@
+for c in ( rgb ) return encode( c[ x(0:450), y(0:300) ], "png" )
diff --git a/petascope/test/testcases-wcps/01-just_trim.xml b/petascope/test/testcases-wcps/01-just_trim.xml
new file mode 100644
index 0000000..debcb3f
--- /dev/null
+++ b/petascope/test/testcases-wcps/01-just_trim.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><trim><coverage>c</coverage><axis>x</axis><lowerBound><numericConstant>0</numericConstant></lowerBound><upperBound><numericConstant>450</numericConstant></upperBound><axis>y</axis><lowerBound><numericConstant>0</numericConstant></lowerBound><upperBound><numericConstant>300</numericConstant></upperBound></trim><format>png</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/02-trim_field_difference.rasql b/petascope/test/testcases-wcps/02-trim_field_difference.rasql
new file mode 100644
index 0000000..c684224
--- /dev/null
+++ b/petascope/test/testcases-wcps/02-trim_field_difference.rasql
@@ -0,0 +1 @@
+select png((char)(abs((((c).1)-((c).0))))[0:450,0:300]) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/02-trim_field_difference.test b/petascope/test/testcases-wcps/02-trim_field_difference.test
new file mode 100644
index 0000000..493c2e9
--- /dev/null
+++ b/petascope/test/testcases-wcps/02-trim_field_difference.test
@@ -0,0 +1 @@
+for c in ( rgb ) return encode( ((char) abs( c.1 - c.0 ))[ x(0:450), y(0:300) ], "png" )
diff --git a/petascope/test/testcases-wcps/02-trim_field_difference.xml b/petascope/test/testcases-wcps/02-trim_field_difference.xml
new file mode 100644
index 0000000..80e5d61
--- /dev/null
+++ b/petascope/test/testcases-wcps/02-trim_field_difference.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><trim><cast><abs><minus><fieldSelect><coverage>c</coverage><field><name>1</name></field></fieldSelect><fieldSelect><coverage>c</coverage><field><name>0</name></field></fieldSelect></minus></abs><type>char</type></cast><axis>x</axis><lowerBound><numericConstant>0</numericConstant></lowerBound><upperBound><numericConstant>450</numericConstant></upperBound><axis>y</axis><lowerBound><numericConstant>0</numericConstant></lowerBound><upperBound><numericConstant>300</numericConstant></upperBound></trim><format>png</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/03-simple_count.rasql b/petascope/test/testcases-wcps/03-simple_count.rasql
new file mode 100644
index 0000000..0fc4e39
--- /dev/null
+++ b/petascope/test/testcases-wcps/03-simple_count.rasql
@@ -0,0 +1 @@
+select count_cells((((c).1)=(0))) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/03-simple_count.test b/petascope/test/testcases-wcps/03-simple_count.test
new file mode 100644
index 0000000..da2cf4c
--- /dev/null
+++ b/petascope/test/testcases-wcps/03-simple_count.test
@@ -0,0 +1 @@
+for c in ( rgb ) return count( c.1 = 0 )
diff --git a/petascope/test/testcases-wcps/03-simple_count.xml b/petascope/test/testcases-wcps/03-simple_count.xml
new file mode 100644
index 0000000..5b1867d
--- /dev/null
+++ b/petascope/test/testcases-wcps/03-simple_count.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><count><equals><fieldSelect><coverage>c</coverage><field><name>1</name></field></fieldSelect><numericConstant>0</numericConstant></equals></count></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/04-vegetation_index.rasql b/petascope/test/testcases-wcps/04-vegetation_index.rasql
new file mode 100644
index 0000000..0142faf
--- /dev/null
+++ b/petascope/test/testcases-wcps/04-vegetation_index.rasql
@@ -0,0 +1 @@
+select png((char)((((((((((c).0)/((float)((((c).0)+((c).1))))))-((((c).1)/((float)((((c).0)+((c).1))))))))>(0.6)))*(255)))) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/04-vegetation_index.test b/petascope/test/testcases-wcps/04-vegetation_index.test
new file mode 100644
index 0000000..a6b69d4
--- /dev/null
+++ b/petascope/test/testcases-wcps/04-vegetation_index.test
@@ -0,0 +1 @@
+for c in ( rgb ) return encode((char) ( ((c.0 / ((float)c.0 + c.1))-(c.1 / ((float)c.0 + c.1))) > 0.6 ) * 255, "png" )
diff --git a/petascope/test/testcases-wcps/04-vegetation_index.xml b/petascope/test/testcases-wcps/04-vegetation_index.xml
new file mode 100644
index 0000000..3fbbb7f
--- /dev/null
+++ b/petascope/test/testcases-wcps/04-vegetation_index.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><cast><mult><greaterThan><minus><div><fieldSelect><coverage>c</coverage><field><name>0</name></field></fieldSelect><cast><plus><fieldSelect><coverage>c</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>c</coverage><field><name>1</name></field></fieldSelect></plus><type>float</type></cast></div><div><fieldSelect><coverage>c</coverage><field><name>1</name></field></fieldSelect><cast><plus><fieldSelect><coverage>c</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>c</coverage><field><name>1</name></field></fieldSelect></plus><type>float</type></cast></div></minus><numericConstant>0.6</numericConstant></greaterThan><numericConstant>255</numericConstant></mult><type>char</type></cast><format>png</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/05-just_encode.rasql b/petascope/test/testcases-wcps/05-just_encode.rasql
new file mode 100644
index 0000000..00018fc
--- /dev/null
+++ b/petascope/test/testcases-wcps/05-just_encode.rasql
@@ -0,0 +1 @@
+select jpeg(c) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/05-just_encode.test b/petascope/test/testcases-wcps/05-just_encode.test
new file mode 100644
index 0000000..51dd902
--- /dev/null
+++ b/petascope/test/testcases-wcps/05-just_encode.test
@@ -0,0 +1 @@
+for c in ( rgb ) return encode( c, "jpeg" )
diff --git a/petascope/test/testcases-wcps/05-just_encode.xml b/petascope/test/testcases-wcps/05-just_encode.xml
new file mode 100644
index 0000000..0bd3be0
--- /dev/null
+++ b/petascope/test/testcases-wcps/05-just_encode.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><coverage>c</coverage><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/06-just_cast_inverse.rasql b/petascope/test/testcases-wcps/06-just_cast_inverse.rasql
new file mode 100644
index 0000000..5a999e1
--- /dev/null
+++ b/petascope/test/testcases-wcps/06-just_cast_inverse.rasql
@@ -0,0 +1 @@
+select jpeg((char)(((255)-((c).red)))[50:150,50:150]) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/06-just_cast_inverse.test b/petascope/test/testcases-wcps/06-just_cast_inverse.test
new file mode 100644
index 0000000..dae835c
--- /dev/null
+++ b/petascope/test/testcases-wcps/06-just_cast_inverse.test
@@ -0,0 +1 @@
+for c in ( rgb ) return encode( ((char)255 - c.red)[x(50:150),y(50:150)], "jpeg" )
diff --git a/petascope/test/testcases-wcps/06-just_cast_inverse.xml b/petascope/test/testcases-wcps/06-just_cast_inverse.xml
new file mode 100644
index 0000000..696d3c8
--- /dev/null
+++ b/petascope/test/testcases-wcps/06-just_cast_inverse.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><trim><cast><minus><numericConstant>255</numericConstant><fieldSelect><coverage>c</coverage><field><name>red</name></field></fieldSelect></minus><type>char</type></cast><axis>x</axis><lowerBound><numericConstant>50</numericConstant></lowerBound><upperBound><numericConstant>150</numericConstant></upperBound><axis>y</axis><lowerBound><numericConstant>50</numericConstant></lowerBound><upperBound><numericConstant>150</numericConstant></upperBound></trim><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/07-just_slice.rasql b/petascope/test/testcases-wcps/07-just_slice.rasql
new file mode 100644
index 0000000..072e83b
--- /dev/null
+++ b/petascope/test/testcases-wcps/07-just_slice.rasql
@@ -0,0 +1 @@
+select jpeg(m[*:*,100,*:*]) from Modis AS m \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/07-just_slice.test b/petascope/test/testcases-wcps/07-just_slice.test
new file mode 100644
index 0000000..b1fa8fd
--- /dev/null
+++ b/petascope/test/testcases-wcps/07-just_slice.test
@@ -0,0 +1 @@
+for m in ( Modis ) return encode( slice( m, {x(100)} ), "jpeg" )
diff --git a/petascope/test/testcases-wcps/07-just_slice.xml b/petascope/test/testcases-wcps/07-just_slice.xml
new file mode 100644
index 0000000..7a45467
--- /dev/null
+++ b/petascope/test/testcases-wcps/07-just_slice.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>m</iteratorVar><coverageName>Modis</coverageName></coverageIterator><encode store="false"><slice><coverage>m</coverage><axis>x</axis><slicingPosition><numericConstant>100</numericConstant></slicingPosition></slice><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/08-just_encode_field.rasql b/petascope/test/testcases-wcps/08-just_encode_field.rasql
new file mode 100644
index 0000000..1a198f4
--- /dev/null
+++ b/petascope/test/testcases-wcps/08-just_encode_field.rasql
@@ -0,0 +1 @@
+select jpeg((m).red) from NIR AS m \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/08-just_encode_field.test b/petascope/test/testcases-wcps/08-just_encode_field.test
new file mode 100644
index 0000000..e5ef4dc
--- /dev/null
+++ b/petascope/test/testcases-wcps/08-just_encode_field.test
@@ -0,0 +1 @@
+for m in ( NIR ) return encode( m.red, "jpeg" )
diff --git a/petascope/test/testcases-wcps/08-just_encode_field.xml b/petascope/test/testcases-wcps/08-just_encode_field.xml
new file mode 100644
index 0000000..60d9750
--- /dev/null
+++ b/petascope/test/testcases-wcps/08-just_encode_field.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>m</iteratorVar><coverageName>NIR</coverageName></coverageIterator><encode store="false"><fieldSelect><coverage>m</coverage><field><name>red</name></field></fieldSelect><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/09-just_log.rasql b/petascope/test/testcases-wcps/09-just_log.rasql
new file mode 100644
index 0000000..b9a1ab0
--- /dev/null
+++ b/petascope/test/testcases-wcps/09-just_log.rasql
@@ -0,0 +1 @@
+select jpeg(log((s).2)) from rgb AS s \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/09-just_log.test b/petascope/test/testcases-wcps/09-just_log.test
new file mode 100644
index 0000000..15110d7
--- /dev/null
+++ b/petascope/test/testcases-wcps/09-just_log.test
@@ -0,0 +1 @@
+for s in ( rgb ) return encode( log(s.2), "jpeg" )
diff --git a/petascope/test/testcases-wcps/09-just_log.xml b/petascope/test/testcases-wcps/09-just_log.xml
new file mode 100644
index 0000000..13dc6e0
--- /dev/null
+++ b/petascope/test/testcases-wcps/09-just_log.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>s</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><log><fieldSelect><coverage>s</coverage><field><name>2</name></field></fieldSelect></log><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/10-just_field_difference.rasql b/petascope/test/testcases-wcps/10-just_field_difference.rasql
new file mode 100644
index 0000000..e5492c7
--- /dev/null
+++ b/petascope/test/testcases-wcps/10-just_field_difference.rasql
@@ -0,0 +1 @@
+select jpeg((((s).0)-((s).1))) from rgb AS s \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/10-just_field_difference.test b/petascope/test/testcases-wcps/10-just_field_difference.test
new file mode 100644
index 0000000..cf7b3ff
--- /dev/null
+++ b/petascope/test/testcases-wcps/10-just_field_difference.test
@@ -0,0 +1 @@
+for s in ( rgb ) return encode( s.0 - s.1, "jpeg" )
diff --git a/petascope/test/testcases-wcps/10-just_field_difference.xml b/petascope/test/testcases-wcps/10-just_field_difference.xml
new file mode 100644
index 0000000..a9dfbea
--- /dev/null
+++ b/petascope/test/testcases-wcps/10-just_field_difference.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>s</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><minus><fieldSelect><coverage>s</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>s</coverage><field><name>1</name></field></fieldSelect></minus><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/11_vegetation_index_computation.rasql b/petascope/test/testcases-wcps/11_vegetation_index_computation.rasql
new file mode 100644
index 0000000..b331c0c
--- /dev/null
+++ b/petascope/test/testcases-wcps/11_vegetation_index_computation.rasql
@@ -0,0 +1 @@
+select jpeg((char)((((((s).0)-((s).1)))/((((s).0)+((s).1)))))) from rgb AS s \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/11_vegetation_index_computation.test b/petascope/test/testcases-wcps/11_vegetation_index_computation.test
new file mode 100644
index 0000000..e8161b8
--- /dev/null
+++ b/petascope/test/testcases-wcps/11_vegetation_index_computation.test
@@ -0,0 +1 @@
+for s in ( rgb ) return encode((char) (s.0 - s.1)/(s.0 + s.1), "jpeg" )
diff --git a/petascope/test/testcases-wcps/11_vegetation_index_computation.xml b/petascope/test/testcases-wcps/11_vegetation_index_computation.xml
new file mode 100644
index 0000000..80b5430
--- /dev/null
+++ b/petascope/test/testcases-wcps/11_vegetation_index_computation.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>s</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><cast><div><minus><fieldSelect><coverage>s</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>s</coverage><field><name>1</name></field></fieldSelect></minus><plus><fieldSelect><coverage>s</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>s</coverage><field><name>1</name></field></fieldSelect></plus></div><type>char</type></cast><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/12-vegetation_index.rasql b/petascope/test/testcases-wcps/12-vegetation_index.rasql
new file mode 100644
index 0000000..8cca981
--- /dev/null
+++ b/petascope/test/testcases-wcps/12-vegetation_index.rasql
@@ -0,0 +1 @@
+select jpeg((((((((s).0)-((s).1)))/((((s).0)+((s).1)))))>(0.1))) from rgb AS s \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/12-vegetation_index.test b/petascope/test/testcases-wcps/12-vegetation_index.test
new file mode 100644
index 0000000..3bdd5e2
--- /dev/null
+++ b/petascope/test/testcases-wcps/12-vegetation_index.test
@@ -0,0 +1 @@
+for s in ( rgb ) return encode( ((s.0-s.1)/(s.0+s.1)) > 0.1, "jpeg" )
diff --git a/petascope/test/testcases-wcps/12-vegetation_index.xml b/petascope/test/testcases-wcps/12-vegetation_index.xml
new file mode 100644
index 0000000..d6b30fb
--- /dev/null
+++ b/petascope/test/testcases-wcps/12-vegetation_index.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>s</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><greaterThan><div><minus><fieldSelect><coverage>s</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>s</coverage><field><name>1</name></field></fieldSelect></minus><plus><fieldSelect><coverage>s</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>s</coverage><field><name>1</name></field></fieldSelect></plus></div><numericConstant>0.1</numericConstant></greaterThan><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/13-just_encode_three_coverages.rasql b/petascope/test/testcases-wcps/13-just_encode_three_coverages.rasql
new file mode 100644
index 0000000..0bcbcae
--- /dev/null
+++ b/petascope/test/testcases-wcps/13-just_encode_three_coverages.rasql
@@ -0,0 +1 @@
+select jpeg(s) from rgb AS s \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/13-just_encode_three_coverages.test b/petascope/test/testcases-wcps/13-just_encode_three_coverages.test
new file mode 100644
index 0000000..302a4b0
--- /dev/null
+++ b/petascope/test/testcases-wcps/13-just_encode_three_coverages.test
@@ -0,0 +1 @@
+for s in ( rgb, rgb, rgb ) return encode( s, "jpeg" )
diff --git a/petascope/test/testcases-wcps/13-just_encode_three_coverages.xml b/petascope/test/testcases-wcps/13-just_encode_three_coverages.xml
new file mode 100644
index 0000000..665a965
--- /dev/null
+++ b/petascope/test/testcases-wcps/13-just_encode_three_coverages.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>s</iteratorVar><coverageName>rgb</coverageName><coverageName>rgb</coverageName><coverageName>rgb</coverageName></coverageIterator><encode store="false"><coverage>s</coverage><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/14_count_vegetation_cells.rasql b/petascope/test/testcases-wcps/14_count_vegetation_cells.rasql
new file mode 100644
index 0000000..1fa9494
--- /dev/null
+++ b/petascope/test/testcases-wcps/14_count_vegetation_cells.rasql
@@ -0,0 +1 @@
+select count_cells((((((((s).0)+((s).1)))/((((s).0)-((s).1)))))>=(0))) from rgb AS s \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/14_count_vegetation_cells.test b/petascope/test/testcases-wcps/14_count_vegetation_cells.test
new file mode 100644
index 0000000..384aaf4
--- /dev/null
+++ b/petascope/test/testcases-wcps/14_count_vegetation_cells.test
@@ -0,0 +1,2 @@
+for s in ( rgb, rgb, rgb ) return
+ count( (s.0+s.1)/(s.0-s.1) >= 0) \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/14_count_vegetation_cells.xml b/petascope/test/testcases-wcps/14_count_vegetation_cells.xml
new file mode 100644
index 0000000..e13f150
--- /dev/null
+++ b/petascope/test/testcases-wcps/14_count_vegetation_cells.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>s</iteratorVar><coverageName>rgb</coverageName><coverageName>rgb</coverageName><coverageName>rgb</coverageName></coverageIterator><count><greaterOrEqual><div><plus><fieldSelect><coverage>s</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>s</coverage><field><name>1</name></field></fieldSelect></plus><minus><fieldSelect><coverage>s</coverage><field><name>0</name></field></fieldSelect><fieldSelect><coverage>s</coverage><field><name>1</name></field></fieldSelect></minus></div><numericConstant>0</numericConstant></greaterOrEqual></count></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.rasql b/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.rasql
new file mode 100644
index 0000000..30244ca
--- /dev/null
+++ b/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.rasql
@@ -0,0 +1 @@
+select jpeg((char)(marray ii in [51:150, 0:99] values ii[0])) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.test b/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.test
new file mode 100644
index 0000000..655dbfa
--- /dev/null
+++ b/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.test
@@ -0,0 +1,8 @@
+for c in ( rgb )
+return encode(
+ (char)
+ coverage greyImage
+ over $first x(51:150),
+ $second y(0:99)
+ values $first
+, "jpeg" ) \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.xml b/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.xml
new file mode 100644
index 0000000..ba88b24
--- /dev/null
+++ b/petascope/test/testcases-wcps/15-construct_simple_gray_gradient.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><cast><construct><name>greyImage</name><axisIterator><iteratorVar>first</iteratorVar><axis>x</axis><numericConstant>51</numericConstant><numericConstant>150</numericConstant></axisIterator><axisIterator><iteratorVar>second</iteratorVar><axis>y</axis><numericConstant>0</numericConstant><numericConstant>99</numericConstant></axisIterator><variableRef>first</variableRef></construct><type>char</type></cast><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/16-simple_histogram.rasql b/petascope/test/testcases-wcps/16-simple_histogram.rasql
new file mode 100644
index 0000000..5176c0b
--- /dev/null
+++ b/petascope/test/testcases-wcps/16-simple_histogram.rasql
@@ -0,0 +1 @@
+select csv(marray ii in [0:255] values count_cells(((c)=(ii[0])))) from mr AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/16-simple_histogram.test b/petascope/test/testcases-wcps/16-simple_histogram.test
new file mode 100644
index 0000000..472329e
--- /dev/null
+++ b/petascope/test/testcases-wcps/16-simple_histogram.test
@@ -0,0 +1,6 @@
+for c in ( mr )
+return encode(
+ coverage histogram
+ over $n x(0:255)
+ values count( c = $n )
+, "csv" ) \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/16-simple_histogram.xml b/petascope/test/testcases-wcps/16-simple_histogram.xml
new file mode 100644
index 0000000..273d639
--- /dev/null
+++ b/petascope/test/testcases-wcps/16-simple_histogram.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>mr</coverageName></coverageIterator><encode store="false"><construct><name>histogram</name><axisIterator><iteratorVar>n</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>255</numericConstant></axisIterator><count><equals><coverage>c</coverage><variableRef>n</variableRef></equals></count></construct><format>csv</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/17-climate_over_earth.rasql b/petascope/test/testcases-wcps/17-climate_over_earth.rasql
new file mode 100644
index 0000000..00bd08d
--- /dev/null
+++ b/petascope/test/testcases-wcps/17-climate_over_earth.rasql
@@ -0,0 +1 @@
+select png((char)(((clouds[*:*,*:*,0])*(mask[*:*,*:*,0])))) from climate_earth AS mask, climate_clouds AS clouds \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/17-climate_over_earth.test b/petascope/test/testcases-wcps/17-climate_over_earth.test
new file mode 100644
index 0000000..d51df7a
--- /dev/null
+++ b/petascope/test/testcases-wcps/17-climate_over_earth.test
@@ -0,0 +1,5 @@
+for clouds in ( climate_clouds ),
+ mask in ( climate_earth )
+return encode(
+ (char) clouds[ t(0) ] * mask[ t(0) ]
+, "png" ) \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/17-climate_over_earth.xml b/petascope/test/testcases-wcps/17-climate_over_earth.xml
new file mode 100644
index 0000000..12d9909
--- /dev/null
+++ b/petascope/test/testcases-wcps/17-climate_over_earth.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>mask</iteratorVar><coverageName>climate_earth</coverageName></coverageIterator><coverageIterator><iteratorVar>clouds</iteratorVar><coverageName>climate_clouds</coverageName></coverageIterator><encode store="false"><cast><mult><slice><coverage>clouds</coverage><axis>t</axis><slicingPosition><numericConstant>0</numericConstant></slicingPosition></slice><slice><coverage>mask</coverage><axis>t</axis><slicingPosition><numericConstant>0</numericConstant></slicingPosition></slice></mult><type>char</type></cast><format>png</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/18-climate_over_water.rasql b/petascope/test/testcases-wcps/18-climate_over_water.rasql
new file mode 100644
index 0000000..234cc47
--- /dev/null
+++ b/petascope/test/testcases-wcps/18-climate_over_water.rasql
@@ -0,0 +1 @@
+select png((char)(((clouds[*:*,*:*,0])*(((mask[*:*,*:*,0])=(0)))))) from climate_earth AS mask, climate_clouds AS clouds \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/18-climate_over_water.test b/petascope/test/testcases-wcps/18-climate_over_water.test
new file mode 100644
index 0000000..a0047bf
--- /dev/null
+++ b/petascope/test/testcases-wcps/18-climate_over_water.test
@@ -0,0 +1,5 @@
+for clouds in ( climate_clouds),
+ mask in ( climate_earth)
+return encode(
+ (char) clouds[ t(0) ] * (mask[ t(0) ] = 0)
+, "png" )
diff --git a/petascope/test/testcases-wcps/18-climate_over_water.xml b/petascope/test/testcases-wcps/18-climate_over_water.xml
new file mode 100644
index 0000000..41a3422
--- /dev/null
+++ b/petascope/test/testcases-wcps/18-climate_over_water.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>mask</iteratorVar><coverageName>climate_earth</coverageName></coverageIterator><coverageIterator><iteratorVar>clouds</iteratorVar><coverageName>climate_clouds</coverageName></coverageIterator><encode store="false"><cast><mult><slice><coverage>clouds</coverage><axis>t</axis><slicingPosition><numericConstant>0</numericConstant></slicingPosition></slice><equals><slice><coverage>mask</coverage><axis>t</axis><slicingPosition><numericConstant>0</numericConstant></slicingPosition></slice><numericConstant>0</numericConstant></equals></mult><type>char</type></cast><format>png</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/19-just_sinus.rasql b/petascope/test/testcases-wcps/19-just_sinus.rasql
new file mode 100644
index 0000000..5738ca3
--- /dev/null
+++ b/petascope/test/testcases-wcps/19-just_sinus.rasql
@@ -0,0 +1 @@
+select jpeg(sin((c).1)) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/19-just_sinus.test b/petascope/test/testcases-wcps/19-just_sinus.test
new file mode 100644
index 0000000..3dcffb8
--- /dev/null
+++ b/petascope/test/testcases-wcps/19-just_sinus.test
@@ -0,0 +1 @@
+for c in (rgb) return encode(sin(c.1), "jpeg")
diff --git a/petascope/test/testcases-wcps/19-just_sinus.xml b/petascope/test/testcases-wcps/19-just_sinus.xml
new file mode 100644
index 0000000..3862f86
--- /dev/null
+++ b/petascope/test/testcases-wcps/19-just_sinus.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><sin><fieldSelect><coverage>c</coverage><field><name>1</name></field></fieldSelect></sin><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/20-just_tangent.rasql b/petascope/test/testcases-wcps/20-just_tangent.rasql
new file mode 100644
index 0000000..d3724d4
--- /dev/null
+++ b/petascope/test/testcases-wcps/20-just_tangent.rasql
@@ -0,0 +1 @@
+select jpeg(tan((c).1)) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/20-just_tangent.test b/petascope/test/testcases-wcps/20-just_tangent.test
new file mode 100644
index 0000000..77946ad
--- /dev/null
+++ b/petascope/test/testcases-wcps/20-just_tangent.test
@@ -0,0 +1 @@
+for c in (rgb) return encode(tan(c.1), "jpeg")
diff --git a/petascope/test/testcases-wcps/20-just_tangent.xml b/petascope/test/testcases-wcps/20-just_tangent.xml
new file mode 100644
index 0000000..db8b3db
--- /dev/null
+++ b/petascope/test/testcases-wcps/20-just_tangent.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><tan><fieldSelect><coverage>c</coverage><field><name>1</name></field></fieldSelect></tan><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/21-just_exponent.rasql b/petascope/test/testcases-wcps/21-just_exponent.rasql
new file mode 100644
index 0000000..b771d4f
--- /dev/null
+++ b/petascope/test/testcases-wcps/21-just_exponent.rasql
@@ -0,0 +1 @@
+select jpeg(exp((((c).1)/(100)))) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/21-just_exponent.test b/petascope/test/testcases-wcps/21-just_exponent.test
new file mode 100644
index 0000000..49f1cde
--- /dev/null
+++ b/petascope/test/testcases-wcps/21-just_exponent.test
@@ -0,0 +1 @@
+for c in (rgb) return encode(exp(c.1/100), "jpeg")
diff --git a/petascope/test/testcases-wcps/21-just_exponent.xml b/petascope/test/testcases-wcps/21-just_exponent.xml
new file mode 100644
index 0000000..9ad7818
--- /dev/null
+++ b/petascope/test/testcases-wcps/21-just_exponent.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><exp><div><fieldSelect><coverage>c</coverage><field><name>1</name></field></fieldSelect><numericConstant>100</numericConstant></div></exp><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/22-just_max_double.rasql b/petascope/test/testcases-wcps/22-just_max_double.rasql
new file mode 100644
index 0000000..2a5ad21
--- /dev/null
+++ b/petascope/test/testcases-wcps/22-just_max_double.rasql
@@ -0,0 +1 @@
+select max_cells((double)((c).2)) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/22-just_max_double.test b/petascope/test/testcases-wcps/22-just_max_double.test
new file mode 100644
index 0000000..42a9215
--- /dev/null
+++ b/petascope/test/testcases-wcps/22-just_max_double.test
@@ -0,0 +1 @@
+for c in ( rgb ) return max((double)c.2)
diff --git a/petascope/test/testcases-wcps/22-just_max_double.xml b/petascope/test/testcases-wcps/22-just_max_double.xml
new file mode 100644
index 0000000..461d8d2
--- /dev/null
+++ b/petascope/test/testcases-wcps/22-just_max_double.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><max><cast><fieldSelect><coverage>c</coverage><field><name>2</name></field></fieldSelect><type>double</type></cast></max></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/23_shown_only_green_areas.rasql b/petascope/test/testcases-wcps/23_shown_only_green_areas.rasql
new file mode 100644
index 0000000..db67c29
--- /dev/null
+++ b/petascope/test/testcases-wcps/23_shown_only_green_areas.rasql
@@ -0,0 +1 @@
+select jpeg(((r)*((((((((r).green)>(130)))and((((r).red)<(110)))))and((((r).blue)<(140))))))) from rgb AS r \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/23_shown_only_green_areas.test b/petascope/test/testcases-wcps/23_shown_only_green_areas.test
new file mode 100644
index 0000000..9a9c78e
--- /dev/null
+++ b/petascope/test/testcases-wcps/23_shown_only_green_areas.test
@@ -0,0 +1,4 @@
+for r in (rgb)
+return encode(
+ r * ((r.green > 130) and (r.red < 110) and (r.blue < 140))
+ , "jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/23_shown_only_green_areas.xml b/petascope/test/testcases-wcps/23_shown_only_green_areas.xml
new file mode 100644
index 0000000..1e1d521
--- /dev/null
+++ b/petascope/test/testcases-wcps/23_shown_only_green_areas.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>r</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><mult><coverage>r</coverage><and><and><greaterThan><fieldSelect><coverage>r</coverage><field><name>green</name></field></fieldSelect><numericConstant>130</numericConstant></greaterThan><lessThan><fieldSelect><coverage>r</coverage><field><name>red</name></field></fieldSelect><numericConstant>110</numericConstant></lessThan></and><lessThan><fieldSelect><coverage>r</coverage><field><name>blue</name></field></fieldSelect><numericConstant>140</numericConstant></lessThan></and></mult><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/24-condense_coverage_one_var.rasql b/petascope/test/testcases-wcps/24-condense_coverage_one_var.rasql
new file mode 100644
index 0000000..39fb5e5
--- /dev/null
+++ b/petascope/test/testcases-wcps/24-condense_coverage_one_var.rasql
@@ -0,0 +1 @@
+select condense + over ii in [1:10] using ((ii[0])*((a[ii[0],10]).red)) from rgb AS a \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/24-condense_coverage_one_var.test b/petascope/test/testcases-wcps/24-condense_coverage_one_var.test
new file mode 100644
index 0000000..7882156
--- /dev/null
+++ b/petascope/test/testcases-wcps/24-condense_coverage_one_var.test
@@ -0,0 +1,4 @@
+for a in (rgb) return
+ condense +
+ over $x x(1:10)
+ using $x * (a[x($x), y(10)]).red \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/24-condense_coverage_one_var.xml b/petascope/test/testcases-wcps/24-condense_coverage_one_var.xml
new file mode 100644
index 0000000..360beda
--- /dev/null
+++ b/petascope/test/testcases-wcps/24-condense_coverage_one_var.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>a</iteratorVar><coverageName>rgb</coverageName></coverageIterator><condense><opPlus/><iterator><iteratorVar>x</iteratorVar><axis>x</axis><numericConstant>1</numericConstant><numericConstant>10</numericConstant></iterator><mult><variableRef>x</variableRef><fieldSelect><slice><coverage>a</coverage><axis>x</axis><slicingPosition><variableRef>x</variableRef></slicingPosition><axis>y</axis><slicingPosition><numericConstant>10</numericConstant></slicingPosition></slice><field><name>red</name></field></fieldSelect></mult></condense></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/25-condense_field_two_vars.rasql b/petascope/test/testcases-wcps/25-condense_field_two_vars.rasql
new file mode 100644
index 0000000..692d925
--- /dev/null
+++ b/petascope/test/testcases-wcps/25-condense_field_two_vars.rasql
@@ -0,0 +1 @@
+select condense + over ii in [1:10, 25:75] using ((ii[0])*((a[ii[0],ii[1]]).red)) from rgb AS a \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/25-condense_field_two_vars.test b/petascope/test/testcases-wcps/25-condense_field_two_vars.test
new file mode 100644
index 0000000..93da0d1
--- /dev/null
+++ b/petascope/test/testcases-wcps/25-condense_field_two_vars.test
@@ -0,0 +1,5 @@
+for a in (rgb) return
+ condense +
+ over $kx x (1:10),
+ $ky y (25:75)
+ using $kx * (a[x($kx),y($ky)]).red
diff --git a/petascope/test/testcases-wcps/25-condense_field_two_vars.xml b/petascope/test/testcases-wcps/25-condense_field_two_vars.xml
new file mode 100644
index 0000000..15219ed
--- /dev/null
+++ b/petascope/test/testcases-wcps/25-condense_field_two_vars.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>a</iteratorVar><coverageName>rgb</coverageName></coverageIterator><condense><opPlus/><iterator><iteratorVar>kx</iteratorVar><axis>x</axis><numericConstant>1</numericConstant><numericConstant>10</numericConstant></iterator><iterator><iteratorVar>ky</iteratorVar><axis>y</axis><numericConstant>25</numericConstant><numericConstant>75</numericConstant></iterator><mult><variableRef>kx</variableRef><fieldSelect><slice><coverage>a</coverage><axis>x</axis><slicingPosition><variableRef>kx</variableRef></slicingPosition><axis>y</axis><slicingPosition><variableRef>ky</variableRef></slicingPosition></slice><field><name>red</name></field></fieldSelect></mult></condense></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/26-constant_coverage.rasql b/petascope/test/testcases-wcps/26-constant_coverage.rasql
new file mode 100644
index 0000000..c44e5d2
--- /dev/null
+++ b/petascope/test/testcases-wcps/26-constant_coverage.rasql
@@ -0,0 +1 @@
+select csv(< [0:1] 0, 1>) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/26-constant_coverage.test b/petascope/test/testcases-wcps/26-constant_coverage.test
new file mode 100644
index 0000000..1325f49
--- /dev/null
+++ b/petascope/test/testcases-wcps/26-constant_coverage.test
@@ -0,0 +1,6 @@
+for c in (rgb) return
+encode(
+ coverage const
+ over $px x(0:1)
+ value list <0;1>
+, "csv") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/26-constant_coverage.xml b/petascope/test/testcases-wcps/26-constant_coverage.xml
new file mode 100644
index 0000000..d2f327c
--- /dev/null
+++ b/petascope/test/testcases-wcps/26-constant_coverage.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><const><name>const</name><axisIterator><iteratorVar>px</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>1</numericConstant></axisIterator><value>0</value><value>1</value></const><format>csv</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/27-construct_boring_histogram.rasql b/petascope/test/testcases-wcps/27-construct_boring_histogram.rasql
new file mode 100644
index 0000000..7402078
--- /dev/null
+++ b/petascope/test/testcases-wcps/27-construct_boring_histogram.rasql
@@ -0,0 +1 @@
+select csv(marray ii in [0:20] values condense + over ij in [0:20, 0:20] using 1) from mr AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/27-construct_boring_histogram.test b/petascope/test/testcases-wcps/27-construct_boring_histogram.test
new file mode 100644
index 0000000..4359686
--- /dev/null
+++ b/petascope/test/testcases-wcps/27-construct_boring_histogram.test
@@ -0,0 +1,9 @@
+for c in ( mr )
+return
+encode( coverage histogram
+ over $n x(0:20)
+ values condense +
+ over $px x(0:20),
+ $py y(0:20)
+ using 1,
+ "csv" )
diff --git a/petascope/test/testcases-wcps/27-construct_boring_histogram.xml b/petascope/test/testcases-wcps/27-construct_boring_histogram.xml
new file mode 100644
index 0000000..ebe3573
--- /dev/null
+++ b/petascope/test/testcases-wcps/27-construct_boring_histogram.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>mr</coverageName></coverageIterator><encode store="false"><construct><name>histogram</name><axisIterator><iteratorVar>n</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>20</numericConstant></axisIterator><condense><opPlus/><iterator><iteratorVar>px</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>20</numericConstant></iterator><iterator><iteratorVar>py</iteratorVar><axis>y</axis><numericConstant>0</numericConstant><numericConstant>20</numericConstant></iterator><numericConstant>1</numericConstant></condense></construct><format>csv</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/28-construct_histogram_range_condition.rasql b/petascope/test/testcases-wcps/28-construct_histogram_range_condition.rasql
new file mode 100644
index 0000000..c99a1d1
--- /dev/null
+++ b/petascope/test/testcases-wcps/28-construct_histogram_range_condition.rasql
@@ -0,0 +1 @@
+select csv(marray ii in [-20:20] values condense + over ij in [10:20, 10:20] using ((((c[ij[0],ij[1]])>((ii[0])-(1))))and(((c[ij[0],ij[1]])<=(ii[0]))))) from mr AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/28-construct_histogram_range_condition.test b/petascope/test/testcases-wcps/28-construct_histogram_range_condition.test
new file mode 100644
index 0000000..5a31004
--- /dev/null
+++ b/petascope/test/testcases-wcps/28-construct_histogram_range_condition.test
@@ -0,0 +1,9 @@
+for c in ( mr )
+return
+encode( coverage histogram
+ over $n x(-20:20)
+ values condense +
+ over $px x(10:20),
+ $py y(10:20)
+ using c[ x($px), y($py) ]>$n - 1 and c[ x($px), y($py) ]<=$n,
+ "csv" )
diff --git a/petascope/test/testcases-wcps/28-construct_histogram_range_condition.xml b/petascope/test/testcases-wcps/28-construct_histogram_range_condition.xml
new file mode 100644
index 0000000..694770a
--- /dev/null
+++ b/petascope/test/testcases-wcps/28-construct_histogram_range_condition.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>mr</coverageName></coverageIterator><encode store="false"><construct><name>histogram</name><axisIterator><iteratorVar>n</iteratorVar><axis>x</axis><numericConstant>-20</numericConstant><numericConstant>20</numericConstant></axisIterator><condense><opPlus/><iterator><iteratorVar>px</iteratorVar><axis>x</axis><numericConstant>10</numericConstant><numericConstant>20</numericConstant></iterator><iterator><iteratorVar>py</iteratorVar><axis>y</axis><numericConstant>10</numericConstant><numericConstant>20</numericConstant></iterator><and><greaterThan><slice><coverage>c</coverage><axis>x</axis><slicingPosition><variableRef>px</variableRef></slicingPosition><axis>y</axis><slicingPosition><variableRef>py</variableRef></slicingPosition></slice><numericMinus><variableRef>n</variableRef><numericConstant>1</numericConstant></numericMinus></greaterThan><lessOrEqual><slice><coverage>c</coverage><axis>x</axis><slicingPosition><variableRef>px</variableRef></slicingPosition><axis>y</axis><slicingPosition><variableRef>py</variableRef></slicingPosition></slice><variableRef>n</variableRef></lessOrEqual></and></condense></construct><format>csv</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/29-filter_image(lines).rasql b/petascope/test/testcases-wcps/29-filter_image(lines).rasql
new file mode 100644
index 0000000..3fc5049
--- /dev/null
+++ b/petascope/test/testcases-wcps/29-filter_image(lines).rasql
@@ -0,0 +1 @@
+select jpeg((char)(marray ii in [10:240, 10:230] values condense + over ij in [-1:1, -1:1] using ((< [-1:1, -1:1] 1, 1, 1, 0, 0, 0, -1, -1, -1>[ij[0],ij[1]])*((c[(ii[0])+(ij[0]),(ii[1])+(ij[1])]).red)))) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/29-filter_image(lines).test b/petascope/test/testcases-wcps/29-filter_image(lines).test
new file mode 100644
index 0000000..15ecb28
--- /dev/null
+++ b/petascope/test/testcases-wcps/29-filter_image(lines).test
@@ -0,0 +1,17 @@
+for c in (rgb) return encode((char)
+ coverage filteredImage
+ over $px x(10:240),
+ $py y(10:230)
+ values
+ condense +
+ over $kx x(-1:1),
+ $ky y(-1:1)
+ using
+ (coverage kernel
+ over $x x (-1:1),
+ $y y(-1:1)
+ value list < 1; 1; 1; 0; 0; 0; -1; -1; -1 >
+ )[x($kx),y($ky)]
+ *
+ (c[x($px+$kx),y($py+$ky)]).red
+ , "jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/29-filter_image(lines).xml b/petascope/test/testcases-wcps/29-filter_image(lines).xml
new file mode 100644
index 0000000..9fac44f
--- /dev/null
+++ b/petascope/test/testcases-wcps/29-filter_image(lines).xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><cast><construct><name>filteredImage</name><axisIterator><iteratorVar>px</iteratorVar><axis>x</axis><numericConstant>10</numericConstant><numericConstant>240</numericConstant></axisIterator><axisIterator><iteratorVar>py</iteratorVar><axis>y</axis><numericConstant>10</numericConstant><numericConstant>230</numericConstant></axisIterator><condense><opPlus/><iterator><iteratorVar>kx</iteratorVar><axis>x</axis><numericConstant>-1</numericConstant><numericConstant>1</numericConstant></iterator><iterator><iteratorVar>ky</iteratorVar><axis>y</axis><numericConstant>-1</numericConstant><numericConstant>1</numericConstant></iterator><mult><slice><const><name>kernel</name><axisIterator><iteratorVar>x</iteratorVar><axis>x</axis><numericConstant>-1</numericConstant><numericConstant>1</numericConstant></axisIterator><axisIterator><iteratorVar>y</iteratorVar><axis>y</axis><numericConstant>-1</numericConstant><numericConstant>1</numericConstant></axisIterator><value>1</value><value>1</value><value>1</value><value>0</value><value>0</value><value>0</value><value>-1</value><value>-1</value><value>-1</value></const><axis>x</axis><slicingPosition><variableRef>kx</variableRef></slicingPosition><axis>y</axis><slicingPosition><variableRef>ky</variableRef></slicingPosition></slice><fieldSelect><slice><coverage>c</coverage><axis>x</axis><slicingPosition><numericAdd><variableRef>px</variableRef><variableRef>kx</variableRef></numericAdd></slicingPosition><axis>y</axis><slicingPosition><numericAdd><variableRef>py</variableRef><variableRef>ky</variableRef></numericAdd></slicingPosition></slice><field><name>red</name></field></fieldSelect></mult></condense></construct><type>char</type></cast><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/30-construct_count.rasql b/petascope/test/testcases-wcps/30-construct_count.rasql
new file mode 100644
index 0000000..ad0bf3e
--- /dev/null
+++ b/petascope/test/testcases-wcps/30-construct_count.rasql
@@ -0,0 +1 @@
+select csv(marray ii in [0:2] values count_cells(((c)=(ii[0])))) from climate_clouds AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/30-construct_count.test b/petascope/test/testcases-wcps/30-construct_count.test
new file mode 100644
index 0000000..8a3e440
--- /dev/null
+++ b/petascope/test/testcases-wcps/30-construct_count.test
@@ -0,0 +1,6 @@
+for c in ( climate_clouds )
+return encode(
+ coverage histogram
+ over $n x(0:2)
+ values count( c = $n )
+ , "csv" ) \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/30-construct_count.xml b/petascope/test/testcases-wcps/30-construct_count.xml
new file mode 100644
index 0000000..1d499f6
--- /dev/null
+++ b/petascope/test/testcases-wcps/30-construct_count.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>climate_clouds</coverageName></coverageIterator><encode store="false"><construct><name>histogram</name><axisIterator><iteratorVar>n</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>2</numericConstant></axisIterator><count><equals><coverage>c</coverage><variableRef>n</variableRef></equals></count></construct><format>csv</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/31-Discrete_Fourier.rasql b/petascope/test/testcases-wcps/31-Discrete_Fourier.rasql
new file mode 100644
index 0000000..9b01f39
--- /dev/null
+++ b/petascope/test/testcases-wcps/31-Discrete_Fourier.rasql
@@ -0,0 +1 @@
+select jpeg(marray ii in [65:70, 65:70] values condense + over ij in [65:70, 65:70] using ((c[ij[0],ij[1]])*(cos((((-2)*((22.0)/(7.0)))*((((double)(((ij[0])*(ii[0]))/(((70)-(65))+(1))))+((double)(((ij[1])*(ii[1]))/(((70)-(65))+(1))))))))))) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/31-Discrete_Fourier.test b/petascope/test/testcases-wcps/31-Discrete_Fourier.test
new file mode 100644
index 0000000..8fbbc07
--- /dev/null
+++ b/petascope/test/testcases-wcps/31-Discrete_Fourier.test
@@ -0,0 +1,23 @@
+for c in (rgb) return
+encode(
+
+ coverage DFT
+ over $xx x(65:70),
+ $xy y(65:70)
+ values
+ condense +
+ over $ux x(65:70),
+ $uy y(65:70)
+ using
+ c[x($ux),y($uy)]
+ *
+ cos(
+ ( -2 * (22.0/7.0) )
+ *
+ (
+ ( (double) ($ux*$xx) / (70 - 65 + 1) )
+ +
+ ( (double) ($uy*$xy) / (70 - 65 + 1 ) )
+ )
+ )
+, "jpeg")
diff --git a/petascope/test/testcases-wcps/31-Discrete_Fourier.xml b/petascope/test/testcases-wcps/31-Discrete_Fourier.xml
new file mode 100644
index 0000000..95e491e
--- /dev/null
+++ b/petascope/test/testcases-wcps/31-Discrete_Fourier.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><construct><name>DFT</name><axisIterator><iteratorVar>xx</iteratorVar><axis>x</axis><numericConstant>65</numericConstant><numericConstant>70</numericConstant></axisIterator><axisIterator><iteratorVar>xy</iteratorVar><axis>y</axis><numericConstant>65</numericConstant><numericConstant>70</numericConstant></axisIterator><condense><opPlus/><iterator><iteratorVar>ux</iteratorVar><axis>x</axis><numericConstant>65</numericConstant><numericConstant>70</numericConstant></iterator><iterator><iteratorVar>uy</iteratorVar><axis>y</axis><numericConstant>65</numericConstant><numericConstant>70</numericConstant></iterator><mult><slice><coverage>c</coverage><axis>x</axis><slicingPosition><variableRef>ux</variableRef></slicingPosition><axis>y</axis><slicingPosition><variableRef>uy</variableRef></slicingPosition></slice><cos><mult><numericMult><numericConstant>-2</numericConstant><numericDiv><numericConstant>22.0</numericConstant><numericConstant>7.0</numericConstant></numericDiv></numericMult><plus><cast><numericDiv><numericMult><variableRef>ux</variableRef><variableRef>xx</variableRef></numericMult><numericAdd><numericMinus><numericConstant>70</numericConstant><numericConstant>65</numericConstant></numericMinus><numericConstant>1</numericConstant></numericAdd></numericDiv><type>double</type></cast><cast><numericDiv><numericMult><variableRef>uy</variableRef><variableRef>xy</variableRef></numericMult><numericAdd><numericMinus><numericConstant>70</numericConstant><numericConstant>65</numericConstant></numericMinus><numericConstant>1</numericConstant></numericAdd></numericDiv><type>double</type></cast></plus></mult></cos></mult></condense></construct><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.rasql b/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.rasql
new file mode 100644
index 0000000..d05509b
--- /dev/null
+++ b/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.rasql
@@ -0,0 +1 @@
+select jpeg((char)(marray ii in [0:10, 0:10] values condense + over ij in [0:10, 0:10] using cos(0.6))) from mr AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.test b/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.test
new file mode 100644
index 0000000..7066b21
--- /dev/null
+++ b/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.test
@@ -0,0 +1,9 @@
+ for c in (mr) return encode((char)
+ coverage DFT
+ over $px x(0:10),
+ $py y(0:10)
+ values
+ condense +
+ over $kx x(0:10),
+ $ky y(0:10)
+ using cos(0.6) , "jpeg")
diff --git a/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.xml b/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.xml
new file mode 100644
index 0000000..8b94a46
--- /dev/null
+++ b/petascope/test/testcases-wcps/32-construct_condense_cosinus_gray_image.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>mr</coverageName></coverageIterator><encode store="false"><cast><construct><name>DFT</name><axisIterator><iteratorVar>px</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>10</numericConstant></axisIterator><axisIterator><iteratorVar>py</iteratorVar><axis>y</axis><numericConstant>0</numericConstant><numericConstant>10</numericConstant></axisIterator><condense><opPlus/><iterator><iteratorVar>kx</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>10</numericConstant></iterator><iterator><iteratorVar>ky</iteratorVar><axis>y</axis><numericConstant>0</numericConstant><numericConstant>10</numericConstant></iterator><cos><numericConstant>0.6</numericConstant></cos></condense></construct><type>char</type></cast><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/33-construct_condense_gray_image.rasql b/petascope/test/testcases-wcps/33-construct_condense_gray_image.rasql
new file mode 100644
index 0000000..8fd1455
--- /dev/null
+++ b/petascope/test/testcases-wcps/33-construct_condense_gray_image.rasql
@@ -0,0 +1 @@
+select jpeg((char)(marray ii in [0:10, 0:10] values condense + over ij in [0:10, 0:10] using 1)) from mr AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/33-construct_condense_gray_image.test b/petascope/test/testcases-wcps/33-construct_condense_gray_image.test
new file mode 100644
index 0000000..ed41e59
--- /dev/null
+++ b/petascope/test/testcases-wcps/33-construct_condense_gray_image.test
@@ -0,0 +1,9 @@
+for c in (mr) return encode((char)
+ coverage gray_image
+ over $px x(0:10),
+ $py y(0:10)
+ values
+ condense +
+ over $kx x(0:10),
+ $ky y(0:10)
+ using 1 , "jpeg")
diff --git a/petascope/test/testcases-wcps/33-construct_condense_gray_image.xml b/petascope/test/testcases-wcps/33-construct_condense_gray_image.xml
new file mode 100644
index 0000000..7cf76c6
--- /dev/null
+++ b/petascope/test/testcases-wcps/33-construct_condense_gray_image.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>c</iteratorVar><coverageName>mr</coverageName></coverageIterator><encode store="false"><cast><construct><name>gray_image</name><axisIterator><iteratorVar>px</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>10</numericConstant></axisIterator><axisIterator><iteratorVar>py</iteratorVar><axis>y</axis><numericConstant>0</numericConstant><numericConstant>10</numericConstant></axisIterator><condense><opPlus/><iterator><iteratorVar>kx</iteratorVar><axis>x</axis><numericConstant>0</numericConstant><numericConstant>10</numericConstant></iterator><iterator><iteratorVar>ky</iteratorVar><axis>y</axis><numericConstant>0</numericConstant><numericConstant>10</numericConstant></iterator><numericConstant>1</numericConstant></condense></construct><type>char</type></cast><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/34-where_clause.rasql b/petascope/test/testcases-wcps/34-where_clause.rasql
new file mode 100644
index 0000000..05b97ae
--- /dev/null
+++ b/petascope/test/testcases-wcps/34-where_clause.rasql
@@ -0,0 +1 @@
+select jpeg(c) from mr AS c where (avg_cells(c))>(30) \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/34-where_clause.test b/petascope/test/testcases-wcps/34-where_clause.test
new file mode 100644
index 0000000..abed2fa
--- /dev/null
+++ b/petascope/test/testcases-wcps/34-where_clause.test
@@ -0,0 +1,4 @@
+for c in (mr)
+where avg(c)>30
+return
+encode (c, "jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/34-where_clause.xml b/petascope/test/testcases-wcps/34-where_clause.xml
new file mode 100644
index 0000000..8117e2a
--- /dev/null
+++ b/petascope/test/testcases-wcps/34-where_clause.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>c</iteratorVar>
+ <coverageName>mr</coverageName>
+ </coverageIterator>
+ <where>
+ <booleanGreaterThan>
+ <reduce>
+ <avg>
+ <coverage>c</coverage>
+ </avg>
+ </reduce>
+ <numericConstant>30</numericConstant>
+ </booleanGreaterThan>
+ </where>
+ <encode store="false">
+ <coverage>c</coverage>
+ <format>jpeg</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.rasql b/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.rasql
new file mode 100644
index 0000000..bdb4129
--- /dev/null
+++ b/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.rasql
@@ -0,0 +1 @@
+ select jpeg(c[1:100,-31:274]) from lena AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.test b/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.test
new file mode 100644
index 0000000..df012f0
--- /dev/null
+++ b/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.test
@@ -0,0 +1 @@
+for c in (lena) return encode(c [x:"CRS:1" (1:100), y:"EPSG:4326" (1:100) ], "jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.xml b/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.xml
new file mode 100644
index 0000000..940bfd2
--- /dev/null
+++ b/petascope/test/testcases-wcps/35-coordinates_in_wgs84_crs.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>c</iteratorVar>
+ <coverageName>lena</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <trim>
+ <coverage>c</coverage>
+ <axis>x</axis>
+ <srsName>CRS:1</srsName>
+ <lowerBound>
+ <numericConstant>1</numericConstant>
+ </lowerBound>
+ <upperBound>
+ <numericConstant>100</numericConstant>
+ </upperBound>
+ <axis>y</axis>
+ <srsName>EPSG:4326</srsName>
+ <lowerBound>
+ <numericConstant>1</numericConstant>
+ </lowerBound>
+ <upperBound>
+ <numericConstant>100</numericConstant>
+ </upperBound>
+ </trim>
+ <format>jpeg</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/36-simple_overlay.rasql b/petascope/test/testcases-wcps/36-simple_overlay.rasql
new file mode 100644
index 0000000..927f0ff
--- /dev/null
+++ b/petascope/test/testcases-wcps/36-simple_overlay.rasql
@@ -0,0 +1 @@
+select jpeg(((c)overlay((char)(((c)*(3)))))) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/36-simple_overlay.test b/petascope/test/testcases-wcps/36-simple_overlay.test
new file mode 100644
index 0000000..03f4464
--- /dev/null
+++ b/petascope/test/testcases-wcps/36-simple_overlay.test
@@ -0,0 +1 @@
+for c in (rgb) return encode(c overlay (char)(c*3), "jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/36-simple_overlay.xml b/petascope/test/testcases-wcps/36-simple_overlay.xml
new file mode 100644
index 0000000..829faaf
--- /dev/null
+++ b/petascope/test/testcases-wcps/36-simple_overlay.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>c</iteratorVar>
+ <coverageName>rgb</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <overlay>
+ <coverage>c</coverage>
+ <cast>
+ <mult>
+ <coverage>c</coverage>
+ <numericConstant>3</numericConstant>
+ </mult>
+ <type>char</type>
+ </cast>
+ </overlay>
+ <format>jpeg</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/37-simple_extend.rasql b/petascope/test/testcases-wcps/37-simple_extend.rasql
new file mode 100644
index 0000000..af01721
--- /dev/null
+++ b/petascope/test/testcases-wcps/37-simple_extend.rasql
@@ -0,0 +1 @@
+select jpeg(extend(c,[0:500,0:500])) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/37-simple_extend.test b/petascope/test/testcases-wcps/37-simple_extend.test
new file mode 100644
index 0000000..0582ac7
--- /dev/null
+++ b/petascope/test/testcases-wcps/37-simple_extend.test
@@ -0,0 +1 @@
+for c in (rgb) return encode(extend(c, x(0:500), y(0:500) ), "jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/37-simple_extend.xml b/petascope/test/testcases-wcps/37-simple_extend.xml
new file mode 100644
index 0000000..7f966a3
--- /dev/null
+++ b/petascope/test/testcases-wcps/37-simple_extend.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>c</iteratorVar>
+ <coverageName>rgb</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <extend>
+ <coverage>c</coverage>
+ <axis>x</axis>
+ <lowerBound>
+ <numericConstant>0</numericConstant>
+ </lowerBound>
+ <upperBound>
+ <numericConstant>500</numericConstant>
+ </upperBound>
+ <axis>y</axis>
+ <lowerBound>
+ <numericConstant>0</numericConstant>
+ </lowerBound>
+ <upperBound>
+ <numericConstant>500</numericConstant>
+ </upperBound>
+ </extend>
+ <format>jpeg</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/38-complex_extend.rasql b/petascope/test/testcases-wcps/38-complex_extend.rasql
new file mode 100644
index 0000000..d267106
--- /dev/null
+++ b/petascope/test/testcases-wcps/38-complex_extend.rasql
@@ -0,0 +1 @@
+select jpeg(extend(((t)+((char)(50))),[0:500,0:500])) from rgb AS t \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/38-complex_extend.test b/petascope/test/testcases-wcps/38-complex_extend.test
new file mode 100644
index 0000000..3f73e2e
--- /dev/null
+++ b/petascope/test/testcases-wcps/38-complex_extend.test
@@ -0,0 +1 @@
+for t in (rgb) return encode(extend( (t + (char)50), x :"CRS:1" ( 0:500 ), y: "CRS:1" (0: 500) ), "jpeg" ) \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/38-complex_extend.xml b/petascope/test/testcases-wcps/38-complex_extend.xml
new file mode 100644
index 0000000..26f34a5
--- /dev/null
+++ b/petascope/test/testcases-wcps/38-complex_extend.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+<query><xmlSyntax><coverageIterator><iteratorVar>t</iteratorVar><coverageName>rgb</coverageName></coverageIterator><encode store="false"><extend><plus><coverage>t</coverage><cast><numericConstant>50</numericConstant><type>char</type></cast></plus><axis>x</axis><srsName>CRS:1</srsName><lowerBound><numericConstant>0</numericConstant></lowerBound><upperBound><numericConstant>500</numericConstant></upperBound><axis>y</axis><srsName>CRS:1</srsName><lowerBound><numericConstant>0</numericConstant></lowerBound><upperBound><numericConstant>500</numericConstant></upperBound></extend><format>jpeg</format></encode></xmlSyntax></query></ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/39-complex_extend-2.rasql b/petascope/test/testcases-wcps/39-complex_extend-2.rasql
new file mode 100644
index 0000000..761e761
--- /dev/null
+++ b/petascope/test/testcases-wcps/39-complex_extend-2.rasql
@@ -0,0 +1 @@
+select jpeg(((extend(t,[0:500,0:500]))+((char)(0)))) from mr AS t \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/39-complex_extend-2.test b/petascope/test/testcases-wcps/39-complex_extend-2.test
new file mode 100644
index 0000000..6e8e45e
--- /dev/null
+++ b/petascope/test/testcases-wcps/39-complex_extend-2.test
@@ -0,0 +1 @@
+for t in (mr) return encode(extend( t, x :"CRS:1" ( 0:500 ), y: "CRS:1" (0: 500) ) + (char) 0 , "jpeg" ) \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/39-complex_extend-2.xml b/petascope/test/testcases-wcps/39-complex_extend-2.xml
new file mode 100644
index 0000000..15ca033
--- /dev/null
+++ b/petascope/test/testcases-wcps/39-complex_extend-2.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>t</iteratorVar>
+ <coverageName>mr</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <plus>
+ <extend>
+ <coverage>t</coverage>
+ <axis>x</axis>
+ <srsName>CRS:1</srsName>
+ <lowerBound>
+ <numericConstant>0</numericConstant>
+ </lowerBound>
+ <upperBound>
+ <numericConstant>500</numericConstant>
+ </upperBound>
+ <axis>y</axis>
+ <srsName>CRS:1</srsName>
+ <lowerBound>
+ <numericConstant>0</numericConstant>
+ </lowerBound>
+ <upperBound>
+ <numericConstant>500</numericConstant>
+ </upperBound>
+ </extend>
+ <cast>
+ <numericConstant>0</numericConstant>
+ <type>char</type>
+ </cast>
+ </plus>
+ <format>jpeg</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/40-range_structure.rasql b/petascope/test/testcases-wcps/40-range_structure.rasql
new file mode 100644
index 0000000..1bdf55f
--- /dev/null
+++ b/petascope/test/testcases-wcps/40-range_structure.rasql
@@ -0,0 +1 @@
+select jpeg((((c).red)*({ 1c,2c,3c }))) from rgb as c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/40-range_structure.test b/petascope/test/testcases-wcps/40-range_structure.test
new file mode 100644
index 0000000..2c3dbb7
--- /dev/null
+++ b/petascope/test/testcases-wcps/40-range_structure.test
@@ -0,0 +1,9 @@
+for c in ( rgb ) return
+encode(
+ c.red *
+ {
+ red: (char) 1;
+ green: (char) 2;
+ blue: (char) 3
+ },
+"jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/40-range_structure.xml b/petascope/test/testcases-wcps/40-range_structure.xml
new file mode 100644
index 0000000..34c2f19
--- /dev/null
+++ b/petascope/test/testcases-wcps/40-range_structure.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>c</iteratorVar>
+ <coverageName>rgb</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <mult>
+ <fieldSelect>
+ <coverage>c</coverage>
+ <field>
+ <name>red</name>
+ </field>
+ </fieldSelect>
+ <rangeConstructor>
+ <component>
+ <field>red</field>
+ <cast>
+ <numericConstant>1</numericConstant>
+ <type>char</type>
+ </cast>
+ </component>
+ <component>
+ <field>green</field>
+ <cast>
+ <numericConstant>2</numericConstant>
+ <type>char</type>
+ </cast>
+ </component>
+ <component>
+ <field>blue</field>
+ <cast>
+ <numericConstant>3</numericConstant>
+ <type>char</type>
+ </cast>
+ </component>
+ </rangeConstructor>
+ </mult>
+ <format>jpeg</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest>
diff --git a/petascope/test/testcases-wcps/41-filter_calculation_reloaded.rasql b/petascope/test/testcases-wcps/41-filter_calculation_reloaded.rasql
new file mode 100644
index 0000000..28b7474
--- /dev/null
+++ b/petascope/test/testcases-wcps/41-filter_calculation_reloaded.rasql
@@ -0,0 +1 @@
+select jpeg(marray ii in [1:100, 1:100] values sqrt(abs(condense + over ij in [-1:1, -1:1] using ((((((double)(< [-1:1, -1:1] -1, 0, 1, -2, 0, 2, -1, 0, 1>)) [ij[0],ij[1]])*((c) [(ii[0])+(ij[0]),(ii[1])+(ij[1])])))/((8)*(5.13712275)))))) from mr AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/41-filter_calculation_reloaded.test b/petascope/test/testcases-wcps/41-filter_calculation_reloaded.test
new file mode 100644
index 0000000..0e560a0
--- /dev/null
+++ b/petascope/test/testcases-wcps/41-filter_calculation_reloaded.test
@@ -0,0 +1,17 @@
+for c in (mr) return encode((char)
+ coverage filteredImage
+ over $px x(1:100),
+ $py y(1:100)
+ values
+ sqrt(abs(
+ condense +
+ over $kx x(-1:1),
+ $ky y(-1:1)
+ using
+ ((((double)coverage kernel
+ over $x x (-1:1),
+ $y y(-1:1)
+ value list < -1; 0; 1; -2; 0; 2;-1; 0; 1 >) [x($kx),y($ky)])
+ *(c[x($px+$kx),y($py+$ky)])/(8*5.13712275))
+ ))
+, "jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/41-filter_calculation_reloaded.xml b/petascope/test/testcases-wcps/41-filter_calculation_reloaded.xml
new file mode 100644
index 0000000..e8731ed
--- /dev/null
+++ b/petascope/test/testcases-wcps/41-filter_calculation_reloaded.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>c</iteratorVar>
+ <coverageName>mr</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <cast>
+ <construct>
+ <name>filteredImage</name>
+ <axisIterator>
+ <iteratorVar>px</iteratorVar>
+ <axis>x</axis>
+ <numericConstant>1</numericConstant>
+ <numericConstant>100</numericConstant>
+ </axisIterator>
+ <axisIterator>
+ <iteratorVar>py</iteratorVar>
+ <axis>y</axis>
+ <numericConstant>1</numericConstant>
+ <numericConstant>100</numericConstant>
+ </axisIterator>
+ <numericSqrt>
+ <numericAbs>
+ <condense>
+ <opPlus/>
+ <iterator>
+ <iteratorVar>kx</iteratorVar>
+ <axis>x</axis>
+ <numericConstant>-1</numericConstant>
+ <numericConstant>1</numericConstant>
+ </iterator>
+ <iterator>
+ <iteratorVar>ky</iteratorVar>
+ <axis>y</axis>
+ <numericConstant>-1</numericConstant>
+ <numericConstant>1</numericConstant>
+ </iterator>
+ <div>
+ <mult>
+ <slice>
+ <cast>
+ <const>
+ <name>kernel</name>
+ <axisIterator>
+ <iteratorVar>x</iteratorVar>
+ <axis>x</axis>
+ <numericConstant>-1</numericConstant>
+ <numericConstant>1</numericConstant>
+ </axisIterator>
+ <axisIterator>
+ <iteratorVar>y</iteratorVar>
+ <axis>y</axis>
+ <numericConstant>-1</numericConstant>
+ <numericConstant>1</numericConstant>
+ </axisIterator>
+ <value>-1</value>
+ <value>0</value>
+ <value>1</value>
+ <value>-2</value>
+ <value>0</value>
+ <value>2</value>
+ <value>-1</value>
+ <value>0</value>
+ <value>1</value>
+ </const>
+ <type>double</type>
+ </cast>
+ <axis>x</axis>
+ <slicingPosition>
+ <variableRef>kx</variableRef>
+ </slicingPosition>
+ <axis>y</axis>
+ <slicingPosition>
+ <variableRef>ky</variableRef>
+ </slicingPosition>
+ </slice>
+ <slice>
+ <coverage>c</coverage>
+ <axis>x</axis>
+ <slicingPosition>
+ <numericAdd>
+ <variableRef>px</variableRef>
+ <variableRef>kx</variableRef>
+ </numericAdd>
+ </slicingPosition>
+ <axis>y</axis>
+ <slicingPosition>
+ <numericAdd>
+ <variableRef>py</variableRef>
+ <variableRef>ky</variableRef>
+ </numericAdd>
+ </slicingPosition>
+ </slice>
+ </mult>
+ <numericMult>
+ <numericConstant>8</numericConstant>
+ <numericConstant>5.13712275</numericConstant>
+ </numericMult>
+ </div>
+ </condense>
+ </numericAbs>
+ </numericSqrt>
+ </construct>
+ <type>char</type>
+ </cast>
+ <format>jpeg</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/42-filter_calculation.rasql b/petascope/test/testcases-wcps/42-filter_calculation.rasql
new file mode 100644
index 0000000..4894e27
--- /dev/null
+++ b/petascope/test/testcases-wcps/42-filter_calculation.rasql
@@ -0,0 +1 @@
+select jpeg((char)(marray ii in [1:100, 1:100] values condense + over ij in [-1:1, -1:1] using ((((((double)(< [-1:1, -1:1] -1, 0, 1, -2, 0, 2, -1, 0, 1>)) [ij[0],ij[1]])*((c) [(ii[0])+(ij[0]),(ii[1])+(ij[1])])))/((8)*(5.13712275))))) from mr AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/42-filter_calculation.test b/petascope/test/testcases-wcps/42-filter_calculation.test
new file mode 100644
index 0000000..d32d1b2
--- /dev/null
+++ b/petascope/test/testcases-wcps/42-filter_calculation.test
@@ -0,0 +1,17 @@
+for c in (mr) return encode((char)
+ coverage filteredImage
+ over $px x(1:100),
+ $py y(1:100)
+ values
+ (
+ condense +
+ over $kx x(-1:1),
+ $ky y(-1:1)
+ using
+ ((((double)coverage kernel
+ over $x x (-1:1),
+ $y y(-1:1)
+ value list < -1; 0; 1; -2; 0; 2;-1; 0; 1 >) [x($kx),y($ky)])
+ *(c[x($px+$kx),y($py+$ky)])/(8*5.13712275))
+ )
+, "jpeg") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/42-filter_calculation.xml b/petascope/test/testcases-wcps/42-filter_calculation.xml
new file mode 100644
index 0000000..b5c2223
--- /dev/null
+++ b/petascope/test/testcases-wcps/42-filter_calculation.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>c</iteratorVar>
+ <coverageName>mr</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <cast>
+ <construct>
+ <name>filteredImage</name>
+ <axisIterator>
+ <iteratorVar>px</iteratorVar>
+ <axis>x</axis>
+ <numericConstant>1</numericConstant>
+ <numericConstant>100</numericConstant>
+ </axisIterator>
+ <axisIterator>
+ <iteratorVar>py</iteratorVar>
+ <axis>y</axis>
+ <numericConstant>1</numericConstant>
+ <numericConstant>100</numericConstant>
+ </axisIterator>
+ <condense>
+ <opPlus/>
+ <iterator>
+ <iteratorVar>kx</iteratorVar>
+ <axis>x</axis>
+ <numericConstant>-1</numericConstant>
+ <numericConstant>1</numericConstant>
+ </iterator>
+ <iterator>
+ <iteratorVar>ky</iteratorVar>
+ <axis>y</axis>
+ <numericConstant>-1</numericConstant>
+ <numericConstant>1</numericConstant>
+ </iterator>
+ <div>
+ <mult>
+ <slice>
+ <cast>
+ <const>
+ <name>kernel</name>
+ <axisIterator>
+ <iteratorVar>x</iteratorVar>
+ <axis>x</axis>
+ <numericConstant>-1</numericConstant>
+ <numericConstant>1</numericConstant>
+ </axisIterator>
+ <axisIterator>
+ <iteratorVar>y</iteratorVar>
+ <axis>y</axis>
+ <numericConstant>-1</numericConstant>
+ <numericConstant>1</numericConstant>
+ </axisIterator>
+ <value>-1</value>
+ <value>0</value>
+ <value>1</value>
+ <value>-2</value>
+ <value>0</value>
+ <value>2</value>
+ <value>-1</value>
+ <value>0</value>
+ <value>1</value>
+ </const>
+ <type>double</type>
+ </cast>
+ <axis>x</axis>
+ <slicingPosition>
+ <variableRef>kx</variableRef>
+ </slicingPosition>
+ <axis>y</axis>
+ <slicingPosition>
+ <variableRef>ky</variableRef>
+ </slicingPosition>
+ </slice>
+ <slice>
+ <coverage>c</coverage>
+ <axis>x</axis>
+ <slicingPosition>
+ <numericAdd>
+ <variableRef>px</variableRef>
+ <variableRef>kx</variableRef>
+ </numericAdd>
+ </slicingPosition>
+ <axis>y</axis>
+ <slicingPosition>
+ <numericAdd>
+ <variableRef>py</variableRef>
+ <variableRef>ky</variableRef>
+ </numericAdd>
+ </slicingPosition>
+ </slice>
+ </mult>
+ <numericMult>
+ <numericConstant>8</numericConstant>
+ <numericConstant>5.13712275</numericConstant>
+ </numericMult>
+ </div>
+ </condense>
+ </construct>
+ <type>char</type>
+ </cast>
+ <format>jpeg</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest>
diff --git a/petascope/test/testcases-wcps/43-encoder_options.rasql b/petascope/test/testcases-wcps/43-encoder_options.rasql
new file mode 100644
index 0000000..56ce75b
--- /dev/null
+++ b/petascope/test/testcases-wcps/43-encoder_options.rasql
@@ -0,0 +1 @@
+select dem(a, "startx=0,starty=0,endx=1000,endy=1000,resx=0.1,resy=0.15") from mr AS a \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/43-encoder_options.test b/petascope/test/testcases-wcps/43-encoder_options.test
new file mode 100644
index 0000000..2bd7b3d
--- /dev/null
+++ b/petascope/test/testcases-wcps/43-encoder_options.test
@@ -0,0 +1,2 @@
+for a in (mr) return
+ encode(a,"dem", "startx=0,starty=0,endx=1000,endy=1000,resx=0.1,resy=0.15") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/43-encoder_options.xml b/petascope/test/testcases-wcps/43-encoder_options.xml
new file mode 100644
index 0000000..8fc1e7f
--- /dev/null
+++ b/petascope/test/testcases-wcps/43-encoder_options.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>a</iteratorVar>
+ <coverageName>mr</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <coverage>a</coverage>
+ <format>dem</format>
+ <extraParameters>startx=0,starty=0,endx=1000,endy=1000,resx=0.1,resy=0.15</extraParameters>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/44-scaling_operation.rasql b/petascope/test/testcases-wcps/44-scaling_operation.rasql
new file mode 100644
index 0000000..5cc051a
--- /dev/null
+++ b/petascope/test/testcases-wcps/44-scaling_operation.rasql
@@ -0,0 +1 @@
+select png(scale( c, [1:600,1:600] )) from rgb AS c \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/44-scaling_operation.test b/petascope/test/testcases-wcps/44-scaling_operation.test
new file mode 100644
index 0000000..81a6568
--- /dev/null
+++ b/petascope/test/testcases-wcps/44-scaling_operation.test
@@ -0,0 +1,2 @@
+for c in (rgb)
+ return encode(scale(c, x(1:600), y(1:600)), "png") \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/44-scaling_operation.xml b/petascope/test/testcases-wcps/44-scaling_operation.xml
new file mode 100644
index 0000000..4ec2b9c
--- /dev/null
+++ b/petascope/test/testcases-wcps/44-scaling_operation.xml
@@ -0,0 +1,30 @@
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <xmlSyntax>
+ <coverageIterator>
+ <iteratorVar>c</iteratorVar>
+ <coverageName>rgb</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <scale>
+ <coverage>c</coverage>
+ <axis>x</axis>
+ <lowerBound>
+ <numericConstant>1</numericConstant>
+ </lowerBound>
+ <upperBound>
+ <numericConstant>600</numericConstant>
+ </upperBound>
+ <axis>y</axis>
+ <lowerBound>
+ <numericConstant>1</numericConstant>
+ </lowerBound>
+ <upperBound>
+ <numericConstant>600</numericConstant>
+ </upperBound>
+ </scale>
+ <format>png</format>
+ </encode>
+ </xmlSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcps/abstract.xml b/petascope/test/testcases-wcps/abstract.xml
new file mode 100644
index 0000000..bfc5306
--- /dev/null
+++ b/petascope/test/testcases-wcps/abstract.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ProcessCoveragesRequest xmlns="http://www.opengis.net/wcps/1.0" service="WCPS" version="1.0.0">
+ <query>
+ <abstractSyntax>
+ for c in ( rgb ) return encode( ((char) abs( c.1 - c.0 ))[ x(0:450), y(0:300) ], "png" )
+ </abstractSyntax>
+ </query>
+</ProcessCoveragesRequest> \ No newline at end of file
diff --git a/petascope/test/testcases-wcs/input/DescribeCoverage1.xml b/petascope/test/testcases-wcs/input/DescribeCoverage1.xml
new file mode 100644
index 0000000..81a72b7
--- /dev/null
+++ b/petascope/test/testcases-wcs/input/DescribeCoverage1.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<DescribeCoverage xmlns="http://www.opengis.net/wcs/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs/1.1 ../wcsDescribeCoverage.xsd" service="WCS" version="1.1.2">
+ <Identifier>coverage_not_offered_by_the_server</Identifier>
+</DescribeCoverage> \ No newline at end of file
diff --git a/petascope/test/testcases-wcs/input/DescribeCoverage2.xml b/petascope/test/testcases-wcs/input/DescribeCoverage2.xml
new file mode 100644
index 0000000..1b42a01
--- /dev/null
+++ b/petascope/test/testcases-wcs/input/DescribeCoverage2.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<DescribeCoverage xmlns="http://www.opengis.net/wcs/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs/1.1 ../wcsDescribeCoverage.xsd" service="WCS" version="1.1.2">
+<!-- <Identifier>mr</Identifier> -->
+ <Identifier>rgb</Identifier>
+ <Identifier>mr</Identifier>
+ <Identifier>mowglie</Identifier>
+</DescribeCoverage> \ No newline at end of file
diff --git a/petascope/test/testcases-wcs/input/GetCapabilitiesMax.xml b/petascope/test/testcases-wcs/input/GetCapabilitiesMax.xml
new file mode 100644
index 0000000..b17c714
--- /dev/null
+++ b/petascope/test/testcases-wcs/input/GetCapabilitiesMax.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GetCapabilities xmlns="http://www.opengis.net/wcs/1.1"
+xmlns:owcs="http://www.opengis.net/wcs/1.1/ows"
+service="WCS">
+ <owcs:AcceptVersions>
+ <owcs:Version>1.0.0</owcs:Version>
+ <owcs:Version>0.8.3</owcs:Version>
+ </owcs:AcceptVersions>
+ <owcs:Sections>
+ <owcs:Section>Contents</owcs:Section>
+ </owcs:Sections>
+ <owcs:AcceptFormats>
+ <owcs:OutputFormat>text/xml</owcs:OutputFormat>
+ </owcs:AcceptFormats>
+</GetCapabilities>
diff --git a/petascope/test/testcases-wcs/input/GetCoverage1.xml b/petascope/test/testcases-wcs/input/GetCoverage1.xml
new file mode 100644
index 0000000..4a4dadc
--- /dev/null
+++ b/petascope/test/testcases-wcs/input/GetCoverage1.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GetCoverage xmlns="http://www.opengis.net/wcs/1.1" xmlns:ows="http://www.opengis.net/ows" xmlns:owcs="http://www.opengis.net/wcs/1.1/ows" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs/1.1 ../wcsGetCoverage.xsd http://www.opengis.net/gml ../../../gml/3.1.1/base/gml.xsd" service="WCS" version="1.1.0">
+ <owcs:Identifier>NIR</owcs:Identifier>
+ <DomainSubset>
+ <ows:BoundingBox>
+ <ows:LowerCorner>0 0</ows:LowerCorner>
+ <ows:UpperCorner>450 300</ows:UpperCorner>
+ </ows:BoundingBox>
+ </DomainSubset>
+ <Output format="image/jpeg" />
+</GetCoverage> \ No newline at end of file
diff --git a/petascope/test/testcases-wcs/input/GetCoverage2.xml b/petascope/test/testcases-wcs/input/GetCoverage2.xml
new file mode 100644
index 0000000..1000c9d
--- /dev/null
+++ b/petascope/test/testcases-wcs/input/GetCoverage2.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GetCoverage xmlns="http://www.opengis.net/wcs/1.1" xmlns:ows="http://www.opengis.net/ows" xmlns:owcs="http://www.opengis.net/wcs/1.1/ows" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs/1.1 ../wcsGetCoverage.xsd" service="WCS" version="1.1.0">
+ <!-- Partial example. Primary editor: Arliss Whiteside. Last updated 2006-09-20-->
+ <owcs:Identifier>TBD</owcs:Identifier>
+ <DomainSubset>
+ <ows:BoundingBox>
+ <ows:LowerCorner>9999 56</ows:LowerCorner>
+ <ows:UpperCorner>23 9999</ows:UpperCorner>
+ </ows:BoundingBox>
+ </DomainSubset>
+ <RangeSubset>
+ <FieldSubset>
+ <owcs:Identifier>TBDField</owcs:Identifier>
+ </FieldSubset>
+ </RangeSubset>
+ <Output format="image/gif" store="false"/>
+</GetCoverage> \ No newline at end of file
diff --git a/petascope/test/testcases-wcs/input/GetCoverage3.xml b/petascope/test/testcases-wcs/input/GetCoverage3.xml
new file mode 100644
index 0000000..5d71efa
--- /dev/null
+++ b/petascope/test/testcases-wcs/input/GetCoverage3.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GetCoverage xmlns="http://www.opengis.net/wcs/1.1" xmlns:ows="http://www.opengis.net/ows" xmlns:owcs="http://www.opengis.net/wcs/1.1/ows" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs/1.1 ../wcsGetCoverage.xsd http://www.opengis.net/gml ../../../gml/3.1.1/base/gml.xsd" service="WCS" version="1.1.0">
+ <owcs:Identifier>rgb</owcs:Identifier>
+ <DomainSubset>
+ <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::26910">
+ <ows:LowerCorner>0 0</ows:LowerCorner>
+ <ows:UpperCorner>300 300</ows:UpperCorner>
+ </ows:BoundingBox>
+ </DomainSubset>
+ <RangeSubset>
+ <FieldSubset>
+ <owcs:Identifier>Wavelength</owcs:Identifier>
+ <InterpolationType>nearest</InterpolationType>
+ <AxisSubset>
+ <Identifier>Band</Identifier>
+ <Key>band1</Key>
+ <Key>band2</Key>
+ <Key>band3</Key>
+ </AxisSubset>
+ </FieldSubset>
+ </RangeSubset>
+ <Output format="image/GeoTIFF" store="true" />
+</GetCoverage> \ No newline at end of file
diff --git a/petascope/test/testcases-wcs/input/GetCoverage4.xml b/petascope/test/testcases-wcs/input/GetCoverage4.xml
new file mode 100644
index 0000000..4a339fe
--- /dev/null
+++ b/petascope/test/testcases-wcs/input/GetCoverage4.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GetCoverage xmlns="http://www.opengis.net/wcs/1.1" xmlns:ows="http://www.opengis.net/ows" xmlns:owcs="http://www.opengis.net/wcs/1.1/ows" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs/1.1 ../wcsGetCoverage.xsd http://www.opengis.net/gml ../../../gml/3.1.1/base/gml.xsd" service="WCS" version="1.1.0">
+ <owcs:Identifier>SPVIEW_530_274_0_020809_5_1_J_3</owcs:Identifier>
+ <DomainSubset>
+ <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::26910">
+ <ows:LowerCorner>551182.3990 4173461.7219</ows:LowerCorner>
+ <ows:UpperCorner>569339.8990 4192512.2137</ows:UpperCorner>
+ </ows:BoundingBox>
+ <TemporalSubset>
+ <gml:timePosition>2002-08-09T19:08:46Z</gml:timePosition>
+ </TemporalSubset>
+ </DomainSubset>
+ <RangeSubset>
+ <FieldSubset>
+ <owcs:Identifier>Wavelength</owcs:Identifier>
+ <InterpolationType>nearest</InterpolationType>
+ <AxisSubset>
+ <Identifier>Band</Identifier>
+ <Key>band1</Key>
+ <Key>band2</Key>
+ <Key>band3</Key>
+ </AxisSubset>
+ </FieldSubset>
+ </RangeSubset>
+ <Output format="image/GeoTIFF" store="true">
+ <GridCRS gml:id="SPVIEW_530_274_0_020809_5_1_J_3_SUBSET_CRS">
+ <gml:srsName>SPVIEW_530_274_0_020809_5_1_J_3_SUBSET_CRS</gml:srsName>
+ <GridBaseCRS>urn:ogc:def:crs:EPSG::4326</GridBaseCRS>
+ <GridType>urn:ogc:def:method:WCS:1.1:grid2dIn2dMethod</GridType>
+ <GridOrigin>-122.4193 37.7058</GridOrigin>
+ <GridOffsets>0.0006926667 0 0 -0.000548889</GridOffsets>
+ <GridCS>urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS</GridCS>
+ </GridCRS>
+ </Output>
+</GetCoverage> \ No newline at end of file
diff --git a/petascope/test/testcases-wcs/output/Capabilities.xml b/petascope/test/testcases-wcs/output/Capabilities.xml
new file mode 100644
index 0000000..182cfeb
--- /dev/null
+++ b/petascope/test/testcases-wcs/output/Capabilities.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:Capabilities xmlns="http://www.opengis.net/ows" xmlns:ns2="http://www.opengis.net/wcs/1.1" xmlns:ns3="http://www.opengis.net/wcs/1.1/ows" xmlns:ns4="http://www.w3.org/1999/xlink" xmlns:ns5="http://www.opengis.net/gml" xmlns:ns6="http://www.w3.org/2001/SMIL20/" xmlns:ns7="http://www.w3.org/2001/SMIL20/Language" version="1.1.0">
+ <ns3:ServiceIdentification>
+ <Title>WCS Coverage Server @ Jacobs University</Title>
+ <Abstract>WCS Server developed at jacobs University</Abstract>
+ <ns3:ServiceType>OGC WCS</ns3:ServiceType>
+ <ns3:Fees>NONE</ns3:Fees>
+ </ns3:ServiceIdentification>
+ <ServiceProvider>
+ <ProviderName>Jacobs University Bremen</ProviderName>
+ <ProviderSite ns4:href="http://www.jacobs-university.de/"/>
+ </ServiceProvider>
+ <ns3:OperationsMetadata>
+ <ns3:Operation name="GetCapabilities">
+ <ns3:DCP>
+ <ns3:HTTP>
+ <Soap xmlns:ns8="http://www.opengis.net/ows" xmlns="" ns4:href="http://localhost/SOAP/URL/for/GetCapabalities"/>
+ <Post xmlns:ns8="http://www.opengis.net/ows" xmlns="" ns4:href="http://localhost/please/replace/me/by/my/GetCapabilities/URL"/>
+ </ns3:HTTP>
+ </ns3:DCP>
+ </ns3:Operation>
+ <ns3:Operation name="GetCoverage">
+ <ns3:DCP>
+ <ns3:HTTP>
+ <Soap xmlns:ns8="http://www.opengis.net/ows" xmlns="" ns4:href="http://localhost/SOAP/URL/for/GetCapabalities"/>
+ <Post xmlns:ns8="http://www.opengis.net/ows" xmlns="" ns4:href="http://localhost/please/replace/me/by/my/GetCoverage/URL"/>
+ </ns3:HTTP>
+ </ns3:DCP>
+ <ns3:Constraint name="Format">
+ <ns3:AllowedValues>
+ <ns3:Value>image/jpeg</ns3:Value>
+ <ns3:Value>image/jpeg</ns3:Value>
+ <ns3:Value>image/png</ns3:Value>
+ <ns3:Value>image/tiff</ns3:Value>
+ <ns3:Value>image/tiff</ns3:Value>
+ <ns3:Value>application/x-octet-stream</ns3:Value>
+ </ns3:AllowedValues>
+ </ns3:Constraint>
+ <ns3:Constraint name="Format">
+ <ns3:AllowedValues>
+ <ns3:Value>text/xml</ns3:Value>
+ </ns3:AllowedValues>
+ </ns3:Constraint>
+ </ns3:Operation>
+ <ns3:Operation name="DescribeCoverage">
+ <ns3:DCP>
+ <ns3:HTTP>
+ <Soap xmlns:ns8="http://www.opengis.net/ows" xmlns="" ns4:href="http://localhost/SOAP/URL/for/GetCapabalities"/>
+ <Post xmlns:ns8="http://www.opengis.net/ows" xmlns="" ns4:href="http://localhost/please/replace/me/by/my/DescribeCoverage/URL"/>
+ </ns3:HTTP>
+ </ns3:DCP>
+ </ns3:Operation>
+ </ns3:OperationsMetadata>
+ <ns2:Contents>
+ <ns2:CoverageSummary>
+ <Title>Coverage SEGY002</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">SEGY002</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage Boonsville_SEGY</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">Boonsville_SEGY</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage Waha_SEGY</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">Waha_SEGY</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage mr</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">mr</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage rgb</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">rgb</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage nrg</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">nrg</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage Modis</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">Modis</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage mowglie</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">mowglie</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage whatevereeeee</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">whatevereeeee</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage climate_temperature</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">climate_temperature</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_1</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_1</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_2</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_2</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_3</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_3</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_4</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_4</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_5</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_5</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_6</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_6</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_7</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_7</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_8</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_8</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_9</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_9</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_10</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_10</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NN3_11</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NN3_11</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage TP</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">TP</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage climate_clouds</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">climate_clouds</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage climate_earth</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">climate_earth</Identifier>
+ </ns2:CoverageSummary>
+ <ns2:CoverageSummary>
+ <Title>Coverage NIR</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">NIR</Identifier>
+ </ns2:CoverageSummary>
+ </ns2:Contents>
+</ns2:Capabilities>
diff --git a/petascope/test/testcases-wcs/output/CoverageDescriptions1.xml b/petascope/test/testcases-wcs/output/CoverageDescriptions1.xml
new file mode 100644
index 0000000..0844d0c
--- /dev/null
+++ b/petascope/test/testcases-wcs/output/CoverageDescriptions1.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ExceptionReport xmlns="http://www.opengis.net/ows" xmlns:ns2="http://www.w3.org/1999/xlink" language="en" version="1.0.0">
+ <Exception locator="Could not connect to the metadata database!" exceptionCode="NoApplicableCode"/>
+</ExceptionReport>
diff --git a/petascope/test/testcases-wcs/output/CoverageDescriptions2.xml b/petascope/test/testcases-wcs/output/CoverageDescriptions2.xml
new file mode 100644
index 0000000..84b073f
--- /dev/null
+++ b/petascope/test/testcases-wcs/output/CoverageDescriptions2.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:CoverageDescriptions xmlns="http://www.opengis.net/ows" xmlns:ns2="http://www.opengis.net/wcs/1.1" xmlns:ns3="http://www.opengis.net/wcs/1.1/ows" xmlns:ns4="http://www.w3.org/1999/xlink" xmlns:ns5="http://www.opengis.net/gml" xmlns:ns6="http://www.w3.org/2001/SMIL20/" xmlns:ns7="http://www.w3.org/2001/SMIL20/Language">
+ <ns2:CoverageDescription>
+ <Title>Coverage rgb</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <ns2:Identifier>rgb</ns2:Identifier>
+ <ns2:Domain>
+ <ns2:SpatialDomain>
+ <BoundingBox xmlns:ns8="http://www.opengis.net/ows" xmlns="">
+ <ns8:LowerCorner>0.0 0.0</ns8:LowerCorner>
+ <ns8:UpperCorner>399.0 343.0</ns8:UpperCorner>
+ </BoundingBox>
+ </ns2:SpatialDomain>
+ </ns2:Domain>
+ <ns2:Range>
+ <ns2:Field>
+ <ns2:Identifier>red</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned int</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">unsigned short</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ <ns2:Field>
+ <ns2:Identifier>green</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned int</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">unsigned short</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ <ns2:Field>
+ <ns2:Identifier>blue</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned int</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">unsigned short</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ </ns2:Range>
+ <ns2:SupportedCRS></ns2:SupportedCRS>
+ <ns2:SupportedFormat>text/xml</ns2:SupportedFormat>
+ </ns2:CoverageDescription>
+ <ns2:CoverageDescription>
+ <Title>Coverage mr</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <ns2:Identifier>mr</ns2:Identifier>
+ <ns2:Domain>
+ <ns2:SpatialDomain>
+ <BoundingBox xmlns:ns8="http://www.opengis.net/ows" xmlns="">
+ <ns8:LowerCorner>0.0 0.0</ns8:LowerCorner>
+ <ns8:UpperCorner>255.0 210.0</ns8:UpperCorner>
+ </BoundingBox>
+ </ns2:SpatialDomain>
+ </ns2:Domain>
+ <ns2:Range>
+ <ns2:Field>
+ <ns2:Identifier>green</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned int</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">unsigned short</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ <ns2:Field>
+ <ns2:Identifier>grey</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned int</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">unsigned short</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ </ns2:Range>
+ <ns2:SupportedCRS></ns2:SupportedCRS>
+ <ns2:SupportedFormat>text/xml</ns2:SupportedFormat>
+ </ns2:CoverageDescription>
+ <ns2:CoverageDescription>
+ <Title>Coverage mowglie</Title>
+ <Abstract>Available coverage, fetched from the database</Abstract>
+ <ns2:Identifier>mowglie</ns2:Identifier>
+ <ns2:Domain>
+ <ns2:SpatialDomain>
+ <BoundingBox xmlns:ns8="http://www.opengis.net/ows" xmlns="">
+ <ns8:LowerCorner>0.0 0.0</ns8:LowerCorner>
+ <ns8:UpperCorner>119.0 158.0</ns8:UpperCorner>
+ </BoundingBox>
+ </ns2:SpatialDomain>
+ </ns2:Domain>
+ <ns2:Range>
+ <ns2:Field>
+ <ns2:Identifier>red</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned int</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">unsigned short</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ <ns2:Field>
+ <ns2:Identifier>green</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned int</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">unsigned short</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ <ns2:Field>
+ <ns2:Identifier>blue</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned int</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">unsigned short</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ </ns2:Range>
+ <ns2:SupportedCRS></ns2:SupportedCRS>
+ <ns2:SupportedFormat>text/xml</ns2:SupportedFormat>
+ </ns2:CoverageDescription>
+</ns2:CoverageDescriptions>
diff --git a/petascope/test/testcases-wcs/output/ProcessCoverage1.xml b/petascope/test/testcases-wcs/output/ProcessCoverage1.xml
new file mode 100644
index 0000000..a2c0d9f
--- /dev/null
+++ b/petascope/test/testcases-wcs/output/ProcessCoverage1.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<processCoverage xmlns="http://www.opengis.net/wcps/1.0.0" version="1.0.0" service="WCPS">
+ <coverageIterator>
+ <iteratorVar>var</iteratorVar>
+ <coverageName>NIR</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <format>jpg</format>
+ <trim>
+ <trimAxisSpec>
+ <axis>x</axis>
+ <domainCoord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:int">0</domainCoord>
+ <domainCoord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:int">450</domainCoord>
+ </trimAxisSpec>
+ <trim>
+ <trimAxisSpec>
+ <axis>y</axis>
+ <domainCoord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:int">0</domainCoord>
+ <domainCoord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:int">300</domainCoord>
+ </trimAxisSpec>
+ <coverage>var</coverage>
+ </trim>
+ </trim>
+ </encode>
+</processCoverage>
diff --git a/petascope/test/testcases-wcs/output/ProcessCoverage2.xml b/petascope/test/testcases-wcs/output/ProcessCoverage2.xml
new file mode 100644
index 0000000..c8b95bf
--- /dev/null
+++ b/petascope/test/testcases-wcs/output/ProcessCoverage2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<processCoverage xmlns="http://www.opengis.net/wcps/1.0.0" version="1.0.0" service="WCPS">
+ <coverageIterator>
+ <iteratorVar>var</iteratorVar>
+ <coverageName>TBD</coverageName>
+ </coverageIterator>
+ <encode store="false">
+ <format>image/gif</format>
+ <trim>
+ <trimAxisSpec>
+ <axis>x</axis>
+ <domainCoord>9999.0</domainCoord>
+ <domainCoord>23.0</domainCoord>
+ </trimAxisSpec>
+ <trim>
+ <trimAxisSpec>
+ <axis>y</axis>
+ <domainCoord>56.0</domainCoord>
+ <domainCoord>9999.0</domainCoord>
+ </trimAxisSpec>
+ <setInterpolationDefault>
+ <field>TBDField</field>
+ <interpolationMethod>nearest neighbor</interpolationMethod>
+ <nullResistance>full</nullResistance>
+ <combine>
+ <component>
+ <field>TBDField</field>
+ <coverage>var</coverage>
+ </component>
+ </combine>
+ </setInterpolationDefault>
+ </trim>
+ </trim>
+ </encode>
+</processCoverage>
diff --git a/petascope/test/testcases-wcs/output/ProcessCoverage3.xml b/petascope/test/testcases-wcs/output/ProcessCoverage3.xml
new file mode 100644
index 0000000..18530c3
--- /dev/null
+++ b/petascope/test/testcases-wcs/output/ProcessCoverage3.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<processCoverage xmlns="http://www.opengis.net/wcps/1.0.0" version="1.0.0" service="WCPS">
+ <coverageIterator>
+ <iteratorVar>var</iteratorVar>
+ <coverageName>rgb</coverageName>
+ </coverageIterator>
+ <encode store="true">
+ <format>image/GeoTIFF</format>
+ <trim>
+ <trimAxisSpec>
+ <axis>x</axis>
+ <domainCoord>0.0</domainCoord>
+ <domainCoord>300.0</domainCoord>
+ </trimAxisSpec>
+ <trim>
+ <trimAxisSpec>
+ <axis>y</axis>
+ <domainCoord>0.0</domainCoord>
+ <domainCoord>300.0</domainCoord>
+ </trimAxisSpec>
+ <crsTransform>
+ <crsTransformAxisSpec>
+ <axis>x</axis>
+ <crs>urn:ogc:def:crs:EPSG::26910</crs>
+ </crsTransformAxisSpec>
+ <crsTransformAxisSpec>
+ <axis>y</axis>
+ <crs>urn:ogc:def:crs:EPSG::26910</crs>
+ </crsTransformAxisSpec>
+ <crsTransformFieldSpec/>
+ <setInterpolationDefault>
+ <field>Wavelength</field>
+ <interpolationMethod>nearest neighbor</interpolationMethod>
+ <nullResistance>none</nullResistance>
+ <combine>
+ <component>
+<field>Wavelength</field>
+<coverage>var</coverage>
+ </component>
+ </combine>
+ </setInterpolationDefault>
+ </crsTransform>
+ </trim>
+ </trim>
+ </encode>
+</processCoverage>
diff --git a/petascope/test/testcases-wcs/output/ProcessCoverage4.xml b/petascope/test/testcases-wcs/output/ProcessCoverage4.xml
new file mode 100644
index 0000000..5ea9826
--- /dev/null
+++ b/petascope/test/testcases-wcs/output/ProcessCoverage4.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ExceptionReport xmlns="http://www.opengis.net/ows" xmlns:ns2="http://www.w3.org/1999/xlink" language="en" version="1.0.0">
+ <Exception locator="Currently, the Output-&gt;GridCRS node is not supported !" exceptionCode="NoApplicableCode"/>
+</ExceptionReport>
diff --git a/petascope/test/testcases-wcs/working/DescribeCoverage.1.xml b/petascope/test/testcases-wcs/working/DescribeCoverage.1.xml
new file mode 100644
index 0000000..3ed2735
--- /dev/null
+++ b/petascope/test/testcases-wcs/working/DescribeCoverage.1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<DescribeCoverage xmlns="http://www.opengis.net/wcs/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs/1.1 ../wcsDescribeCoverage.xsd" service="WCS" version="1.1.2">
+ <!-- <Identifier>mr</Identifier> -->
+ <Identifier>rgb</Identifier>
+ <Identifier>mr</Identifier>
+ <Identifier>mowglie</Identifier>
+</DescribeCoverage> \ No newline at end of file
diff --git a/petascope/test/testcases-wcs/working/GetCapabilities.xml b/petascope/test/testcases-wcs/working/GetCapabilities.xml
new file mode 100644
index 0000000..0cfae50
--- /dev/null
+++ b/petascope/test/testcases-wcs/working/GetCapabilities.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GetCapabilities xmlns="http://www.opengis.net/wcs/1.1"
+ xmlns:owcs="http://www.opengis.net/wcs/1.1/ows"
+ service="WCS">
+ <owcs:AcceptVersions>
+ <owcs:Version>1.0.0</owcs:Version>
+ <owcs:Version>0.8.3</owcs:Version>
+ </owcs:AcceptVersions>
+ <owcs:Sections>
+ <owcs:Section>Contents</owcs:Section>
+ </owcs:Sections>
+ <owcs:AcceptFormats>
+ <owcs:OutputFormat>text/xml</owcs:OutputFormat>
+ </owcs:AcceptFormats>
+</GetCapabilities>
diff --git a/petascope/test/testcases-wcs/working/GetCoverage.1.xml b/petascope/test/testcases-wcs/working/GetCoverage.1.xml
new file mode 100644
index 0000000..7326767
--- /dev/null
+++ b/petascope/test/testcases-wcs/working/GetCoverage.1.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GetCoverage xmlns="http://www.opengis.net/wcs/1.1" xmlns:ows="http://www.opengis.net/ows" xmlns:owcs="http://www.opengis.net/wcs/1.1/ows" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs/1.1 ../wcsGetCoverage.xsd http://www.opengis.net/gml ../../../gml/3.1.1/base/gml.xsd" service="WCS" version="1.1.0">
+ <owcs:Identifier>NIR</owcs:Identifier>
+ <DomainSubset>
+ <ows:BoundingBox>
+ <ows:LowerCorner>0 0</ows:LowerCorner>
+ <ows:UpperCorner>450 450</ows:UpperCorner>
+ </ows:BoundingBox>
+ </DomainSubset>
+ <Output format="image/jpeg" />
+</GetCoverage> \ No newline at end of file
diff --git a/petascope/test/testcases-wcst/CoverageDescriptions1.xml b/petascope/test/testcases-wcst/CoverageDescriptions1.xml
new file mode 100644
index 0000000..b9cabba
--- /dev/null
+++ b/petascope/test/testcases-wcst/CoverageDescriptions1.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:CoverageDescriptions xmlns="http://www.opengis.net/ows" xmlns:ns2="http://www.opengis.net/wcs/1.1" xmlns:ns3="http://www.opengis.net/wcs/1.1/ows" xmlns:ns4="http://www.w3.org/1999/xlink" xmlns:ns5="http://www.opengis.net/gml" xmlns:ns6="http://www.w3.org/2001/SMIL20/" xmlns:ns7="http://www.w3.org/2001/SMIL20/Language" xmlns:ns8="http://www.opengis.net/ows">
+ <ns2:CoverageDescription>
+ <Title>Title 1 (Descriptions)</Title>
+ <Abstract>Test coverage (Description)</Abstract>
+ <ns2:Identifier>coverage_1</ns2:Identifier>
+ <ns2:Domain>
+ <ns2:SpatialDomain>
+ <ns8:BoundingBox>
+ <ns8:LowerCorner>0.0 0.0</ns8:LowerCorner>
+ <ns8:UpperCorner>399.0 343.0</ns8:UpperCorner>
+ </ns8:BoundingBox>
+ </ns2:SpatialDomain>
+ </ns2:Domain>
+ <ns2:Range>
+ <ns2:Field>
+ <ns2:Identifier>red</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned short</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">none</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ </ns2:Range>
+ <ns2:SupportedCRS></ns2:SupportedCRS>
+ <ns2:SupportedFormat>text/xml</ns2:SupportedFormat>
+ </ns2:CoverageDescription>
+</ns2:CoverageDescriptions>
diff --git a/petascope/test/testcases-wcst/CoverageDescriptions2.xml b/petascope/test/testcases-wcst/CoverageDescriptions2.xml
new file mode 100644
index 0000000..151e99c
--- /dev/null
+++ b/petascope/test/testcases-wcst/CoverageDescriptions2.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:CoverageDescriptions xmlns="http://www.opengis.net/ows" xmlns:ns2="http://www.opengis.net/wcs/1.1" xmlns:ns3="http://www.opengis.net/wcs/1.1/ows" xmlns:ns4="http://www.w3.org/1999/xlink" xmlns:ns5="http://www.opengis.net/gml" xmlns:ns6="http://www.w3.org/2001/SMIL20/" xmlns:ns7="http://www.w3.org/2001/SMIL20/Language" xmlns:ns8="http://www.opengis.net/ows">
+ <ns2:CoverageDescription>
+ <Title>Title 2 (Descriptions)</Title>
+ <Abstract>Test coverage (Description)</Abstract>
+ <ns2:Identifier>coverage_2</ns2:Identifier>
+ <ns2:Domain>
+ <ns2:SpatialDomain>
+ <ns8:BoundingBox>
+ <ns8:LowerCorner>0.0 0.0</ns8:LowerCorner>
+ <ns8:UpperCorner>399.0 343.0</ns8:UpperCorner>
+ </ns8:BoundingBox>
+ </ns2:SpatialDomain>
+ </ns2:Domain>
+ <ns2:Range>
+ <ns2:Field>
+ <ns2:Identifier>red</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>unsigned short</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">none</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ <ns2:Field>
+ <ns2:Identifier>blue</ns2:Identifier>
+ <ns2:Definition>
+ <ns3:DataType>weird</ns3:DataType>
+ </ns2:Definition>
+ <ns3:InterpolationMethods>
+ <ns3:DefaultMethod nullResistance="none">none</ns3:DefaultMethod>
+ </ns3:InterpolationMethods>
+ </ns2:Field>
+ </ns2:Range>
+ <ns2:SupportedCRS></ns2:SupportedCRS>
+ <ns2:SupportedFormat>text/xml</ns2:SupportedFormat>
+ </ns2:CoverageDescription>
+</ns2:CoverageDescriptions>
diff --git a/petascope/test/testcases-wcst/CoverageSummary1.xml b/petascope/test/testcases-wcst/CoverageSummary1.xml
new file mode 100644
index 0000000..651d4fe
--- /dev/null
+++ b/petascope/test/testcases-wcst/CoverageSummary1.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:CoverageSummary xmlns="http://www.opengis.net/ows" xmlns:ns2="http://www.opengis.net/wcs/1.1" xmlns:ns3="http://www.opengis.net/wcs/1.1/ows" xmlns:ns4="http://www.w3.org/1999/xlink" xmlns:ns5="http://www.opengis.net/gml" xmlns:ns6="http://www.w3.org/2001/SMIL20/" xmlns:ns7="http://www.w3.org/2001/SMIL20/Language" version="1.1.0">
+ <Title>Title1</Title>
+ <Abstract>Abstract1 (Summary)</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">coverage_1</Identifier>
+</ns2:CoverageSummary>
diff --git a/petascope/test/testcases-wcst/CoverageSummary2.xml b/petascope/test/testcases-wcst/CoverageSummary2.xml
new file mode 100644
index 0000000..78a78d9
--- /dev/null
+++ b/petascope/test/testcases-wcst/CoverageSummary2.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:CoverageSummary xmlns="http://www.opengis.net/ows" xmlns:ns2="http://www.opengis.net/wcs/1.1" xmlns:ns3="http://www.opengis.net/wcs/1.1/ows" xmlns:ns4="http://www.w3.org/1999/xlink" xmlns:ns5="http://www.opengis.net/gml" xmlns:ns6="http://www.w3.org/2001/SMIL20/" xmlns:ns7="http://www.w3.org/2001/SMIL20/Language" version="1.1.0">
+ <Title>Title2</Title>
+ <Abstract>Abstract2 (Summary)</Abstract>
+ <Identifier xmlns:ns8="http://www.opengis.net/ows" xmlns="">coverage_2</Identifier>
+</ns2:CoverageSummary>
diff --git a/petascope/test/testcases-wcst/Transaction1-async.xml b/petascope/test/testcases-wcst/Transaction1-async.xml
new file mode 100644
index 0000000..ba626ab
--- /dev/null
+++ b/petascope/test/testcases-wcst/Transaction1-async.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Document : Transaction1.xml
+ Created on : March 16, 2009, 10:37 PM
+ Author : Andrei
+ Description:
+ Test operation Transaction of WCS, action ADD: add one coverage to the WCS server, asynchroneously !
+-->
+<Transaction xmlns="http://www.opengis.net/wcs/1.1/wcst"
+xmlns:xlink="http://www.w3.org/1999/xlink"
+xmlns:ows="http://www.opengis.net/ows/1.1"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.opengis.net/wcs/1.1/wcst ../../src/conf/xml-resources/jaxb/WCS-Transaction Schema/wcstTransaction.xsd"
+service="WCS" version="1.1">
+ <InputCoverages>
+ <Coverage>
+ <ows:Identifier codeSpace="TBD">coverage_1</ows:Identifier>
+ <ows:Reference xlink:href="http://localhost/peta/flickr1.jpg"
+ xlink:role="urn:ogc:def:role:WCS:1.1:Pixels"/>
+ <ows:Reference xlink:href="http://localhost/peta/CoverageDescriptions1.xml"
+ xlink:role="urn:ogc:def:role:WCS:1.1:CoverageDescription"/>
+ <ows:Reference xlink:href="http://localhost/peta/CoverageSummary1.xml"
+ xlink:role="urn:ogc:def:role:WCS:1.1:CoverageSummary"/>
+ <Action>Add</Action>
+ </Coverage>
+ </InputCoverages>
+ <ResponseHandler>
+ http://localhost:8080/PetaScope/WCPService
+ </ResponseHandler>
+</Transaction>
diff --git a/petascope/test/testcases-wcst/Transaction1.xml b/petascope/test/testcases-wcst/Transaction1.xml
new file mode 100644
index 0000000..bc99400
--- /dev/null
+++ b/petascope/test/testcases-wcst/Transaction1.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Document : Transaction1.xml
+ Created on : March 16, 2009, 10:37 PM
+ Author : Andrei
+ Description:
+ Test operation Transaction of WCS, action ADD: add one coverage to the WCS server.
+-->
+<Transaction xmlns="http://www.opengis.net/wcs/1.1/wcst"
+xmlns:xlink="http://www.w3.org/1999/xlink"
+xmlns:ows="http://www.opengis.net/ows/1.1"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.opengis.net/wcs/1.1/wcst ../../src/conf/xml-resources/jaxb/WCS-Transaction Schema/wcstTransaction.xsd"
+service="WCS" version="1.1">
+ <InputCoverages>
+ <Coverage>
+ <ows:Identifier codeSpace="TBD">coverage_1</ows:Identifier>
+ <ows:Reference xlink:href="http://localhost/peta/flickr1.jpg"
+ xlink:role="urn:ogc:def:role:WCS:1.1:Pixels"/>
+ <ows:Reference xlink:href="http://localhost/peta/CoverageDescriptions1.xml"
+ xlink:role="urn:ogc:def:role:WCS:1.1:CoverageDescription"/>
+ <ows:Reference xlink:href="http://localhost/peta/CoverageSummary1.xml"
+ xlink:role="urn:ogc:def:role:WCS:1.1:CoverageSummary"/>
+ <Action>Add</Action>
+ </Coverage>
+ </InputCoverages>
+</Transaction>
diff --git a/petascope/test/testcases-wcst/Transaction2.xml b/petascope/test/testcases-wcst/Transaction2.xml
new file mode 100644
index 0000000..6f14c39
--- /dev/null
+++ b/petascope/test/testcases-wcst/Transaction2.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Document : Transaction1.xml
+ Created on : March 16, 2009, 10:37 PM
+ Author : Andrei
+ Description:
+ Test operation Transaction of WCS, action ADD: add multiple coverages.
+-->
+<Transaction xmlns="http://www.opengis.net/wcs/1.1/wcst"
+xmlns:xlink="http://www.w3.org/1999/xlink"
+xmlns:ows="http://www.opengis.net/ows/1.1"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.opengis.net/wcs/1.1/wcst ../../src/conf/xml-resources/jaxb/WCS-Transaction Schema/wcstTransaction.xsd"
+service="WCS" version="1.1">
+ <InputCoverages>
+ <Coverage>
+ <ows:Identifier codeSpace="TBD">coverage_1</ows:Identifier>
+ <ows:Reference xlink:href="http://localhost/peta/flickr1.jpg"
+ xlink:role="urn:ogc:def:role:WCS:1.1:Pixels"/>
+ <ows:Reference xlink:href="http://localhost/peta/CoverageDescriptions1.xml"
+ xlink:role="urn:ogc:def:role:WCS:1.1:CoverageDescription"/>
+ <ows:Reference xlink:href="http://localhost/peta/CoverageSummary1.xml"
+ xlink:role="urn:ogc:def:role:WCS:1.1:CoverageSummary"/>
+ <Action>Add</Action>
+ </Coverage>
+ <Coverage>
+ <ows:Identifier codeSpace="TBD">coverage_2</ows:Identifier>
+ <ows:Reference xlink:href="http://localhost/peta/flickr1.jpg"
+ xlink:role="urn:ogc:def:role:WCS:1.1:Pixels"/>
+ <ows:Reference xlink:href="http://localhost/peta/CoverageDescriptions2.xml"
+ xlink:role="urn:ogc:def:role:WCS:1.1:CoverageDescription"/>
+ <ows:Reference xlink:href="http://localhost/peta/CoverageSummary2.xml"
+ xlink:role="urn:ogc:def:role:WCS:1.1:CoverageSummary"/>
+ <Action>Add</Action>
+ </Coverage>
+ </InputCoverages>
+</Transaction>
diff --git a/petascope/test/testcases-wcst/Transaction3.xml b/petascope/test/testcases-wcst/Transaction3.xml
new file mode 100644
index 0000000..4bf4b99
--- /dev/null
+++ b/petascope/test/testcases-wcst/Transaction3.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Document : Transaction1.xml
+ Created on : March 16, 2009, 10:37 PM
+ Author : Andrei
+ Description:
+ Test operation Transaction of WCS, action DELETE one coverage.
+-->
+<Transaction xmlns="http://www.opengis.net/wcs/1.1/wcst"
+xmlns:xlink="http://www.w3.org/1999/xlink"
+xmlns:ows="http://www.opengis.net/ows/1.1"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://www.opengis.net/wcs/1.1/wcst ../../src/conf/xml-resources/jaxb/WCS-Transaction Schema/wcstTransaction.xsd"
+service="WCS" version="1.1">
+ <InputCoverages>
+ <Coverage>
+ <ows:Identifier codeSpace="TBD">coverage_1</ows:Identifier>
+ <Action>Delete</Action>
+ </Coverage>
+ </InputCoverages>
+</Transaction>
diff --git a/petascope/test/wcps_grammar.sh b/petascope/test/wcps_grammar.sh
new file mode 100755
index 0000000..a93dc1d
--- /dev/null
+++ b/petascope/test/wcps_grammar.sh
@@ -0,0 +1,16 @@
+#! /bin/bash
+# Run the grammar CLI tool
+
+if [ $# != 1 ]; then
+ echo "WCPS Abstract Syntax Grammar Test Tool."
+ echo "Parses an abstract syntax query and transforms it into XML for WCPS. "
+ echo "Third parameter (String) is the query. "
+ echo ""
+ echo "Usage: ./grammar queryString"
+ echo "For example: ./grammar \"for c in (nir) return encode(c,\"png\") "
+ exit 1
+fi
+
+CLASSPATH=.:../lib/wcps-all.jar:../lib/jaxb-api.jar:../lib/jaxb-impl.jar:../lib/postgresql-8.3-604.jdbc4.jar:../lib/jsr173_api.jar:../lib/rasj.jar:../lib/commons-math-1.1.jar:../lib/antlrworks-1.2.3.jar
+
+java -cp $CLASSPATH wcps.server.cli.grammar "$1"
diff --git a/petascope/test/wcps_xml.sh b/petascope/test/wcps_xml.sh
new file mode 100755
index 0000000..aadfd92
--- /dev/null
+++ b/petascope/test/wcps_xml.sh
@@ -0,0 +1,11 @@
+#! /bin/bash
+# Run the xml CLI tool.
+# Use as below: wcps_xml.sh testcases_wcps/1.test.xml
+# Input: ProcessCoverages XML document (WCPS 1.0.0)
+# Output: RasQL query (on the last line of output)
+
+CLASSPATH=.:lib/wcps-all.jar:lib/jaxb-api.jar:lib/jaxb-impl.jar:lib/postgresql-8.3-604.jdbc4.jar:lib/jsr173_api.jar:lib/rasj.jar:lib/commons-math-1.1.jar:lib/antlrworks-1.2.3.jar
+
+echo "Will run with file '$1'"
+
+cd .. && java -cp $CLASSPATH wcps.server.cli.xml test/$1
diff --git a/petascope/test/wcs/server/core/TimeStringTest.java b/petascope/test/wcs/server/core/TimeStringTest.java
new file mode 100644
index 0000000..8fb274d
--- /dev/null
+++ b/petascope/test/wcs/server/core/TimeStringTest.java
@@ -0,0 +1,140 @@
+/*
+ * This file is part of PetaScope.
+ *
+ * PetaScope is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * PetaScope 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with PetaScope. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * For more information please see <http://www.PetaScope.org>
+ * or contact Peter Baumann via <baumann@rasdaman.com>.
+ *
+ * Copyright 2009 Jacobs University Bremen, Peter Baumann.
+ */
+
+package wcs.server.core;
+
+//~--- non-JDK imports --------------------------------------------------------
+
+import org.joda.time.DateTime;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import petascope.wcs.server.core.TimeString;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test class for TimeString ISO 8601 utility class.
+ * @author Andrei Aiordachioaie
+ */
+public class TimeStringTest
+{
+ public TimeStringTest() {}
+
+ @BeforeClass
+ public static void setUpClass() throws Exception {}
+
+ @AfterClass
+ public static void tearDownClass() throws Exception {}
+
+ @Test
+ public void testDate0()
+ {
+ System.out.println("date0");
+ TimeString t = new TimeString("2000");
+ DateTime date = t.getDateTime();
+
+ assertEquals(date.getYear(), 2000);
+ }
+
+ @Test
+ public void testDate1()
+ {
+ System.out.println("date1");
+ TimeString t = new TimeString("2009-06");
+ DateTime date = t.getDateTime();
+
+ assertEquals(2009, date.getYear());
+ assertEquals(6, date.getMonthOfYear());
+ }
+
+ @Test
+ public void testDate2()
+ {
+ System.out.println("date2");
+ DateTime date = TimeString.parse("2006-11-22");
+
+ assertEquals(2006, date.getYear());
+ assertEquals(11, date.getMonthOfYear());
+ assertEquals(22, date.getDayOfMonth());
+ }
+
+ @Test
+ public void testDate3()
+ {
+ System.out.println("date3");
+ DateTime date = TimeString.parse("2006-11-22T08");
+ long m = TimeString.parseMillis("2006-11-22T08");
+
+ assertEquals(2006, date.getYear());
+ assertEquals(11, date.getMonthOfYear());
+ assertEquals(22, date.getDayOfMonth());
+ assertEquals(8, date.getHourOfDay());
+ }
+
+ @Test
+ public void testDate4()
+ {
+ System.out.println("date4");
+ DateTime date = TimeString.parse("2006-11-22T08:11");
+ long m = TimeString.parseMillis("2006-11-22T08:11");
+
+ assertEquals(2006, date.getYear());
+ assertEquals(11, date.getMonthOfYear());
+ assertEquals(22, date.getDayOfMonth());
+ assertEquals(8, date.getHourOfDay());
+ assertEquals(11, date.getMinuteOfHour());
+ }
+
+ @Test
+ public void testDate5()
+ {
+ System.out.println("date5");
+ DateTime date = TimeString.parse("2006-11-22T08:55:00");
+ long m = TimeString.parseMillis("2006-11-22T08:55:00");
+
+ assertEquals(2006, date.getYear());
+ assertEquals(11, date.getMonthOfYear());
+ assertEquals(22, date.getDayOfMonth());
+ assertEquals(8, date.getHourOfDay());
+ assertEquals(55, date.getMinuteOfHour());
+ assertEquals(0, date.getSecondOfMinute());
+ }
+
+ @Test
+ public void testDate6()
+ {
+ System.out.println("date6");
+ DateTime date = TimeString.parse("1988-03-01T13:00:00.000Z");
+ long m = TimeString.parseMillis("2006-11-22T08:00:00.000Z");
+
+ assertEquals(1988, date.getYear());
+ assertEquals(3, date.getMonthOfYear());
+ assertEquals(1, date.getDayOfMonth());
+ assertEquals(14, date.getHourOfDay());
+ assertEquals(0, date.getMinuteOfHour());
+ assertEquals(0, date.getSecondOfMinute());
+ assertEquals(0, date.getMillisOfSecond());
+ }
+
+}
diff --git a/petascope/web/META-INF/context.xml b/petascope/web/META-INF/context.xml
new file mode 100644
index 0000000..b3eae8b
--- /dev/null
+++ b/petascope/web/META-INF/context.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context antiJARLocking="true" path="/PetaScope"/>
diff --git a/petascope/web/WEB-INF/web.xml b/petascope/web/WEB-INF/web.xml
new file mode 100644
index 0000000..5ea7948
--- /dev/null
+++ b/petascope/web/WEB-INF/web.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <description>PetaScope project offers WCS, WCPS and WCS-T services.</description>
+ <display-name>PetaScope</display-name>
+ <servlet>
+ <description>WCPS Service</description>
+ <servlet-name>wcpsServlet</servlet-name>
+ <servlet-class>wcps.server.servlet.WCPSServlet</servlet-class>
+ </servlet>
+ <servlet>
+ <description>WCS-T Service</description>
+ <servlet-name>wcstServlet</servlet-name>
+ <servlet-class>wcst.server.servlet.wcstServlet</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>PetaScope Interface</servlet-name>
+ <servlet-class>petascope.PetascopeInterface</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>wcpsServlet</servlet-name>
+ <url-pattern>/wcps</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>wcstServlet</servlet-name>
+ <url-pattern>/wcst</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>PetaScope Interface</servlet-name>
+ <url-pattern>/earthlook</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>
+ 30
+ </session-timeout>
+ </session-config>
+</web-app>
diff --git a/petascope/web/index.jsp b/petascope/web/index.jsp
new file mode 100644
index 0000000..6430298
--- /dev/null
+++ b/petascope/web/index.jsp
@@ -0,0 +1,24 @@
+<%--
+ Document : WAR Application index entry point
+ Created on : Apr 21, 2009, 7:47:47 AM
+ Author : Andrei Aiordachioaie
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="refresh" content="0;url=earthlook">
+ <title>PetaScope Implementation</title>
+ </head>
+ <body>
+ <div align="center"><h1>PetaScope Implementation</h1></div>
+
+ <br/>
+ Hold on, you are being redirected to the <a href="earthlook">PetaScope interface</a> ...
+
+ </body>
+</html>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/ReadMe.txt b/petascope/xml/ogc/gml/3.1.1/base/ReadMe.txt
new file mode 100644
index 0000000..97fc026
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/ReadMe.txt
@@ -0,0 +1,9 @@
+This set of XML Schema Documents for GML Version 3.1.1 has been edited
+to reflect the corrigendum to documents 0GC 03-105r1 and OGC 04-092r4
+that is based on the change requests:
+OGC 05-068r1 "Store xlinks.xsd file at a fixed location"
+OGC 05-081r2 "Change to use relative paths"
+OGC 05-105 "Remove description and copyright tags from XML schema documents"
+
+Arliss Whiteside, 2005-11-22
+
diff --git a/petascope/xml/ogc/gml/3.1.1/base/basicTypes.xsd b/petascope/xml/ogc/gml/3.1.1/base/basicTypes.xsd
new file mode 100644
index 0000000..75805c2
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/basicTypes.xsd
@@ -0,0 +1,276 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:basicTypes:3.1.1">basicTypes.xsd</appinfo>
+ <documentation>
+ Generic simpleContent components for use in GML
+ Copyright (c) 2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ </documentation>
+ </annotation>
+ <!-- =========================================================== -->
+ <simpleType name="NullEnumeration">
+ <annotation>
+ <documentation> Some common reasons for a null value:
+
+ innapplicable - the object does not have a value
+ missing - The correct value is not readily available to the sender of this data.
+ Furthermore, a correct value may not exist.
+ template - the value will be available later
+ unknown - The correct value is not known to, and not computable by, the sender of this data.
+ However, a correct value probably exists.
+ withheld - the value is not divulged
+
+ other:reason - as indicated by "reason" string
+
+ Specific communities may agree to assign more strict semantics when these terms are used in a particular context.
+ </documentation>
+ </annotation>
+ <union>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="inapplicable"/>
+ <enumeration value="missing"/>
+ <enumeration value="template"/>
+ <enumeration value="unknown"/>
+ <enumeration value="withheld"/>
+ </restriction>
+ </simpleType>
+ <simpleType>
+ <restriction base="string">
+ <pattern value="other:\w{2,}"/>
+ </restriction>
+ </simpleType>
+ </union>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="NullType">
+ <annotation>
+ <documentation>Utility type for null elements. The value may be selected from one of the enumerated tokens, or may be a URI in which case this should identify a resource which describes the reason for the null. </documentation>
+ </annotation>
+ <union memberTypes="gml:NullEnumeration anyURI"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="Null" type="gml:NullType"/>
+ <!-- ===================================================== -->
+ <simpleType name="SignType">
+ <annotation>
+ <documentation>Utility type used in various places
+ - e.g. to indicate the direction of topological objects;
+ "+" for forwards, or "-" for backwards.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="-"/>
+ <enumeration value="+"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="booleanOrNull">
+ <annotation>
+ <documentation>Union of the XML Schema boolean type and the GML Nulltype. An element which uses this type may have content which is either a boolean {0,1,true,false} or a value from Nulltype</documentation>
+ </annotation>
+ <union memberTypes="gml:NullEnumeration boolean anyURI"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="booleanOrNullList">
+ <annotation>
+ <documentation>XML List based on the union type defined above. An element declared with this type contains a space-separated list of boolean values {0,1,true,false} with null values interspersed as needed</documentation>
+ </annotation>
+ <list itemType="gml:booleanOrNull"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="booleanList">
+ <annotation>
+ <documentation>XML List based on XML Schema boolean type. An element of this type contains a space-separated list of boolean values {0,1,true,false}</documentation>
+ </annotation>
+ <list itemType="boolean"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="stringOrNull">
+ <annotation>
+ <documentation>Union of the XML Schema string type and the GML Nulltype. An element which uses this type may have content which is either a string or a value from Nulltype. Note that a "string" may contain whitespace. </documentation>
+ </annotation>
+ <union memberTypes="gml:NullEnumeration string anyURI"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="NameOrNull">
+ <annotation>
+ <documentation>Union of the XML Schema Name type and the GML Nulltype. An element which uses this type may have content which is either a Name or a value from Nulltype. Note that a "Name" may not contain whitespace. </documentation>
+ </annotation>
+ <union memberTypes="gml:NullEnumeration Name anyURI"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="NameOrNullList">
+ <annotation>
+ <documentation>XML List based on the union type defined above. An element declared with this type contains a space-separated list of Name values with null values interspersed as needed</documentation>
+ </annotation>
+ <list itemType="gml:NameOrNull"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="NameList">
+ <annotation>
+ <documentation>XML List based on XML Schema Name type. An element of this type contains a space-separated list of Name values</documentation>
+ </annotation>
+ <list itemType="Name"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="doubleOrNull">
+ <annotation>
+ <documentation>Union of the XML Schema double type and the GML Nulltype. An element which uses this type may have content which is either a double or a value from Nulltype</documentation>
+ </annotation>
+ <union memberTypes="gml:NullEnumeration double anyURI"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="doubleOrNullList">
+ <annotation>
+ <documentation>XML List based on the union type defined above. An element declared with this type contains a space-separated list of double values with null values interspersed as needed</documentation>
+ </annotation>
+ <list itemType="gml:doubleOrNull"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="doubleList">
+ <annotation>
+ <documentation>XML List based on XML Schema double type. An element of this type contains a space-separated list of double values</documentation>
+ </annotation>
+ <list itemType="double"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="integerOrNull">
+ <annotation>
+ <documentation>Union of the XML Schema integer type and the GML Nulltype. An element which uses this type may have content which is either an integer or a value from Nulltype</documentation>
+ </annotation>
+ <union memberTypes="gml:NullEnumeration integer anyURI"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="integerOrNullList">
+ <annotation>
+ <documentation>XML List based on the union type defined above. An element declared with this type contains a space-separated list of integer values with null values interspersed as needed</documentation>
+ </annotation>
+ <list itemType="gml:integerOrNull"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="integerList">
+ <annotation>
+ <documentation>XML List based on XML Schema integer type. An element of this type contains a space-separated list of integer values</documentation>
+ </annotation>
+ <list itemType="integer"/>
+ </simpleType>
+ <!-- =========================================================== -->
+ <complexType name="CodeType">
+ <annotation>
+ <documentation>Name or code with an (optional) authority. Text token.
+ If the codeSpace attribute is present, then its value should identify a dictionary, thesaurus
+ or authority for the term, such as the organisation who assigned the value,
+ or the dictionary from which it is taken.
+ A text string with an optional codeSpace attribute. </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string">
+ <attribute name="codeSpace" type="anyURI" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="CodeListType">
+ <annotation>
+ <documentation>List of values on a uniform nominal scale. List of text tokens.
+ In a list context a token should not include any spaces, so xsd:Name is used instead of xsd:string.
+ If a codeSpace attribute is present, then its value is a reference to
+ a Reference System for the value, a dictionary or code list.</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:NameList">
+ <attribute name="codeSpace" type="anyURI" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="CodeOrNullListType">
+ <annotation>
+ <documentation>List of values on a uniform nominal scale. List of text tokens.
+ In a list context a token should not include any spaces, so xsd:Name is used instead of xsd:string.
+ A member of the list may be a typed null.
+ If a codeSpace attribute is present, then its value is a reference to
+ a Reference System for the value, a dictionary or code list.</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:NameOrNullList">
+ <attribute name="codeSpace" type="anyURI" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="MeasureType">
+ <annotation>
+ <documentation>Number with a scale.
+ The value of uom (Units Of Measure) attribute is a reference to a Reference System for the amount, either a ratio or position scale. </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="double">
+ <attribute name="uom" type="anyURI" use="required"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="MeasureListType">
+ <annotation>
+ <documentation>List of numbers with a uniform scale.
+ The value of uom (Units Of Measure) attribute is a reference to
+ a Reference System for the amount, either a ratio or position scale. </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:doubleList">
+ <attribute name="uom" type="anyURI" use="required"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="MeasureOrNullListType">
+ <annotation>
+ <documentation>List of numbers with a uniform scale.
+ A member of the list may be a typed null.
+ The value of uom (Units Of Measure) attribute is a reference to
+ a Reference System for the amount, either a ratio or position scale. </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:doubleOrNullList">
+ <attribute name="uom" type="anyURI" use="required"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="CoordinatesType">
+ <annotation>
+ <documentation>Tables or arrays of tuples.
+ May be used for text-encoding of values from a table.
+ Actually just a string, but allows the user to indicate which characters are used as separators.
+ The value of the 'cs' attribute is the separator for coordinate values,
+ and the value of the 'ts' attribute gives the tuple separator (a single space by default);
+ the default values may be changed to reflect local usage.
+ Defaults to CSV within a tuple, space between tuples.
+ However, any string content will be schema-valid. </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string">
+ <attribute name="decimal" type="string" default="."/>
+ <attribute name="cs" type="string" default=","/>
+ <attribute name="ts" type="string" default="&#x20;"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <simpleType name="NCNameList">
+ <annotation>
+ <documentation>A set of values, representing a list of token with the lexical value space of NCName. The tokens are seperated by whitespace.</documentation>
+ </annotation>
+ <list itemType="NCName"/>
+ </simpleType>
+ <!-- ============================================================== -->
+ <simpleType name="QNameList">
+ <annotation>
+ <documentation>A set of values, representing a list of token with the lexical value space of QName. The tokens are seperated by whitespace.</documentation>
+ </annotation>
+ <list itemType="QName"/>
+ </simpleType>
+ <!-- ============================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/coordinateOperations.xsd b/petascope/xml/ogc/gml/3.1.1/base/coordinateOperations.xsd
new file mode 100644
index 0000000..d659e25
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/coordinateOperations.xsd
@@ -0,0 +1,784 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1" xml:lang="en">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:coordinateOperations:3.1.1"/>
+ <documentation>How to encode coordinate operation definitions. Builds on referenceSystems.xsd to encode the data needed to define coordinate operations, including Transformations, Conversions, and other specific subtypes of operations.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ This schema encodes the Coordinate Operation (CC_) package of the extended UML Model for OGC Abstract Specification Topic 2: Spatial Referencing by Coordinates. That UML model is adapted from ISO 19111 - Spatial referencing by coordinates, as described in Annex C of Topic 2.
+ Caution: The CRS package in GML 3.1 and GML 3.1.1 is preliminary, and is expected to undergo some modifications that are not backward compatible during the development of GML 3.2 (ISO 19136). The GML 3.2 package will implement the model described in the revised version of ISO 19111. </documentation>
+ </annotation>
+ <!-- ======================================================
+ includes and imports
+ ====================================================== -->
+ <include schemaLocation="referenceSystems.xsd"/>
+ <include schemaLocation="dataQuality.xsd"/>
+ <!-- ======================================================
+ elements and types
+ ====================================================== -->
+ <element name="_CoordinateOperation" type="gml:AbstractCoordinateOperationType" abstract="true" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractCoordinateOperationBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for coordinate operation objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:coordinateOperationName"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="coordinateOperationName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this coordinate operation is identified. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="AbstractCoordinateOperationType" abstract="true">
+ <annotation>
+ <documentation>A mathematical operation on coordinates that transforms or converts coordinates to another coordinate reference system. Many but not all coordinate operations (from CRS A to CRS B) also uniquely define the inverse operation (from CRS B to CRS A). In some cases, the operation method algorithm for the inverse operation is the same as for the forward algorithm, but the signs of some operation parameter values must be reversed. In other cases, different algorithms are required for the forward and inverse operations, but the same operation parameter values are used. If (some) entirely different parameter values are needed, a different coordinate operation shall be defined.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateOperationBaseType">
+ <sequence>
+ <element ref="gml:coordinateOperationID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this coordinate operation. The first coordinateOperationID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this coordinate operation, including source information. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:operationVersion" minOccurs="0"/>
+ <element ref="gml:validArea" minOccurs="0"/>
+ <element ref="gml:scope" minOccurs="0"/>
+ <element ref="gml:_positionalAccuracy" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered set of estimates of the impact of this coordinate operation on point position accuracy. Gives position error estimates for target coordinates of this coordinate operation, assuming no errors in source coordinates. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:sourceCRS" minOccurs="0"/>
+ <element ref="gml:targetCRS" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="coordinateOperationID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of a coordinate operation. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="operationVersion" type="string">
+ <annotation>
+ <documentation>Version of the coordinate transformation (i.e., instantiation due to the stochastic nature of the parameters). Mandatory when describing a transformation, and should not be supplied for a conversion. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="sourceCRS" type="gml:CRSRefType">
+ <annotation>
+ <documentation>Association to the source CRS (coordinate reference system) of this coordinate operation. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="targetCRS" type="gml:CRSRefType">
+ <annotation>
+ <documentation>Association to the target CRS (coordinate reference system) of this coordinate operation. For constraints on multiplicity of "sourceCRS" and "targetCRS", see UML model of Coordinate Operation package in OGC Abstract Specification topic 2. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="coordinateOperationRef" type="gml:CoordinateOperationRefType"/>
+ <!-- =================================================== -->
+ <complexType name="CoordinateOperationRefType">
+ <annotation>
+ <documentation>Association to a coordinate operation, either referencing or containing the definition of that coordinate operation. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_CoordinateOperation"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="ConcatenatedOperation" type="gml:ConcatenatedOperationType" substitutionGroup="gml:_CoordinateOperation"/>
+ <!-- =================================================== -->
+ <complexType name="ConcatenatedOperationType">
+ <annotation>
+ <documentation>An ordered sequence of two or more single coordinate operations. The sequence of operations is constrained by the requirement that the source coordinate reference system of step (n+1) must be the same as the target coordinate reference system of step (n). The source coordinate reference system of the first step and the target coordinate reference system of the last step are the source and target coordinate reference system associated with the concatenated operation. Instead of a forward operation, an inverse operation may be used for one or more of the operation steps mentioned above, if the inverse operation is uniquely defined by the forward operation.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateOperationType">
+ <sequence>
+ <element ref="gml:usesSingleOperation" minOccurs="2" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Ordered sequence of associations to the two or more single operations used by this concatenated operation. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesSingleOperation" type="gml:SingleOperationRefType">
+ <annotation>
+ <documentation>Association to a single operation. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="concatenatedOperationRef" type="gml:ConcatenatedOperationRefType"/>
+ <!-- =================================================== -->
+ <complexType name="ConcatenatedOperationRefType">
+ <annotation>
+ <documentation>Association to a concatenated operation, either referencing or containing the definition of that concatenated operation. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:ConcatenatedOperation"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="_SingleOperation" type="gml:AbstractCoordinateOperationType" abstract="true" substitutionGroup="gml:_CoordinateOperation">
+ <annotation>
+ <documentation>A single (not concatenated) coordinate operation. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="singleOperationRef" type="gml:SingleOperationRefType"/>
+ <!-- =================================================== -->
+ <complexType name="SingleOperationRefType">
+ <annotation>
+ <documentation>Association to a single operation, either referencing or containing the definition of that single operation. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_SingleOperation"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="PassThroughOperation" type="gml:PassThroughOperationType" substitutionGroup="gml:_SingleOperation"/>
+ <!-- =================================================== -->
+ <complexType name="PassThroughOperationType">
+ <annotation>
+ <documentation>A pass-through operation specifies that a subset of a coordinate tuple is subject to a specific coordinate operation. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateOperationType">
+ <sequence>
+ <element ref="gml:modifiedCoordinate" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Ordered sequence of positive integers defining the positions in a coordinate tuple of the coordinates affected by this pass-through operation. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:usesOperation"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="modifiedCoordinate" type="positiveInteger">
+ <annotation>
+ <documentation>A positive integer defining a position in a coordinate tuple. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesOperation" type="gml:OperationRefType">
+ <annotation>
+ <documentation>Association to the operation applied to the specified ordinates. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="passThroughOperationRef" type="gml:PassThroughOperationRefType"/>
+ <!-- =================================================== -->
+ <complexType name="PassThroughOperationRefType">
+ <annotation>
+ <documentation>Association to a pass through operation, either referencing or containing the definition of that pass through operation. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:PassThroughOperation"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="_Operation" type="gml:AbstractCoordinateOperationType" abstract="true" substitutionGroup="gml:_SingleOperation">
+ <annotation>
+ <documentation>A parameterized mathematical operation on coordinates that transforms or converts coordinates to another coordinate reference system. This coordinate operation uses an operation method, usually with associated parameter values. However, operation methods and parameter values are directly associated with concrete subtypes, not with this abstract type.
+
+This abstract complexType shall not be directly used, extended, or restricted in a compliant Application Schema. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="operationRef" type="gml:OperationRefType"/>
+ <!-- =================================================== -->
+ <complexType name="OperationRefType">
+ <annotation>
+ <documentation>Association to an abstract operation, either referencing or containing the definition of that operation. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_Operation"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <!-- =================================================== -->
+ <element name="_GeneralConversion" type="gml:AbstractGeneralConversionType" abstract="true" substitutionGroup="gml:_Operation"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractGeneralConversionType" abstract="true">
+ <annotation>
+ <documentation>An abstract operation on coordinates that does not include any change of datum. The best-known example of a coordinate conversion is a map projection. The parameters describing coordinate conversions are defined rather than empirically derived. Note that some conversions have no parameters.
+
+This abstract complexType is expected to be extended for well-known operation methods with many Conversion instances, in Application Schemas that define operation-method-specialized element names and contents. This conversion uses an operation method, usually with associated parameter values. However, operation methods and parameter values are directly associated with concrete subtypes, not with this abstract type. All concrete types derived from this type shall extend this type to include a "usesMethod" element that references the "OperationMethod" element. Similarly, all concrete types derived from this type shall extend this type to include zero or more elements each named "uses...Value" that each use the type of an element substitutable for the "_generalParameterValue" element. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractCoordinateOperationType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:coordinateOperationName"/>
+ <element ref="gml:coordinateOperationID" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:remarks" minOccurs="0"/>
+ <element ref="gml:validArea" minOccurs="0"/>
+ <element ref="gml:scope" minOccurs="0"/>
+ <element ref="gml:_positionalAccuracy" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="generalConversionRef" type="gml:GeneralConversionRefType"/>
+ <!-- =================================================== -->
+ <complexType name="GeneralConversionRefType">
+ <annotation>
+ <documentation>Association to a general conversion, either referencing or containing the definition of that conversion. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_GeneralConversion"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="Conversion" type="gml:ConversionType" substitutionGroup="gml:_GeneralConversion"/>
+ <!-- =================================================== -->
+ <complexType name="ConversionType">
+ <annotation>
+ <documentation>A concrete operation on coordinates that does not include any change of Datum. The best-known example of a coordinate conversion is a map projection. The parameters describing coordinate conversions are defined rather than empirically derived. Note that some conversions have no parameters.
+
+This concrete complexType can be used with all operation methods, without using an Application Schema that defines operation-method-specialized element names and contents, especially for methods with only one Conversion instance. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeneralConversionType">
+ <sequence>
+ <element ref="gml:usesMethod"/>
+ <element ref="gml:usesValue" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of composition associations to the set of parameter values used by this conversion operation. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesMethod" type="gml:OperationMethodRefType">
+ <annotation>
+ <documentation>Association to the operation method used by this coordinate operation. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesValue" type="gml:ParameterValueType">
+ <annotation>
+ <documentation>Composition association to a parameter value used by this coordinate operation. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="conversionRef" type="gml:ConversionRefType"/>
+ <!-- =================================================== -->
+ <complexType name="ConversionRefType">
+ <annotation>
+ <documentation>Association to a concrete general-purpose conversion, either referencing or containing the definition of that conversion. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:Conversion"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="_GeneralTransformation" type="gml:AbstractGeneralTransformationType" abstract="true" substitutionGroup="gml:_Operation"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractGeneralTransformationType" abstract="true">
+ <annotation>
+ <documentation>An abstract operation on coordinates that usually includes a change of Datum. The parameters of a coordinate transformation are empirically derived from data containing the coordinates of a series of points in both coordinate reference systems. This computational process is usually "over-determined", allowing derivation of error (or accuracy) estimates for the transformation. Also, the stochastic nature of the parameters may result in multiple (different) versions of the same coordinate transformation.
+
+This abstract complexType is expected to be extended for well-known operation methods with many Transformation instances, in Application Schemas that define operation-method-specialized value element names and contents. This transformation uses an operation method with associated parameter values. However, operation methods and parameter values are directly associated with concrete subtypes, not with this abstract type. All concrete types derived from this type shall extend this type to include a "usesMethod" element that references one "OperationMethod" element. Similarly, all concrete types derived from this type shall extend this type to include one or more elements each named "uses...Value" that each use the type of an element substitutable for the "_generalParameterValue" element. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractCoordinateOperationType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:coordinateOperationName"/>
+ <element ref="gml:coordinateOperationID" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:remarks" minOccurs="0"/>
+ <element ref="gml:operationVersion"/>
+ <element ref="gml:validArea" minOccurs="0"/>
+ <element ref="gml:scope" minOccurs="0"/>
+ <element ref="gml:_positionalAccuracy" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:sourceCRS"/>
+ <element ref="gml:targetCRS"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="generalTransformationRef" type="gml:GeneralTransformationRefType"/>
+ <!-- =================================================== -->
+ <complexType name="GeneralTransformationRefType">
+ <annotation>
+ <documentation>Association to a general transformation, either referencing or containing the definition of that transformation. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_GeneralTransformation"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="Transformation" type="gml:TransformationType" substitutionGroup="gml:_GeneralTransformation"/>
+ <!-- =================================================== -->
+ <complexType name="TransformationType">
+ <annotation>
+ <documentation>A concrete operation on coordinates that usually includes a change of datum. The parameters of a coordinate transformation are empirically derived from data containing the coordinates of a series of points in both coordinate reference systems. This computational process is usually "over-determined", allowing derivation of error (or accuracy) estimates for the transformation. Also, the stochastic nature of the parameters may result in multiple (different) versions of the same coordinate transformation.
+
+This concrete complexType can be used for all operation methods, without using an Application Schema that defines operation-method-specialized element names and contents, especially for methods with only one Transformation instance. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeneralTransformationType">
+ <sequence>
+ <element ref="gml:usesMethod"/>
+ <element ref="gml:usesValue" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered set of composition associations to the set of parameter values used by this transformation operation. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="transformationRef" type="gml:TransformationRefType"/>
+ <!-- =================================================== -->
+ <complexType name="TransformationRefType">
+ <annotation>
+ <documentation>Association to a transformation, either referencing or containing the definition of that transformation. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:Transformation"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <!-- =================================================== -->
+ <element name="_generalParameterValue" type="gml:AbstractGeneralParameterValueType" abstract="true"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractGeneralParameterValueType" abstract="true">
+ <annotation>
+ <documentation>Abstract parameter value or group of parameter values.
+
+This abstract complexType is expected to be extended and restricted for well-known operation methods with many instances, in Application Schemas that define operation-method-specialized element names and contents. Specific parameter value elements are directly contained in concrete subtypes, not in this abstract type. All concrete types derived from this type shall extend this type to include one "...Value" element with an appropriate type, which should be one of the element types allowed in the ParameterValueType. In addition, all derived concrete types shall extend this type to include a "valueOfParameter" element that references one element substitutable for the "OperationParameter" element. </documentation>
+ </annotation>
+ <sequence/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="parameterValue" type="gml:ParameterValueType" substitutionGroup="gml:_generalParameterValue"/>
+ <!-- =================================================== -->
+ <complexType name="ParameterValueType">
+ <annotation>
+ <documentation>A parameter value, ordered sequence of values, or reference to a file of parameter values. This concrete complexType can be used for operation methods without using an Application Schema that defines operation-method-specialized element names and contents, especially for methods with only one instance. This complexType can be used, extended, or restricted for well-known operation methods, especially for methods with many instances. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeneralParameterValueType">
+ <sequence>
+ <choice>
+ <element ref="gml:value"/>
+ <element ref="gml:dmsAngleValue"/>
+ <element ref="gml:stringValue"/>
+ <element ref="gml:integerValue"/>
+ <element ref="gml:booleanValue"/>
+ <element ref="gml:valueList"/>
+ <element ref="gml:integerValueList"/>
+ <element ref="gml:valueFile"/>
+ </choice>
+ <element ref="gml:valueOfParameter"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="value" type="gml:MeasureType">
+ <annotation>
+ <documentation>Numeric value of an operation parameter, with its associated unit of measure. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="dmsAngleValue" type="gml:DMSAngleType">
+ <annotation>
+ <documentation>Value of an angle operation parameter, in either degree-minute-second format or single value format. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="stringValue" type="string">
+ <annotation>
+ <documentation>String value of an operation parameter. A string value does not have an associated unit of measure. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="integerValue" type="positiveInteger">
+ <annotation>
+ <documentation>Positive integer value of an operation parameter, usually used for a count. An integer value does not have an associated unit of measure. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="booleanValue" type="boolean">
+ <annotation>
+ <documentation>Boolean value of an operation parameter. A Boolean value does not have an associated unit of measure. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="valueList" type="gml:MeasureListType">
+ <annotation>
+ <documentation>Ordered sequence of two or more numeric values of an operation parameter list, where each value has the same associated unit of measure. An element of this type contains a space-separated sequence of double values. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="integerValueList" type="gml:integerList">
+ <annotation>
+ <documentation>Ordered sequence of two or more integer values of an operation parameter list, usually used for counts. These integer values do not have an associated unit of measure. An element of this type contains a space-separated sequence of integer values. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="valueFile" type="anyURI">
+ <annotation>
+ <documentation>Reference to a file or a part of a file containing one or more parameter values, each numeric value with its associated unit of measure. When referencing a part of a file, that file must contain multiple identified parts, such as an XML encoded document. Furthermore, the referenced file or part of a file can reference another part of the same or different files, as allowed in XML documents. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="valueOfParameter" type="gml:OperationParameterRefType">
+ <annotation>
+ <documentation>Association to the operation parameter that this is a value of. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <!-- =================================================== -->
+ <element name="parameterValueGroup" type="gml:ParameterValueGroupType" substitutionGroup="gml:_generalParameterValue"/>
+ <!-- =================================================== -->
+ <complexType name="ParameterValueGroupType">
+ <annotation>
+ <documentation>A group of related parameter values. The same group can be repeated more than once in a Conversion, Transformation, or higher level parameterValueGroup, if those instances contain different values of one or more parameterValues which suitably distinquish among those groups. This concrete complexType can be used for operation methods without using an Application Schema that defines operation-method-specialized element names and contents, especially for methods with only one instance. This complexType can be used, extended, or restricted for well-known operation methods, especially for methods with many instances. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeneralParameterValueType">
+ <sequence>
+ <element ref="gml:includesValue" minOccurs="2" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered set of composition associations to the parameter values and groups of values included in this group. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:valuesOfGroup"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="includesValue" type="gml:AbstractGeneralParameterValueType" substitutionGroup="gml:_generalParameterValue">
+ <annotation>
+ <documentation>A composition association to a parameter value or group of values included in this group. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="valuesOfGroup" type="gml:OperationParameterGroupRefType">
+ <annotation>
+ <documentation>Association to the operation parameter group for which this element provides parameter values. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <!-- =================================================== -->
+ <element name="OperationMethod" type="gml:OperationMethodType" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="OperationMethodBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for operation method objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:methodName"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="methodName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this operation method is identified. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="OperationMethodType">
+ <annotation>
+ <documentation>Definition of an algorithm used to perform a coordinate operation. Most operation methods use a number of operation parameters, although some coordinate conversions use none. Each coordinate operation using the method assigns values to these parameters. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:OperationMethodBaseType">
+ <sequence>
+ <element ref="gml:methodID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this operation method. The first methodID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this operation method, including source information.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:methodFormula"/>
+ <element ref="gml:sourceDimensions"/>
+ <element ref="gml:targetDimensions"/>
+ <element ref="gml:usesParameter" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of associations to the set of operation parameters and parameter groups used by this operation method. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="methodID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of an operation method. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="methodFormula" type="gml:CodeType">
+ <annotation>
+ <documentation>Formula(s) used by this operation method. The value may be a reference to a publication. Note that the operation method may not be analytic, in which case this element references or contains the procedure, not an analytic formula.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="sourceDimensions" type="positiveInteger">
+ <annotation>
+ <documentation>Number of dimensions in the source CRS of this operation method. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="targetDimensions" type="positiveInteger">
+ <annotation>
+ <documentation>Number of dimensions in the target CRS of this operation method. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesParameter" type="gml:AbstractGeneralOperationParameterRefType">
+ <annotation>
+ <documentation>Association to an operation parameter or parameter group used by this operation method. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="operationMethodRef" type="gml:OperationMethodRefType"/>
+ <!-- =================================================== -->
+ <complexType name="OperationMethodRefType">
+ <annotation>
+ <documentation>Association to a concrete general-purpose operation method, either referencing or containing the definition of that method. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:OperationMethod"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <!-- =================================================== -->
+ <element name="_GeneralOperationParameter" type="gml:AbstractGeneralOperationParameterType" abstract="true" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractGeneralOperationParameterType" abstract="true">
+ <annotation>
+ <documentation>Abstract definition of a parameter or group of parameters used by an operation method. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:minimumOccurs" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="minimumOccurs" type="nonNegativeInteger">
+ <annotation>
+ <documentation>The minimum number of times that values for this parameter group or parameter are required. If this attribute is omitted, the minimum number is one. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="abstractGeneralOperationParameterRef" type="gml:AbstractGeneralOperationParameterRefType"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractGeneralOperationParameterRefType">
+ <annotation>
+ <documentation>Association to an operation parameter or group, either referencing or containing the definition of that parameter or group. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_GeneralOperationParameter"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="OperationParameter" type="gml:OperationParameterType" substitutionGroup="gml:_GeneralOperationParameter"/>
+ <!-- =================================================== -->
+ <complexType name="OperationParameterBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for operation parameter objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractGeneralOperationParameterType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:parameterName"/>
+ <element ref="gml:minimumOccurs" minOccurs="0"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="parameterName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this operation parameter is identified. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="OperationParameterType">
+ <annotation>
+ <documentation>The definition of a parameter used by an operation method. Most parameter values are numeric, but other types of parameter values are possible. This complexType is expected to be used or extended for all operation methods, without defining operation-method-specialized element names. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:OperationParameterBaseType">
+ <sequence>
+ <element ref="gml:parameterID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this operation parameter. The first parameterID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this operation parameter, including source information. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="parameterID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of an operation parameter. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="operationParameterRef" type="gml:OperationParameterRefType"/>
+ <!-- =================================================== -->
+ <complexType name="OperationParameterRefType">
+ <annotation>
+ <documentation>Association to an operation parameter, either referencing or containing the definition of that parameter. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:OperationParameter"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="OperationParameterGroup" type="gml:OperationParameterGroupType" substitutionGroup="gml:_GeneralOperationParameter"/>
+ <!-- =================================================== -->
+ <complexType name="OperationParameterGroupBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for operation parameter group objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractGeneralOperationParameterType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:groupName"/>
+ <element ref="gml:minimumOccurs" minOccurs="0"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="groupName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this operation parameter group is identified. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="OperationParameterGroupType">
+ <annotation>
+ <documentation>The definition of a group of parameters used by an operation method. This complexType is expected to be used or extended for all applicable operation methods, without defining operation-method-specialized element names. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:OperationParameterGroupBaseType">
+ <sequence>
+ <element ref="gml:groupID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this operation parameter group. The first groupID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this operation parameter group, including source information. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:maximumOccurs" minOccurs="0"/>
+ <element ref="gml:includesParameter" minOccurs="2" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of associations to the set of operation parameters that are members of this group. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="groupID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of an operation parameter group. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="maximumOccurs" type="positiveInteger">
+ <annotation>
+ <documentation>The maximum number of times that values for this parameter group can be included. If this attribute is omitted, the maximum number is one. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="includesParameter" type="gml:AbstractGeneralOperationParameterRefType">
+ <annotation>
+ <documentation>Association to an operation parameter that is a member of a group. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="operationParameterGroupRef" type="gml:OperationParameterRefType"/>
+ <!-- =================================================== -->
+ <complexType name="OperationParameterGroupRefType">
+ <annotation>
+ <documentation>Association to an operation parameter, either referencing or containing the definition of that parameter. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:OperationParameterGroup"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/coordinateReferenceSystems.xsd b/petascope/xml/ogc/gml/3.1.1/base/coordinateReferenceSystems.xsd
new file mode 100644
index 0000000..252b06f
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/coordinateReferenceSystems.xsd
@@ -0,0 +1,425 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1" xml:lang="en">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:coordinateReferenceSystems:3.1.1"/>
+ <documentation>How to encode coordinate reference system definitions. Builds on referenceSystems.xsd to encode the data needed to define coordinate reference systems, including the specific subtypes of coordinate reference systems.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ This schema encodes the Coordinate Reference System (SC_) package of the extended UML Model for OGC Abstract Specification Topic 2: Spatial Referencing by Coordinates, with the exception of the abstract "SC_CRS" class. The "SC_CRS" class is encoded in referenceSystems.xsd, to eliminate the (circular) references from coordinateOperations.xsd to coordinateReferenceSystems.xsd. That UML model is adapted from ISO 19111 - Spatial referencing by coordinates, as described in Annex C of Topic 2.
+ Caution: The CRS package in GML 3.1 and GML 3.1.1 is preliminary, and is expected to undergo some modifications that are not backward compatible during the development of GML 3.2 (ISO 19136). The GML 3.2 package will implement the model described in the revised version of ISO 19111. </documentation>
+ </annotation>
+ <!-- ======================================================
+ includes and imports
+ ====================================================== -->
+ <include schemaLocation="coordinateSystems.xsd"/>
+ <include schemaLocation="datums.xsd"/>
+ <include schemaLocation="coordinateOperations.xsd"/>
+ <!-- ======================================================
+ elements and types
+ ====================================================== -->
+ <element name="_CoordinateReferenceSystem" type="gml:AbstractReferenceSystemType" abstract="true" substitutionGroup="gml:_CRS">
+ <annotation>
+ <documentation>A coordinate reference system consists of an ordered sequence of coordinate system axes that are related to the earth through a datum. A coordinate reference system is defined by one datum and by one coordinate system. Most coordinate reference system do not move relative to the earth, except for engineering coordinate reference systems defined on moving platforms such as cars, ships, aircraft, and spacecraft. For further information, see OGC Abstract Specification Topic 2.
+
+Coordinate reference systems are commonly divided into sub-types. The common classification criterion for sub-typing of coordinate reference systems is the way in which they deal with earth curvature. This has a direct effect on the portion of the earth's surface that can be covered by that type of CRS with an acceptable degree of error. The exception to the rule is the subtype "Temporal" which has been added by analogy. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="coordinateReferenceSystemRef" type="gml:CoordinateReferenceSystemRefType"/>
+ <!-- =================================================== -->
+ <complexType name="CoordinateReferenceSystemRefType">
+ <annotation>
+ <documentation>Association to a coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_CoordinateReferenceSystem"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="CompoundCRS" type="gml:CompoundCRSType" substitutionGroup="gml:_CRS"/>
+ <!-- =================================================== -->
+ <complexType name="CompoundCRSType">
+ <annotation>
+ <documentation>A coordinate reference system describing the position of points through two or more independent coordinate reference systems. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemType">
+ <sequence>
+ <element ref="gml:includesCRS" minOccurs="2" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Ordered sequence of associations to all the component coordinate reference systems included in this compound coordinate reference system. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="includesCRS" type="gml:CoordinateReferenceSystemRefType">
+ <annotation>
+ <documentation>An association to a component coordinate reference system included in this compound coordinate reference system. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="compoundCRSRef" type="gml:CompoundCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="CompoundCRSRefType">
+ <annotation>
+ <documentation>Association to a compound coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:CompoundCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="GeographicCRS" type="gml:GeographicCRSType" substitutionGroup="gml:_CoordinateReferenceSystem"/>
+ <!-- =================================================== -->
+ <complexType name="GeographicCRSType">
+ <annotation>
+ <documentation>A coordinate reference system based on an ellipsoidal approximation of the geoid; this provides an accurate representation of the geometry of geographic features for a large portion of the earth's surface.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemType">
+ <sequence>
+ <element ref="gml:usesEllipsoidalCS"/>
+ <element ref="gml:usesGeodeticDatum"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesEllipsoidalCS" type="gml:EllipsoidalCSRefType">
+ <annotation>
+ <documentation>Association to the ellipsoidal coordinate system used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesGeodeticDatum" type="gml:GeodeticDatumRefType">
+ <annotation>
+ <documentation>Association to the geodetic datum used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="geographicCRSRef" type="gml:GeographicCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="GeographicCRSRefType">
+ <annotation>
+ <documentation>Association to a geographic coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:GeographicCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="VerticalCRS" type="gml:VerticalCRSType" substitutionGroup="gml:_CoordinateReferenceSystem"/>
+ <!-- =================================================== -->
+ <complexType name="VerticalCRSType">
+ <annotation>
+ <documentation>A 1D coordinate reference system used for recording heights or depths. Vertical CRSs make use of the direction of gravity to define the concept of height or depth, but the relationship with gravity may not be straightforward. By implication, ellipsoidal heights (h) cannot be captured in a vertical coordinate reference system. Ellipsoidal heights cannot exist independently, but only as an inseparable part of a 3D coordinate tuple defined in a geographic 3D coordinate reference system. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemType">
+ <sequence>
+ <element ref="gml:usesVerticalCS"/>
+ <element ref="gml:usesVerticalDatum"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesVerticalCS" type="gml:VerticalCSRefType">
+ <annotation>
+ <documentation>Association to the vertical coordinate system used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesVerticalDatum" type="gml:VerticalDatumRefType">
+ <annotation>
+ <documentation>Association to the vertical datum used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="verticalCRSRef" type="gml:VerticalCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="VerticalCRSRefType">
+ <annotation>
+ <documentation>Association to a vertical coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:VerticalCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="GeocentricCRS" type="gml:GeocentricCRSType" substitutionGroup="gml:_CoordinateReferenceSystem"/>
+ <!-- =================================================== -->
+ <complexType name="GeocentricCRSType">
+ <annotation>
+ <documentation>A 3D coordinate reference system with the origin at the approximate centre of mass of the earth. A geocentric CRS deals with the earth's curvature by taking a 3D spatial view, which obviates the need to model the earth's curvature. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemType">
+ <sequence>
+ <choice>
+ <element ref="gml:usesCartesianCS"/>
+ <element ref="gml:usesSphericalCS"/>
+ </choice>
+ <element ref="gml:usesGeodeticDatum"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesCartesianCS" type="gml:CartesianCSRefType">
+ <annotation>
+ <documentation>Association to the Cartesian coordinate system used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesSphericalCS" type="gml:SphericalCSRefType">
+ <annotation>
+ <documentation>Association to the spherical coordinate system used by this CRS.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="geocentricCRSRef" type="gml:GeocentricCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="GeocentricCRSRefType">
+ <annotation>
+ <documentation>Association to a geocentric coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:GeocentricCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="_GeneralDerivedCRS" type="gml:AbstractGeneralDerivedCRSType" abstract="true" substitutionGroup="gml:_CoordinateReferenceSystem"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractGeneralDerivedCRSType" abstract="true">
+ <annotation>
+ <documentation>A coordinate reference system that is defined by its coordinate conversion from another coordinate reference system (not by a datum). This abstract complexType shall not be used, extended, or restricted, in an Application Schema, to define a concrete subtype with a meaning equivalent to a concrete subtype specified in this document. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemType">
+ <sequence>
+ <element ref="gml:baseCRS"/>
+ <element ref="gml:definedByConversion"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="baseCRS" type="gml:CoordinateReferenceSystemRefType">
+ <annotation>
+ <documentation>Association to the coordinate reference system used by this derived CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="definedByConversion" type="gml:GeneralConversionRefType">
+ <annotation>
+ <documentation>Association to the coordinate conversion used to define this derived CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="ProjectedCRS" type="gml:ProjectedCRSType" substitutionGroup="gml:_GeneralDerivedCRS"/>
+ <!-- =================================================== -->
+ <complexType name="ProjectedCRSType">
+ <annotation>
+ <documentation>A 2D coordinate reference system used to approximate the shape of the earth on a planar surface, but in such a way that the distortion that is inherent to the approximation is carefully controlled and known. Distortion correction is commonly applied to calculated bearings and distances to produce values that are a close match to actual field values. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeneralDerivedCRSType">
+ <sequence>
+ <element ref="gml:usesCartesianCS"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="projectedCRSRef" type="gml:ProjectedCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="ProjectedCRSRefType">
+ <annotation>
+ <documentation>Association to a projected coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:ProjectedCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="DerivedCRS" type="gml:DerivedCRSType" substitutionGroup="gml:_GeneralDerivedCRS"/>
+ <!-- =================================================== -->
+ <complexType name="DerivedCRSType">
+ <annotation>
+ <documentation>A coordinate reference system that is defined by its coordinate conversion from another coordinate reference system but is not a projected coordinate reference system. This category includes coordinate reference systems derived from a projected coordinate reference system. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeneralDerivedCRSType">
+ <sequence>
+ <element ref="gml:derivedCRSType"/>
+ <element ref="gml:usesCS"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="derivedCRSType" type="gml:DerivedCRSTypeType"/>
+ <!-- =================================================== -->
+ <complexType name="DerivedCRSTypeType">
+ <annotation>
+ <documentation>Type of a derived coordinate reference system. </documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:CodeType">
+ <attribute name="codeSpace" type="anyURI" use="required">
+ <annotation>
+ <documentation>Reference to a source of information specifying the values and meanings of all the allowed string values for this DerivedCRSTypeType. </documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesCS" type="gml:CoordinateSystemRefType">
+ <annotation>
+ <documentation>Association to the coordinate system used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="derivedCRSRef" type="gml:DerivedCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="DerivedCRSRefType">
+ <annotation>
+ <documentation>Association to a non-projected derived coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:DerivedCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="EngineeringCRS" type="gml:EngineeringCRSType" substitutionGroup="gml:_CoordinateReferenceSystem"/>
+ <!-- =================================================== -->
+ <complexType name="EngineeringCRSType">
+ <annotation>
+ <documentation>A contextually local coordinate reference system; which can be divided into two broad categories:
+- earth-fixed systems applied to engineering activities on or near the surface of the earth;
+- CRSs on moving platforms such as road vehicles, vessels, aircraft, or spacecraft.
+For further information, see OGC Abstract Specification Topic 2. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemType">
+ <sequence>
+ <element ref="gml:usesCS"/>
+ <element ref="gml:usesEngineeringDatum"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesEngineeringDatum" type="gml:EngineeringDatumRefType">
+ <annotation>
+ <documentation>Association to the engineering datum used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="engineeringCRSRef" type="gml:EngineeringCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="EngineeringCRSRefType">
+ <annotation>
+ <documentation>Association to an engineering coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:EngineeringCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="ImageCRS" type="gml:ImageCRSType" substitutionGroup="gml:_CoordinateReferenceSystem"/>
+ <!-- =================================================== -->
+ <complexType name="ImageCRSType">
+ <annotation>
+ <documentation>An engineering coordinate reference system applied to locations in images. Image coordinate reference systems are treated as a separate sub-type because a separate user community exists for images with its own terms of reference. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemType">
+ <sequence>
+ <choice>
+ <element ref="gml:usesCartesianCS"/>
+ <element ref="gml:usesObliqueCartesianCS"/>
+ </choice>
+ <element ref="gml:usesImageDatum"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesObliqueCartesianCS" type="gml:ObliqueCartesianCSRefType">
+ <annotation>
+ <documentation>Association to the oblique Cartesian coordinate system used by this CRS.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesImageDatum" type="gml:ImageDatumRefType">
+ <annotation>
+ <documentation>Association to the image datum used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="imageCRSRef" type="gml:ImageCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="ImageCRSRefType">
+ <annotation>
+ <documentation>Association to an image coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:ImageCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="TemporalCRS" type="gml:TemporalCRSType" substitutionGroup="gml:_CoordinateReferenceSystem"/>
+ <!-- =================================================== -->
+ <complexType name="TemporalCRSType">
+ <annotation>
+ <documentation>A 1D coordinate reference system used for the recording of time. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemType">
+ <sequence>
+ <element ref="gml:usesTemporalCS"/>
+ <element ref="gml:usesTemporalDatum"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesTemporalCS" type="gml:TemporalCSRefType">
+ <annotation>
+ <documentation>Association to the temporal coordinate system used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesTemporalDatum" type="gml:TemporalDatumRefType">
+ <annotation>
+ <documentation>Association to the temporal datum used by this CRS. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="temporalCRSRef" type="gml:TemporalCRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="TemporalCRSRefType">
+ <annotation>
+ <documentation>Association to a temporal coordinate reference system, either referencing or containing the definition of that reference system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:TemporalCRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/coordinateSystems.xsd b/petascope/xml/ogc/gml/3.1.1/base/coordinateSystems.xsd
new file mode 100644
index 0000000..9d39a8c
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/coordinateSystems.xsd
@@ -0,0 +1,404 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1" xml:lang="en">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:coordinateSystems:3.1.1"/>
+ <documentation>How to encode coordinate system definitions. Builds on referenceSystems.xsd to encode the data needed to define coordinate systems, including the specific subtypes of coordinate systems.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ This schema encodes the Coordinate System (CS_) package of the extended UML Model for OGC Abstract Specification Topic 2: Spatial Referencing by Coordinates. That UML model is adapted from ISO 19111 - Spatial referencing by coordinates, as described in Annex C of Topic 2.
+ Caution: The CRS package in GML 3.1 and GML 3.1.1 is preliminary, and is expected to undergo some modifications that are not backward compatible during the development of GML 3.2 (ISO 19136). The GML 3.2 package will implement the model described in the revised version of ISO 19111. </documentation>
+ </annotation>
+ <!-- ======================================================
+ includes and imports
+ ====================================================== -->
+ <include schemaLocation="referenceSystems.xsd"/>
+ <!-- ======================================================
+ elements and types
+ ====================================================== -->
+ <element name="CoordinateSystemAxis" type="gml:CoordinateSystemAxisType" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="CoordinateSystemAxisBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for coordinate system axis objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:name">
+ <annotation>
+ <documentation>The name by which this coordinate system axis is identified. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <complexType name="CoordinateSystemAxisType">
+ <annotation>
+ <documentation>Definition of a coordinate system axis. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:CoordinateSystemAxisBaseType">
+ <sequence>
+ <element ref="gml:axisID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this coordinate system axis. The first axisID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this coordinate system axis, including data source information. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:axisAbbrev"/>
+ <element ref="gml:axisDirection"/>
+ </sequence>
+ <attribute ref="gml:uom" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="axisID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of a coordinate system axis. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="axisAbbrev" type="gml:CodeType">
+ <annotation>
+ <documentation>The abbreviation used for this coordinate system axis. This abbreviation can be used to identify the ordinates in a coordinate tuple. Examples are X and Y. The codeSpace attribute can reference a source of more information on a set of standardized abbreviations, or on this abbreviation. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="axisDirection" type="gml:CodeType">
+ <annotation>
+ <documentation>Direction of this coordinate system axis (or in the case of Cartesian projected coordinates, the direction of this coordinate system axis at the origin). Examples: north or south, east or west, up or down. Within any set of coordinate system axes, only one of each pair of terms can be used. For earth-fixed CRSs, this direction is often approximate and intended to provide a human interpretable meaning to the axis. When a geodetic datum is used, the precise directions of the axes may therefore vary slightly from this approximate direction. Note that an EngineeringCRS can include specific descriptions of the directions of its coordinate system axes. For example, the path of a linear CRS axis can be referenced in another document, such as referencing a GML feature that references or includes a curve geometry. The codeSpace attribute can reference a source of more information on a set of standardized directions, or on this direction. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <attribute name="uom" type="anyURI">
+ <annotation>
+ <documentation>Identifier of the unit of measure used for this coordinate system axis. The value of this coordinate in a coordinate tuple shall be recorded using this unit of measure, whenever those coordinates use a coordinate reference system that uses a coordinate system that uses this axis.</documentation>
+ </annotation>
+ </attribute>
+ <!-- =================================================== -->
+ <element name="coordinateSystemAxisRef" type="gml:CoordinateSystemAxisRefType"/>
+ <!-- =================================================== -->
+ <complexType name="CoordinateSystemAxisRefType">
+ <annotation>
+ <documentation>Association to a coordinate system axis, either referencing or containing the definition of that axis. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:CoordinateSystemAxis"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <!-- =================================================== -->
+ <element name="_CoordinateSystem" type="gml:AbstractCoordinateSystemType" abstract="true" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractCoordinateSystemBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for coordinate system objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:csName"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="csName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this coordinate system is identified. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="AbstractCoordinateSystemType" abstract="true">
+ <annotation>
+ <documentation>A coordinate system (CS) is the set of coordinate system axes that spans a given coordinate space. A CS is derived from a set of (mathematical) rules for specifying how coordinates in a given space are to be assigned to points. The coordinate values in a coordinate tuple shall be recorded in the order in which the coordinate system axes associations are recorded, whenever those coordinates use a coordinate reference system that uses this coordinate system. This abstract complexType shall not be used, extended, or restricted, in an Application Schema, to define a concrete subtype with a meaning equivalent to a concrete subtype specified in this document. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemBaseType">
+ <sequence>
+ <element ref="gml:csID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this coordinate system. The first csID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this coordinate system, including data source information. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:usesAxis" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Ordered sequence of associations to the coordinate system axes included in this coordinate system. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="csID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of a coordinate system. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesAxis" type="gml:CoordinateSystemAxisRefType">
+ <annotation>
+ <documentation>Association to a coordinate system axis. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="coordinateSystemRef" type="gml:CoordinateSystemRefType"/>
+ <!-- =================================================== -->
+ <complexType name="CoordinateSystemRefType">
+ <annotation>
+ <documentation>Association to a coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_CoordinateSystem"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="EllipsoidalCS" type="gml:EllipsoidalCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="EllipsoidalCSType">
+ <annotation>
+ <documentation>A two- or three-dimensional coordinate system in which position is specified by geodetic latitude, geodetic longitude, and (in the three-dimensional case) ellipsoidal height. An EllipsoidalCS shall have two or three usesAxis associations. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="ellipsoidalCSRef" type="gml:EllipsoidalCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="EllipsoidalCSRefType">
+ <annotation>
+ <documentation>Association to an ellipsoidal coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:EllipsoidalCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="CartesianCS" type="gml:CartesianCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="CartesianCSType">
+ <annotation>
+ <documentation>A 1-, 2-, or 3-dimensional coordinate system. Gives the position of points relative to orthogonal straight axes in the 2- and 3-dimensional cases. In the 1-dimensional case, it contains a single straight coordinate axis. In the multi-dimensional case, all axes shall have the same length unit of measure. A CartesianCS shall have one, two, or three usesAxis associations. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="cartesianCSRef" type="gml:CartesianCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="CartesianCSRefType">
+ <annotation>
+ <documentation>Association to a Cartesian coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:CartesianCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="VerticalCS" type="gml:VerticalCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="VerticalCSType">
+ <annotation>
+ <documentation>A one-dimensional coordinate system used to record the heights (or depths) of points. Such a coordinate system is usually dependent on the Earth's gravity field, perhaps loosely as when atmospheric pressure is the basis for the vertical coordinate system axis. A VerticalCS shall have one usesAxis association. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="verticalCSRef" type="gml:VerticalCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="VerticalCSRefType">
+ <annotation>
+ <documentation>Association to a vertical coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:VerticalCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="TemporalCS" type="gml:TemporalCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="TemporalCSType">
+ <annotation>
+ <documentation>A one-dimensional coordinate system containing a single time axis, used to describe the temporal position of a point in the specified time units from a specified time origin. A TemporalCS shall have one usesAxis association. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="temporalCSRef" type="gml:TemporalCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="TemporalCSRefType">
+ <annotation>
+ <documentation>Association to a temporal coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:TemporalCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="LinearCS" type="gml:LinearCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="LinearCSType">
+ <annotation>
+ <documentation>A one-dimensional coordinate system that consists of the points that lie on the single axis described. The associated ordinate is the distance from the specified origin to the point along the axis. Example: usage of the line feature representing a road to describe points on or along that road. A LinearCS shall have one usesAxis association. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="linearCSRef" type="gml:LinearCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="LinearCSRefType">
+ <annotation>
+ <documentation>Association to a linear coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:LinearCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="UserDefinedCS" type="gml:UserDefinedCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="UserDefinedCSType">
+ <annotation>
+ <documentation>A two- or three-dimensional coordinate system that consists of any combination of coordinate axes not covered by any other coordinate system type. An example is a multilinear coordinate system which contains one coordinate axis that may have any 1-D shape which has no intersections with itself. This non-straight axis is supplemented by one or two straight axes to complete a 2 or 3 dimensional coordinate system. The non-straight axis is typically incrementally straight or curved. A UserDefinedCS shall have two or three usesAxis associations. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="userDefinedCSRef" type="gml:UserDefinedCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="UserDefinedCSRefType">
+ <annotation>
+ <documentation>Association to a user-defined coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:UserDefinedCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="SphericalCS" type="gml:SphericalCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="SphericalCSType">
+ <annotation>
+ <documentation>A three-dimensional coordinate system with one distance measured from the origin and two angular coordinates. Not to be confused with an ellipsoidal coordinate system based on an ellipsoid "degenerated" into a sphere. A SphericalCS shall have three usesAxis associations. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="sphericalCSRef" type="gml:SphericalCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="SphericalCSRefType">
+ <annotation>
+ <documentation>Association to a spherical coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:SphericalCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="PolarCS" type="gml:PolarCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="PolarCSType">
+ <annotation>
+ <documentation>A two-dimensional coordinate system in which position is specified by the distance from the origin and the angle between the line from the origin to a point and a reference direction. A PolarCS shall have two usesAxis associations. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="polarCSRef" type="gml:PolarCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="PolarCSRefType">
+ <annotation>
+ <documentation>Association to a polar coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:PolarCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="CylindricalCS" type="gml:CylindricalCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="CylindricalCSType">
+ <annotation>
+ <documentation>A three-dimensional coordinate system consisting of a polar coordinate system extended by a straight coordinate axis perpendicular to the plane spanned by the polar coordinate system. A CylindricalCS shall have three usesAxis associations. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="cylindricalCSRef" type="gml:CylindricalCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="CylindricalCSRefType">
+ <annotation>
+ <documentation>Association to a cylindrical coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:CylindricalCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="ObliqueCartesianCS" type="gml:ObliqueCartesianCSType" substitutionGroup="gml:_CoordinateSystem"/>
+ <!-- =================================================== -->
+ <complexType name="ObliqueCartesianCSType">
+ <annotation>
+ <documentation>A two- or three-dimensional coordinate system with straight axes that are not necessarily orthogonal. An ObliqueCartesianCS shall have two or three usesAxis associations. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoordinateSystemType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="obliqueCartesianCSRef" type="gml:ObliqueCartesianCSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="ObliqueCartesianCSRefType">
+ <annotation>
+ <documentation>Association to an oblique-Cartesian coordinate system, either referencing or containing the definition of that coordinate system. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:ObliqueCartesianCS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/coverage.xsd b/petascope/xml/ogc/gml/3.1.1/base/coverage.xsd
new file mode 100644
index 0000000..8f4efb2
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/coverage.xsd
@@ -0,0 +1,448 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:coverage:3.1.1">coverage.xsd</appinfo>
+ <documentation xml:lang="en">GML Coverage schema.
+ Copyright (c) 2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <include schemaLocation="feature.xsd"/>
+ <include schemaLocation="valueObjects.xsd"/>
+ <include schemaLocation="grids.xsd"/>
+ <include schemaLocation="geometryAggregates.xsd"/>
+ <!-- ==============================================================
+ global types and elements
+ ============================================================== -->
+ <!-- ================= Abstract coverage definition ================== -->
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="_Coverage" type="gml:AbstractCoverageType" abstract="true" substitutionGroup="gml:_Feature"/>
+ <!-- =========================================================== -->
+ <complexType name="AbstractCoverageType" abstract="true">
+ <annotation>
+ <documentation>Abstract element which acts as the head of a substitution group for coverages. Note that a coverage is a GML feature.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractFeatureType">
+ <sequence>
+ <element ref="gml:domainSet"/>
+ <element ref="gml:rangeSet"/>
+ </sequence>
+ <attribute name="dimension" type="positiveInteger" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="_ContinuousCoverage" type="gml:AbstractContinuousCoverageType" abstract="true" substitutionGroup="gml:_Coverage"/>
+ <!-- =========================================================== -->
+ <complexType name="AbstractContinuousCoverageType" abstract="true">
+ <annotation>
+ <documentation>A continuous coverage as defined in ISO 19123 is a coverage that can return different values for the same feature attribute at different direct positions within a single spatiotemporal object in its spatiotemporal domain</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoverageType">
+ <sequence>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="_DiscreteCoverage" type="gml:AbstractDiscreteCoverageType" abstract="true" substitutionGroup="gml:_Coverage"/>
+ <!-- =========================================================== -->
+ <complexType name="AbstractDiscreteCoverageType" abstract="true">
+ <annotation>
+ <documentation>A discrete coverage consists of a domain set, range set and optionally a coverage function. The domain set consists of either geometry or temporal objects, finite in number. The range set is comprised of a finite number of attribute values each of which is associated to every direct position within any single spatiotemporal object in the domain. In other words, the range values are constant on each spatiotemporal object in the domain. This coverage function maps each element from the coverage domain to an element in its range. This definition conforms to ISO 19123.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCoverageType">
+ <sequence>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="domainSet" type="gml:DomainSetType"/>
+ <!-- =========================================================== -->
+ <complexType name="DomainSetType">
+ <annotation>
+ <documentation>The spatiotemporal domain of a coverage.
+ Typically
+ * a geometry collection,
+ * an implicit geometry (e.g. a grid),
+ * an explicit or implicit collection of time instances or periods, or
+
+N.B. Temporal geometric complexes and temporal grids are not yet implemented in GML.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <choice>
+ <element ref="gml:_Geometry"/>
+ <element ref="gml:_TimeObject"/>
+ </choice>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="rangeSet" type="gml:RangeSetType"/>
+ <!-- =========================================================== -->
+ <complexType name="RangeSetType">
+ <choice>
+ <element ref="gml:ValueArray" maxOccurs="unbounded">
+ <annotation>
+ <documentation>each member _Value holds a tuple or "row" from the equivalent table</documentation>
+ </annotation>
+ </element>
+ <group ref="gml:ScalarValueList" maxOccurs="unbounded">
+ <annotation>
+ <documentation>each list holds the complete set of one scalar component from the values - i.e. a "column" from the equivalent table</documentation>
+ </annotation>
+ </group>
+ <element ref="gml:DataBlock">
+ <annotation>
+ <documentation>Its tuple list holds the values as space-separated tuples each of which contains comma-separated components, and the tuple structure is specified using the rangeParameters property.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:File">
+ <annotation>
+ <documentation>a reference to an external source for the data, together with a description of how that external source is structured</documentation>
+ </annotation>
+ </element>
+ </choice>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="coverageFunction" type="gml:CoverageFunctionType"/>
+ <!-- =========================================================== -->
+ <complexType name="CoverageFunctionType">
+ <annotation>
+ <documentation>The function or rule which defines the map from members of the domainSet to the range.
+ More functions will be added to this list</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:MappingRule"/>
+ <element ref="gml:GridFunction"/>
+ </choice>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- ============== Components for encoding the rangeSet ============= -->
+ <!-- =========================================================== -->
+ <element name="DataBlock" type="gml:DataBlockType"/>
+ <!-- =========================================================== -->
+ <complexType name="DataBlockType">
+ <sequence>
+ <element ref="gml:rangeParameters"/>
+ <choice>
+ <element ref="gml:tupleList"/>
+ <element ref="gml:doubleOrNullTupleList"/>
+ </choice>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="tupleList" type="gml:CoordinatesType"/>
+ <!-- =========================================================== -->
+ <element name="doubleOrNullTupleList" type="gml:doubleOrNullList"/>
+ <!-- =========================================================== -->
+ <element name="File" type="gml:FileType"/>
+ <!-- =========================================================== -->
+ <complexType name="FileType">
+ <sequence>
+ <element ref="gml:rangeParameters"/>
+ <element name="fileName" type="anyURI"/>
+ <element name="fileStructure" type="gml:FileValueModelType"/>
+ <element name="mimeType" type="anyURI" minOccurs="0"/>
+ <element name="compression" type="anyURI" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <simpleType name="FileValueModelType">
+ <annotation>
+ <documentation>List of codes that identifies the file structure model for records stored in files.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="Record Interleaved"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="rangeParameters" type="gml:RangeParametersType"/>
+ <!-- =========================================================== -->
+ <complexType name="RangeParametersType">
+ <annotation>
+ <documentation>Metadata about the rangeSet. Definition of record structure.
+ This is required if the rangeSet is encoded in a DataBlock.
+ We use a gml:_Value with empty values as a map of the composite value structure.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <group ref="gml:ValueObject"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- ============= Components for coverageFunctions ================ -->
+ <!-- =========================================================== -->
+ <element name="MappingRule" type="gml:StringOrRefType">
+ <annotation>
+ <documentation>Description of a rule for associating members from the domainSet with members of the rangeSet.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="GridFunction" type="gml:GridFunctionType"/>
+ <!-- =========================================================== -->
+ <complexType name="GridFunctionType">
+ <annotation>
+ <documentation>Defines how values in the domain are mapped to the range set. The start point and the sequencing rule are specified here.</documentation>
+ </annotation>
+ <sequence>
+ <element name="sequenceRule" type="gml:SequenceRuleType" minOccurs="0">
+ <annotation>
+ <documentation>If absent, the implied value is "Linear".</documentation>
+ </annotation>
+ </element>
+ <element name="startPoint" type="gml:integerList" minOccurs="0">
+ <annotation>
+ <documentation>Index position of the first grid post, which must lie somwhere in the GridEnvelope. If absent, the startPoint is equal to the value of gridEnvelope::low from the grid definition.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="IndexMap" type="gml:IndexMapType" substitutionGroup="gml:GridFunction"/>
+ <!-- =========================================================== -->
+ <complexType name="IndexMapType">
+ <annotation>
+ <documentation>Exends GridFunctionType with a lookUpTable. This contains a list of indexes of members within the rangeSet corresponding with the members of the domainSet. The domainSet is traversed in list order if it is enumerated explicitly, or in the order specified by a SequenceRule if the domain is an implicit set. The length of the lookUpTable corresponds with the length of the subset of the domainSet for which the coverage is defined.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:GridFunctionType">
+ <sequence>
+ <element name="lookUpTable" type="gml:integerList"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="SequenceRuleType">
+ <simpleContent>
+ <extension base="gml:SequenceRuleNames">
+ <attribute name="order" type="gml:IncrementOrder" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <simpleType name="SequenceRuleNames">
+ <annotation>
+ <documentation>List of codes (adopted from ISO 19123 Annex C) that identifies the rule for traversing a grid to correspond with the sequence of members of the rangeSet.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="Linear"/>
+ <enumeration value="Boustrophedonic"/>
+ <enumeration value="Cantor-diagonal"/>
+ <enumeration value="Spiral"/>
+ <enumeration value="Morton"/>
+ <enumeration value="Hilbert"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="IncrementOrder">
+ <annotation>
+ <documentation>The enumeration value here indicates the incrementation order to be used on the first 2 axes, i.e. "+x-y" means that the points on the first axis are to be traversed from lowest to highest and the points on the second axis are to be traversed from highest to lowest. The points on all other axes (if any) beyond the first 2 are assumed to increment from lowest to highest.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="+x+y"/>
+ <enumeration value="+y+x"/>
+ <enumeration value="+x-y"/>
+ <enumeration value="-x-y"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <!-- == Specialised Coverage types - typed by the structure of the domain set == -->
+ <!-- =========================================================== -->
+ <element name="MultiPointCoverage" type="gml:MultiPointCoverageType" substitutionGroup="gml:_DiscreteCoverage"/>
+ <!-- =========================================================== -->
+ <complexType name="MultiPointCoverageType">
+ <annotation>
+ <documentation>A discrete coverage type whose domain is defined by a collection of point</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractDiscreteCoverageType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:boundedBy" minOccurs="0"/>
+ <element ref="gml:multiPointDomain"/>
+ <element ref="gml:rangeSet"/>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiPointDomain" type="gml:MultiPointDomainType" substitutionGroup="gml:domainSet"/>
+ <!-- =========================================================== -->
+ <complexType name="MultiPointDomainType">
+ <complexContent>
+ <restriction base="gml:DomainSetType">
+ <sequence minOccurs="0">
+ <element ref="gml:MultiPoint"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="MultiCurveCoverage" type="gml:MultiCurveCoverageType" substitutionGroup="gml:_DiscreteCoverage"/>
+ <!-- =========================================================== -->
+ <complexType name="MultiCurveCoverageType">
+ <annotation>
+ <documentation>A discrete coverage type whose domain is defined by a collection of curves.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractDiscreteCoverageType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:boundedBy" minOccurs="0"/>
+ <element ref="gml:multiCurveDomain"/>
+ <element ref="gml:rangeSet"/>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiCurveDomain" type="gml:MultiCurveDomainType" substitutionGroup="gml:domainSet"/>
+ <!-- =========================================================== -->
+ <complexType name="MultiCurveDomainType">
+ <complexContent>
+ <restriction base="gml:DomainSetType">
+ <sequence minOccurs="0">
+ <element ref="gml:MultiCurve"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="MultiSurfaceCoverage" type="gml:MultiSurfaceCoverageType" substitutionGroup="gml:_DiscreteCoverage"/>
+ <!-- =========================================================== -->
+ <complexType name="MultiSurfaceCoverageType">
+ <annotation>
+ <documentation>A discrete coverage type whose domain is defined by a collection of surface patches (includes polygons, triangles, rectangles, etc).</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractDiscreteCoverageType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:boundedBy" minOccurs="0"/>
+ <element ref="gml:multiSurfaceDomain"/>
+ <element ref="gml:rangeSet"/>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiSurfaceDomain" type="gml:MultiSurfaceDomainType" substitutionGroup="gml:domainSet"/>
+ <!-- =========================================================== -->
+ <complexType name="MultiSurfaceDomainType">
+ <complexContent>
+ <restriction base="gml:DomainSetType">
+ <sequence minOccurs="0">
+ <element ref="gml:MultiSurface"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="MultiSolidCoverage" type="gml:MultiSolidCoverageType" substitutionGroup="gml:_DiscreteCoverage"/>
+ <!-- =========================================================== -->
+ <complexType name="MultiSolidCoverageType">
+ <annotation>
+ <documentation>A discrete coverage type whose domain is defined by a collection of Solids.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractDiscreteCoverageType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:boundedBy" minOccurs="0"/>
+ <element ref="gml:multiSolidDomain"/>
+ <element ref="gml:rangeSet"/>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiSolidDomain" type="gml:MultiSolidDomainType" substitutionGroup="gml:domainSet"/>
+ <!-- =========================================================== -->
+ <complexType name="MultiSolidDomainType">
+ <complexContent>
+ <restriction base="gml:DomainSetType">
+ <sequence minOccurs="0">
+ <element ref="gml:MultiSolid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="GridCoverage" type="gml:GridCoverageType" substitutionGroup="gml:_DiscreteCoverage"/>
+ <!-- =========================================================== -->
+ <complexType name="GridCoverageType">
+ <complexContent>
+ <restriction base="gml:AbstractDiscreteCoverageType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:boundedBy" minOccurs="0"/>
+ <element ref="gml:gridDomain"/>
+ <element ref="gml:rangeSet"/>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="gridDomain" type="gml:GridDomainType" substitutionGroup="gml:domainSet"/>
+ <!-- =========================================================== -->
+ <complexType name="GridDomainType">
+ <complexContent>
+ <restriction base="gml:DomainSetType">
+ <sequence minOccurs="0">
+ <element ref="gml:Grid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="RectifiedGridCoverage" type="gml:RectifiedGridCoverageType" substitutionGroup="gml:_DiscreteCoverage"/>
+ <!-- =========================================================== -->
+ <complexType name="RectifiedGridCoverageType">
+ <complexContent>
+ <restriction base="gml:AbstractDiscreteCoverageType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:boundedBy" minOccurs="0"/>
+ <element ref="gml:rectifiedGridDomain"/>
+ <element ref="gml:rangeSet"/>
+ <element ref="gml:coverageFunction" minOccurs="0"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="rectifiedGridDomain" type="gml:RectifiedGridDomainType" substitutionGroup="gml:domainSet"/>
+ <!-- =========================================================== -->
+ <complexType name="RectifiedGridDomainType">
+ <complexContent>
+ <restriction base="gml:DomainSetType">
+ <sequence minOccurs="0">
+ <element ref="gml:RectifiedGrid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/dataQuality.xsd b/petascope/xml/ogc/gml/3.1.1/base/dataQuality.xsd
new file mode 100644
index 0000000..0e66a9a
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/dataQuality.xsd
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1" xml:lang="en">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:dataQuality:3.1.1"/>
+ <documentation>How to encode positional data quality information. Builds on units.xsd to encode the data needed to describe the positional accuracy of coordinate operations.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ This schema encodes the Data Quality (DQ) package of the extended UML Model for OGC Abstract Specification Topic 2: Spatial Referencing by Coordinates. That UML model is adapted from ISO 19111 - Spatial referencing by coordinates, as described in Annex C of Topic 2.
+ Caution: The CRS package in GML 3.1 and GML 3.1.1 is preliminary, and is expected to undergo some modifications that are not backward compatible during the development of GML 3.2 (ISO 19136). The GML 3.2 package will implement the model described in the revised version of ISO 19111. </documentation>
+ </annotation>
+ <!-- ======================================================
+ includes and imports
+ ====================================================== -->
+ <include schemaLocation="units.xsd"/>
+ <!-- ======================================================
+ elements and types
+ ====================================================== -->
+ <element name="_positionalAccuracy" type="gml:AbstractPositionalAccuracyType" abstract="true"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractPositionalAccuracyType" abstract="true">
+ <annotation>
+ <documentation>Position error estimate (or accuracy) data. </documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:measureDescription" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="measureDescription" type="gml:CodeType">
+ <annotation>
+ <documentation>A description of the position accuracy parameter(s) provided. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="absoluteExternalPositionalAccuracy" type="gml:AbsoluteExternalPositionalAccuracyType" substitutionGroup="gml:_positionalAccuracy"/>
+ <!-- =================================================== -->
+ <complexType name="AbsoluteExternalPositionalAccuracyType">
+ <annotation>
+ <documentation>Closeness of reported coordinate values to values accepted as or being true. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractPositionalAccuracyType">
+ <sequence>
+ <element ref="gml:result"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="relativeInternalPositionalAccuracy" type="gml:RelativeInternalPositionalAccuracyType" substitutionGroup="gml:_positionalAccuracy"/>
+ <!-- =================================================== -->
+ <complexType name="RelativeInternalPositionalAccuracyType">
+ <annotation>
+ <documentation>Closeness of the relative positions of two or more positions to their respective relative positions accepted as or being true. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractPositionalAccuracyType">
+ <sequence>
+ <element ref="gml:result"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="result" type="gml:MeasureType">
+ <annotation>
+ <documentation>A quantitative result defined by the evaluation procedure used, and identified by the measureDescription. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="covarianceMatrix" type="gml:CovarianceMatrixType" substitutionGroup="gml:_positionalAccuracy"/>
+ <!-- =================================================== -->
+ <complexType name="CovarianceMatrixType">
+ <annotation>
+ <documentation>Error estimate covariance matrix. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractPositionalAccuracyType">
+ <sequence>
+ <element ref="gml:unitOfMeasure" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Ordered sequence of units of measure, corresponding to the row and column index numbers of the covariance matrix, starting with row and column 1 and ending with row/column N. Each unit of measure is for the ordinate reflected in the relevant row and column of the covariance matrix. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:includesElement" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered set of elements in this covariance matrix. Because the covariance matrix is symmetrical, only the elements in the upper or lower diagonal part (including the main diagonal) of the matrix need to be specified. Any zero valued covariance elements can be omitted. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="includesElement" type="gml:CovarianceElementType"/>
+ <!-- =================================================== -->
+ <complexType name="CovarianceElementType">
+ <annotation>
+ <documentation>An element of a covariance matrix.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:rowIndex"/>
+ <element ref="gml:columnIndex"/>
+ <element ref="gml:covariance"/>
+ </sequence>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="rowIndex" type="positiveInteger">
+ <annotation>
+ <documentation>Row number of this covariance element value. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="columnIndex" type="positiveInteger">
+ <annotation>
+ <documentation>Column number of this covariance element value. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="covariance" type="double">
+ <annotation>
+ <documentation>Value of covariance matrix element. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/datums.xsd b/petascope/xml/ogc/gml/3.1.1/base/datums.xsd
new file mode 100644
index 0000000..3098bf8
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/datums.xsd
@@ -0,0 +1,480 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1" xml:lang="en">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:datums:3.1.1"/>
+ <documentation>How to encode datum definitions. Builds on referenceSystems.xsd to encode the data needed to define datums, including the specific subtypes of datums.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ This schema encodes the Datum (CD_) package of the extended UML Model for OGC Abstract Specification Topic 2: Spatial Referencing by Coordinates. That UML model is adapted from ISO 19111 - Spatial referencing by coordinates, as described in Annex C of Topic 2.
+ Caution: The CRS package in GML 3.1 and GML 3.1.1 is preliminary, and is expected to undergo some modifications that are not backward compatible during the development of GML 3.2 (ISO 19136). The GML 3.2 package will implement the model described in the revised version of ISO 19111. </documentation>
+ </annotation>
+ <!-- ======================================================
+ includes and imports
+ ====================================================== -->
+ <include schemaLocation="referenceSystems.xsd"/>
+ <!-- ======================================================
+ elements and types
+ ====================================================== -->
+ <element name="_Datum" type="gml:AbstractDatumType" abstract="true" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractDatumBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for datum objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:datumName"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="datumName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this datum is identified. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="AbstractDatumType" abstract="true">
+ <annotation>
+ <documentation>A datum specifies the relationship of a coordinate system to the earth, thus creating a coordinate reference system. A datum uses a parameter or set of parameters that determine the location of the origin of the coordinate reference system. Each datum subtype can be associated with only specific types of coordinate systems. This abstract complexType shall not be used, extended, or restricted, in an Application Schema, to define a concrete subtype with a meaning equivalent to a concrete subtype specified in this document. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractDatumBaseType">
+ <sequence>
+ <element ref="gml:datumID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this datum. The first datumID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on this reference system, including source information. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:anchorPoint" minOccurs="0"/>
+ <element ref="gml:realizationEpoch" minOccurs="0"/>
+ <element ref="gml:validArea" minOccurs="0"/>
+ <element ref="gml:scope" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="datumID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of a datum. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="anchorPoint" type="gml:CodeType">
+ <annotation>
+ <documentation>Description, possibly including coordinates, of the point or points used to anchor the datum to the Earth. Also known as the "origin", especially for engineering and image datums. The codeSpace attribute can be used to reference a source of more detailed on this point or surface, or on a set of such descriptions.
+- For a geodetic datum, this point is also known as the fundamental point, which is traditionally the point where the relationship between geoid and ellipsoid is defined. In some cases, the "fundamental point" may consist of a number of points. In those cases, the parameters defining the geoid/ellipsoid relationship have been averaged for these points, and the averages adopted as the datum definition.
+- For an engineering datum, the anchor point may be a physical point, or it may be a point with defined coordinates in another CRS. When appropriate, the coordinates of this anchor point can be referenced in another document, such as referencing a GML feature that references or includes a point position.
+- For an image datum, the anchor point is usually either the centre of the image or the corner of the image.
+- For a temporal datum, this attribute is not defined. Instead of the anchor point, a temporal datum carries a separate time origin of type DateTime. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="realizationEpoch" type="date">
+ <annotation>
+ <documentation>The time after which this datum definition is valid. This time may be precise (e.g. 1997.0 for IRTF97) or merely a year (e.g. 1983 for NAD83). In the latter case, the epoch usually refers to the year in which a major recalculation of the geodetic control network, underlying the datum, was executed or initiated. An old datum can remain valid after a new datum is defined. Alternatively, a datum may be superseded by a later datum, in which case the realization epoch for the new datum defines the upper limit for the validity of the superseded datum. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="datumRef" type="gml:DatumRefType"/>
+ <!-- =================================================== -->
+ <complexType name="DatumRefType">
+ <annotation>
+ <documentation>Association to a datum, either referencing or containing the definition of that datum. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_Datum"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="EngineeringDatum" type="gml:EngineeringDatumType" substitutionGroup="gml:_Datum"/>
+ <!-- =================================================== -->
+ <complexType name="EngineeringDatumType">
+ <annotation>
+ <documentation>An engineering datum defines the origin of an engineering coordinate reference system, and is used in a region around that origin. This origin can be fixed with respect to the earth (such as a defined point at a construction site), or be a defined point on a moving vehicle (such as on a ship or satellite). </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractDatumType"/>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="engineeringDatumRef" type="gml:EngineeringDatumRefType"/>
+ <!-- =================================================== -->
+ <complexType name="EngineeringDatumRefType">
+ <annotation>
+ <documentation>Association to an engineering datum, either referencing or containing the definition of that datum. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:EngineeringDatum"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="ImageDatum" type="gml:ImageDatumType" substitutionGroup="gml:_Datum"/>
+ <!-- =================================================== -->
+ <complexType name="ImageDatumType">
+ <annotation>
+ <documentation>An image datum defines the origin of an image coordinate reference system, and is used in a local context only. For more information, see OGC Abstract Specification Topic 2. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractDatumType">
+ <sequence>
+ <element ref="gml:pixelInCell"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="pixelInCell" type="gml:PixelInCellType"/>
+ <!-- =================================================== -->
+ <complexType name="PixelInCellType">
+ <annotation>
+ <documentation>Specification of the way an image grid is associated with the image data attributes. </documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:CodeType">
+ <attribute name="codeSpace" type="anyURI" use="required">
+ <annotation>
+ <documentation>Reference to a source of information specifying the values and meanings of all the allowed string values for this PixelInCellType. </documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="imageDatumRef" type="gml:ImageDatumRefType"/>
+ <!-- =================================================== -->
+ <complexType name="ImageDatumRefType">
+ <annotation>
+ <documentation>Association to an image datum, either referencing or containing the definition of that datum. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:ImageDatum"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="VerticalDatum" type="gml:VerticalDatumType" substitutionGroup="gml:_Datum"/>
+ <!-- =================================================== -->
+ <complexType name="VerticalDatumType">
+ <annotation>
+ <documentation>A textual description and/or a set of parameters identifying a particular reference level surface used as a zero-height surface, including its position with respect to the Earth for any of the height types recognized by this standard. There are several types of Vertical Datums, and each may place constraints on the Coordinate Axis with which it is combined to create a Vertical CRS. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractDatumType">
+ <sequence>
+ <element ref="gml:verticalDatumType" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="verticalDatumType" type="gml:VerticalDatumTypeType"/>
+ <!-- =================================================== -->
+ <complexType name="VerticalDatumTypeType">
+ <annotation>
+ <documentation>Type of a vertical datum. </documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:CodeType">
+ <attribute name="codeSpace" type="anyURI" use="required">
+ <annotation>
+ <documentation>Reference to a source of information specifying the values and meanings of all the allowed string values for this VerticalDatumTypeType. </documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="verticalDatumRef" type="gml:VerticalDatumRefType"/>
+ <!-- =================================================== -->
+ <complexType name="VerticalDatumRefType">
+ <annotation>
+ <documentation>Association to a vertical datum, either referencing or containing the definition of that datum. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:VerticalDatum"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="TemporalDatum" type="gml:TemporalDatumType" substitutionGroup="gml:_Datum"/>
+ <!-- =================================================== -->
+ <complexType name="TemporalDatumBaseType" abstract="true">
+ <annotation>
+ <documentation>Partially defines the origin of a temporal coordinate reference system. This type restricts the AbstractDatumType to remove the "anchorPoint" and "realizationEpoch" elements. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractDatumType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:datumName"/>
+ <element ref="gml:datumID" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:validArea" minOccurs="0"/>
+ <element ref="gml:scope" minOccurs="0"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <complexType name="TemporalDatumType">
+ <annotation>
+ <documentation>Defines the origin of a temporal coordinate reference system. This type extends the TemporalDatumRestrictionType to add the "origin" element with the dateTime type. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:TemporalDatumBaseType">
+ <sequence>
+ <element ref="gml:origin"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="origin" type="dateTime">
+ <annotation>
+ <documentation>The date and time origin of this temporal datum. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="temporalDatumRef" type="gml:TemporalDatumRefType"/>
+ <!-- =================================================== -->
+ <complexType name="TemporalDatumRefType">
+ <annotation>
+ <documentation>Association to a temporal datum, either referencing or containing the definition of that datum. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:TemporalDatum"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="GeodeticDatum" type="gml:GeodeticDatumType" substitutionGroup="gml:_Datum"/>
+ <!-- =================================================== -->
+ <complexType name="GeodeticDatumType">
+ <annotation>
+ <documentation>A geodetic datum defines the precise location and orientation in 3-dimensional space of a defined ellipsoid (or sphere) that approximates the shape of the earth, or of a Cartesian coordinate system centered in this ellipsoid (or sphere). </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractDatumType">
+ <sequence>
+ <element ref="gml:usesPrimeMeridian"/>
+ <element ref="gml:usesEllipsoid"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="usesPrimeMeridian" type="gml:PrimeMeridianRefType">
+ <annotation>
+ <documentation>Association to the prime meridian used by this geodetic datum. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="usesEllipsoid" type="gml:EllipsoidRefType">
+ <annotation>
+ <documentation>Association to the ellipsoid used by this geodetic datum. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="geodeticDatumRef" type="gml:GeodeticDatumRefType"/>
+ <!-- =================================================== -->
+ <complexType name="GeodeticDatumRefType">
+ <annotation>
+ <documentation>Association to a geodetic datum, either referencing or containing the definition of that datum. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:GeodeticDatum"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <!-- =================================================== -->
+ <element name="PrimeMeridian" type="gml:PrimeMeridianType" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="PrimeMeridianBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for prime meridian objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:meridianName"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="meridianName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this prime meridian is identified. The meridianName most common value is Greenwich, and that value shall be used when the greenwichLongitude value is zero. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="PrimeMeridianType">
+ <annotation>
+ <documentation>A prime meridian defines the origin from which longitude values are determined.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:PrimeMeridianBaseType">
+ <sequence>
+ <element ref="gml:meridianID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this prime meridian. The first meridianID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this prime meridian, including source information. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:greenwichLongitude"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="meridianID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of a prime meridian. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="greenwichLongitude" type="gml:AngleChoiceType">
+ <annotation>
+ <documentation>Longitude of the prime meridian measured from the Greenwich meridian, positive eastward. The greenwichLongitude most common value is zero, and that value shall be used when the meridianName value is Greenwich. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="primeMeridianRef" type="gml:PrimeMeridianRefType"/>
+ <!-- =================================================== -->
+ <complexType name="PrimeMeridianRefType">
+ <annotation>
+ <documentation>Association to a prime meridian, either referencing or containing the definition of that meridian. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:PrimeMeridian"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="Ellipsoid" type="gml:EllipsoidType" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="EllipsoidBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for ellipsoid objects, simplifying and restricting the DefinitionType as needed. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:ellipsoidName"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="ellipsoidName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this ellipsoid is identified. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="EllipsoidType">
+ <annotation>
+ <documentation>An ellipsoid is a geometric figure that can be used to describe the approximate shape of the earth. In mathematical terms, it is a surface formed by the rotation of an ellipse about its minor axis.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:EllipsoidBaseType">
+ <sequence>
+ <element ref="gml:ellipsoidID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alternative identifications of this ellipsoid. The first ellipsoidID, if any, is normally the primary identification code, and any others are aliases. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this ellipsoid, including source information. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:semiMajorAxis"/>
+ <element ref="gml:secondDefiningParameter"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="ellipsoidID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of an ellipsoid. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="semiMajorAxis" type="gml:MeasureType">
+ <annotation>
+ <documentation>Length of the semi-major axis of the ellipsoid, with its units. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for a length, such as metres or feet. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="ellipsoidRef" type="gml:EllipsoidRefType"/>
+ <!-- =================================================== -->
+ <complexType name="EllipsoidRefType">
+ <annotation>
+ <documentation>Association to an ellipsoid, either referencing or containing the definition of that ellipsoid. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:Ellipsoid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="secondDefiningParameter" type="gml:SecondDefiningParameterType"/>
+ <!-- =================================================== -->
+ <complexType name="SecondDefiningParameterType">
+ <annotation>
+ <documentation>Definition of the second parameter that defines the shape of an ellipsoid. An ellipsoid requires two defining parameters: semi-major axis and inverse flattening or semi-major axis and semi-minor axis. When the reference body is a sphere rather than an ellipsoid, only a single defining parameter is required, namely the radius of the sphere; in that case, the semi-major axis "degenerates" into the radius of the sphere.</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:inverseFlattening"/>
+ <element ref="gml:semiMinorAxis"/>
+ <element ref="gml:isSphere"/>
+ </choice>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="inverseFlattening" type="gml:MeasureType">
+ <annotation>
+ <documentation>Inverse flattening value of the ellipsoid. Value is a scale factor (or ratio) that has no physical unit. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for a scale factor, such as percent, permil, or parts-per-million. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="semiMinorAxis" type="gml:MeasureType">
+ <annotation>
+ <documentation>Length of the semi-minor axis of the ellipsoid. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for a length, such as metres or feet. </documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="isSphere">
+ <annotation>
+ <documentation>The ellipsoid is degenerate and is actually a sphere. The sphere is completely defined by the semi-major axis, which is the radius of the sphere. </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="sphere"/>
+ </restriction>
+ </simpleType>
+ </element>
+ <!-- =================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/defaultStyle.xsd b/petascope/xml/ogc/gml/3.1.1/base/defaultStyle.xsd
new file mode 100644
index 0000000..ecb2389
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/defaultStyle.xsd
@@ -0,0 +1,450 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:smil20="http://www.w3.org/2001/SMIL20/" elementFormDefault="qualified" version="3.1.0">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-defaultStyle:v3.1.0">defaultStyle.xsd</appinfo>
+ <documentation>Default Style schema for GML 3.1.0
+ Copyright (c) 2001-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ Compliance: reference to ISO Specifications</documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <include schemaLocation="measures.xsd"/>
+ <import namespace="http://www.w3.org/2001/SMIL20/" schemaLocation="../smil/smil20.xsd"/>
+ <!-- ==============================================================
+ the Style property
+ ============================================================== -->
+ <element name="defaultStyle" type="gml:DefaultStylePropertyType">
+ <annotation>
+ <documentation>Top-level property. Used in application schemas to "attach" the styling information to GML data. The link between the data and the style should be established through this property only.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="DefaultStylePropertyType">
+ <annotation>
+ <documentation>[complexType of] Top-level property. Used in application schemas to "attach" the styling information to GML data. The link between the data and the style should be established through this property only.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_Style" minOccurs="0"/>
+ </sequence>
+ <attribute name="about" type="anyURI" use="optional"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ==============================================================
+ the Style
+ ============================================================== -->
+ <element name="_Style" type="gml:AbstractStyleType" abstract="true" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>The value of the top-level property. It is an abstract element. Used as the head element of the substitution group for extensibility purposes.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractStyleType" abstract="true">
+ <annotation>
+ <documentation>[complexType of] The value of the top-level property. It is an abstract element. Used as the head element of the substitution group for extensibility purposes.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Style" type="gml:StyleType" substitutionGroup="gml:_Style">
+ <annotation>
+ <documentation>Predefined concrete value of the top-level property. Encapsulates all other styling information.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="StyleType">
+ <annotation>
+ <documentation>[complexType of] Predefined concrete value of the top-level property. Encapsulates all other styling information.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractStyleType">
+ <sequence>
+ <element ref="gml:featureStyle" maxOccurs="unbounded"/>
+ <element ref="gml:graphStyle" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ==============================================================
+ Feature Style Property
+ ============================================================== -->
+ <element name="featureStyle" type="gml:FeatureStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="FeatureStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ <sequence>
+ <element ref="gml:FeatureStyle" minOccurs="0"/>
+ </sequence>
+ <attribute name="about" type="anyURI" use="optional"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ==============================================================
+ Feature Style
+ ============================================================== -->
+ <element name="FeatureStyle" type="gml:FeatureStyleType" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>The style descriptor for features.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="FeatureStyleType">
+ <annotation>
+ <documentation>[complexType of] The style descriptor for features.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element name="featureConstraint" type="string" minOccurs="0"/>
+ <element ref="gml:geometryStyle" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:topologyStyle" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:labelStyle" minOccurs="0"/>
+ </sequence>
+ <attribute name="featureType" type="string" use="optional"/>
+ <attribute name="baseType" type="string" use="optional"/>
+ <attribute name="queryGrammar" type="gml:QueryGrammarEnumeration"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <simpleType name="QueryGrammarEnumeration">
+ <annotation>
+ <documentation>Used to specify the grammar of the feature query mechanism.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="xpath"/>
+ <enumeration value="xquery"/>
+ <enumeration value="other"/>
+ </restriction>
+ </simpleType>
+ <!-- ==============================================================
+ Base style descriptor type (for geometry, topology, label, graph)
+ ============================================================== -->
+ <complexType name="BaseStyleDescriptorType">
+ <annotation>
+ <documentation>Base complex type for geometry, topology, label and graph styles.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element name="spatialResolution" type="gml:ScaleType" minOccurs="0"/>
+ <element name="styleVariation" type="gml:StyleVariationType" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="smil20:animate" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="smil20:animateMotion" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="smil20:animateColor" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="smil20:set" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ==============================================================
+ Geometry Style Property
+ ============================================================== -->
+ <element name="geometryStyle" type="gml:GeometryStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="GeometryStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ <sequence>
+ <element ref="gml:GeometryStyle" minOccurs="0"/>
+ </sequence>
+ <attribute name="about" type="anyURI" use="optional"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ==============================================================
+ Geometry Style
+ ============================================================== -->
+ <element name="GeometryStyle" type="gml:GeometryStyleType" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>The style descriptor for geometries of a feature.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="GeometryStyleType">
+ <annotation>
+ <documentation>[complexType of] The style descriptor for geometries of a feature.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:BaseStyleDescriptorType">
+ <sequence>
+ <choice>
+ <element ref="gml:symbol"/>
+ <element name="style" type="string">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>Deprecated in GML version 3.1.0. Use symbol with inline content instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:labelStyle" minOccurs="0"/>
+ </sequence>
+ <attribute name="geometryProperty" type="string"/>
+ <attribute name="geometryType" type="string"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ==============================================================
+ Topology Style Property
+ ============================================================== -->
+ <element name="topologyStyle" type="gml:TopologyStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="TopologyStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ <sequence>
+ <element ref="gml:TopologyStyle" minOccurs="0"/>
+ </sequence>
+ <attribute name="about" type="anyURI" use="optional"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ==============================================================
+ Topology Style
+ ============================================================== -->
+ <element name="TopologyStyle" type="gml:TopologyStyleType" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>The style descriptor for topologies of a feature. Describes individual topology elements styles.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="TopologyStyleType">
+ <annotation>
+ <documentation>[complexType of] The style descriptor for topologies of a feature. Describes individual topology elements styles.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:BaseStyleDescriptorType">
+ <sequence>
+ <choice>
+ <element ref="gml:symbol"/>
+ <element name="style" type="string">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>Deprecated in GML version 3.1.0. Use symbol with inline content instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:labelStyle" minOccurs="0"/>
+ </sequence>
+ <attribute name="topologyProperty" type="string"/>
+ <attribute name="topologyType" type="string"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ==============================================================
+ Label Style Property
+ ============================================================== -->
+ <element name="labelStyle" type="gml:LabelStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="LabelStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ <sequence>
+ <element ref="gml:LabelStyle" minOccurs="0"/>
+ </sequence>
+ <attribute name="about" type="anyURI" use="optional"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ==============================================================
+ Label Style
+ ============================================================== -->
+ <element name="LabelStyle" type="gml:LabelStyleType" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>The style descriptor for labels of a feature, geometry or topology.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="LabelStyleType">
+ <annotation>
+ <documentation>[complexType of] The style descriptor for labels of a feature, geometry or topology.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:BaseStyleDescriptorType">
+ <sequence>
+ <element name="style" type="string"/>
+ <element name="label" type="gml:LabelType"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ==============================================================
+ Graph Style Property
+ ============================================================== -->
+ <element name="graphStyle" type="gml:GraphStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="GraphStylePropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ <sequence>
+ <element ref="gml:GraphStyle" minOccurs="0"/>
+ </sequence>
+ <attribute name="about" type="anyURI" use="optional"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ==============================================================
+ Graph Style
+ ============================================================== -->
+ <element name="GraphStyle" type="gml:GraphStyleType" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>The style descriptor for a graph consisting of a number of features. Describes graph-specific style attributes.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="GraphStyleType">
+ <annotation>
+ <documentation>[complexType of] The style descriptor for a graph consisting of a number of features. Describes graph-specific style attributes.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:BaseStyleDescriptorType">
+ <sequence>
+ <element name="planar" type="boolean" minOccurs="0"/>
+ <element name="directed" type="boolean" minOccurs="0"/>
+ <element name="grid" type="boolean" minOccurs="0"/>
+ <element name="minDistance" type="double" minOccurs="0"/>
+ <element name="minAngle" type="double" minOccurs="0"/>
+ <element name="graphType" type="gml:GraphTypeType" minOccurs="0"/>
+ <element name="drawingType" type="gml:DrawingTypeType" minOccurs="0"/>
+ <element name="lineType" type="gml:LineTypeType" minOccurs="0"/>
+ <element name="aestheticCriteria" type="gml:AesheticCriteriaType" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ==============================================================
+ Common elements
+ ============================================================== -->
+ <element name="symbol" type="gml:SymbolType">
+ <annotation>
+ <documentation>The symbol property. Extends the gml:AssociationType to allow for remote referencing of symbols.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="SymbolType">
+ <annotation>
+ <documentation>[complexType of] The symbol property. Allows for remote referencing of symbols.</documentation>
+ </annotation>
+ <sequence>
+ <any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="symbolType" type="gml:SymbolTypeEnumeration" use="required"/>
+ <attribute ref="gml:transform" use="optional"/>
+ <attribute name="about" type="anyURI" use="optional"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <simpleType name="SymbolTypeEnumeration">
+ <annotation>
+ <documentation>Used to specify the type of the symbol used.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="svg"/>
+ <enumeration value="xpath"/>
+ <enumeration value="other"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <complexType name="LabelType" mixed="true">
+ <annotation>
+ <documentation>Label is mixed -- composed of text and XPath expressions used to extract the useful information from the feature.</documentation>
+ </annotation>
+ <sequence>
+ <element name="LabelExpression" type="string" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute ref="gml:transform" use="optional"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <attribute name="transform" type="string">
+ <annotation>
+ <documentation>Defines the geometric transformation of entities. There is no particular grammar defined for this value.</documentation>
+ </annotation>
+ </attribute>
+ <!-- =========================================================== -->
+ <complexType name="StyleVariationType">
+ <annotation>
+ <documentation>Used to vary individual graphic parameters and attributes of the style, symbol or text.</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string">
+ <attribute name="styleProperty" type="string" use="required"/>
+ <attribute name="featurePropertyRange" type="string" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- ==============================================================
+ Graph parameters types
+ ============================================================== -->
+ <simpleType name="GraphTypeType">
+ <annotation>
+ <documentation>Graph-specific styling property.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="TREE"/>
+ <enumeration value="BICONNECTED"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="DrawingTypeType">
+ <annotation>
+ <documentation>Graph-specific styling property.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="POLYLINE"/>
+ <enumeration value="ORTHOGONAL"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="LineTypeType">
+ <annotation>
+ <documentation>Graph-specific styling property.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="STRAIGHT"/>
+ <enumeration value="BENT"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="AesheticCriteriaType">
+ <annotation>
+ <documentation>Graph-specific styling property.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="MIN_CROSSINGS"/>
+ <enumeration value="MIN_AREA"/>
+ <enumeration value="MIN_BENDS"/>
+ <enumeration value="MAX_BENDS"/>
+ <enumeration value="UNIFORM_BENDS"/>
+ <enumeration value="MIN_SLOPES"/>
+ <enumeration value="MIN_EDGE_LENGTH"/>
+ <enumeration value="MAX_EDGE_LENGTH"/>
+ <enumeration value="UNIFORM_EDGE_LENGTH"/>
+ <enumeration value="MAX_ANGULAR_RESOLUTION"/>
+ <enumeration value="MIN_ASPECT_RATIO"/>
+ <enumeration value="MAX_SYMMETRIES"/>
+ </restriction>
+ </simpleType>
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/dictionary.xsd b/petascope/xml/ogc/gml/3.1.1/base/dictionary.xsd
new file mode 100644
index 0000000..2fc1c43
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/dictionary.xsd
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:dictionary:3.1.1"/>
+ <documentation>
+ Dictionary schema for GML 3.1.1
+ Components to support the lists of definitions.
+ Copyright (c) 2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ========================================================
+ includes and imports
+ ======================================================== -->
+ <include schemaLocation="gmlBase.xsd"/>
+ <!-- ===================================================== -->
+ <!-- ===================================================== -->
+ <!-- === Dictionary and Definition components === -->
+ <!-- ===================================================== -->
+ <group name="StandardDefinitionProperties">
+ <annotation>
+ <documentation>This content model group makes it easier to construct types that
+ derive from DefinitionType and its descendents "by restriction".
+ A reference to the group saves having to enumerate the standard definition properties.
+ See definition of StandardObjectProperties for more documentation</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:description" minOccurs="0"/>
+ <element ref="gml:name" maxOccurs="unbounded"/>
+ </sequence>
+ </group>
+ <!-- ===================================================== -->
+ <element name="Definition" type="gml:DefinitionType" substitutionGroup="gml:_GML"/>
+ <!-- ===================================================== -->
+ <complexType name="DefinitionType">
+ <annotation>
+ <documentation>A definition, which can be included in or referenced by a dictionary. In this extended type, the inherited "description" optional element can hold the definition whenever only text is needed. The inherited "name" elements can provide one or more brief terms for which this is the definition. The inherited "metaDataProperty" elements can be used to reference or include more information about this definition.
+The gml:id attribute is required - it must be possible to reference this definition using this handle. </documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractGMLType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:description" minOccurs="0"/>
+ <element ref="gml:name" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- ===================================================== -->
+ <element name="Dictionary" type="gml:DictionaryType" substitutionGroup="gml:Definition"/>
+ <element name="DefinitionCollection" type="gml:DictionaryType" substitutionGroup="gml:Definition"/>
+ <!-- ===================================================== -->
+ <complexType name="DictionaryType">
+ <annotation>
+ <documentation>A non-abstract bag that is specialized for use as a dictionary which contains a set of definitions. These definitions are referenced from other places, in the same and different XML documents. In this restricted type, the inherited optional "description" element can be used for a description of this dictionary. The inherited optional "name" element can be used for the name(s) of this dictionary. The inherited "metaDataProperty" elements can be used to reference or contain more information about this dictionary. The inherited required gml:id attribute allows the dictionary to be referenced using this handle. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:DefinitionType">
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <choice>
+ <element ref="gml:dictionaryEntry">
+ <annotation>
+ <documentation>An entry in this dictionary. The content of an entry can itself be a lower level dictionary or definition collection. This element follows the standard GML property model, so the value may be provided directly or by reference. Note that if the value is provided by reference, this definition does not carry a handle (gml:id) in this context, so does not allow external references to this specific entry in this context. When used in this way the referenced definition will usually be in a dictionary in the same XML document. </documentation>
+ </annotation>
+ </element>
+ <element ref="gml:indirectEntry">
+ <annotation>
+ <documentation>An identified reference to a remote entry in this dictionary, to be used when this entry should be identified to allow external references to this specific entry. </documentation>
+ </annotation>
+ </element>
+ </choice>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ===================================================== -->
+ <element name="dictionaryEntry" type="gml:DictionaryEntryType"/>
+ <element name="definitionMember" type="gml:DictionaryEntryType" substitutionGroup="gml:dictionaryEntry"/>
+ <!-- ===================================================== -->
+ <complexType name="DictionaryEntryType">
+ <annotation>
+ <documentation>An entry in a dictionary of definitions. An instance of this type contains or refers to a definition object.
+
+The number of definitions contained in this dictionaryEntry is restricted to one, but a DefinitionCollection or Dictionary that contains multiple definitions can be substituted if needed. Specialized descendents of this dictionaryEntry might be restricted in an application schema to allow only including specified types of definitions as valid entries in a dictionary. </documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:Definition">
+ <annotation>
+ <documentation>This element in a dictionary entry contains the actual definition. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>A non-identified reference to a remote entry in this dictionary, to be used when this entry need not be identified to allow external references to this specific entry. The remote entry referenced will usually be in a dictionary in the same XML document. This element will usually be used in dictionaries that are inside of another dictionary. </documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- ===================================================== -->
+ <element name="indirectEntry" type="gml:IndirectEntryType"/>
+ <!-- ===================================================== -->
+ <complexType name="IndirectEntryType">
+ <annotation>
+ <documentation>An entry in a dictionary of definitions that contains a GML object which references a remote definition object. This entry is expected to be convenient in allowing multiple elements in one XML document to contain short (abbreviated XPointer) references, which are resolved to an external definition provided in a Dictionary element in the same XML document. Specialized descendents of this dictionaryEntry might be restricted in an application schema to allow only including specified types of definitions as valid entries in a dictionary. </documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:DefinitionProxy"/>
+ </sequence>
+ </complexType>
+ <!-- ===================================================== -->
+ <element name="DefinitionProxy" type="gml:DefinitionProxyType" substitutionGroup="gml:Definition"/>
+ <!-- ===================================================== -->
+ <complexType name="DefinitionProxyType">
+ <annotation>
+ <documentation>A proxy entry in a dictionary of definitions. An element of this type contains a reference to a remote definition object. This entry is expected to be convenient in allowing multiple elements in one XML document to contain short (abbreviated XPointer) references, which are resolved to an external definition provided in a Dictionary element in the same XML document. </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:definitionRef">
+ <annotation>
+ <documentation>A reference to a remote entry in this dictionary, used when this dictionary entry is identified to allow external references to this specific entry. The remote entry referenced can be in a dictionary in the same or different XML document. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ===================================================== -->
+ <element name="definitionRef" type="gml:ReferenceType"/>
+ <!-- =========================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/direction.xsd b/petascope/xml/ogc/gml/3.1.1/base/direction.xsd
new file mode 100644
index 0000000..f33f968
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/direction.xsd
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified"
+ version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:direction:3.1.1">direction.xsd</appinfo>
+ <documentation>This schema defines "direction" element and type.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <include schemaLocation="geometryBasic0d1d.xsd"/>
+ <!-- ============================================================== -->
+ <!--=================================================================== -->
+ <element name="direction" type="gml:DirectionPropertyType"/>
+ <!--=================================================================== -->
+ <complexType name="DirectionPropertyType">
+ <annotation>
+ <documentation/>
+ </annotation>
+ <choice>
+ <element ref="gml:DirectionVector"/>
+ <element ref="gml:CompassPoint"/>
+ <element name="DirectionKeyword" type="gml:CodeType"/>
+ <element name="DirectionString" type="gml:StringOrRefType"/>
+ </choice>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!--=================================================================== -->
+ <element name="DirectionVector" type="gml:DirectionVectorType"/>
+ <!--=================================================================== -->
+ <complexType name="DirectionVectorType">
+ <annotation>
+ <documentation>Direction expressed as a vector, either using components, or using angles.</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:vector"/>
+ <sequence>
+ <element name="horizontalAngle" type="gml:AngleType"/>
+ <element name="verticalAngle" type="gml:AngleType"/>
+ </sequence>
+ </choice>
+ </complexType>
+ <!--=================================================================== -->
+ <element name="CompassPoint" type="gml:CompassPointEnumeration"/>
+ <!--=================================================================== -->
+ <simpleType name="CompassPointEnumeration">
+ <restriction base="string">
+ <enumeration value="N"/>
+ <enumeration value="NNE"/>
+ <enumeration value="NE"/>
+ <enumeration value="ENE"/>
+ <enumeration value="E"/>
+ <enumeration value="ESE"/>
+ <enumeration value="SE"/>
+ <enumeration value="SSE"/>
+ <enumeration value="S"/>
+ <enumeration value="SSW"/>
+ <enumeration value="SW"/>
+ <enumeration value="WSW"/>
+ <enumeration value="W"/>
+ <enumeration value="WNW"/>
+ <enumeration value="NW"/>
+ <enumeration value="NNW"/>
+ </restriction>
+ </simpleType>
+ <!--=================================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/dynamicFeature.xsd b/petascope/xml/ogc/gml/3.1.1/base/dynamicFeature.xsd
new file mode 100644
index 0000000..38f5252
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/dynamicFeature.xsd
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:dynamicFeature:3.1.1"/>
+ <documentation xml:lang="en">Basic support for tracking moving objects and objects with changing state.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ================================================================== -->
+ <include schemaLocation="feature.xsd"/>
+ <include schemaLocation="direction.xsd"/>
+ <!-- ================================================================== -->
+ <element name="dataSource" type="gml:StringOrRefType"/>
+ <element name="status" type="gml:StringOrRefType"/>
+ <!-- ================================================================== -->
+ <element name="_TimeSlice" type="gml:AbstractTimeSliceType" abstract="true" substitutionGroup="gml:_GML"/>
+ <!-- ===================================== -->
+ <complexType name="AbstractTimeSliceType" abstract="true">
+ <annotation>
+ <documentation xml:lang="en">A timeslice encapsulates the time-varying properties of a dynamic feature--it
+ must be extended to represent a timestamped projection of a feature. The dataSource
+ property describes how the temporal data was acquired.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element ref="gml:validTime"/>
+ <element ref="gml:dataSource" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <element name="MovingObjectStatus" type="gml:MovingObjectStatusType" substitutionGroup="gml:_TimeSlice"/>
+ <!-- ===================================== -->
+ <complexType name="MovingObjectStatusType">
+ <annotation>
+ <documentation xml:lang="en">This type encapsulates various dynamic properties of moving objects
+ (points, lines, regions). It is useful for dealing with features whose
+ geometry or topology changes over time.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeSliceType">
+ <sequence>
+ <element ref="gml:location"/>
+ <element name="speed" type="gml:MeasureType" minOccurs="0"/>
+ <element name="bearing" type="gml:DirectionPropertyType" minOccurs="0"/>
+ <element name="acceleration" type="gml:MeasureType" minOccurs="0"/>
+ <element name="elevation" type="gml:MeasureType" minOccurs="0"/>
+ <element ref="gml:status" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <element name="history" type="gml:HistoryPropertyType"/>
+ <!-- ===================================== -->
+ <complexType name="HistoryPropertyType">
+ <annotation>
+ <documentation xml:lang="en">The history relationship associates a feature with a sequence of TimeSlice instances.</documentation>
+ </annotation>
+ <sequence maxOccurs="unbounded">
+ <element ref="gml:_TimeSlice"/>
+ </sequence>
+ </complexType>
+ <!-- ================================================================== -->
+ <element name="track" type="gml:TrackType" substitutionGroup="gml:history"/>
+ <!-- ===================================== -->
+ <complexType name="TrackType">
+ <annotation>
+ <documentation xml:lang="en">The track of a moving object is a sequence of specialized timeslices that indicate the status of the object.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:HistoryPropertyType">
+ <sequence maxOccurs="unbounded">
+ <element ref="gml:MovingObjectStatus"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <group name="dynamicProperties">
+ <sequence>
+ <element ref="gml:validTime" minOccurs="0"/>
+ <element ref="gml:history" minOccurs="0"/>
+ <element ref="gml:dataSource" minOccurs="0"/>
+ </sequence>
+ </group>
+ <!-- ================================================================== -->
+ <complexType name="DynamicFeatureType">
+ <annotation>
+ <documentation>A dynamic feature may possess a history and/or a timestamp.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractFeatureType">
+ <group ref="gml:dynamicProperties"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ===================================== -->
+ <complexType name="DynamicFeatureCollectionType">
+ <annotation>
+ <documentation>A dynamic feature collection may possess a history and/or a timestamp.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:FeatureCollectionType">
+ <group ref="gml:dynamicProperties"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ===================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/feature.xsd b/petascope/xml/ogc/gml/3.1.1/base/feature.xsd
new file mode 100644
index 0000000..fc50bb3
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/feature.xsd
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:feature:v3.1.1"/>
+ <documentation>GML Feature schema.
+ Copyright (c) 2001-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <!-- ================== includes and imports ======================= -->
+ <!-- ============================================================== -->
+ <include schemaLocation="geometryBasic2d.xsd"/>
+ <include schemaLocation="temporal.xsd"/>
+ <!-- ============================================================== -->
+ <element name="_Feature" type="gml:AbstractFeatureType" abstract="true" substitutionGroup="gml:_GML"/>
+ <!-- =========================================================== -->
+ <complexType name="AbstractFeatureType" abstract="true">
+ <annotation>
+ <documentation>An abstract feature provides a set of common properties, including id, metaDataProperty, name and description inherited from AbstractGMLType, plus boundedBy. A concrete feature type must derive from this type and specify additional properties in an application schema. A feature must possess an identifying attribute ('id' - 'fid' has been deprecated).</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element ref="gml:boundedBy" minOccurs="0"/>
+ <element ref="gml:location" minOccurs="0">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>deprecated in GML version 3.1</documentation>
+ </annotation>
+ </element>
+ <!-- additional properties must be specified in an application schema -->
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <!-- =========================================================== -->
+ <element name="boundedBy" type="gml:BoundingShapeType"/>
+ <!-- ====================================================================== -->
+ <complexType name="BoundingShapeType">
+ <annotation>
+ <documentation>Bounding shape.</documentation>
+ </annotation>
+ <sequence>
+ <choice>
+ <element ref="gml:Envelope"/>
+ <element ref="gml:Null"/>
+ </choice>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="EnvelopeWithTimePeriod" type="gml:EnvelopeWithTimePeriodType" substitutionGroup="gml:Envelope"/>
+ <!-- ====================================================================== -->
+ <complexType name="EnvelopeWithTimePeriodType">
+ <annotation>
+ <documentation>Envelope that includes also a temporal extent.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:EnvelopeType">
+ <sequence>
+ <element ref="gml:timePosition" minOccurs="2" maxOccurs="2"/>
+ </sequence>
+ <attribute name="frame" type="anyURI" use="optional" default="#ISO-8601"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ====================================================================== -->
+ <!-- ===== property for feature association ==== -->
+ <element name="featureMember" type="gml:FeaturePropertyType"/>
+ <element name="featureProperty" type="gml:FeaturePropertyType"/>
+ <!-- ============================================================== -->
+ <complexType name="FeaturePropertyType">
+ <annotation>
+ <documentation>Container for a feature - follow gml:AssociationType pattern.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_Feature"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ============================================================== -->
+ <!-- ===== property for association of an array of features ===== -->
+ <element name="featureMembers" type="gml:FeatureArrayPropertyType"/>
+ <!-- =========================================================== -->
+ <complexType name="FeatureArrayPropertyType">
+ <annotation>
+ <documentation>Container for features - follow gml:ArrayAssociationType pattern.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_Feature" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- ============================================================== -->
+ <!-- =========================================================== -->
+ <element name="_FeatureCollection" type="gml:AbstractFeatureCollectionType" abstract="true" substitutionGroup="gml:_Feature"/>
+ <!-- =========================================================== -->
+ <complexType name="AbstractFeatureCollectionType" abstract="true">
+ <annotation>
+ <documentation>A feature collection contains zero or more features.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractFeatureType">
+ <sequence>
+ <element ref="gml:featureMember" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:featureMembers" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="FeatureCollection" type="gml:FeatureCollectionType" substitutionGroup="gml:_Feature"/>
+ <!-- =========================================================== -->
+ <complexType name="FeatureCollectionType">
+ <annotation>
+ <documentation>Concrete generic feature collection.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractFeatureCollectionType"/>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <!-- ============================================================== -->
+ <element name="LocationKeyWord" type="gml:CodeType"/>
+ <element name="LocationString" type="gml:StringOrRefType"/>
+ <!-- =========================================================== -->
+ <!-- ============= common aliases for geometry properties =============== -->
+ <element name="centerOf" type="gml:PointPropertyType"/>
+ <element name="position" type="gml:PointPropertyType"/>
+ <element name="edgeOf" type="gml:CurvePropertyType"/>
+ <element name="centerLineOf" type="gml:CurvePropertyType"/>
+ <element name="extentOf" type="gml:SurfacePropertyType"/>
+ <!-- =========================================================== -->
+ <!-- ================= deprecated components =========================== -->
+ <complexType name="BoundedFeatureType" abstract="true">
+ <annotation>
+ <documentation>Makes boundedBy mandatory</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:AbstractFeatureType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:boundedBy"/>
+ <element ref="gml:location" minOccurs="0">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>deprecated in GML version 3.1</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="location" type="gml:LocationPropertyType">
+ <annotation>
+ <documentation>Deprecated in GML 3.1.0</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="LocationPropertyType">
+ <annotation>
+ <documentation>Convenience property for generalised location.
+ A representative location for plotting or analysis.
+ Often augmented by one or more additional geometry properties with more specific semantics.</documentation>
+ <documentation>Deprecated in GML 3.1.0</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <choice>
+ <element ref="gml:_Geometry"/>
+ <element ref="gml:LocationKeyWord"/>
+ <element ref="gml:LocationString"/>
+ <element ref="gml:Null"/>
+ </choice>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ============================================================== -->
+ <element name="priorityLocation" type="gml:PriorityLocationPropertyType" substitutionGroup="gml:location">
+ <annotation>
+ <documentation>Deprecated in GML 3.1.0</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="PriorityLocationPropertyType">
+ <annotation>
+ <documentation>G-XML component</documentation>
+ <documentation>Deprecated in GML 3.1.0</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:LocationPropertyType">
+ <attribute name="priority" type="string" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/geometryAggregates.xsd b/petascope/xml/ogc/gml/3.1.1/base/geometryAggregates.xsd
new file mode 100644
index 0000000..07be051
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/geometryAggregates.xsd
@@ -0,0 +1,427 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified"
+ version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:geometryAggregates:3.1.1">geometryAggregates.xsd</appinfo>
+ <documentation>Copyright (c) 2001-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <include schemaLocation="geometryPrimitives.xsd"/>
+ <!-- =========================================================== -->
+ <!-- aggregate geometry objects -->
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="_GeometricAggregate" type="gml:AbstractGeometricAggregateType" abstract="true" substitutionGroup="gml:_Geometry">
+ <annotation>
+ <documentation>The "_GeometricAggregate" element is the abstract head of the substituition group for all geometric aggremates.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractGeometricAggregateType" abstract="true">
+ <annotation>
+ <documentation>This is the abstract root type of the geometric aggregates.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometryType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="MultiGeometry" type="gml:MultiGeometryType" substitutionGroup="gml:_GeometricAggregate"/>
+ <!-- ======================================================= -->
+ <complexType name="MultiGeometryType">
+ <annotation>
+ <documentation>A geometry collection must include one or more geometries, referenced through geometryMember elements.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <annotation>
+ <documentation>The members of the geometric aggregate can be specified either using the "standard" property or the array property style. It is also valid to use both the "standard" and the array property style in the same collection.
+NOTE: Array properties cannot reference remote geometry elements.</documentation>
+ </annotation>
+ <element ref="gml:geometryMember" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:geometryMembers" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiGeometryProperty" type="gml:MultiGeometryPropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:multiGeometryProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a geometric aggregate via the XLink-attributes or contains the "multi geometry" element. multiGeometryProperty is the predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that is substitutable for _GeometricAggregate.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="MultiGeometryPropertyType">
+ <annotation>
+ <documentation>A property that has a geometric aggregate as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_GeometricAggregate"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="MultiPoint" type="gml:MultiPointType" substitutionGroup="gml:_GeometricAggregate"/>
+ <!-- ======================================================= -->
+ <complexType name="MultiPointType">
+ <annotation>
+ <documentation>A MultiPoint is defined by one or more Points, referenced through pointMember elements.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <annotation>
+ <documentation>The members of the geometric aggregate can be specified either using the "standard" property or the array property style. It is also valid to use both the "standard" and the array property style in the same collection.
+NOTE: Array properties cannot reference remote geometry elements.</documentation>
+ </annotation>
+ <element ref="gml:pointMember" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:pointMembers" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiPointProperty" type="gml:MultiPointPropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:multiPointProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a point aggregate via the XLink-attributes or contains the "multi point" element. multiPointProperty is the predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that is substitutable for MultiPoint.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="MultiPointPropertyType">
+ <annotation>
+ <documentation>A property that has a collection of points as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:MultiPoint"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="MultiCurve" type="gml:MultiCurveType" substitutionGroup="gml:_GeometricAggregate"/>
+ <!-- ======================================================= -->
+ <complexType name="MultiCurveType">
+ <annotation>
+ <documentation>A MultiCurve is defined by one or more Curves, referenced through curveMember elements.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <annotation>
+ <documentation>The members of the geometric aggregate can be specified either using the "standard" property or the array property style. It is also valid to use both the "standard" and the array property style in the same collection.
+NOTE: Array properties cannot reference remote geometry elements.</documentation>
+ </annotation>
+ <element ref="gml:curveMember" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:curveMembers" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiCurveProperty" type="gml:MultiCurvePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:multiCurveProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a curve aggregate via the XLink-attributes or contains the "multi curve" element. multiCurveProperty is the predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that is substitutable for MultiCurve.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="MultiCurvePropertyType">
+ <annotation>
+ <documentation>A property that has a collection of curves as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:MultiCurve"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="MultiSurface" type="gml:MultiSurfaceType" substitutionGroup="gml:_GeometricAggregate"/>
+ <!-- ======================================================= -->
+ <complexType name="MultiSurfaceType">
+ <annotation>
+ <documentation>A MultiSurface is defined by one or more Surfaces, referenced through surfaceMember elements.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <annotation>
+ <documentation>The members of the geometric aggregate can be specified either using the "standard" property or the array property style. It is also valid to use both the "standard" and the array property style in the same collection.
+NOTE: Array properties cannot reference remote geometry elements.</documentation>
+ </annotation>
+ <element ref="gml:surfaceMember" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:surfaceMembers" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiSurfaceProperty" type="gml:MultiSurfacePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:multiSurfaceProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a surface aggregate via the XLink-attributes or contains the "multi surface" element. multiSurfaceProperty is the predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that is substitutable for MultiSurface.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="MultiSurfacePropertyType">
+ <annotation>
+ <documentation>A property that has a collection of surfaces as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:MultiSurface"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- ============================================================ -->
+ <element name="MultiSolid" type="gml:MultiSolidType" substitutionGroup="gml:_GeometricAggregate"/>
+ <!-- ======================================================= -->
+ <complexType name="MultiSolidType">
+ <annotation>
+ <documentation>A MultiSolid is defined by one or more Solids, referenced through solidMember elements.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <annotation>
+ <documentation>The members of the geometric aggregate can be specified either using the "standard" property or the array property style. It is also valid to use both the "standard" and the array property style in the same collection.
+NOTE: Array properties cannot reference remote geometry elements.</documentation>
+ </annotation>
+ <element ref="gml:solidMember" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:solidMembers" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="multiSolidProperty" type="gml:MultiSolidPropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:multiSolidProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a solid aggregate via the XLink-attributes or contains the "multi solid" element. multiSolidProperty is the predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that is substitutable for MultiSolid.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="MultiSolidPropertyType">
+ <annotation>
+ <documentation>A property that has a collection of solids as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:MultiSolid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <!--
+
+ The following types and elements are deprecated and should not be used !
+ For backward compatibility with GML2 only
+
+ -->
+ <!-- =========================================================== -->
+ <element name="MultiPolygon" type="gml:MultiPolygonType" substitutionGroup="gml:_GeometricAggregate">
+ <annotation>
+ <documentation>Deprecated with GML 3.0 and included for backwards compatibility with GML 2. Use the "MultiSurface" element instead.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="MultiLineString" type="gml:MultiLineStringType" substitutionGroup="gml:_GeometricAggregate">
+ <annotation>
+ <documentation>Deprecated with GML 3.0 and included for backwards compatibility with GML 2. Use the "MultiCurve" element instead.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="MultiLineStringType">
+ <annotation>
+ <documentation>A MultiLineString is defined by one or more LineStrings, referenced through lineStringMember elements. Deprecated with GML version 3.0. Use MultiCurveType instead.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <element ref="gml:lineStringMember" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="MultiLineStringPropertyType">
+ <annotation>
+ <documentation>This type is deprecated with GML 3 and shall not be used. It is included for backwards compatibility with GML 2. Use MultiCurvePropertyType instead.
+A property that has a collection of line strings as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:MultiLineString"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="MultiPolygonType">
+ <annotation>
+ <documentation>A MultiPolygon is defined by one or more Polygons, referenced through polygonMember elements. Deprecated with GML version 3.0. Use MultiSurfaceType instead.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricAggregateType">
+ <sequence>
+ <element ref="gml:polygonMember" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="MultiPolygonPropertyType">
+ <annotation>
+ <documentation>This type is deprecated with GML 3 and shall not be used. It is included for backwards compatibility with GML 2. Use MultiSurfacePropertyType instead.
+
+A property that has a collection of polygons as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:MultiPolygon"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="geometryMember" type="gml:GeometryPropertyType">
+ <annotation>
+ <documentation>This property element either references a geometry element via the XLink-attributes or contains the geometry element.</documentation>
+ </annotation>
+ </element>
+ <element name="geometryMembers" type="gml:GeometryArrayPropertyType">
+ <annotation>
+ <documentation>This property element contains a list of geometry elements. The order of the elements is significant and shall be preserved when processing the array.</documentation>
+ </annotation>
+ </element>
+ <element name="pointMember" type="gml:PointPropertyType">
+ <annotation>
+ <documentation>This property element either references a Point via the XLink-attributes or contains the Point element.</documentation>
+ </annotation>
+ </element>
+ <element name="pointMembers" type="gml:PointArrayPropertyType">
+ <annotation>
+ <documentation>This property element contains a list of points. The order of the elements is significant and shall be preserved when processing the array.</documentation>
+ </annotation>
+ </element>
+ <element name="curveMembers" type="gml:CurveArrayPropertyType">
+ <annotation>
+ <documentation>This property element contains a list of curves. The order of the elements is significant and shall be preserved when processing the array.</documentation>
+ </annotation>
+ </element>
+ <element name="surfaceMember" type="gml:SurfacePropertyType">
+ <annotation>
+ <documentation>This property element either references a surface via the XLink-attributes or contains the surface element. A surface element is any element which is substitutable for "_Surface".</documentation>
+ </annotation>
+ </element>
+ <element name="surfaceMembers" type="gml:SurfaceArrayPropertyType">
+ <annotation>
+ <documentation>This property element contains a list of surfaces. The order of the elements is significant and shall be preserved when processing the array.</documentation>
+ </annotation>
+ </element>
+ <element name="solidMember" type="gml:SolidPropertyType">
+ <annotation>
+ <documentation>This property element either references a solid via the XLink-attributes or contains the solid element. A solid element is any element which is substitutable for "_Solid".</documentation>
+ </annotation>
+ </element>
+ <element name="solidMembers" type="gml:SolidArrayPropertyType">
+ <annotation>
+ <documentation>This property element contains a list of solids. The order of the elements is significant and shall be preserved when processing the array.</documentation>
+ </annotation>
+ </element>
+ <!-- some named geometry properties - for backward compatibility with GML2 -->
+ <element name="multiCenterOf" type="gml:MultiPointPropertyType"/>
+ <element name="multiPosition" type="gml:MultiPointPropertyType"/>
+ <element name="multiCenterLineOf" type="gml:MultiCurvePropertyType"/>
+ <element name="multiEdgeOf" type="gml:MultiCurvePropertyType"/>
+ <element name="multiCoverage" type="gml:MultiSurfacePropertyType"/>
+ <element name="multiExtentOf" type="gml:MultiSurfacePropertyType"/>
+ <!--
+
+ The following types and elements are deprecated and should not be used !
+
+ -->
+ <element name="multiLocation" type="gml:MultiPointPropertyType">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>Deprecated with GML 3.0 and included only for backwards compatibility with GML 2.0. Use "curveMember" instead.
+This property element either references a line string via the XLink-attributes or contains the line string element.</documentation>
+ </annotation>
+ </element>
+ <element name="lineStringMember" type="gml:LineStringPropertyType">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>Deprecated with GML 3.0 and included only for backwards compatibility with GML 2.0. Use "curveMember" instead.
+This property element either references a line string via the XLink-attributes or contains the line string element.</documentation>
+ </annotation>
+ </element>
+ <element name="polygonMember" type="gml:PolygonPropertyType">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>Deprecated with GML 3.0 and included only for backwards compatibility with GML 2.0. Use "surfaceMember" instead.
+This property element either references a polygon via the XLink-attributes or contains the polygon element.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/geometryBasic0d1d.xsd b/petascope/xml/ogc/gml/3.1.1/base/geometryBasic0d1d.xsd
new file mode 100644
index 0000000..b4cd483
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/geometryBasic0d1d.xsd
@@ -0,0 +1,599 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by David Burggraf (Galdos Systems Inc) -->
+<schema targetNamespace="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:sch="http://www.ascc.net/xml/schematron"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:geometryBasic0d1d:v3.1.1">geometryBasic0d1d.xsd</appinfo>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:geometryBasic0d1d:v3.1.1">
+ <sch:title>Schematron validation</sch:title>
+ <sch:pattern name="Check SRS tags">
+ <sch:rule abstract="true" id="CRSLabels">
+ <sch:report test="not(@srsDimension) or @srsName">The presence of a dimension attribute implies the presence of the srsName attribute.</sch:report>
+ <sch:report test="not(@axisLabels) or @srsName">The presence of an axisLabels attribute implies the presence of the srsName attribute.</sch:report>
+ <sch:report test="not(@uomLabels) or @srsName">The presence of an uomLabels attribute implies the presence of the srsName attribute.</sch:report>
+ <sch:report test="(not(@uomLabels) and not(@axisLabels)) or (@uomLabels and @axisLabels)">The presence of an uomLabels attribute implies the presence of the axisLabels attribute and vice versa.</sch:report>
+ </sch:rule>
+ </sch:pattern>
+ <sch:pattern name="Check Dimension">
+ <sch:rule abstract="true" id="Count">
+ <sch:report test="not(@count) or @srsDimension">The presence of a count attribute implies the presence of the dimension attribute.</sch:report>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>Copyright (c) 2001-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ============================================================== -->
+ <include schemaLocation="measures.xsd">
+ <annotation>
+ <documentation>This includes not only measures.xsd, but also units.xsd, gmlBase.xsd and basicTypes.xsd.</documentation>
+ </annotation>
+ </include>
+ <!-- ============================================================== -->
+ <!-- =========== abstract supertype for geometry objects =================== -->
+ <!-- ============================================================== -->
+ <element name="_Geometry" type="gml:AbstractGeometryType" abstract="true" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>The "_Geometry" element is the abstract head of the substituition group for all geometry elements of GML 3. This
+ includes pre-defined and user-defined geometry elements. Any geometry element must be a direct or indirect extension/restriction
+ of AbstractGeometryType and must be directly or indirectly in the substitution group of "_Geometry".</documentation>
+ <appinfo>
+ <sch:pattern name="Check SRS tags">
+ <sch:rule context="gml:_Geometry">
+ <sch:extends rule="CRSLabels"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="GeometryPropertyType">
+ <annotation>
+ <documentation>A geometric property can either be any geometry element encapsulated in an element of this type or an XLink reference
+ to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Note that either
+ the reference or the contained element must be given, but not both or none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_Geometry"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference
+ remote resources (including those elsewhere in the same document). A simple link element can be constructed by
+ including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation
+ of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create
+ sophisticated links between resources; such links can be used to reference remote properties. A simple link element
+ can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by
+ including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- ============================================================== -->
+ <complexType name="GeometryArrayPropertyType">
+ <annotation>
+ <documentation>A container for an array of geometry elements. The elements are always contained in the array property,
+ referencing geometry elements or arrays of geometry elements is not supported.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_Geometry" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- ============================================================== -->
+ <complexType name="AbstractGeometryType" abstract="true">
+ <annotation>
+ <documentation>All geometry elements are derived directly or indirectly from this abstract supertype. A geometry element may
+ have an identifying attribute ("gml:id"), a name (attribute "name") and a description (attribute "description"). It may be associated
+ with a spatial reference system (attribute "srsName"). The following rules shall be adhered: - Every geometry type shall derive
+ from this abstract type. - Every geometry element (i.e. an element of a geometry type) shall be directly or indirectly in the
+ substitution group of _Geometry.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <attribute name="gid" type="string" use="optional">
+ <annotation>
+ <documentation>This attribute is included for backward compatibility with GML 2 and is deprecated with GML 3.
+ This identifer is superceded by "gml:id" inherited from AbstractGMLType. The attribute "gid" should not be used
+ anymore and may be deleted in future versions of GML without further notice.</documentation>
+ </annotation>
+ </attribute>
+ <attributeGroup ref="gml:SRSReferenceGroup"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <attributeGroup name="SRSReferenceGroup">
+ <annotation>
+ <documentation>Optional reference to the CRS used by this geometry, with optional additional information to simplify use when
+ a more complete definition of the CRS is not needed.</documentation>
+ </annotation>
+ <attribute name="srsName" type="anyURI" use="optional">
+ <annotation>
+ <documentation>In general this reference points to a CRS instance of gml:CoordinateReferenceSystemType
+ (see coordinateReferenceSystems.xsd). For well known references it is not required that the CRS description exists at the
+ location the URI points to. If no srsName attribute is given, the CRS must be specified as part of the larger context this
+ geometry element is part of, e.g. a geometric element like point, curve, etc. It is expected that this attribute will be specified
+ at the direct position level only in rare cases.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="srsDimension" type="positiveInteger" use="optional">
+ <annotation>
+ <documentation>The "srsDimension" is the length of coordinate sequence (the number of entries in the list). This dimension is
+ specified by the coordinate reference system. When the srsName attribute is omitted, this attribute shall be omitted.</documentation>
+ </annotation>
+ </attribute>
+ <attributeGroup ref="gml:SRSInformationGroup"/>
+ </attributeGroup>
+ <!-- =================================================== -->
+ <attributeGroup name="SRSInformationGroup">
+ <annotation>
+ <documentation>Optional additional and redundant information for a CRS to simplify use when a more complete definition of the
+ CRS is not needed. This information shall be the same as included in the more complete definition of the CRS, referenced by the
+ srsName attribute. When the srsName attribute is included, either both or neither of the axisLabels and uomLabels attributes
+ shall be included. When the srsName attribute is omitted, both of these attributes shall be omitted.</documentation>
+ </annotation>
+ <attribute name="axisLabels" type="gml:NCNameList" use="optional">
+ <annotation>
+ <documentation>Ordered list of labels for all the axes of this CRS. The gml:axisAbbrev value should be used for these axis
+ labels, after spaces and forbiddden characters are removed. When the srsName attribute is included, this attribute is optional.
+ When the srsName attribute is omitted, this attribute shall also be omitted.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="uomLabels" type="gml:NCNameList" use="optional">
+ <annotation>
+ <documentation>Ordered list of unit of measure (uom) labels for all the axes of this CRS. The value of the string in the
+ gml:catalogSymbol should be used for this uom labels, after spaces and forbiddden characters are removed. When the
+ axisLabels attribute is included, this attribute shall also be included. When the axisLabels attribute is omitted, this attribute
+ shall also be omitted.</documentation>
+ </annotation>
+ </attribute>
+ </attributeGroup>
+ <!-- ============================================================== -->
+ <element name="_GeometricPrimitive" type="gml:AbstractGeometricPrimitiveType" abstract="true" substitutionGroup="gml:_Geometry">
+ <annotation>
+ <documentation>The "_GeometricPrimitive" element is the abstract head of the substituition group for all (pre- and user-defined)
+ geometric primitives.</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="AbstractGeometricPrimitiveType" abstract="true">
+ <annotation>
+ <documentation>This is the abstract root type of the geometric primitives. A geometric primitive is a geometric object that is not
+ decomposed further into other primitives in the system. All primitives are oriented in the direction implied by the sequence of their
+ coordinate tuples.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometryType"/>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <complexType name="GeometricPrimitivePropertyType">
+ <annotation>
+ <documentation>A property that has a geometric primitive as its value domain can either be an appropriate geometry element
+ encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry
+ elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither
+ both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_GeometricPrimitive"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote
+ resources (including those elsewhere in the same document). A simple link element can be constructed by including a
+ specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide
+ Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between
+ resources; such links can be used to reference remote properties. A simple link element can be used to implement pointer
+ functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- primitive geometry objects (0-dimensional) -->
+ <!-- ============================================================== -->
+ <element name="Point" type="gml:PointType" substitutionGroup="gml:_GeometricPrimitive"/>
+ <!-- ============================================================== -->
+ <complexType name="PointType">
+ <annotation>
+ <documentation>A Point is defined by a single coordinate tuple.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricPrimitiveType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the direct poisiton of a point. 1. The "pos" element is of type
+ DirectPositionType.</documentation>
+ </annotation>
+ <element ref="gml:pos"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0 for coordinates with ordinate values that are numbers. Use "pos"
+ instead. The "coordinates" element shall only be used for coordinates with ordinates that require a string
+ representation, e.g. DMS representations.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:coord">
+ <annotation>
+ <documentation>Deprecated with GML version 3.0. Use "pos" instead. The "coord" element is included for
+ backwards compatibility with GML 2.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <element name="pointProperty" type="gml:PointPropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:pointProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a point via the XLink-attributes or contains the point element. pointProperty
+ is the predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that
+ is substitutable for Point.</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <element name="pointRep" type="gml:PointPropertyType">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="PointPropertyType">
+ <annotation>
+ <documentation>A property that has a point as its value domain can either be an appropriate geometry element encapsulated in an
+ element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located
+ elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:Point"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote
+ resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific
+ set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium.
+ XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be
+ used to reference remote properties. A simple link element can be used to implement pointer functionality, and this functionality has
+ been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- ============================================================== -->
+ <element name="pointArrayProperty" type="gml:PointArrayPropertyType"/>
+ <!-- =========================================================== -->
+ <complexType name="PointArrayPropertyType">
+ <annotation>
+ <documentation>A container for an array of points. The elements are always contained in the array property, referencing geometry
+ elements or arrays of geometry elements is not supported.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:Point" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- primitive geometry objects (1-dimensional) -->
+ <!-- ============================================================== -->
+ <element name="_Curve" type="gml:AbstractCurveType" abstract="true" substitutionGroup="gml:_GeometricPrimitive">
+ <annotation>
+ <documentation>The "_Curve" element is the abstract head of the substituition group for all (continuous) curve elements.</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="AbstractCurveType" abstract="true">
+ <annotation>
+ <documentation>An abstraction of a curve to support the different levels of complexity. The curve can always be viewed as a geometric
+ primitive, i.e. is continuous.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricPrimitiveType"/>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <element name="curveProperty" type="gml:CurvePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:curveProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a curve via the XLink-attributes or contains the curve element. curveProperty is the
+ predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that is
+ substitutable for _Curve.</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="CurvePropertyType">
+ <annotation>
+ <documentation>A property that has a curve as its value domain can either be an appropriate geometry element encapsulated in an
+ element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere
+ in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_Curve"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote
+ resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific
+ set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium.
+ XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used
+ to reference remote properties. A simple link element can be used to implement pointer functionality, and this functionality has been built
+ into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- ============================================================== -->
+ <element name="curveArrayProperty" type="gml:CurveArrayPropertyType"/>
+ <!-- =========================================================== -->
+ <complexType name="CurveArrayPropertyType">
+ <annotation>
+ <documentation>A container for an array of curves. The elements are always contained in the array property, referencing geometry elements
+ or arrays of geometry elements is not supported.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_Curve" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="LineString" type="gml:LineStringType" substitutionGroup="gml:_Curve"/>
+ <!-- =========================================================== -->
+ <complexType name="LineStringType">
+ <annotation>
+ <documentation>A LineString is a special curve that consists of a single segment with linear interpolation. It is defined by two or more coordinate
+ tuples, with linear interpolation between them. It is backwards compatible with the LineString of GML 2, GM_LineString of ISO 19107 is
+ implemented by LineStringSegment.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a line string. 1. A sequence of "pos"
+ (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part
+ of this curve, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference
+ another point defined outside of this curve (reuse of existing points). 2. The "posList" element allows for a compact way to
+ specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong
+ to this curve only. The number of direct positions in the list must be at least two.</documentation>
+ </annotation>
+ <choice minOccurs="2" maxOccurs="unbounded">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility
+ with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:coord">
+ <annotation>
+ <documentation>Deprecated with GML version 3.0. Use "pos" instead. The "coord" element is included for backwards
+ compatibility with GML 2.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <!-- positions -->
+ <!-- =========================================================== -->
+ <element name="pos" type="gml:DirectPositionType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check SRS tags">
+ <sch:rule context="gml:pos">
+ <sch:extends rule="CRSLabels"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="DirectPositionType">
+ <annotation>
+ <documentation>DirectPosition instances hold the coordinates for a position within some coordinate reference system (CRS). Since
+ DirectPositions, as data types, will often be included in larger objects (such as geometry elements) that have references to CRS, the
+ "srsName" attribute will in general be missing, if this particular DirectPosition is included in a larger element with such a reference to a
+ CRS. In this case, the CRS is implicitly assumed to take on the value of the containing object's CRS.</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:doubleList">
+ <attributeGroup ref="gml:SRSReferenceGroup"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="posList" type="gml:DirectPositionListType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check SRS tags">
+ <sch:rule context="gml:posList">
+ <sch:extends rule="CRSLabels"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <appinfo>
+ <sch:pattern name="Check Dimension">
+ <sch:rule context="gml:posList">
+ <sch:extends rule="Count"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="DirectPositionListType">
+ <annotation>
+ <documentation>DirectPositionList instances hold the coordinates for a sequence of direct positions within the same coordinate
+ reference system (CRS).</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:doubleList">
+ <attributeGroup ref="gml:SRSReferenceGroup"/>
+ <attribute name="count" type="positiveInteger" use="optional">
+ <annotation>
+ <documentation>"count" allows to specify the number of direct positions in the list. If the attribute count is present then
+ the attribute srsDimension shall be present, too.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <element name="vector" type="gml:VectorType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check SRS tags">
+ <sch:rule context="gml:vector">
+ <sch:extends rule="CRSLabels"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ============================================================== -->
+ <complexType name="VectorType">
+ <annotation>
+ <documentation>Vector instances hold the compoents for a (usually spatial) vector within some coordinate reference system (CRS).
+ Since Vectors will often be included in larger objects that have references to CRS, the "srsName" attribute may be missing.
+ In this case, the CRS is implicitly assumed to take on the value of the containing object's CRS.
+
+ Note that this content model is the same as DirectPositionType, but is defined separately to reflect the distinct semantics, and to avoid validation problems. SJDC 2004-12-02</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:doubleList">
+ <attributeGroup ref="gml:SRSReferenceGroup"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <group name="geometricPositionGroup">
+ <annotation>
+ <documentation>A geometric position represented either by a DirectPosition or a Point.</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ </choice>
+ </group>
+ <!-- ============================================================== -->
+ <group name="geometricPositionListGroup">
+ <annotation>
+ <documentation>A list of geometric positions represented either by a DirectPosition or a Point.</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:posList"/>
+ <group ref="gml:geometricPositionGroup" maxOccurs="unbounded"/>
+ </choice>
+ </group>
+ <!-- ============================================================== -->
+ <element name="coordinates" type="gml:CoordinatesType">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <!-- Envelope -->
+ <!-- =========================================================== -->
+ <element name="Envelope" type="gml:EnvelopeType"/>
+ <!-- =========================================================== -->
+ <complexType name="EnvelopeType">
+ <annotation>
+ <documentation>Envelope defines an extent using a pair of positions defining opposite corners in arbitrary dimensions. The first direct
+ position is the "lower corner" (a coordinate position consisting of all the minimal ordinates for each dimension for all points within the envelope),
+ the second one the "upper corner" (a coordinate position consisting of all the maximal ordinates for each dimension for all points within the
+ envelope).</documentation>
+ </annotation>
+ <choice>
+ <sequence>
+ <element name="lowerCorner" type="gml:DirectPositionType"/>
+ <element name="upperCorner" type="gml:DirectPositionType"/>
+ </sequence>
+ <element ref="gml:coord" minOccurs="2" maxOccurs="2">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>deprecated with GML version 3.0</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:pos" minOccurs="2" maxOccurs="2">
+ <annotation>
+ <appinfo>deprecated</appinfo>
+ <documentation>Deprecated with GML version 3.1. Use the explicit properties "lowerCorner" and "upperCorner" instead.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use the explicit properties "lowerCorner" and "upperCorner" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <attributeGroup ref="gml:SRSReferenceGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <!-- The following types and elements are deprecated and should not be used ! -->
+ <element name="coord" type="gml:CoordType">
+ <annotation>
+ <documentation>Deprecated with GML 3.0 and included for backwards compatibility with GML 2. Use the "pos" element instead.</documentation>
+ </annotation>
+ </element>
+ <complexType name="CoordType">
+ <annotation>
+ <documentation>Represents a coordinate tuple in one, two, or three dimensions. Deprecated with GML 3.0 and replaced by
+ DirectPositionType.</documentation>
+ </annotation>
+ <sequence>
+ <element name="X" type="decimal"/>
+ <element name="Y" type="decimal" minOccurs="0"/>
+ <element name="Z" type="decimal" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="lineStringProperty" type="gml:LineStringPropertyType">
+ <annotation>
+ <documentation>Deprecated with GML 3.0 and included only for backwards compatibility with GML 2.0. Use "curveProperty" instead. This
+ property element either references a line string via the XLink-attributes or contains the line string element.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="LineStringPropertyType">
+ <annotation>
+ <documentation>This type is deprecated with GML 3 and shall not be used. It is included for backwards compatibility with GML 2. Use
+ CurvePropertyType instead. A property that has a line string as its value domain can either be an appropriate geometry element encapsulated
+ in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere
+ in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:LineString"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources
+ (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes.
+ The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to
+ be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+ A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by
+ including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/geometryBasic2d.xsd b/petascope/xml/ogc/gml/3.1.1/base/geometryBasic2d.xsd
new file mode 100644
index 0000000..21d46da
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/geometryBasic2d.xsd
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by Clemens Portele (interactive instruments) -->
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+ version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:geometryBasic2d:3.1.1">geometryBasic2d.xsd</appinfo>
+ <documentation>Copyright (c) 2001-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <include schemaLocation="geometryBasic0d1d.xsd"/>
+ <!-- =========================================================== -->
+ <!-- primitive geometry objects (2-dimensional) -->
+ <!-- =========================================================== -->
+ <element name="_Surface" type="gml:AbstractSurfaceType" abstract="true" substitutionGroup="gml:_GeometricPrimitive">
+ <annotation>
+ <documentation>The "_Surface" element is the abstract head of the substituition group for all (continuous) surface elements.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractSurfaceType">
+ <annotation>
+ <documentation>An abstraction of a surface to support the different levels of complexity. A surface is always a continuous region of a plane.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricPrimitiveType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="surfaceProperty" type="gml:SurfacePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:surfaceProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a surface via the XLink-attributes or contains the surface element. surfaceProperty is the predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that is substitutable for _Surface.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="SurfacePropertyType">
+ <annotation>
+ <documentation>A property that has a surface as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_Surface"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="surfaceArrayProperty" type="gml:SurfaceArrayPropertyType"/>
+ <!-- =========================================================== -->
+ <complexType name="SurfaceArrayPropertyType">
+ <annotation>
+ <documentation>A container for an array of surfaces. The elements are always contained in the array property, referencing geometry elements or arrays of geometry elements is not supported.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_Surface" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Polygon" type="gml:PolygonType" substitutionGroup="gml:_Surface"/>
+ <!-- =========================================================== -->
+ <complexType name="PolygonType">
+ <annotation>
+ <documentation>A Polygon is a special surface that is defined by a single surface patch. The boundary of this patch is coplanar and the polygon uses planar interpolation in its interior. It is backwards compatible with the Polygon of GML 2, GM_Polygon of ISO 19107 is implemented by PolygonPatch.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSurfaceType">
+ <sequence>
+ <element ref="gml:exterior" minOccurs="0"/>
+ <element ref="gml:interior" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- rings (closed curves for surface boundaries) -->
+ <!-- =========================================================== -->
+ <element name="_Ring" type="gml:AbstractRingType" abstract="true" substitutionGroup="gml:_Geometry">
+ <annotation>
+ <documentation>The "_Ring" element is the abstract head of the substituition group for all closed boundaries of a surface patch.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractRingType" abstract="true">
+ <annotation>
+ <documentation>An abstraction of a ring to support surface boundaries of different complexity.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometryType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="exterior" type="gml:AbstractRingPropertyType">
+ <annotation>
+ <documentation>A boundary of a surface consists of a number of rings. In the normal 2D case, one of these rings is distinguished as being the exterior boundary. In a general manifold this is not always possible, in which case all boundaries shall be listed as interior boundaries, and the exterior will be empty.</documentation>
+ </annotation>
+ </element>
+ <element name="interior" type="gml:AbstractRingPropertyType">
+ <annotation>
+ <documentation>A boundary of a surface consists of a number of rings. The "interior" rings seperate the surface / surface patch from the area enclosed by the rings.</documentation>
+ </annotation>
+ </element>
+ <element name="outerBoundaryIs" type="gml:AbstractRingPropertyType" substitutionGroup="gml:exterior">
+ <annotation>
+ <documentation>Deprecated with GML 3.0, included only for backwards compatibility with GML 2. Use "exterior" instead.</documentation>
+ </annotation>
+ </element>
+ <element name="innerBoundaryIs" type="gml:AbstractRingPropertyType" substitutionGroup="gml:interior">
+ <annotation>
+ <documentation>Deprecated with GML 3.0, included only for backwards compatibility with GML 2. Use "interior" instead.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractRingPropertyType">
+ <annotation>
+ <documentation>Encapsulates a ring to represent the surface boundary property of a surface.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_Ring"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="LinearRing" type="gml:LinearRingType" substitutionGroup="gml:_Ring"/>
+ <!-- =========================================================== -->
+ <complexType name="LinearRingType">
+ <annotation>
+ <documentation>A LinearRing is defined by four or more coordinate tuples, with linear interpolation between them; the first and last coordinates must be coincident.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractRingType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a linear ring.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this ring, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this ring (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this ring only. The number of direct positions in the list must be at least four.</documentation>
+ </annotation>
+ <choice minOccurs="4" maxOccurs="unbounded">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:coord" minOccurs="4" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Deprecated with GML version 3.0 and included for backwards compatibility with GML 2. Use "pos" elements instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="LinearRingPropertyType">
+ <annotation>
+ <documentation>Encapsulates a ring to represent properties in features or geometry collections.</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:LinearRing"/>
+ </choice>
+ </complexType>
+ <!-- =========================================================== -->
+ <!--
+
+ The following types and elements are deprecated and should not be used !
+
+ -->
+ <!-- =========================================================== -->
+ <element name="polygonProperty" type="gml:PolygonPropertyType">
+ <annotation>
+ <documentation>Deprecated with GML 3.0 and included only for backwards compatibility with GML 2.0. Use "surfaceProperty" instead.
+This property element either references a polygon via the XLink-attributes or contains the polygon element.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="PolygonPropertyType">
+ <annotation>
+ <documentation>This type is deprecated with GML 3 and shall not be used. It is included for backwards compatibility with GML 2. Use SurfacePropertyType instead.
+A property that has a polygon as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:Polygon"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/geometryComplexes.xsd b/petascope/xml/ogc/gml/3.1.1/base/geometryComplexes.xsd
new file mode 100644
index 0000000..825179b
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/geometryComplexes.xsd
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+ version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:geometryComplexes:v3.1.1">geometryComplexes.xsd</appinfo>
+ <documentation>Copyright (c) 2001-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <include schemaLocation="geometryAggregates.xsd"/>
+ <!-- =========================================================== -->
+ <element name="CompositeCurve" type="gml:CompositeCurveType" substitutionGroup="gml:_Curve"/>
+ <!-- =========================================================== -->
+ <complexType name="CompositeCurveType">
+ <annotation>
+ <documentation>A CompositeCurve is defined by a sequence of (orientable) curves such that the each curve in the sequence terminates at the start point of the subsequent curve in the list.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveType">
+ <sequence>
+ <element ref="gml:curveMember" maxOccurs="unbounded">
+ <annotation>
+ <documentation>This element references or contains one curve in the composite curve. The curves are contiguous, the collection of curves is ordered.
+NOTE: This definition allows for a nested structure, i.e. a CompositeCurve may use, for example, another CompositeCurve as a curve member.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <complexType name="CompositeCurvePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:CompositeCurve"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="CompositeSurface" type="gml:CompositeSurfaceType" substitutionGroup="gml:_Surface"/>
+ <!-- =========================================================== -->
+ <complexType name="CompositeSurfaceType">
+ <annotation>
+ <documentation>A CompositeSurface is defined by a set of orientable surfaces. A composite surface is geometry type with all the geometric properties of a (primitive) surface. Essentially, a composite surface is a collection of surfaces that join in pairs on common boundary curves and which, when considered as a whole, form a single surface.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSurfaceType">
+ <sequence>
+ <element ref="gml:surfaceMember" maxOccurs="unbounded">
+ <annotation>
+ <documentation>This element references or contains one surface in the composite surface. The surfaces are contiguous.
+NOTE: This definition allows for a nested structure, i.e. a CompositeSurface may use, for example, another CompositeSurface as a member.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <complexType name="CompositeSurfacePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:CompositeSurface"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="CompositeSolid" type="gml:CompositeSolidType" substitutionGroup="gml:_Solid"/>
+ <!-- =========================================================== -->
+ <complexType name="CompositeSolidType">
+ <annotation>
+ <documentation>A composite solid is a geometry type with all the geometric properties of a (primitive) solid.
+ Essentially, a composite solid is a collection of solids that join in pairs on common boundary surfaces and which, when considered as a whole, form a single solid.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSolidType">
+ <sequence>
+ <element ref="gml:solidMember" maxOccurs="unbounded">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:solidMember">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This element references or contains one solid in the composite solid. The solids are contiguous.
+NOTE: This definition allows for a nested structure, i.e. a CompositeSolid may use, for example, another CompositeSolid as a member.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ============================================================== -->
+ <complexType name="CompositeSolidPropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:CompositeSolid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- complex/composite geometry objects -->
+ <!-- =========================================================== -->
+ <element name="GeometricComplex" type="gml:GeometricComplexType" substitutionGroup="gml:_Geometry"/>
+ <!-- =========================================================== -->
+ <complexType name="GeometricComplexType">
+ <annotation>
+ <documentation>A geometric complex.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometryType">
+ <sequence>
+ <element name="element" type="gml:GeometricPrimitivePropertyType" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="GeometricComplexPropertyType">
+ <annotation>
+ <documentation>A property that has a geometric complex as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.
+NOTE: The allowed geometry elements contained in such a property (or referenced by it) have to be modelled by an XML Schema choice element since the composites inherit both from geometric complex *and* geometric primitive and are already part of the _GeometricPrimitive substitution group.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <choice>
+ <element ref="gml:GeometricComplex"/>
+ <element ref="gml:CompositeCurve"/>
+ <element ref="gml:CompositeSurface"/>
+ <element ref="gml:CompositeSolid"/>
+ </choice>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/geometryPrimitives.xsd b/petascope/xml/ogc/gml/3.1.1/base/geometryPrimitives.xsd
new file mode 100644
index 0000000..2f28c64
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/geometryPrimitives.xsd
@@ -0,0 +1,1606 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by Clemens Portele (interactive instruments) -->
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified"
+ version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:geometryPrimitives:3.1.1">geometryPrimitives.xsd</appinfo>
+ <documentation>Copyright (c) 2001-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- =========================================================== -->
+ <include schemaLocation="geometryBasic2d.xsd"/>
+ <!-- =========================================================== -->
+ <element name="Curve" type="gml:CurveType" substitutionGroup="gml:_Curve"/>
+ <!-- =========================================================== -->
+ <complexType name="CurveType">
+ <annotation>
+ <documentation>Curve is a 1-dimensional primitive. Curves are continuous, connected, and have a measurable length in terms of the coordinate system.
+ A curve is composed of one or more curve segments. Each curve segment within a curve may be defined using a different interpolation method. The curve segments are connected to one another, with the end point of each segment except the last being the start point of the next segment in the segment list.
+ The orientation of the curve is positive.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveType">
+ <sequence>
+ <element ref="gml:segments">
+ <annotation>
+ <documentation>This element encapsulates the segments of the curve.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="baseCurve" type="gml:CurvePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:baseCurve">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a curve via the XLink-attributes or contains the curve element. A curve element is any element which is substitutable for "_Curve".</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="OrientableCurve" type="gml:OrientableCurveType" substitutionGroup="gml:_Curve"/>
+ <!-- =========================================================== -->
+ <complexType name="OrientableCurveType">
+ <annotation>
+ <documentation>OrientableCurve consists of a curve and an orientation. If the orientation is "+", then the OrientableCurve is identical to the baseCurve. If the orientation is "-", then the OrientableCurve is related to another _Curve with a parameterization that reverses the sense of the curve traversal.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveType">
+ <sequence>
+ <element ref="gml:baseCurve">
+ <annotation>
+ <documentation>References or contains the base curve (positive orientation).
+NOTE: This definition allows for a nested structure, i.e. an OrientableCurve may use another OrientableCurve as its base curve.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="orientation" type="gml:SignType" default="+">
+ <annotation>
+ <documentation>If the orientation is "+", then the OrientableCurve is identical to the baseCurve. If the orientation is "-", then the OrientableCurve is related to another _Curve with a parameterization that reverses the sense of the curve traversal. "+" is the default value.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- curve segments (1-dimensional) -->
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="_CurveSegment" type="gml:AbstractCurveSegmentType" abstract="true">
+ <annotation>
+ <documentation>The "_CurveSegment" element is the abstract head of the substituition group for all curve segment elements, i.e. continuous segments of the same interpolation mechanism.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractCurveSegmentType" abstract="true">
+ <annotation>
+ <documentation>Curve segment defines a homogeneous segment of a curve.</documentation>
+ </annotation>
+ <sequence/>
+ <attribute name="numDerivativesAtStart" type="integer" use="optional" default="0">
+ <annotation>
+ <documentation>The attribute "numDerivativesAtStart" specifies the type of continuity between this curve segment and its predecessor. If this is the first curve segment in the curve, one of these values, as appropriate, is ignored. The default value of "0" means simple continuity, which is a mandatory minimum level of continuity. This level is referred to as "C 0 " in mathematical texts. A value of 1 means that the function and its first derivative are continuous at the appropriate end point: "C 1 " continuity. A value of "n" for any integer means the function and its first n derivatives are continuous: "C n " continuity.
+NOTE: Use of these values is only appropriate when the basic curve definition is an underdetermined system. For example, line string segments cannot support continuity above C 0 , since there is no spare control parameter to adjust the incoming angle at the end points of the segment. Spline functions on the other hand often have extra degrees of freedom on end segments that allow them to adjust the values of the derivatives to support C 1 or higher continuity.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="numDerivativesAtEnd" type="integer" use="optional" default="0">
+ <annotation>
+ <documentation>The attribute "numDerivativesAtEnd" specifies the type of continuity between this curve segment and its successor. If this is the last curve segment in the curve, one of these values, as appropriate, is ignored. The default value of "0" means simple continuity, which is a mandatory minimum level of continuity. This level is referred to as "C 0 " in mathematical texts. A value of 1 means that the function and its first derivative are continuous at the appropriate end point: "C 1 " continuity. A value of "n" for any integer means the function and its first n derivatives are continuous: "C n " continuity.
+NOTE: Use of these values is only appropriate when the basic curve definition is an underdetermined system. For example, line string segments cannot support continuity above C 0 , since there is no spare control parameter to adjust the incoming angle at the end points of the segment. Spline functions on the other hand often have extra degrees of freedom on end segments that allow them to adjust the values of the derivatives to support C 1 or higher continuity.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="numDerivativeInterior" type="integer" use="optional" default="0">
+ <annotation>
+ <documentation>The attribute "numDerivativesInterior" specifies the type of continuity that is guaranteed interior to the curve. The default value of "0" means simple continuity, which is a mandatory minimum level of continuity. This level is referred to as "C 0 " in mathematical texts. A value of 1 means that the function and its first derivative are continuous at the appropriate end point: "C 1 " continuity. A value of "n" for any integer means the function and its first n derivatives are continuous: "C n " continuity.
+NOTE: Use of these values is only appropriate when the basic curve definition is an underdetermined system. For example, line string segments cannot support continuity above C 0 , since there is no spare control parameter to adjust the incoming angle at the end points of the segment. Spline functions on the other hand often have extra degrees of freedom on end segments that allow them to adjust the values of the derivatives to support C 1 or higher continuity.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="segments" type="gml:CurveSegmentArrayPropertyType">
+ <annotation>
+ <documentation>This property element contains a list of curve segments. The order of the elements is significant and shall be preserved when processing the array.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="CurveSegmentArrayPropertyType">
+ <annotation>
+ <documentation>A container for an array of curve segments.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_CurveSegment" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="LineStringSegment" type="gml:LineStringSegmentType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- =========================================================== -->
+ <complexType name="LineStringSegmentType">
+ <annotation>
+ <documentation>A LineStringSegment is a curve segment that is defined by two or more coordinate tuples, with linear interpolation between them.
+ Note: LineStringSegment implements GM_LineString of ISO 19107.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve segment, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve segment only. The number of direct positions in the list must be at least two.</documentation>
+ </annotation>
+ <choice minOccurs="2" maxOccurs="unbounded">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ </sequence>
+ <attribute name="interpolation" type="gml:CurveInterpolationType" fixed="linear">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the curve interpolation mechanism used for this segment. This mechanism
+uses the control points and control parameters to determine the position of this curve segment. For a LineStringSegment the interpolation is fixed as "linear".</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="ArcString" type="gml:ArcStringType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- =========================================================== -->
+ <complexType name="ArcStringType">
+ <annotation>
+ <documentation>An ArcString is a curve segment that uses three-point circular arc interpolation.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve segment, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve segment only. The number of direct positions in the list must be at least three.</documentation>
+ </annotation>
+ <choice minOccurs="3" maxOccurs="unbounded">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ </sequence>
+ <attribute name="interpolation" type="gml:CurveInterpolationType" fixed="circularArc3Points">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the curve interpolation mechanism used for this segment. This mechanism
+uses the control points and control parameters to determine the position of this curve segment. For an ArcString the interpolation is fixed as "circularArc3Points".</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="numArc" type="integer" use="optional">
+ <annotation>
+ <documentation>The number of arcs in the arc string can be explicitly stated in this attribute. The number of control points in the arc string must be 2 * numArc + 1.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="Arc" type="gml:ArcType" substitutionGroup="gml:ArcString"/>
+ <!-- =========================================================== -->
+ <complexType name="ArcType">
+ <annotation>
+ <documentation>An Arc is an arc string with only one arc unit, i.e. three control points.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:ArcStringType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve segment, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve segment only. The number of direct positions in the list must be three.</documentation>
+ </annotation>
+ <choice minOccurs="3" maxOccurs="3">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ </sequence>
+ <attribute name="numArc" type="integer" use="optional" fixed="1">
+ <annotation>
+ <documentation>An arc is an arc string consiting of a single arc, the attribute is fixed to "1".</documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="Circle" type="gml:CircleType" substitutionGroup="gml:Arc"/>
+ <!-- =========================================================== -->
+ <complexType name="CircleType">
+ <annotation>
+ <documentation>A Circle is an arc whose ends coincide to form a simple closed loop. The "start" and "end" bearing are equal and shall be the bearing for the first controlPoint listed. The three control points must be distinct non-co-linear points for the Circle to be unambiguously defined. The arc is simply extended past the third control point until the first control point is encountered.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:ArcType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="ArcStringByBulge" type="gml:ArcStringByBulgeType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- =========================================================== -->
+ <complexType name="ArcStringByBulgeType">
+ <annotation>
+ <documentation>This variant of the arc computes the mid points of the arcs instead of storing the coordinates directly. The control point sequence consists of the start and end points of each arc plus the bulge.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve segment, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve segment only. The number of direct positions in the list must be at least two.</documentation>
+ </annotation>
+ <choice minOccurs="2" maxOccurs="unbounded">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element name="bulge" type="double" maxOccurs="unbounded">
+ <annotation>
+ <documentation>The bulge controls the offset of each arc's midpoint. The "bulge" is the real number multiplier for the normal that determines the offset direction of the midpoint of each arc. The length of the bulge sequence is exactly 1 less than the length of the control point array, since a bulge is needed for each pair of adjacent points in the control point array. The bulge is not given by a distance, since it is simply a multiplier for the normal.
+The midpoint of the resulting arc is given by: midPoint = ((startPoint + endPoint)/2.0) + bulge*normal</documentation>
+ </annotation>
+ </element>
+ <element name="normal" type="gml:VectorType" maxOccurs="unbounded">
+ <annotation>
+ <documentation>The attribute "normal" is a vector normal (perpendicular) to the chord of the arc, the line joining the first and last
+point of the arc. In a 2D coordinate system, there are only two possible directions for the normal, and it is often given as a signed real, indicating its length, with a positive sign indicating a left turn angle from the chord line, and a negative sign indicating a right turn from the chord. In 3D, the normal determines the plane of the arc, along with the start and endPoint of the arc.
+The normal is usually a unit vector, but this is not absolutely necessary. If the normal is a zero vector, the geometric object becomes equivalent to the straight line between the two end points. The length of the normal sequence is exactly the same as for the bulge sequence, 1 less than the control point sequence length.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="interpolation" type="gml:CurveInterpolationType" fixed="circularArc2PointWithBulge">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the curve interpolation mechanism used for this segment. This mechanism
+uses the control points and control parameters to determine the position of this curve segment. For an ArcStringByBulge the interpolation is fixed as "circularArc2PointWithBulge".</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="numArc" type="integer" use="optional">
+ <annotation>
+ <documentation>The number of arcs in the arc string can be explicitly stated in this attribute. The number of control points in the arc string must be numArc + 1.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="ArcByBulge" type="gml:ArcByBulgeType" substitutionGroup="gml:ArcStringByBulge"/>
+ <!-- =========================================================== -->
+ <complexType name="ArcByBulgeType">
+ <annotation>
+ <documentation>An ArcByBulge is an arc string with only one arc unit, i.e. two control points and one bulge.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:ArcStringByBulgeType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve segment, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve segment only. The number of direct positions in the list must be two.</documentation>
+ </annotation>
+ <choice minOccurs="2" maxOccurs="2">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element name="bulge" type="double">
+ <annotation>
+ <documentation>The bulge controls the offset of each arc's midpoint. The "bulge" is the real number multiplier for the normal that determines the offset direction of the midpoint of each arc. The length of the bulge sequence is exactly 1 less than the length of the control point array, since a bulge is needed for each pair of adjacent points in the control point array. The bulge is not given by a distance, since it is simply a multiplier for the normal.
+The midpoint of the resulting arc is given by: midPoint = ((startPoint + endPoint)/2.0) + bulge*normal</documentation>
+ </annotation>
+ </element>
+ <element name="normal" type="gml:VectorType">
+ <annotation>
+ <documentation>The attribute "normal" is a vector normal (perpendicular) to the chord of the arc, the line joining the first and last
+point of the arc. In a 2D coordinate system, there are only two possible directions for the normal, and it is often given as a signed real, indicating its length, with a positive sign indicating a left turn angle from the chord line, and a negative sign indicating a right turn from the chord. In 3D, the normal determines the plane of the arc, along with the start and endPoint of the arc.
+The normal is usually a unit vector, but this is not absolutely necessary. If the normal is a zero vector, the geometric object becomes equivalent to the straight line between the two end points. The length of the normal sequence is exactly the same as for the bulge sequence, 1 less than the control point sequence length.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="numArc" type="integer" use="optional" fixed="1">
+ <annotation>
+ <documentation>An arc is an arc string consiting of a single arc, the attribute is fixed to "1".</documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="ArcByCenterPoint" type="gml:ArcByCenterPointType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- =========================================================== -->
+ <complexType name="ArcByCenterPointType">
+ <annotation>
+ <documentation>This variant of the arc requires that the points on the arc have to be computed instead of storing the coordinates directly. The control point is the center point of the arc plus the radius and the bearing at start and end. This represenation can be used only in 2D.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) element. The "pos" element contains a center point that is only part of this curve segment, a "pointProperty" element contains a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element can be used to specifiy the coordinates of the center point, too. The number of direct positions in the list must be one.</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element name="radius" type="gml:LengthType">
+ <annotation>
+ <documentation>The radius of the arc.</documentation>
+ </annotation>
+ </element>
+ <element name="startAngle" type="gml:AngleType" minOccurs="0">
+ <annotation>
+ <documentation>The bearing of the arc at the start.</documentation>
+ </annotation>
+ </element>
+ <element name="endAngle" type="gml:AngleType" minOccurs="0">
+ <annotation>
+ <documentation>The bearing of the arc at the end.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="interpolation" type="gml:CurveInterpolationType" fixed="circularArcCenterPointWithRadius">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the curve interpolation mechanism used for this segment. This mechanism
+uses the control points and control parameters to determine the position of this curve segment. For an ArcByCenterPoint the interpolation is fixed as "circularArcCenterPointWithRadius".</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="numArc" type="integer" use="required" fixed="1">
+ <annotation>
+ <documentation>Since this type describes always a single arc, the attribute is fixed to "1".</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="CircleByCenterPoint" type="gml:CircleByCenterPointType" substitutionGroup="gml:ArcByCenterPoint"/>
+ <!-- =========================================================== -->
+ <complexType name="CircleByCenterPointType">
+ <annotation>
+ <documentation>A CircleByCenterPoint is an ArcByCenterPoint with identical start and end angle to form a full circle. Again, this represenation can be used only in 2D.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:ArcByCenterPointType"/>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================================ -->
+ <element name="OffsetCurve" type="gml:OffsetCurveType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- ================================================================================ -->
+ <complexType name="OffsetCurveType">
+ <annotation>
+ <documentation>An offset curve is a curve at a constant
+ distance from the basis curve. They can be useful as a cheap
+ and simple alternative to constructing curves that are offsets
+ by definition.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <sequence>
+ <element name="offsetBase" type="gml:CurvePropertyType">
+ <annotation>
+ <documentation>offsetBase is a reference to thecurve from which this
+ curve is define as an offset.</documentation>
+ </annotation>
+ </element>
+ <element name="distance" type="gml:LengthType">
+ <annotation>
+ <documentation>distance is the distance at which the
+ offset curve is generated from the basis curve. In 2D systems, positive distances
+ are to be to the left of the basis curve, and the negative distances are to be to the
+ right of the basis curve.</documentation>
+ </annotation>
+ </element>
+ <element name="refDirection" type="gml:VectorType" minOccurs="0">
+ <annotation>
+ <documentation>refDistance is used to define the vector
+ direction of the offset curve from the basis curve. It can
+ be omitted in the 2D case, where the distance can be
+ positive or negative. In that case, distance defines left
+ side (positive distance) or right side (negative distance)
+ with respect to the tangent to the basis curve.
+
+ In 3D the basis curve shall have a well defined tangent
+ direction for every point. The offset curve at any point
+ in 3D, the basis curve shall have a well-defined tangent
+ direction for every point. The offset curve at any point
+ (parameter) on the basis curve c is in the direction
+ - - - -
+ s = v x t where v = c.refDirection()
+ and
+ -
+ t = c.tangent()
+ -
+ For the offset direction to be well-defined, v shall not
+ on any point of the curve be in the same, or opposite,
+ direction as
+ -
+ t.
+
+ The default value of the refDirection shall be the local
+ co-ordinate axis vector for elevation, which indicates up for
+ the curve in a geographic sense.
+
+ NOTE! If the refDirection is the positive tangent to the
+ local elevation axis ("points upward"), then the offset
+ vector points to the left of the curve when viewed from
+ above.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ====================================================== -->
+ <element name="AffinePlacement" type="gml:AffinePlacementType"/>
+ <!-- ====================================================== -->
+ <complexType name="AffinePlacementType">
+ <annotation>
+ <documentation>A placement takes a standard geometric
+ construction and places it in geographic space. It defines a
+ transformation from a constructive parameter space to the
+ co-ordinate space of the co-ordinate reference system being used.
+ Parameter spaces in formulae in this International Standard are
+ given as (u, v) in 2D and(u, v, w) in 3D. Co-ordinate reference
+ systems positions are given in formulae, in this International
+ Standard, by either (x, y) in 2D, or (x, y, z) in 3D.
+
+ Affine placements are defined by linear transformations from
+ parameter space to the target co-ordiante space. 2-dimensional
+ Cartesian parameter space,(u,v) transforms into 3-dimensional co-
+ ordinate reference systems,(x,y,z) by using an affine
+ transformation,(u,v)->(x,y,z) which is defined :
+
+ x ux vx x0
+ u
+ y = uy vy + y0
+ v
+ x uz vz z0
+
+ Then, given this equation, the location element of the
+ AffinePlacement is the direct position (x0, y0, z0), which is the
+ target position of the origin in (u, v). The two reference
+ directions (ux, uy, uz) and (vx, vy, vz) are the target
+ directions of the unit vectors at the origin in (u, v).</documentation>
+ </annotation>
+ <sequence>
+ <element name="location" type="gml:DirectPositionType">
+ <annotation>
+ <documentation>The location property gives
+ the target of the parameter space origin. This is the vector
+ (x0, y0, z0) in the formulae above.</documentation>
+ </annotation>
+ </element>
+ <element name="refDirection" type="gml:VectorType" maxOccurs="unbounded">
+ <annotation>
+ <documentation>The attribute refDirection gives the
+target directions for the co-ordinate basis vectors of the
+parameter space. These are the columns of the matrix in the
+formulae given above. The number of directions given shall be
+inDimension. The dimension of the directions shall be
+outDimension.</documentation>
+ </annotation>
+ </element>
+ <element name="inDimension" type="positiveInteger">
+ <annotation>
+ <documentation>Dimension of the constructive parameter
+ space.</documentation>
+ </annotation>
+ </element>
+ <element name="outDimension" type="positiveInteger">
+ <annotation>
+ <documentation>Dimension of the co-ordinate space.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <!-- = global element in "_CurveSegment" substitution group ========================== -->
+ <element name="Clothoid" type="gml:ClothoidType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- ======================================================================= -->
+ <complexType name="ClothoidType">
+ <annotation>
+ <documentation>A clothoid, or Cornu's spiral, is plane
+ curve whose curvature is a fixed function of its length.
+ In suitably chosen co-ordinates it is given by Fresnel's
+ integrals.
+
+ x(t) = 0-integral-t cos(AT*T/2)dT
+
+ y(t) = 0-integral-t sin(AT*T/2)dT
+
+ This geometry is mainly used as a transition curve between
+ curves of type straight line to circular arc or circular arc
+ to circular arc. With this curve type it is possible to
+ achieve a C2-continous transition between the above mentioned
+ curve types. One formula for the Clothoid is A*A = R*t where
+ A is constant, R is the varying radius of curvature along the
+ the curve and t is the length along and given in the Fresnel
+ integrals.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <sequence>
+ <element name="refLocation">
+ <complexType>
+ <sequence>
+ <element ref="gml:AffinePlacement">
+ <annotation>
+ <documentation>The "refLocation" is an affine mapping
+ that places the curve defined by the Fresnel Integrals
+ into the co-ordinate reference system of this object.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="scaleFactor" type="decimal">
+ <annotation>
+ <documentation>The element gives the value for the
+ constant in the Fresnel's integrals.</documentation>
+ </annotation>
+ </element>
+ <element name="startParameter" type="double">
+ <annotation>
+ <documentation>The startParameter is the arc length
+ distance from the inflection point that will be the start
+ point for this curve segment. This shall be lower limit
+ used in the Fresnel integral and is the value of the
+ constructive parameter of this curve segment at its start
+ point. The startParameter can either be positive or
+ negative.
+ NOTE! If 0.0 (zero), lies between the startParameter and
+ the endParameter of the clothoid, then the curve goes
+ through the clothoid's inflection point, and the direction
+ of its radius of curvature, given by the second
+ derivative vector, changes sides with respect to the
+ tangent vector. The term length distance for the</documentation>
+ </annotation>
+ </element>
+ <element name="endParameter" type="double">
+ <annotation>
+ <documentation>The endParameter is the arc length
+ distance from the inflection point that will be the end
+ point for this curve segment. This shall be upper limit
+ used in the Fresnel integral and is the value of the
+ constructive parameter of this curve segment at its
+ start point. The startParameter can either be positive
+ or negative.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- = global element in "_CurveSegment" substitution group = -->
+ <element name="GeodesicString" type="gml:GeodesicStringType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- ======================================================== -->
+ <complexType name="GeodesicStringType">
+ <annotation>
+ <documentation>A GeodesicString consists of sequence of
+ geodesic segments. The type essentially combines a sequence of
+ Geodesic into a single object.
+ The GeodesicString is computed from two or more positions and an
+ interpolation using geodesics defined from the geoid (or
+ ellipsoid) of the co-ordinate reference system being used.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <choice>
+ <element ref="gml:posList"/>
+ <group ref="gml:geometricPositionGroup" minOccurs="2" maxOccurs="unbounded"/>
+ </choice>
+ <attribute name="interpolation" type="gml:CurveInterpolationType" fixed="geodesic">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the
+ curve interpolation mechanism used for this segment. This
+ mechanism uses the control points and control parameters to
+ determine the position of this curve segment. For an
+ GeodesicString the interpolation is fixed as "geodesic".</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- = global element in "_CurveSegment" substitution group = -->
+ <element name="Geodesic" type="gml:GeodesicType" substitutionGroup="gml:GeodesicString"/>
+ <!-- ======================================================== -->
+ <complexType name="GeodesicType">
+ <annotation>
+ <documentation>A Geodesic consists of two distinct
+ positions joined by a geodesic curve. The control points of
+ a Geodesic shall lie on the geodesic between its start
+ point and end points. Between these two points, a geodesic
+ curve defined from ellipsoid or geoid model used by the
+ co-ordinate reference systems may be used to interpolate
+ other positions. Any other point in the controlPoint array
+ must fall on this geodesic.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:GeodesicStringType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="CubicSpline" type="gml:CubicSplineType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- =========================================================== -->
+ <complexType name="CubicSplineType">
+ <annotation>
+ <documentation>Cubic splines are similar to line strings in that they are a sequence of segments each with its own defining function. A cubic spline uses the control points and a set of derivative parameters to define a piecewise 3rd degree polynomial interpolation. Unlike line-strings, the parameterization by arc length is not necessarily still a polynomial.
+ The function describing the curve must be C2, that is, have a continuous 1st and 2nd derivative at all points, and pass through the controlPoints in the order given. Between the control points, the curve segment is defined by a cubic polynomial. At each control point, the polynomial changes in such a manner that the 1st and 2nd derivative vectors are the same from either side. The control parameters record must contain vectorAtStart, and vectorAtEnd which are the unit tangent vectors at controlPoint[1] and controlPoint[n] where n = controlPoint.count.
+ Note: only the direction of the vectors is relevant, not their length.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve segment, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve segment only. The number of direct positions in the list must be at least three.</documentation>
+ </annotation>
+ <choice minOccurs="2" maxOccurs="unbounded">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element name="vectorAtStart" type="gml:VectorType">
+ <annotation>
+ <documentation>"vectorAtStart" is the unit tangent vector at the start point of the spline.</documentation>
+ </annotation>
+ </element>
+ <element name="vectorAtEnd" type="gml:VectorType">
+ <annotation>
+ <documentation>"vectorAtEnd" is the unit tangent vector at the end point of the spline.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="interpolation" type="gml:CurveInterpolationType" fixed="cubicSpline">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the curve interpolation mechanism used for this segment. This mechanism
+uses the control points and control parameters to determine the position of this curve segment. For a CubicSpline the interpolation is fixed as "cubicSpline".</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="degree" type="integer" fixed="3">
+ <annotation>
+ <documentation>The degree for a cubic spline is "3".</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="KnotType">
+ <annotation>
+ <documentation>A knot is a breakpoint on a piecewise spline curve.</documentation>
+ </annotation>
+ <sequence>
+ <element name="value" type="double">
+ <annotation>
+ <documentation>The property "value" is the value of the parameter at the knot of the spline. The sequence of knots shall be a non-decreasing sequence. That is, each knot's value in the sequence shall be equal to or greater than the previous knot's value. The use of equal consecutive knots is normally handled using the multiplicity.</documentation>
+ </annotation>
+ </element>
+ <element name="multiplicity" type="nonNegativeInteger">
+ <annotation>
+ <documentation>The property "multiplicity" is the multiplicity of this knot used in the definition of the spline (with the same weight).</documentation>
+ </annotation>
+ </element>
+ <element name="weight" type="double">
+ <annotation>
+ <documentation>The property "weight" is the value of the averaging weight used for this knot of the spline.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="KnotPropertyType">
+ <annotation>
+ <documentation>Encapsulates a knot to use it in a geometric type.</documentation>
+ </annotation>
+ <sequence>
+ <element name="Knot" type="gml:KnotType"/>
+ </sequence>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="BSpline" type="gml:BSplineType" substitutionGroup="gml:_CurveSegment"/>
+ <!-- =========================================================== -->
+ <complexType name="BSplineType">
+ <annotation>
+ <documentation>A B-Spline is a piecewise parametric polynomial or rational curve described in terms of control points and basis functions. Knots are breakpoints on the curve that connect its pieces. They are given as a non-decreasing sequence of real numbers. If the weights in the knots are equal then it is a polynomial spline. The degree is the algebraic degree of the basis functions.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractCurveSegmentType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve segment, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve segment only.</documentation>
+ </annotation>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element name="degree" type="nonNegativeInteger">
+ <annotation>
+ <documentation>The attribute "degree" shall be the degree of the polynomial used for interpolation in this spline.</documentation>
+ </annotation>
+ </element>
+ <element name="knot" type="gml:KnotPropertyType" minOccurs="2" maxOccurs="unbounded">
+ <annotation>
+ <documentation>The property "knot" shall be the sequence of distinct knots used to define the spline basis functions.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="interpolation" type="gml:CurveInterpolationType" default="polynomialSpline">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the curve interpolation mechanism used for this segment. This mechanism
+uses the control points and control parameters to determine the position of this curve segment. For a BSpline the interpolation can be either "polynomialSpline" or "rationalSpline", default is "polynomialSpline".</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="isPolynomial" type="boolean" use="optional">
+ <annotation>
+ <documentation>The attribute isPolynomial is set to true if this is a polynomial spline.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="knotType" type="gml:KnotTypesType" use="optional">
+ <annotation>
+ <documentation>The attribute "knotType" gives the type of knot distribution used in defining this spline. This is for information only
+and is set according to the different construction-functions.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========== global element in "_CurveSegment" substitution group ================ -->
+ <element name="Bezier" type="gml:BezierType" substitutionGroup="gml:BSpline"/>
+ <!-- =========================================================== -->
+ <complexType name="BezierType">
+ <annotation>
+ <documentation>Bezier curves are polynomial splines that use Bezier or Bernstein polynomials for interpolation purposes. It is a special case of the B-Spline curve with two knots.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:BSplineType">
+ <sequence>
+ <choice>
+ <annotation>
+ <documentation>GML supports two different ways to specify the control points of a curve segment.
+1. A sequence of "pos" (DirectPositionType) or "pointProperty" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve segment, "pointProperty" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve segment (reuse of existing points).
+2. The "posList" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve segment only.</documentation>
+ </annotation>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="gml:pos"/>
+ <element ref="gml:pointProperty"/>
+ <element ref="gml:pointRep">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "pointProperty" instead. Included for backwards compatibility with GML 3.0.0.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:posList"/>
+ <element ref="gml:coordinates">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0. Use "posList" instead.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element name="degree" type="nonNegativeInteger">
+ <annotation>
+ <documentation>The attribute "degree" shall be the degree of the polynomial used for interpolation in this spline.</documentation>
+ </annotation>
+ </element>
+ <element name="knot" type="gml:KnotPropertyType" minOccurs="2" maxOccurs="2">
+ <annotation>
+ <documentation>The property "knot" shall be the sequence of distinct knots used to define the spline basis functions.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="interpolation" type="gml:CurveInterpolationType" fixed="polynomialSpline">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the curve interpolation mechanism used for this segment. This mechanism
+uses the control points and control parameters to determine the position of this curve segment. For a Bezier the interpolation is fixed as "polynomialSpline".</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="isPolynomial" type="boolean" fixed="true">
+ <annotation>
+ <documentation>The attribute isPolynomial is set to true as this is a polynomial spline.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="knotType" type="gml:KnotTypesType" use="prohibited">
+ <annotation>
+ <documentation>The property "knotType" is not relevant for Bezier curve segments.</documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Surface" type="gml:SurfaceType" substitutionGroup="gml:_Surface"/>
+ <!-- =========================================================== -->
+ <complexType name="SurfaceType">
+ <annotation>
+ <documentation>A Surface is a 2-dimensional primitive and is composed of one or more surface patches. The surface patches are connected to one another.
+ The orientation of the surface is positive ("up"). The orientation of a surface chooses an "up" direction through the choice of the upward normal, which, if the surface is not a cycle, is the side of the surface from which the exterior boundary appears counterclockwise. Reversal of the surface orientation reverses the curve orientation of each boundary component, and interchanges the conceptual "up" and "down" direction of the surface. If the surface is the boundary of a solid, the "up" direction is usually outward. For closed surfaces, which have no boundary, the up direction is that of the surface patches, which must be consistent with one another. Its included surface patches describe the interior structure of the Surface.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSurfaceType">
+ <sequence>
+ <element ref="gml:patches">
+ <annotation>
+ <documentation>This element encapsulates the patches of the surface.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="baseSurface" type="gml:SurfacePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:baseSurface">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a surface via the XLink-attributes or contains the surface element. A surface element is any element which is substitutable for "_Surface".</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="OrientableSurface" type="gml:OrientableSurfaceType" substitutionGroup="gml:_Surface"/>
+ <!-- =========================================================== -->
+ <complexType name="OrientableSurfaceType">
+ <annotation>
+ <documentation>OrientableSurface consists of a surface and an orientation. If the orientation is "+", then the OrientableSurface is identical to the baseSurface. If the orientation is "-", then the OrientableSurface is a reference to a Surface with an up-normal that reverses the direction for this OrientableSurface, the sense of "the top of the surface".</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSurfaceType">
+ <sequence>
+ <element ref="gml:baseSurface">
+ <annotation>
+ <documentation>References or contains the base surface (positive orientation).</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="orientation" type="gml:SignType" default="+">
+ <annotation>
+ <documentation>If the orientation is "+", then the OrientableSurface is identical to the baseSurface. If the orientation is "-", then the OrientableSurface is a reference to a Surface with an up-normal that reverses the direction for this OrientableSurface, the sense of "the top of the surface". "+" is the default value.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- surface patches (2-dimensional) -->
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="_SurfacePatch" type="gml:AbstractSurfacePatchType" abstract="true">
+ <annotation>
+ <documentation>The "_SurfacePatch" element is the abstract head of the substituition group for all surface pach elements describing a continuous portion of a surface.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractSurfacePatchType" abstract="true">
+ <annotation>
+ <documentation>A surface patch defines a homogenuous portion of a surface.</documentation>
+ </annotation>
+ <sequence/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="patches" type="gml:SurfacePatchArrayPropertyType">
+ <annotation>
+ <documentation>This property element contains a list of surface patches. The order of the elements is significant and shall be preserved when processing the array.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="SurfacePatchArrayPropertyType">
+ <annotation>
+ <documentation>A container for an array of surface patches.</documentation>
+ </annotation>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="gml:_SurfacePatch"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="PolygonPatch" type="gml:PolygonPatchType" substitutionGroup="gml:_SurfacePatch"/>
+ <!-- =========================================================== -->
+ <complexType name="PolygonPatchType">
+ <annotation>
+ <documentation>A PolygonPatch is a surface patch that is defined by a set of boundary curves and an underlying surface to which these curves adhere. The curves are coplanar and the polygon uses planar interpolation in its interior. Implements GM_Polygon of ISO 19107.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSurfacePatchType">
+ <sequence>
+ <element ref="gml:exterior" minOccurs="0"/>
+ <element ref="gml:interior" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="interpolation" type="gml:SurfaceInterpolationType" fixed="planar">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the interpolation mechanism used for this surface patch. Currently only planar surface patches are defined in GML 3, the attribute is fixed to "planar", i.e. the interpolation method shall return points on a single plane. The boundary of the patch shall be contained within that plane.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Triangle" type="gml:TriangleType" substitutionGroup="gml:_SurfacePatch"/>
+ <!-- =========================================================== -->
+ <complexType name="TriangleType">
+ <annotation>
+ <documentation>Represents a triangle as a surface with an outer boundary consisting of a linear ring. Note that this is a polygon (subtype) with no inner boundaries. The number of points in the linear ring must be four.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSurfacePatchType">
+ <sequence>
+ <element ref="gml:exterior">
+ <annotation>
+ <documentation>Constraint: The Ring shall be a LinearRing and must form a triangle, the first and the last position must be co-incident.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="interpolation" type="gml:SurfaceInterpolationType" fixed="planar">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the interpolation mechanism used for this surface patch. Currently only planar surface patches are defined in GML 3, the attribute is fixed to "planar", i.e. the interpolation method shall return points on a single plane. The boundary of the patch shall be contained within that plane.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Rectangle" type="gml:RectangleType" substitutionGroup="gml:_SurfacePatch"/>
+ <!-- =========================================================== -->
+ <complexType name="RectangleType">
+ <annotation>
+ <documentation>Represents a rectangle as a surface with an outer boundary consisting of a linear ring. Note that this is a polygon (subtype) with no inner boundaries. The number of points in the linear ring must be five.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSurfacePatchType">
+ <sequence>
+ <element ref="gml:exterior">
+ <annotation>
+ <documentation>Constraint: The Ring shall be a LinearRing and must form a rectangle; the first and the last position must be co-incident.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="interpolation" type="gml:SurfaceInterpolationType" fixed="planar">
+ <annotation>
+ <documentation>The attribute "interpolation" specifies the interpolation mechanism used for this surface patch. Currently only planar surface patches are defined in GML 3, the attribute is fixed to "planar", i.e. the interpolation method shall return points on a single plane. The boundary of the patch shall be contained within that plane.</documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="curveMember" type="gml:CurvePropertyType">
+ <annotation>
+ <documentation>This property element either references a curve via the XLink-attributes or contains the curve element. A curve element is any element which is substitutable for "_Curve".</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="Ring" type="gml:RingType" substitutionGroup="gml:_Ring"/>
+ <!-- =========================================================== -->
+ <complexType name="RingType">
+ <annotation>
+ <documentation>A Ring is used to represent a single connected component of a surface boundary. It consists of a sequence of curves connected in a cycle (an object whose boundary is empty).
+A Ring is structurally similar to a composite curve in that the endPoint of each curve in the sequence is the startPoint of the next curve in the Sequence. Since the sequence is circular, there is no exception to this rule. Each ring, like all boundaries, is a cycle and each ring is simple.
+NOTE: Even though each Ring is simple, the boundary need not be simple. The easiest case of this is where one of the interior rings of a surface is tangent to its exterior ring.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractRingType">
+ <sequence>
+ <element ref="gml:curveMember" maxOccurs="unbounded">
+ <annotation>
+ <documentation>This element references or contains one curve in the composite curve. The curves are contiguous, the collection of curves is ordered.
+NOTE: This definition allows for a nested structure, i.e. a CompositeCurve may use, for example, another CompositeCurve as a curve member.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="RingPropertyType">
+ <annotation>
+ <documentation>Encapsulates a ring to represent properties in features or geometry collections.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:Ring"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <group name="PointGrid">
+ <annotation>
+ <documentation>Reference points which are organised
+ into sequences or grids(sequences of equal length sequences).</documentation>
+ </annotation>
+ <sequence>
+ <element name="row" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <group ref="gml:geometricPositionListGroup"/>
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </group>
+ <!-- ====================================================== -->
+ <element name="_ParametricCurveSurface" type="gml:AbstractParametricCurveSurfaceType" abstract="true" substitutionGroup="gml:_SurfacePatch"/>
+ <!-- ====================================================== -->
+ <complexType name="AbstractParametricCurveSurfaceType">
+ <annotation>
+ <documentation>
+ </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSurfacePatchType"/>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="_GriddedSurface" type="gml:AbstractGriddedSurfaceType" abstract="true" substitutionGroup="gml:_ParametricCurveSurface"/>
+ <!-- ======================================================== -->
+ <complexType name="AbstractGriddedSurfaceType">
+ <annotation>
+ <documentation>A gridded surface is a parametric curve
+ surface derived from a rectangular grid in the parameter
+ space. The rows from this grid are control points for
+ horizontal surface curves; the columns are control points
+ for vertical surface curves. The working assumption is that
+ for a pair of parametric co-ordinates (s, t) that the
+ horizontal curves for each integer offset are calculated
+ and evaluated at "s". The defines a sequence of control
+ points:
+
+ cn(s) : s 1 .....columns
+
+ From this sequence a vertical curve is calculated for "s",
+ and evaluated at "t". In most cases, the order of
+ calculation (horizontal-vertical vs. vertical-horizontal)
+ does not make a difference. Where it does, the horizontal-
+ vertical order shall be the one used.
+
+ Logically, any pair of curve interpolation types can lead
+ to a subtype of GriddedSurface. The following clauses
+ define some most commonly encountered surfaces that can
+ be represented in this manner.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractParametricCurveSurfaceType">
+ <sequence>
+ <group ref="gml:PointGrid">
+ <annotation>
+ <documentation>This is the double indexed sequence
+ of control points, given in row major form.
+ NOTE! There in no assumption made about the shape
+ of the grid.
+ For example, the positions need not effect a "21/2D"
+ surface, consecutive points may be equal in any or all
+ of the ordinates. Further, the curves in either or both
+ directions may close.</documentation>
+ </annotation>
+ </group>
+ <element name="rows" type="integer" minOccurs="0">
+ <annotation>
+ <documentation>The attribute rows gives the number
+ of rows in the parameter grid.</documentation>
+ </annotation>
+ </element>
+ <element name="columns" type="integer" minOccurs="0">
+ <annotation>
+ <documentation>The attribute columns gives the number
+ of columns in the parameter grid.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="Cone" type="gml:ConeType" substitutionGroup="gml:_GriddedSurface"/>
+ <!-- ======================================================== -->
+ <complexType name="ConeType">
+ <annotation>
+ <documentation>A cone is a gridded surface given as a
+ family of conic sections whose control points vary linearly.
+ NOTE! A 5-point ellipse with all defining positions identical
+ is a point. Thus, a truncated elliptical cone can be given as a
+ 2x5 set of control points
+ ((P1, P1, P1, P1, P1), (P2, P3, P4, P5, P6)). P1 is the apex
+ of the cone. P2, P3,P4, P5 and P6 are any five distinct points
+ around the base ellipse of the cone. If the horizontal curves
+ are circles as opposed to ellipses, the a circular cone can
+ be constructed using ((P1, P1, P1),(P2, P3, P4)). The apex most
+ not coinside with the other plane.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGriddedSurfaceType">
+ <attribute name="horizontalCurveType" type="gml:CurveInterpolationType" fixed="circularArc3Points"/>
+ <attribute name="verticalCurveType" type="gml:CurveInterpolationType" fixed="linear"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="Cylinder" type="gml:CylinderType" substitutionGroup="gml:_GriddedSurface"/>
+ <!-- ======================================================== -->
+ <complexType name="CylinderType">
+ <annotation>
+ <documentation>A cylinder is a gridded surface given as a
+ family of circles whose positions vary along a set of parallel
+ lines, keeping the cross sectional horizontal curves of a
+ constant shape.
+ NOTE! Given the same working assumptions as in the previous
+ note, a Cylinder can be given by two circles, giving us the
+ control points of the form ((P1, P2, P3),(P4, P5, P6)).</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGriddedSurfaceType">
+ <attribute name="horizontalCurveType" type="gml:CurveInterpolationType" fixed="circularArc3Points"/>
+ <attribute name="verticalCurveType" type="gml:CurveInterpolationType" fixed="linear"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="Sphere" type="gml:SphereType" substitutionGroup="gml:_GriddedSurface"/>
+ <!-- ======================================================== -->
+ <complexType name="SphereType">
+ <annotation>
+ <documentation>A sphere is a gridded surface given as a
+ family of circles whose positions vary linearly along the
+ axis of the sphere, and whise radius varies in proportions to
+ the cosine function of the central angle. The horizontal
+ circles resemble lines of constant latitude, and the vertical
+ arcs resemble lines of constant longitude.
+ NOTE! If the control points are sorted in terms of increasing
+ longitude, and increasing latitude, the upNormal of a sphere
+ is the outward normal.
+ EXAMPLE If we take a gridded set of latitudes and longitudes
+ in degrees,(u,v) such as
+
+ (-90,-180) (-90,-90) (-90,0) (-90, 90) (-90, 180)
+ (-45,-180) (-45,-90) (-45,0) (-45, 90) (-45, 180)
+ ( 0,-180) ( 0,-90) ( 0,0) ( 0, 90) ( 0, 180)
+ ( 45,-180) ( 45,-90) ( 45,0) ( 45, -90) ( 45, 180)
+ ( 90,-180) ( 90,-90) ( 90,0) ( 90, -90) ( 90, 180)
+
+ And map these points to 3D using the usual equations (where R
+ is the radius of the required sphere).
+
+ z = R sin u
+ x = (R cos u)(sin v)
+ y = (R cos u)(cos v)
+
+ We have a sphere of Radius R, centred at (0,0), as a gridded
+ surface. Notice that the entire first row and the entire last
+ row of the control points map to a single point in each 3D
+ Euclidean space, North and South poles respectively, and that
+ each horizontal curve closes back on itself forming a
+ geometric cycle. This gives us a metrically bounded (of finite
+ size), topologically unbounded (not having a boundary, a
+ cycle) surface.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGriddedSurfaceType">
+ <attribute name="horizontalCurveType" type="gml:CurveInterpolationType" fixed="circularArc3Points"/>
+ <attribute name="verticalCurveType" type="gml:CurveInterpolationType" fixed="circularArc3Points"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="PolyhedralSurface" type="gml:PolyhedralSurfaceType" substitutionGroup="gml:Surface"/>
+ <!-- ======================================================== -->
+ <complexType name="PolyhedralSurfaceType">
+ <annotation>
+ <documentation>A polyhedral surface is a surface composed
+ of polygon surfaces connected along their common boundary
+ curves. This differs from the surface type only in the
+ restriction on the types of surface patches acceptable.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:SurfaceType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:polygonPatches">
+ <annotation>
+ <documentation>This property encapsulates the patches of
+ the polyhedral surface.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="polygonPatches" type="gml:PolygonPatchArrayPropertyType" substitutionGroup="gml:patches">
+ <annotation>
+ <documentation>This property element contains a list of
+ polygon patches. The order of the patches is significant and
+ shall be preserved when processing the list.</documentation>
+ </annotation>
+ </element>
+ <!-- ======================================================== -->
+ <complexType name="PolygonPatchArrayPropertyType">
+ <annotation>
+ <documentation>This type defines a container for an array of
+ polygon patches.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:SurfacePatchArrayPropertyType">
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="gml:PolygonPatch"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="trianglePatches" type="gml:TrianglePatchArrayPropertyType" substitutionGroup="gml:patches">
+ <annotation>
+ <documentation>This property element contains a list of
+ triangle patches. The order of the patches is significant and
+ shall be preserved when processing the list.</documentation>
+ </annotation>
+ </element>
+ <!-- ======================================================== -->
+ <complexType name="TrianglePatchArrayPropertyType">
+ <annotation>
+ <documentation>This type defines a container for an array of
+ triangle patches.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:SurfacePatchArrayPropertyType">
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="gml:Triangle"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="TriangulatedSurface" type="gml:TriangulatedSurfaceType" substitutionGroup="gml:Surface"/>
+ <!-- ======================================================== -->
+ <complexType name="TriangulatedSurfaceType">
+ <annotation>
+ <documentation>A triangulated surface is a polyhedral
+ surface that is composed only of triangles. There is no
+ restriction on how the triangulation is derived.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:SurfaceType">
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ <element ref="gml:trianglePatches">
+ <annotation>
+ <documentation>This property encapsulates the patches of
+ the triangulated surface.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- ======================================================== -->
+ <element name="Tin" type="gml:TinType" substitutionGroup="gml:TriangulatedSurface"/>
+ <!-- ======================================================== -->
+ <complexType name="TinType">
+ <annotation>
+ <documentation>A tin is a triangulated surface that uses
+ the Delauny algorithm or a similar algorithm complemented with
+ consideration of breaklines, stoplines, and maximum length of
+ triangle sides. These networks satisfy the Delauny's criterion
+ away from the modifications: Fore each triangle in the
+ network, the circle passing through its vertices does not
+ contain, in its interior, the vertex of any other triangle.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:TriangulatedSurfaceType">
+ <sequence>
+ <element name="stopLines" type="gml:LineStringSegmentArrayPropertyType" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Stoplines are lines where the local
+ continuity or regularity of the surface is questionable.
+ In the area of these pathologies, triangles intersecting
+ a stopline shall be removed from the tin surface, leaving
+ holes in the surface. If coincidence occurs on surface
+ boundary triangles, the result shall be a change of the
+ surface boundary. Stoplines contains all these
+ pathological segments as a set of line strings.</documentation>
+ </annotation>
+ </element>
+ <element name="breakLines" type="gml:LineStringSegmentArrayPropertyType" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Breaklines are lines of a critical
+ nature to the shape of the surface, representing local
+ ridges, or depressions (such as drainage lines) in the
+ surface. As such their constituent segments must be
+ included in the tin eve if doing so
+ violates the Delauny criterion. Break lines contains these
+ critical segments as a set of line strings.</documentation>
+ </annotation>
+ </element>
+ <element name="maxLength" type="gml:LengthType">
+ <annotation>
+ <documentation>Areas of the surface where data is not
+ sufficiently dense to assure reasonable calculation shall be
+ removed by adding a retention criterion for triangles based
+ on the length of their sides. For many triangle sides
+ exceeding maximum length, the adjacent triangles to that
+ triangle side shall be removed from the surface.</documentation>
+ </annotation>
+ </element>
+ <element name="controlPoint">
+ <annotation>
+ <documentation>The corners of the triangles in the TIN
+ are often referred to as pots. ControlPoint shall contain a
+ set of the GM_Position used as posts for this TIN. Since each
+ TIN contains triangles, there must be at least 3 posts. The
+ order in which these points are given does not affect the
+ surface that is represented. Application schemas may add
+ information based on ordering of control points to facilitate
+ the reconstruction of the TIN from the control points.</documentation>
+ </annotation>
+ <complexType>
+ <choice>
+ <element ref="gml:posList"/>
+ <group ref="gml:geometricPositionGroup" minOccurs="3" maxOccurs="unbounded"/>
+ </choice>
+ </complexType>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="LineStringSegmentArrayPropertyType">
+ <sequence>
+ <element ref="gml:LineStringSegment" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- primitive geometry objects (3-dimensional) -->
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="_Solid" type="gml:AbstractSolidType" abstract="true" substitutionGroup="gml:_GeometricPrimitive">
+ <annotation>
+ <documentation>The "_Solid" element is the abstract head of the substituition group for all (continuous) solid elements.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractSolidType">
+ <annotation>
+ <documentation>An abstraction of a solid to support the different levels of complexity. A solid is always contiguous.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometricPrimitiveType"/>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="solidProperty" type="gml:SolidPropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:solidProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>This property element either references a solid via the XLink-attributes or contains the solid element. solidProperty is the predefined property which can be used by GML Application Schemas whenever a GML Feature has a property with a value that is substitutable for _Solid.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="SolidPropertyType">
+ <annotation>
+ <documentation>A property that has a solid as its value domain can either be an appropriate geometry element encapsulated in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_Solid"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup">
+ <annotation>
+ <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
+A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by including the gml:AssociationAttributeGroup.</documentation>
+ </annotation>
+ </attributeGroup>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="solidArrayProperty" type="gml:SolidArrayPropertyType"/>
+ <!-- =========================================================== -->
+ <complexType name="SolidArrayPropertyType">
+ <annotation>
+ <documentation>A container for an array of solids. The elements are always contained in the array property, referencing geometry elements or arrays of geometry elements is not supported.</documentation>
+ </annotation>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="gml:_Solid"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Solid" type="gml:SolidType" substitutionGroup="gml:_Solid"/>
+ <!-- =========================================================== -->
+ <complexType name="SolidType">
+ <annotation>
+ <documentation>A solid is the basis for 3-dimensional geometry. The extent of a solid is defined by the boundary surfaces (shells). A shell is represented by a composite surface, where every shell is used to represent a single connected component of the boundary of a solid. It consists of a composite surface (a list of orientable surfaces) connected in a topological cycle (an object whose boundary is empty). Unlike a Ring, a Shell's elements have no natural sort order. Like Rings, Shells are simple.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractSolidType">
+ <sequence>
+ <element name="exterior" type="gml:SurfacePropertyType" minOccurs="0">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:exterior">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>Boundaries of solids are similar to surface boundaries. In normal 3-dimensional Euclidean space, one (composite) surface is distinguished as the exterior. In the more general case, this is not always possible.</documentation>
+ </annotation>
+ </element>
+ <element name="interior" type="gml:SurfacePropertyType" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule context="gml:interior">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>Boundaries of solids are similar to surface boundaries.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- predefined simple types (enumerations, simple typed arrays) -->
+ <!-- =========================================================== -->
+ <simpleType name="CurveInterpolationType">
+ <annotation>
+ <documentation>CurveInterpolationType is a list of codes that may be used to identify the interpolation mechanisms specified by an
+application schema.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="linear"/>
+ <enumeration value="geodesic"/>
+ <enumeration value="circularArc3Points"/>
+ <enumeration value="circularArc2PointWithBulge"/>
+ <enumeration value="circularArcCenterPointWithRadius"/>
+ <enumeration value="elliptical"/>
+ <enumeration value="clothoid"/>
+ <enumeration value="conic"/>
+ <enumeration value="polynomialSpline"/>
+ <enumeration value="cubicSpline"/>
+ <enumeration value="rationalSpline"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="SurfaceInterpolationType">
+ <annotation>
+ <documentation>SurfaceInterpolationType is a list of codes that may be used to identify the interpolation mechanisms specified by an
+application schema.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="none"/>
+ <enumeration value="planar"/>
+ <enumeration value="spherical"/>
+ <enumeration value="elliptical"/>
+ <enumeration value="conic"/>
+ <enumeration value="tin"/>
+ <enumeration value="parametricCurve"/>
+ <enumeration value="polynomialSpline"/>
+ <enumeration value="rationalSpline"/>
+ <enumeration value="triangulatedSpline"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <simpleType name="KnotTypesType">
+ <annotation>
+ <documentation>Defines allowed values for the knots` type. Uniform knots implies that all knots are of multiplicity 1 and they differ by a positive constant from the preceding knot. Knots are quasi-uniform iff they are of multiplicity (degree + 1) at the ends, of multiplicity 1 elsewhere, and they differ by a positive constant from the preceding knot.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="uniform"/>
+ <enumeration value="quasiUniform"/>
+ <enumeration value="piecewiseBezier"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/gml.xsd b/petascope/xml/ogc/gml/3.1.1/base/gml.xsd
new file mode 100644
index 0000000..eaf1023
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/gml.xsd
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:gml="http://www.opengis.net/gml"
+ xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:gml:3.1.1">gml.xsd</appinfo>
+ <documentation>Top level GML schema
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ====================================================================== -->
+ <include schemaLocation="dynamicFeature.xsd"/>
+ <include schemaLocation="topology.xsd"/>
+ <include schemaLocation="coverage.xsd"/>
+ <include schemaLocation="coordinateReferenceSystems.xsd"/>
+ <include schemaLocation="observation.xsd"/>
+ <include schemaLocation="defaultStyle.xsd"/>
+ <include schemaLocation="temporalReferenceSystems.xsd"/>
+ <!-- ====================================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/gmlBase.xsd b/petascope/xml/ogc/gml/3.1.1/base/gmlBase.xsd
new file mode 100644
index 0000000..44afda4
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/gmlBase.xsd
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:gmlBase:3.1.1">
+ <sch:title>Schematron validation</sch:title>
+ <sch:ns prefix="gml" uri="http://www.opengis.net/gml"/>
+ <sch:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
+ <sch:pattern name="Check either href or content not both">
+ <sch:rule abstract="true" id="hrefOrContent">
+ <sch:report test="@xlink:href and (*|text())">Property element may not carry both a reference to an object and contain an object.</sch:report>
+ <sch:assert test="@xlink:href | (*|text())">Property element must either carry a reference to an object or contain an object.</sch:assert>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>GML base schema for GML 3
+ Components to support the GML encoding model.
+ The abstract Schematron rules can be used by any schema that includes gmlBase.
+ Copyright (c) 2001-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <include schemaLocation="basicTypes.xsd"/>
+ <import namespace="http://www.w3.org/1999/xlink" schemaLocation="../../../xlink/1.0.0/xlinks.xsd"/>
+ <!-- =========================================================== -->
+ <!-- ==================== Objects ================================ -->
+ <!-- =========================================================== -->
+ <!-- =========== Abstract "Object" is "anyType" ============= -->
+ <!-- ===== Global element at the head of the "Object" substitution group ======== -->
+ <element name="_Object" abstract="true">
+ <annotation>
+ <documentation>This abstract element is the head of a substitutionGroup hierararchy which may contain either simpleContent or complexContent elements. It is used to assert the model position of "class" elements declared in other GML schemas.</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <!-- =========== Abstract "GMLobject" supertype ========================= -->
+ <element name="_GML" type="gml:AbstractGMLType" abstract="true" substitutionGroup="gml:_Object">
+ <annotation>
+ <documentation>Global element which acts as the head of a substitution group that may include any element which is a GML feature, object, geometry or complex value</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <group name="StandardObjectProperties">
+ <annotation>
+ <documentation>This content model group makes it easier to construct types that
+ derive from AbstractGMLType and its descendents "by restriction".
+ A reference to the group saves having to enumerate the standard object properties.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:description" minOccurs="0"/>
+ <element ref="gml:name" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Multiple names may be provided. These will often be distinguished by being assigned by different authorities, as indicated by the value of the codeSpace attribute. In an instance document there will usually only be one name per authority.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </group>
+ <!-- =========================================================== -->
+ <complexType name="AbstractGMLType" abstract="true">
+ <annotation>
+ <documentation>All complexContent GML elements are directly or indirectly derived from this abstract supertype
+ to establish a hierarchy of GML types that may be distinguished from other XML types by their ancestry.
+ Elements in this hierarchy may have an ID and are thus referenceable.</documentation>
+ </annotation>
+ <sequence>
+ <group ref="gml:StandardObjectProperties"/>
+ </sequence>
+ <attribute ref="gml:id" use="optional"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========== Concrete "Collection" supertype ========================= -->
+ <element name="Bag" type="gml:BagType" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>Generic GML element to contain a heterogeneous collection of GML _Objects</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="BagType">
+ <annotation>
+ <documentation>A non-abstract generic collection type that can be used as a document element for a collection of any GML types - Geometries, Topologies, Features ...
+
+FeatureCollections may only contain Features. GeometryCollections may only contain Geometrys. Bags are less constrained they must contain objects that are substitutable for gml:_Object. This may mix several levels, including Features, Definitions, Dictionaries, Geometries etc.
+
+The content model would ideally be
+ member 0..*
+ members 0..1
+ member 0..*
+for maximum flexibility in building a collection from both homogeneous and distinct components:
+included "member" elements each contain a single Object
+an included "members" element contains a set of Objects
+
+However, this is non-deterministic, thus prohibited by XSD.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element ref="gml:member" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:members" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========== Concrete "Array" supertype ========================= -->
+ <element name="Array" type="gml:ArrayType" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation>Generic GML element to contain a homogeneous array of GML _Objects</documentation>
+ </annotation>
+ </element>
+ <!-- ======================================================================= -->
+ <complexType name="ArrayType">
+ <annotation>
+ <documentation>A non-abstract generic collection type that can be used as a document element for a homogeneous collection of any GML types - Geometries, Topologies, Features ...</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element ref="gml:members" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========== Abstract Metadata supertype ========================= -->
+ <element name="_MetaData" type="gml:AbstractMetaDataType" abstract="true" substitutionGroup="gml:_Object">
+ <annotation>
+ <documentation>Abstract element which acts as the head of a substitution group for packages of MetaData properties.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AbstractMetaDataType" abstract="true" mixed="true">
+ <annotation>
+ <documentation>An abstract base type for complex metadata types.</documentation>
+ </annotation>
+ <attribute ref="gml:id" use="optional"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========== Container for Generic Metadata ========================= -->
+ <element name="GenericMetaData" type="gml:GenericMetaDataType" substitutionGroup="gml:_MetaData">
+ <annotation>
+ <documentation>Concrete element in the _MetaData substitution group, which permits any well-formed XML content. Intended to act as a container for metadata defined in external schemas, for which it is not possible to add the concrete components to the GML _MetaData substitution group directly. Deprecated with GML version 3.1.0.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="GenericMetaDataType" mixed="true">
+ <annotation>
+ <documentation>Deprecated with GML version 3.1.0.</documentation>
+ </annotation>
+ <complexContent mixed="true">
+ <extension base="gml:AbstractMetaDataType">
+ <sequence>
+ <any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ================== Base Property Types ============================== -->
+ <!-- ================================================================== -->
+ <!-- ==== property types for unspecified association - by Value or by Reference ==== -->
+ <!-- ====== single Objects - by Value or by Reference ======== -->
+ <element name="_association" type="gml:AssociationType" abstract="true"/>
+ <!-- =========================================================== -->
+ <element name="_strictAssociation" type="gml:AssociationType" abstract="true">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:_strictAssociation">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>must carry a reference to an object or contain an object but not both</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="member" type="gml:AssociationType"/>
+ <!-- =========================================================== -->
+ <complexType name="AssociationType">
+ <annotation>
+ <documentation>A pattern or base for derived types used to specify complex types corresponding to an unspecified UML association - either composition or aggregation. Restricts the cardinality of Objects contained in the association to a maximum of one. An instance of this type can contain an element representing an Object, or serve as a pointer to a remote Object.
+
+Descendents of this type can be restricted in an application schema to
+* allow only specified classes as valid participants in the aggregation
+* allow only association by reference (i.e. empty the content model) or by value (i.e. remove the xlinks).
+
+When used for association by reference, the value of the gml:remoteSchema attribute can be used to locate a schema fragment that constrains the target instance.
+
+In many cases it is desirable to impose the constraint prohibiting the occurence of both reference and value in the same instance, as that would be ambiguous. This is accomplished by adding a directive in the annotation element of the element declaration. This directive can be in the form of normative prose, or can use a Schematron pattern to automatically constrain co-occurrence - see the declaration for _strictAssociation below.
+
+If co-occurence is not prohibited, then both a link and content may be present. If this occurs in an instance, then the rule for interpretation is that the instance found by traversing the href provides the normative value of the property, and should be used when possible. The value(s) included as content may be used if the remote instance cannot be resolved. This may be considered to be a "cached" version of the value(s).</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_Object"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="_reference" type="gml:ReferenceType" abstract="true"/>
+ <!-- =========================================================== -->
+ <complexType name="ReferenceType">
+ <annotation>
+ <documentation>A pattern or base for derived types used to specify complex types corresponding to a UML aggregation association. An instance of this type serves as a pointer to a remote Object.</documentation>
+ </annotation>
+ <sequence/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- ========= multiple objects - by Value or by Reference ================== -->
+ <element name="members" type="gml:ArrayAssociationType"/>
+ <!-- =========================================================== -->
+ <complexType name="ArrayAssociationType">
+ <annotation>
+ <documentation>A base for derived types used to specify complex types containing an array of objects, by unspecified UML association - either composition or aggregation. An instance of this type contains elements representing Objects.
+
+Ideally this type would be derived by extension of AssociationType.
+However, this leads to a non-deterministic content model, since both the base and the extension have minOccurs="0", and is thus prohibited in XML Schema.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_Object" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========== Abstract "property" supertype ========================= -->
+ <element name="metaDataProperty" type="gml:MetaDataPropertyType">
+ <annotation>
+ <documentation>Contains or refers to a metadata package that contains metadata properties.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="MetaDataPropertyType">
+ <annotation>
+ <documentation>Base type for complex metadata property types.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <any processContents="lax"/>
+ <!-- <element ref="gml:_MetaData"/> -->
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ <attribute name="about" type="anyURI" use="optional"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- ==========================================================
+ global attribute, attribute group and element declarations
+ ============================================================ -->
+ <attribute name="id" type="ID">
+ <annotation>
+ <documentation>Database handle for the object. It is of XML type ID, so is constrained to be unique in the XML document within which it occurs. An external identifier for the object in the form of a URI may be constructed using standard XML and XPointer methods. This is done by concatenating the URI for the document, a fragment separator, and the value of the id attribute.</documentation>
+ </annotation>
+ </attribute>
+ <!-- =========================================================== -->
+ <attribute name="remoteSchema" type="anyURI">
+ <annotation>
+ <documentation>Reference to an XML Schema fragment that specifies the content model of the propertys value. This is in conformance with the XML Schema Section 4.14 Referencing Schemas from Elsewhere.</documentation>
+ </annotation>
+ </attribute>
+ <!-- =========================================================== -->
+ <attributeGroup name="AssociationAttributeGroup">
+ <annotation>
+ <documentation>Attribute group used to enable property elements to refer to their value remotely. It contains the simple link components from xlinks.xsd, with all members optional, and the remoteSchema attribute, which is also optional. These attributes can be attached to any element, thus allowing it to act as a pointer. The 'remoteSchema' attribute allows an element that carries link attributes to indicate that the element is declared in a remote schema rather than by the schema that constrains the current document instance.</documentation>
+ </annotation>
+ <attributeGroup ref="xlink:simpleLink"/>
+ <attribute ref="gml:remoteSchema" use="optional"/>
+ </attributeGroup>
+ <!-- =========================================================== -->
+ <element name="name" type="gml:CodeType">
+ <annotation>
+ <documentation>Label for the object, normally a descriptive name. An object may have several names, typically assigned by different authorities. The authority for a name is indicated by the value of its (optional) codeSpace attribute. The name may or may not be unique, as determined by the rules of the organization responsible for the codeSpace.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="description" type="gml:StringOrRefType">
+ <annotation>
+ <documentation>Contains a simple text description of the object, or refers to an external description.</documentation>
+ </annotation>
+ </element>
+ <!-- ===================================================== -->
+ <complexType name="StringOrRefType">
+ <annotation>
+ <documentation>This type is available wherever there is a need for a "text" type property. It is of string type, so the text can be included inline, but the value can also be referenced remotely via xlinks from the AssociationAttributeGroup. If the remote reference is present, then the value obtained by traversing the link should be used, and the string content of the element can be used for an annotation.</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string">
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- ===================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/grids.xsd b/petascope/xml/ogc/gml/3.1.1/base/grids.xsd
new file mode 100644
index 0000000..277a47b
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/grids.xsd
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:grids:3.1.1">grids.xsd</appinfo>
+ <documentation xml:lang="en">Grid geometries
+ A subset of implicit geometries
+ Designed for use with GML Coverage schema, but maybe useful elsewhere as well.
+
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <include schemaLocation="geometryBasic0d1d.xsd"/>
+ <!-- ==============================================================
+ global elements
+ ============================================================== -->
+ <element name="_ImplicitGeometry" type="gml:AbstractGeometryType" abstract="true" substitutionGroup="gml:_Geometry"/>
+ <!-- =========================================================== -->
+ <element name="Grid" type="gml:GridType" substitutionGroup="gml:_ImplicitGeometry"/>
+ <!-- =========================================================== -->
+ <complexType name="GridType">
+ <annotation>
+ <documentation>An unrectified grid, which is a network composed of two or more sets of equally spaced parallel lines in which the members of each set intersect the members of the other sets at right angles.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGeometryType">
+ <sequence>
+ <element name="limits" type="gml:GridLimitsType"/>
+ <element name="axisName" type="string" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="dimension" type="positiveInteger" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="GridLimitsType">
+ <sequence>
+ <element name="GridEnvelope" type="gml:GridEnvelopeType"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="GridEnvelopeType">
+ <annotation>
+ <documentation>Provides grid coordinate values for the diametrically opposed corners of an envelope that bounds a section of grid. The value of a single coordinate is the number of offsets from the origin of the grid in the direction of a specific axis.</documentation>
+ </annotation>
+ <sequence>
+ <element name="low" type="gml:integerList"/>
+ <element name="high" type="gml:integerList"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="RectifiedGrid" type="gml:RectifiedGridType" substitutionGroup="gml:_ImplicitGeometry">
+ <annotation>
+ <documentation>Should be substitutionGroup="gml:Grid" but changed in order to accomplish Xerces-J schema validation</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="RectifiedGridType">
+ <annotation>
+ <documentation>A rectified grid has an origin and vectors that define its post locations.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:GridType">
+ <sequence>
+ <element name="origin" type="gml:PointPropertyType"/>
+ <element name="offsetVector" type="gml:VectorType" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/measures.xsd b/petascope/xml/ogc/gml/3.1.1/base/measures.xsd
new file mode 100644
index 0000000..6462732
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/measures.xsd
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.1.1" xml:lang="en" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-measures:3.1.1"/>
+ <documentation>Extends the units.xsd and basicTypes.xsd schemas with types for recording measures using specific types of units, especially the measures and units needed for coordinate reference systems and coordinate operations. The specific unit types encoded are length, angle, scale factor, time, area, volume, speed, and grid length. This schema allows angle values to be recorded as single numbers or in degree-minute-second format.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ Parts of this schema are based on Subclause 6.5.7 of ISO/CD 19103 Geographic information - Conceptual schema language, on Subclause A.5.2.2.3 of ISO/CD 19118 Geographic information - Encoding, and on Subclause 4.7 of OpenGIS Recommendation Paper OGC 02-007r4 Units of Measure Use and Definition Recommendations.</documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <include schemaLocation="units.xsd"/>
+ <!-- ==============================================================
+ elements and types
+ ============================================================== -->
+ <!-- This schema uses the gml:MeasureType defined in basicTypes.xsd with the modified meaning:
+ <documentation>Value of a quantity, with its units. This element uses the XML Schema primitive data type "double" because it supports both decimal and scientific notation, and thus offers flexibility and precision. However, there is no requirement to store values using any particular format, and applications receiving elements of this type may choose to coerce the data to any other type as convenient. The XML attribute uom references the units or scale by which the amount should be multiplied. For a reference within the same XML document, the abbreviated XPointer prefix "#" symbol should be used, followed by a text abbreviation of the unit name. However, the "#" symbol may be optional, and still may be interpreted as a reference. </documentation> -->
+ <!-- =========================================================== -->
+ <element name="measure" type="gml:MeasureType"/>
+ <!-- =========================================================== -->
+ <complexType name="LengthType">
+ <annotation>
+ <documentation>Value of a length (or distance) quantity, with its units. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for a length, such as metres or feet.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureType"/>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="ScaleType">
+ <annotation>
+ <documentation>Value of a scale factor (or ratio) that has no physical unit. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for a scale factor, such as percent, permil, or parts-per-million.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureType"/>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="TimeType">
+ <annotation>
+ <documentation>Value of a time or temporal quantity, with its units. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for a time value, such as seconds or weeks.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureType"/>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="GridLengthType">
+ <annotation>
+ <documentation>Value of a length (or distance) quantity in a grid, where the grid spacing does not have any associated physical units, or does not have a constant physical spacing. This grid length will often be used in a digital image grid, where the base units are likely to be pixel spacings. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for length along the axes of a grid, such as pixel spacings or grid spacings.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureType"/>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="AreaType">
+ <annotation>
+ <documentation>Value of a spatial area quantity, with its units. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for an area, such as square metres or square miles.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureType"/>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="VolumeType">
+ <annotation>
+ <documentation>Value of a spatial volume quantity, with its units. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for a volume, such as cubic metres or cubic feet.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureType"/>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="SpeedType">
+ <annotation>
+ <documentation>Value of a speed, with its units. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for a velocity, such as metres per second or miles per hour.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureType"/>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="AngleChoiceType">
+ <annotation>
+ <documentation>Value of an angle quantity provided in either degree-minute-second format or single value format.</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:angle"/>
+ <element ref="gml:dmsAngle"/>
+ </choice>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="angle" type="gml:MeasureType"/>
+ <!-- =========================================================== -->
+ <complexType name="AngleType">
+ <annotation>
+ <documentation>Value of an angle quantity recorded as a single number, with its units. Uses the MeasureType with the restriction that the unit of measure referenced by uom must be suitable for an angle, such as degrees or radians.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureType"/>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="dmsAngle" type="gml:DMSAngleType"/>
+ <!-- =========================================================== -->
+ <complexType name="DMSAngleType">
+ <annotation>
+ <documentation>Angle value provided in degree-minute-second or degree-minute format.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:degrees"/>
+ <choice minOccurs="0">
+ <element ref="gml:decimalMinutes"/>
+ <sequence>
+ <element ref="gml:minutes"/>
+ <element ref="gml:seconds" minOccurs="0"/>
+ </sequence>
+ </choice>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="degrees" type="gml:DegreesType"/>
+ <!-- =========================================================== -->
+ <complexType name="DegreesType">
+ <annotation>
+ <documentation>Integer number of degrees, plus the angle direction. This element can be used for geographic Latitude and Longitude. For Latitude, the XML attribute direction can take the values "N" or "S", meaning North or South of the equator. For Longitude, direction can take the values "E" or "W", meaning East or West of the prime meridian. This element can also be used for other angles. In that case, the direction can take the values "+" or "-" (of SignType), in the specified rotational direction from a specified reference direction.</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:DegreeValueType">
+ <attribute name="direction">
+ <simpleType>
+ <union>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="N"/>
+ <enumeration value="E"/>
+ <enumeration value="S"/>
+ <enumeration value="W"/>
+ </restriction>
+ </simpleType>
+ <simpleType>
+ <restriction base="gml:SignType"/>
+ </simpleType>
+ </union>
+ </simpleType>
+ </attribute>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <simpleType name="DegreeValueType">
+ <annotation>
+ <documentation>Integer number of degrees in a degree-minute-second or degree-minute angular value, without indication of direction.</documentation>
+ </annotation>
+ <restriction base="nonNegativeInteger">
+ <maxInclusive value="359"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="decimalMinutes" type="gml:DecimalMinutesType"/>
+ <!-- =========================================================== -->
+ <simpleType name="DecimalMinutesType">
+ <annotation>
+ <documentation>Decimal number of arc-minutes in a degree-minute angular value.</documentation>
+ </annotation>
+ <restriction base="decimal">
+ <minInclusive value="0.00"/>
+ <maxExclusive value="60.00"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="minutes" type="gml:ArcMinutesType"/>
+ <!-- =========================================================== -->
+ <simpleType name="ArcMinutesType">
+ <annotation>
+ <documentation>Integer number of arc-minutes in a degree-minute-second angular value.</documentation>
+ </annotation>
+ <restriction base="nonNegativeInteger">
+ <maxInclusive value="59"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <element name="seconds" type="gml:ArcSecondsType"/>
+ <!-- =========================================================== -->
+ <simpleType name="ArcSecondsType">
+ <annotation>
+ <documentation>Number of arc-seconds in a degree-minute-second angular value.</documentation>
+ </annotation>
+ <restriction base="decimal">
+ <minInclusive value="0.00"/>
+ <maxExclusive value="60.00"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/observation.xsd b/petascope/xml/ogc/gml/3.1.1/base/observation.xsd
new file mode 100644
index 0000000..10e1c7b
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/observation.xsd
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:observation:3.1.1">observation.xsd</appinfo>
+ <documentation>Observation schema for GML 3.1
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- =================================================================== -->
+ <!-- === includes and imports ============================================ -->
+ <include schemaLocation="feature.xsd"/>
+ <include schemaLocation="direction.xsd"/>
+ <include schemaLocation="valueObjects.xsd"/>
+ <!-- =================================================================== -->
+ <!-- =================== properties =================================== -->
+ <element name="using" type="gml:FeaturePropertyType">
+ <annotation>
+ <documentation>This element contains or points to a description of a sensor, instrument or procedure used for the observation</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================================== -->
+ <element name="target" type="gml:TargetPropertyType">
+ <annotation>
+ <documentation>This element contains or points to the specimen, region or station which is the object of the observation</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================================== -->
+ <element name="subject" type="gml:TargetPropertyType" substitutionGroup="gml:target">
+ <annotation>
+ <documentation>Synonym for target - common word used for photographs</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================================== -->
+ <complexType name="TargetPropertyType">
+ <annotation>
+ <documentation>Container for an object representing the target or subject of an observation.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <choice>
+ <element ref="gml:_Feature"/>
+ <element ref="gml:_Geometry"/>
+ </choice>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================================== -->
+ <element name="resultOf" type="gml:AssociationType">
+ <annotation>
+ <documentation>The result of the observation: an image, external object, etc</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================================== -->
+ <!-- ===================== Features =========================== -->
+ <element name="Observation" type="gml:ObservationType" substitutionGroup="gml:_Feature"/>
+ <!-- =========================================================== -->
+ <complexType name="ObservationType">
+ <complexContent>
+ <extension base="gml:AbstractFeatureType">
+ <sequence>
+ <element ref="gml:validTime"/>
+ <element ref="gml:using" minOccurs="0"/>
+ <element ref="gml:target" minOccurs="0"/>
+ <element ref="gml:resultOf"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="DirectedObservation" type="gml:DirectedObservationType" substitutionGroup="gml:Observation"/>
+ <!-- =========================================================== -->
+ <complexType name="DirectedObservationType">
+ <complexContent>
+ <extension base="gml:ObservationType">
+ <sequence>
+ <element ref="gml:direction"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="DirectedObservationAtDistance" type="gml:DirectedObservationAtDistanceType" substitutionGroup="gml:DirectedObservation"/>
+ <!-- =========================================================== -->
+ <complexType name="DirectedObservationAtDistanceType">
+ <complexContent>
+ <extension base="gml:DirectedObservationType">
+ <sequence>
+ <element name="distance" type="gml:MeasureType"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/referenceSystems.xsd b/petascope/xml/ogc/gml/3.1.1/base/referenceSystems.xsd
new file mode 100644
index 0000000..5235f3d
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/referenceSystems.xsd
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1" xml:lang="en">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:referenceSystems:3.1.1"/>
+ <documentation>How to encode reference system definitions. Builds on several other parts of GML 3 to encode the data needed to define reference systems.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved. For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ This schema encodes the Reference System (RS_) package of the extended UML Model for OGC Abstract Specification Topic 2: Spatial Referencing by Coordinates. That UML model is adapted from ISO 19111 - Spatial referencing by coordinates, as described in Annex C of Topic 2. The SC_CRS class is also encoded here, to eliminate the (circular) references from coordinateOperations.xsd to coordinateReferenceSystems.xsd. The RS_SpatialReferenceSystemUsingGeographicIdentifier class is not encoded, since it is not applicable to coordinate positions. The CI_Citation class is not directly encoded, since such information can be included as metaDataProperty elements which are optionally allowed. A modified version of the EX_Extent (DataType) class from ISO 19115 is currently encoded here, using GML 3 schema types. (A more extensive version of the EX_Extent package might be XML encoded in the future, probably in a separate extent.xsd schema.)
+ Caution: The CRS package in GML 3.1 and GML 3.1.1 is preliminary, and is expected to undergo some modifications that are not backward compatible during the development of GML 3.2 (ISO 19136). The GML 3.2 package will implement the model described in the revised version of ISO 19111.</documentation>
+ </annotation>
+ <!-- ======================================================
+ includes and imports
+ ====================================================== -->
+ <include schemaLocation="geometryBasic2d.xsd"/>
+ <include schemaLocation="temporal.xsd"/>
+ <!-- ======================================================
+ elements and types
+ ====================================================== -->
+ <element name="_ReferenceSystem" type="gml:AbstractReferenceSystemType" abstract="true" substitutionGroup="gml:Definition"/>
+ <!-- =================================================== -->
+ <complexType name="AbstractReferenceSystemBaseType" abstract="true">
+ <annotation>
+ <documentation>Basic encoding for reference system objects, simplifying and restricting the DefinitionType as needed.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:srsName"/>
+ </sequence>
+ <attribute ref="gml:id" use="required"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="srsName" type="gml:CodeType" substitutionGroup="gml:name">
+ <annotation>
+ <documentation>The name by which this reference system is identified.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="AbstractReferenceSystemType" abstract="true">
+ <annotation>
+ <documentation>Description of a spatial and/or temporal reference system used by a dataset.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractReferenceSystemBaseType">
+ <sequence>
+ <element ref="gml:srsID" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Set of alterative identifications of this reference system. The first srsID, if any, is normally the primary identification code, and any others are aliases.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Comments on or information about this reference system, including source information.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:validArea" minOccurs="0"/>
+ <element ref="gml:scope" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="srsID" type="gml:IdentifierType">
+ <annotation>
+ <documentation>An identification of a reference system.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="referenceSystemRef" type="gml:ReferenceSystemRefType"/>
+ <!-- =================================================== -->
+ <complexType name="ReferenceSystemRefType">
+ <annotation>
+ <documentation>Association to a reference system, either referencing or containing the definition of that reference system.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_ReferenceSystem"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="_CRS" type="gml:AbstractReferenceSystemType" abstract="true" substitutionGroup="gml:_ReferenceSystem">
+ <annotation>
+ <documentation>Abstract coordinate reference system, usually defined by a coordinate system and a datum. This abstract complexType shall not be used, extended, or restricted, in an Application Schema, to define a concrete subtype with a meaning equivalent to a concrete subtype specified in this document.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="crsRef" type="gml:CRSRefType"/>
+ <!-- =================================================== -->
+ <complexType name="CRSRefType">
+ <annotation>
+ <documentation>Association to a CRS abstract coordinate reference system, either referencing or containing the definition of that CRS.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_CRS"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =================================================== -->
+ <!-- =================================================== -->
+ <complexType name="IdentifierType">
+ <annotation>
+ <documentation>An identification of a CRS object. The first use of the IdentifierType for an object, if any, is normally the primary identification code, and any others are aliases.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:name">
+ <annotation>
+ <documentation>The code or name for this Identifier, often from a controlled list or pattern defined by a code space. The optional codeSpace attribute is normally included to identify or reference a code space within which one or more codes are defined. This code space is often defined by some authority organization, where one organization may define multiple code spaces. The range and format of each Code Space identifier is defined by that code space authority. Information about that code space authority can be included as metaDataProperty elements which are optionally allowed in all CRS objects.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:version" minOccurs="0"/>
+ <element ref="gml:remarks" minOccurs="0">
+ <annotation>
+ <documentation>Remarks about this code or alias.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="version" type="string">
+ <annotation>
+ <documentation>Identifier of the version of the associated codeSpace or code, as specified by the codeSpace or code authority. This version is included only when the "code" or "codeSpace" uses versions. When appropriate, the version is identified by the effective date, coded using ISO 8601 date format.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="remarks" type="gml:StringOrRefType">
+ <annotation>
+ <documentation>Information about this object or code. Contains text or refers to external text.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="scope" type="string">
+ <annotation>
+ <documentation>Description of domain of usage, or limitations of usage, for which this CRS object is valid.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="validArea" type="gml:ExtentType">
+ <annotation>
+ <documentation>Area or region in which this CRS object is valid.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <complexType name="ExtentType">
+ <annotation>
+ <documentation>Information about the spatial, vertical, and/or temporal extent of a reference system object. Constraints: At least one of the elements "description", "boundingBox", "boundingPolygon", "verticalExtent", and temporalExtent" must be included, but more that one can be included when appropriate. Furthermore, more than one "boundingBox", "boundingPolygon", "verticalExtent", and/or temporalExtent" element can be included, with more than one meaning the union of the individual domains.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:description" minOccurs="0">
+ <annotation>
+ <documentation>Description of spatial and/or temporal extent of this object.</documentation>
+ </annotation>
+ </element>
+ <choice>
+ <annotation>
+ <documentation>Geographic domain of this reference system object.</documentation>
+ </annotation>
+ <element ref="gml:boundingBox" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of bounding boxes (or envelopes) whose union describes the spatial domain of this object.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:boundingPolygon" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of bounding polygons whose union describes the spatial domain of this object.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ <element ref="gml:verticalExtent" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of vertical intervals whose union describes the spatial domain of this object.</documentation>
+ </annotation>
+ </element>
+ <element ref="gml:temporalExtent" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Unordered list of time periods whose union describes the spatial domain of this object.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <!-- =================================================== -->
+ <element name="boundingBox" type="gml:EnvelopeType">
+ <annotation>
+ <documentation>A bounding box (or envelope) defining the spatial domain of this object.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="boundingPolygon" type="gml:PolygonType">
+ <annotation>
+ <documentation>A bounding polygon defining the horizontal spatial domain of this object.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="verticalExtent" type="gml:EnvelopeType">
+ <annotation>
+ <documentation>An interval defining the vertical spatial domain of this object.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+ <element name="temporalExtent" type="gml:TimePeriodType">
+ <annotation>
+ <documentation>A time period defining the temporal domain of this object.</documentation>
+ </annotation>
+ </element>
+ <!-- =================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/temporal.xsd b/petascope/xml/ogc/gml/3.1.1/base/temporal.xsd
new file mode 100644
index 0000000..d60b80b
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/temporal.xsd
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:temporal:3.1.1"/>
+ <documentation xml:lang="en">The temporal schema for GML 3.1 provides constructs for handling time-varying spatial data.
+ This schema reflects a partial implementation of the model described in ISO 19108:2002.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ================================================================== -->
+ <include schemaLocation="gmlBase.xsd"/>
+ <!-- ================================================================== -->
+ <!-- ==== Time Object ===== -->
+ <!-- ================================================================== -->
+ <element name="_TimeObject" type="gml:AbstractTimeObjectType" abstract="true" substitutionGroup="gml:_GML">
+ <annotation>
+ <documentation xml:lang="en">This abstract element acts as the head of the substitution group for temporal primitives and complexes.</documentation>
+ </annotation>
+ </element>
+ <!-- ===================================== -->
+ <complexType name="AbstractTimeObjectType" abstract="true">
+ <annotation>
+ <documentation xml:lang="en">The abstract supertype for temporal objects.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType"/>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ==== Time Primitive ===== -->
+ <!-- ================================================================== -->
+ <element name="_TimePrimitive" type="gml:AbstractTimePrimitiveType" abstract="true" substitutionGroup="gml:_TimeObject">
+ <annotation>
+ <documentation xml:lang="en">This abstract element acts as the head of the substitution group for temporal primitives.</documentation>
+ </annotation>
+ </element>
+ <!-- ===================================== -->
+ <complexType name="AbstractTimePrimitiveType" abstract="true">
+ <annotation>
+ <documentation xml:lang="en">The abstract supertype for temporal primitives.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeObjectType">
+ <sequence>
+ <element name="relatedTime" type="gml:RelatedTimeType" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimePrimitivePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:_TimePrimitive"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="RelatedTimeType">
+ <complexContent>
+ <extension base="gml:TimePrimitivePropertyType">
+ <attribute name="relativePosition">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="Before"/>
+ <enumeration value="After"/>
+ <enumeration value="Begins"/>
+ <enumeration value="Ends"/>
+ <enumeration value="During"/>
+ <enumeration value="Equals"/>
+ <enumeration value="Contains"/>
+ <enumeration value="Overlaps"/>
+ <enumeration value="Meets"/>
+ <enumeration value="OverlappedBy"/>
+ <enumeration value="MetBy"/>
+ <enumeration value="BegunBy"/>
+ <enumeration value="EndedBy"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ==== Time Complex ===== -->
+ <!-- ================================================================== -->
+ <element name="_TimeComplex" type="gml:AbstractTimeComplexType" abstract="true" substitutionGroup="gml:_TimeObject">
+ <annotation>
+ <documentation xml:lang="en">This abstract element acts as the head of the substitution group for temporal complexes.
+ Temporal complex is an aggregation of temporal primitives as its components,
+ represents a temporal geometric complex and a temporal topology complex.
+ N.B. Temporal geometric complex is not defined in this schema.</documentation>
+ </annotation>
+ </element>
+ <!-- ================================================================== -->
+ <complexType name="AbstractTimeComplexType" abstract="true">
+ <annotation>
+ <documentation xml:lang="en">The abstract supertype for temporal complexes.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeObjectType"/>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ==== Time Geometric Primitive ===== -->
+ <!-- ================================================================== -->
+ <element name="_TimeGeometricPrimitive" type="gml:AbstractTimeGeometricPrimitiveType" abstract="true" substitutionGroup="gml:_TimePrimitive">
+ <annotation>
+ <documentation xml:lang="en">This abstract element acts as the head of the substitution group for temporal geometric primitives.</documentation>
+ </annotation>
+ </element>
+ <!-- ===================================== -->
+ <complexType name="AbstractTimeGeometricPrimitiveType" abstract="true">
+ <annotation>
+ <documentation xml:lang="en">The abstract supertype for temporal geometric primitives.
+ A temporal geometry must be associated with a temporal reference system via URI.
+ The Gregorian calendar with UTC is the default reference system, following ISO
+ 8601. Other reference systems in common use include the GPS calendar and the
+ Julian calendar.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimePrimitiveType">
+ <attribute name="frame" type="anyURI" use="optional" default="#ISO-8601"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeGeometricPrimitivePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:_TimeGeometricPrimitive"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ==== Time Instant ===== -->
+ <!-- ================================================================== -->
+ <element name="TimeInstant" type="gml:TimeInstantType" substitutionGroup="gml:_TimeGeometricPrimitive"/>
+ <!-- ===================================== -->
+ <complexType name="TimeInstantType">
+ <annotation>
+ <documentation>Omit back-pointers begunBy, endedBy.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeGeometricPrimitiveType">
+ <sequence>
+ <element ref="gml:timePosition"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeInstantPropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:TimeInstant"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ==== Time Period ===== -->
+ <!-- ================================================================== -->
+ <element name="TimePeriod" type="gml:TimePeriodType" substitutionGroup="gml:_TimeGeometricPrimitive"/>
+ <!-- ===================================== -->
+ <complexType name="TimePeriodType">
+ <complexContent>
+ <extension base="gml:AbstractTimeGeometricPrimitiveType">
+ <sequence>
+ <choice>
+ <element name="beginPosition" type="gml:TimePositionType"/>
+ <element name="begin" type="gml:TimeInstantPropertyType"/>
+ </choice>
+ <choice>
+ <element name="endPosition" type="gml:TimePositionType"/>
+ <element name="end" type="gml:TimeInstantPropertyType"/>
+ </choice>
+ <group ref="gml:timeLength" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimePeriodPropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:TimePeriod"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ==== duration & interval ===== -->
+ <!-- ================================================================== -->
+ <group name="timeLength">
+ <annotation>
+ <documentation>This model group is provided as an alternative to the abstract susbstitutionGroup head _timeLength.
+ ISO 19136 comment 411</documentation>
+ </annotation>
+ <choice>
+ <element ref="gml:duration"/>
+ <element ref="gml:timeInterval"/>
+ </choice>
+ </group>
+ <!-- ================================================================== -->
+ <element name="duration" type="duration">
+ <annotation>
+ <documentation xml:lang="en">This element is an instance of the primitive xsd:duration simple type to
+ enable use of the ISO 8601 syntax for temporal length (e.g. P5DT4H30M).
+ It is a valid subtype of TimeDurationType according to section 3.14.6,
+ rule 2.2.4 in XML Schema, Part 1.</documentation>
+ </annotation>
+ </element>
+ <!-- ================================================================== -->
+ <element name="timeInterval" type="gml:TimeIntervalLengthType">
+ <annotation>
+ <documentation>This element is a valid subtype of TimeDurationType
+ according to section 3.14.6, rule 2.2.4 in XML Schema, Part 1.</documentation>
+ </annotation>
+ </element>
+ <!-- ===================================== -->
+ <complexType name="TimeIntervalLengthType" final="#all">
+ <annotation>
+ <documentation xml:lang="en">This type extends the built-in xsd:decimal simple type to allow floating-point
+ values for temporal length. According to the ISO 11404 model you have to use
+ positiveInteger together with appropriate values for radix and factor. The
+ resolution of the time interval is to one radix ^(-factor) of the specified
+ time unit (e.g. unit="second", radix="10", factor="3" specifies a resolution
+ of milliseconds). It is a subtype of TimeDurationType.</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="decimal">
+ <attribute name="unit" type="gml:TimeUnitType" use="required"/>
+ <attribute name="radix" type="positiveInteger" use="optional"/>
+ <attribute name="factor" type="integer" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <simpleType name="TimeUnitType">
+ <annotation>
+ <documentation xml:lang="en">Standard units for measuring time intervals (see ISO 31-1).</documentation>
+ </annotation>
+ <union>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="year"/>
+ <enumeration value="day"/>
+ <enumeration value="hour"/>
+ <enumeration value="minute"/>
+ <enumeration value="second"/>
+ </restriction>
+ </simpleType>
+ <simpleType>
+ <restriction base="string">
+ <pattern value="other:\w{2,}"/>
+ </restriction>
+ </simpleType>
+ </union>
+ </simpleType>
+ <!-- ================================================================== -->
+ <!-- ==== Time Position ===== -->
+ <!-- ================================================================== -->
+ <element name="timePosition" type="gml:TimePositionType">
+ <annotation>
+ <documentation>Direct representation of a temporal position</documentation>
+ </annotation>
+ </element>
+ <!-- ================================================================== -->
+ <complexType name="TimePositionType" final="#all">
+ <annotation>
+ <documentation xml:lang="en">Direct representation of a temporal position.
+ Indeterminate time values are also allowed, as described in ISO 19108. The indeterminatePosition
+ attribute can be used alone or it can qualify a specific value for temporal position (e.g. before
+ 2002-12, after 1019624400).
+ For time values that identify position within a calendar, the calendarEraName attribute provides
+ the name of the calendar era to which the date is referenced (e.g. the Meiji era of the Japanese calendar).</documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="gml:TimePositionUnion">
+ <attribute name="frame" type="anyURI" use="optional" default="#ISO-8601"/>
+ <attribute name="calendarEraName" type="string" use="optional"/>
+ <attribute name="indeterminatePosition" type="gml:TimeIndeterminateValueType" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <simpleType name="TimePositionUnion">
+ <annotation>
+ <documentation xml:lang="en">The ISO 19108:2002 hierarchy of subtypes for temporal position are collapsed
+ by defining a union of XML Schema simple types for indicating temporal position relative
+ to a specific reference system.
+
+ Dates and dateTime may be indicated with varying degrees of precision.
+ dateTime by itself does not allow right-truncation, except for fractions of seconds.
+ When used with non-Gregorian calendars based on years, months, days,
+ the same lexical representation should still be used, with leading zeros added if the
+ year value would otherwise have fewer than four digits.
+
+ An ordinal position may be referenced via URI identifying the definition of an ordinal era.
+
+ A time coordinate value is indicated as a decimal (e.g. UNIX time, GPS calendar).</documentation>
+ </annotation>
+ <union memberTypes="gml:CalDate time dateTime anyURI decimal"/>
+ </simpleType>
+ <!-- ================================================================== -->
+ <simpleType name="CalDate">
+ <annotation>
+ <documentation xml:lang="en">Calendar dates may be indicated with varying degrees of precision,
+ using year, year-month, date.
+ When used with non-Gregorian calendars based on years, months, days,
+ the same lexical representation should still be used, with leading zeros added if the
+ year value would otherwise have fewer than four digits.
+ time is used for a position that recurs daily (see clause 5.4.4.2 of ISO 19108:2002).</documentation>
+ </annotation>
+ <union memberTypes="date gYearMonth gYear"/>
+ </simpleType>
+ <!-- ================================================================== -->
+ <simpleType name="TimeIndeterminateValueType">
+ <annotation>
+ <documentation xml:lang="en">This enumerated data type specifies values for indeterminate positions.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="after"/>
+ <enumeration value="before"/>
+ <enumeration value="now"/>
+ <enumeration value="unknown"/>
+ </restriction>
+ </simpleType>
+ <!-- ================================================================== -->
+ <!-- ==== Convenience properties ==== -->
+ <!-- ================================================================== -->
+ <element name="validTime" type="gml:TimePrimitivePropertyType"/>
+ <!-- ===================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/temporalReferenceSystems.xsd b/petascope/xml/ogc/gml/3.1.1/base/temporalReferenceSystems.xsd
new file mode 100644
index 0000000..c4793f3
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/temporalReferenceSystems.xsd
@@ -0,0 +1,248 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:temporalReferenceSystems:3.1.1"/>
+ <documentation xml:lang="en">The Temporal Reference Systems schema for GML 3.1 provides constructs for handling various styles of temporal reference system.
+ This schema reflects a partial implementation of the model described in ISO 19108:2002.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ================================================================== -->
+ <include schemaLocation="temporalTopology.xsd"/>
+ <include schemaLocation="dictionary.xsd"/>
+ <!-- ================================================================== -->
+ <!-- == Time Reference System == -->
+ <!-- ================================================================== -->
+ <element name="_TimeReferenceSystem" type="gml:AbstractTimeReferenceSystemType" abstract="true" substitutionGroup="gml:Definition">
+ <annotation>
+ <documentation>Abstract element serves primarily as the head of a substitution group for temporal reference systems.</documentation>
+ </annotation>
+ </element>
+ <!-- ===================================== -->
+ <complexType name="AbstractTimeReferenceSystemType" abstract="true">
+ <annotation>
+ <documentation xml:lang="en">A value in the time domain is measured relative to a temporal reference system. Common
+ types of reference systems include calendars, ordinal temporal reference systems, and
+ temporal coordinate systems (time elapsed since some epoch, e.g. UNIX time).</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:DefinitionType">
+ <sequence>
+ <element name="domainOfValidity" type="string" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- == Time Coordinate System == -->
+ <!-- ================================================================== -->
+ <element name="TimeCoordinateSystem" type="gml:TimeCoordinateSystemType" substitutionGroup="gml:_TimeReferenceSystem"/>
+ <!-- ===================================== -->
+ <complexType name="TimeCoordinateSystemType">
+ <annotation>
+ <documentation xml:lang="en">A temporal coordinate system is based on a continuous interval scale defined in terms of a single time interval.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeReferenceSystemType">
+ <sequence>
+ <choice>
+ <element name="originPosition" type="gml:TimePositionType"/>
+ <element name="origin" type="gml:TimeInstantPropertyType"/>
+ </choice>
+ <element name="interval" type="gml:TimeIntervalLengthType"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- == Time Ordinal System == -->
+ <!-- ================================================================== -->
+ <element name="TimeOrdinalReferenceSystem" type="gml:TimeOrdinalReferenceSystemType" substitutionGroup="gml:_TimeReferenceSystem"/>
+ <!-- ===================================== -->
+ <complexType name="TimeOrdinalReferenceSystemType">
+ <annotation>
+ <documentation xml:lang="en">In an ordinal reference system the order of events in time can be well
+ established, but the magnitude of the intervals between them can not be
+ accurately determined (e.g. a stratigraphic sequence).</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeReferenceSystemType">
+ <sequence>
+ <element name="component" type="gml:TimeOrdinalEraPropertyType" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <element name="TimeOrdinalEra" type="gml:TimeOrdinalEraType"/>
+ <!-- ===================================== -->
+ <complexType name="TimeOrdinalEraType">
+ <annotation>
+ <documentation xml:lang="en">Ordinal temporal reference systems are often hierarchically structured
+ such that an ordinal era at a given level of the hierarchy includes a
+ sequence of shorter, coterminous ordinal eras. This captured using the member/group properties.
+
+ Note that in this schema, TIme Ordinal Era is patterned on TimeEdge, which is a variation from ISO 19108.
+ This is in order to fulfill the requirements of ordinal reference systems based on eras delimited by
+ named points or nodes, which are common in geology, archeology, etc.
+
+ This change is subject of a change proposal to ISO</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:DefinitionType">
+ <sequence>
+ <element name="relatedTime" type="gml:RelatedTimeType" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="start" type="gml:TimeNodePropertyType"/>
+ <element name="end" type="gml:TimeNodePropertyType"/>
+ <element name="extent" type="gml:TimePeriodPropertyType" minOccurs="0"/>
+ <element name="member" type="gml:TimeOrdinalEraPropertyType" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>An Era may be composed of several member Eras. The "member" element implements the association to the Era at the next level down the hierarchy. "member" follows the standard GML property pattern whereby its (complex) value may be either described fully inline, or may be the target of a link carried on the member element and described fully elsewhere, either in the same document or from another service.</documentation>
+ </annotation>
+ </element>
+ <element name="group" type="gml:ReferenceType" minOccurs="0">
+ <annotation>
+ <documentation>In a particular Time System, an Era may be a member of a group. The "group" element implements the back-pointer to the Era at the next level up in the hierarchy.
+
+If the hierarchy is represented by describing the nested components fully in the their nested position inside "member" elements, then the parent can be easily inferred, so the group property is unnecessary.
+
+However, if the hierarchy is represented by links carried on the "member" property elements, pointing to Eras described fully elsewhere, then it may be useful for a child (member) era to carry an explicit pointer back to its parent (group) Era.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeOrdinalEraPropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:TimeOrdinalEra"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- == Calendar == -->
+ <!-- ================================================================== -->
+ <element name="TimeCalendar" type="gml:TimeCalendarType" substitutionGroup="gml:_TimeReferenceSystem"/>
+ <!-- ===================================== -->
+ <complexType name="TimeCalendarType">
+ <annotation>
+ <documentation xml:lang="en">A calendar is a discrete temporal reference system
+ that provides a basis for defining temporal position to a resolution of one day.
+ A single calendar may reference more than one calendar era.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeReferenceSystemType">
+ <sequence>
+ <element name="referenceFrame" type="gml:TimeCalendarEraPropertyType" maxOccurs="unbounded">
+ <annotation>
+ <documentation>Link to the CalendarEras that it uses as a reference for dating.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeCalendarPropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:TimeCalendar"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <element name="TimeCalendarEra" type="gml:TimeCalendarEraType" substitutionGroup="gml:Definition"/>
+ <!-- ===================================== -->
+ <complexType name="TimeCalendarEraType">
+ <annotation>
+ <documentation xml:lang="en">In every calendar, years are numbered relative to the date of a
+ reference event that defines a calendar era.
+ In this implementation, we omit the back-pointer "datingSystem".</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:DefinitionType">
+ <sequence>
+ <element name="referenceEvent" type="gml:StringOrRefType">
+ <annotation>
+ <documentation>Name or description of a mythical or historic event which fixes the position of the base scale of the calendar era.</documentation>
+ </annotation>
+ </element>
+ <element name="referenceDate" type="date" default="0001-01-01" minOccurs="0">
+ <annotation>
+ <documentation>Date of the referenceEvent expressed as a date in the given calendar.
+ In most calendars, this date is the origin (i.e., the first day) of the scale, but this is not always true.</documentation>
+ </annotation>
+ </element>
+ <element name="julianReference" type="decimal">
+ <annotation>
+ <documentation>Julian date that corresponds to the reference date.
+ The Julian day numbering system is a temporal coordinate system that has an
+ origin earlier than any known calendar,
+ at noon on 1 January 4713 BC in the Julian proleptic calendar.
+ The Julian day number is an integer value;
+ the Julian date is a decimal value that allows greater resolution.
+ Transforming calendar dates to and from Julian dates provides a
+ relatively simple basis for transforming dates from one calendar to another.</documentation>
+ </annotation>
+ </element>
+ <element name="epochOfUse" type="gml:TimePeriodPropertyType">
+ <annotation>
+ <documentation>Period for which the calendar era was used as a basis for dating.</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeCalendarEraPropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:TimeCalendarEra"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- == Clock == -->
+ <!-- ================================================================== -->
+ <element name="TimeClock" type="gml:TimeClockType" substitutionGroup="gml:_TimeReferenceSystem"/>
+ <!-- ===================================== -->
+ <complexType name="TimeClockType" final="#all">
+ <annotation>
+ <documentation xml:lang="en">A clock provides a basis for defining temporal position within a day.
+ A clock must be used with a calendar in order to provide a complete description of a temporal position
+ within a specific day.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeReferenceSystemType">
+ <sequence>
+ <element name="referenceEvent" type="gml:StringOrRefType">
+ <annotation>
+ <documentation>Name or description of an event, such as solar noon or sunrise,
+ which fixes the position of the base scale of the clock.</documentation>
+ </annotation>
+ </element>
+ <element name="referenceTime" type="time">
+ <annotation>
+ <documentation>time of day associated with the reference event expressed as
+ a time of day in the given clock. The reference time is usually the origin of the clock scale.</documentation>
+ </annotation>
+ </element>
+ <element name="utcReference" type="time">
+ <annotation>
+ <documentation>24 hour local or UTC time that corresponds to the reference time.</documentation>
+ </annotation>
+ </element>
+ <element name="dateBasis" type="gml:TimeCalendarPropertyType" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeClockPropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:TimeClock"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/temporalTopology.xsd b/petascope/xml/ogc/gml/3.1.1/base/temporalTopology.xsd
new file mode 100644
index 0000000..89b9a89
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/temporalTopology.xsd
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:temporalTopology:3.1.1"/>
+ <documentation xml:lang="en">The temporal topology schema for ISO19136 provides constructs for handling topological complexes and
+ temporal feature relationships.
+ Temporal geometric characteristics of features are represented as instants and periods.
+ While, temporal context of features that does not relate to the position of time is described as connectivity relationships
+ among instants and periods. These relationships are called temporal topology as they do not change in time,
+ as long as the direction of time does not change.
+ It is used effectively in the case of describing a family tree expressing evolution of species, an ecological cycle,
+ a lineage of lands or buildings, or a history of separation and merger of administrative boundaries.
+ This schema reflects a partial yet consistent implementation of the model described in ISO 19108:2002.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ===================================== -->
+ <include schemaLocation="temporal.xsd"/>
+ <!-- ===================================== -->
+ <!-- ================================================================== -->
+ <!-- == TimeTopologyComplex == -->
+ <!-- ================================================================== -->
+ <element name="TimeTopologyComplex" type="gml:TimeTopologyComplexType" substitutionGroup="gml:_TimeComplex">
+ <annotation>
+ <documentation xml:lang="en">This element represents temporal topology complex. It shall be the connected acyclic directed graph composed of time nodes and time edges.</documentation>
+ </annotation>
+ </element>
+ <!-- ================================================================== -->
+ <complexType name="TimeTopologyComplexType">
+ <annotation>
+ <documentation xml:lang="en">A temporal topology complex.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeComplexType">
+ <sequence>
+ <element name="primitive" type="gml:TimeTopologyPrimitivePropertyType" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeTopologyComplexPropertyType">
+ <annotation>
+ <documentation>A time topology complex property can either be any time topology complex element
+ encapsulated in an element of this type or an XLink reference to a remote time topology complex element
+ (where remote includes elements located elsewhere in the same document).
+ Note that either the reference or the contained element must be given, but not both or none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:TimeTopologyComplex"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- == TimeTopologyPrimitive == -->
+ <!-- ================================================================== -->
+ <element name="_TimeTopologyPrimitive" type="gml:AbstractTimeTopologyPrimitiveType" abstract="true" substitutionGroup="gml:_TimePrimitive">
+ <annotation>
+ <documentation xml:lang="en">This abstract element acts as the head of the substitution group for temporal topology primitives.</documentation>
+ </annotation>
+ </element>
+ <!-- ================================================================== -->
+ <complexType name="AbstractTimeTopologyPrimitiveType" abstract="true">
+ <annotation>
+ <documentation xml:lang="en">The element "complex" carries a reference to the complex containing this primitive.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimePrimitiveType">
+ <sequence>
+ <element name="complex" type="gml:ReferenceType" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeTopologyPrimitivePropertyType">
+ <annotation>
+ <documentation>A time topology primitive property can either hold any time topology complex element
+ eor carry an XLink reference to a remote time topology complex element
+ (where remote includes elements located elsewhere in the same document).
+ Note that either the reference or the contained element must be given, but not both or none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:_TimeTopologyPrimitive"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ======= TimeNode ======= -->
+ <!-- ================================================================== -->
+ <element name="TimeNode" type="gml:TimeNodeType" substitutionGroup="gml:_TimeTopologyPrimitive">
+ <annotation>
+ <documentation xml:lang="en">"TimeNode" is a zero dimensional temporal topology primitive,
+ expresses a position in topological time, and is a start and an end of time edge, which represents states of time.
+ Time node may be isolated. However, it cannot describe the ordering relationships with other primitives.
+ An isolated node may not be an element of any temporal topology complex.</documentation>
+ </annotation>
+ </element>
+ <!-- ================================================================== -->
+ <complexType name="TimeNodeType">
+ <annotation>
+ <documentation xml:lang="en">Type declaration of the element "TimeNode".</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeTopologyPrimitiveType">
+ <sequence>
+ <element name="previousEdge" type="gml:TimeEdgePropertyType" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="nextEdge" type="gml:TimeEdgePropertyType" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="position" type="gml:TimeInstantPropertyType" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeNodePropertyType">
+ <annotation>
+ <documentation>A time node property can either be any time node element encapsulated in an element of this type
+ or an XLink reference to a remote time node element (where remote includes elements located elsewhere in the same document).
+ Note that either the reference or the contained element must be given, but not both or none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:TimeNode"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- ======= TimeEdge ======= -->
+ <!-- ================================================================== -->
+ <element name="TimeEdge" type="gml:TimeEdgeType" substitutionGroup="gml:_TimeTopologyPrimitive">
+ <annotation>
+ <documentation xml:lang="en">TimeEdge is one dimensional temporal topology primitive,
+ expresses a state in topological time. It has an orientation from its start toward the end,
+ and its boundaries shall associate with two different time nodes.</documentation>
+ </annotation>
+ </element>
+ <!-- ================================================================== -->
+ <complexType name="TimeEdgeType">
+ <annotation>
+ <documentation xml:lang="en">Type declaration of the element "TimeEdge".</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTimeTopologyPrimitiveType">
+ <sequence>
+ <element name="start" type="gml:TimeNodePropertyType"/>
+ <element name="end" type="gml:TimeNodePropertyType"/>
+ <element name="extent" type="gml:TimePeriodPropertyType" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ================================================================== -->
+ <complexType name="TimeEdgePropertyType">
+ <annotation>
+ <documentation>A time edge property can either be any time edge element encapsulated in an element of this type
+ or an XLink reference to a remote time edge element (where remote includes elements located elsewhere in the same document).
+ Note that either the reference or the contained element must be given, but not both or none.</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <element ref="gml:TimeEdge"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ================================================================== -->
+ <!-- === Succession === -->
+ <!-- ================================================================== -->
+ <simpleType name="SuccessionType">
+ <annotation>
+ <documentation>Feature succession is a semantic relationship derived from evaluation of observer, and
+ Feature Substitution, Feature Division and Feature Fusion are defined as associations between
+ previous features and next features in the temporal context.
+ Successions shall be represented in either following two ways.
+ * define a temporal topological complex element as a feature element
+ * define an association same as temporal topological complex between features.</documentation>
+ </annotation>
+ <restriction base="string">
+ <enumeration value="substitution"/>
+ <enumeration value="division"/>
+ <enumeration value="fusion"/>
+ <enumeration value="initiation"/>
+ </restriction>
+ </simpleType>
+ <!-- ================================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/topology.xsd b/petascope/xml/ogc/gml/3.1.1/base/topology.xsd
new file mode 100644
index 0000000..60969f4
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/topology.xsd
@@ -0,0 +1,458 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/2001/XMLSchema">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:topology:3.1.1">topology.xsd</appinfo>
+ <documentation>
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ </documentation>
+ </annotation>
+ <include schemaLocation="geometryComplexes.xsd"/>
+ <!-- ==============================================================
+ abstract supertype for topology objects
+ =============================================================== -->
+ <!-- ========================================================== -->
+ <element name="_Topology" type="gml:AbstractTopologyType" abstract="true" substitutionGroup="gml:_GML"/>
+ <!-- ========================================================== -->
+ <complexType name="AbstractTopologyType" abstract="true">
+ <complexContent>
+ <extension base="gml:AbstractGMLType"/>
+ </complexContent>
+ </complexType>
+ <!-- ========================================================== -->
+ <element name="_TopoPrimitive" type="gml:AbstractTopoPrimitiveType" abstract="true" substitutionGroup="gml:_Topology">
+ <annotation>
+ <documentation>Substitution group branch for Topo Primitives, used by TopoPrimitiveArrayAssociationType</documentation>
+ </annotation>
+ </element>
+ <!-- ========================================================== -->
+ <complexType name="AbstractTopoPrimitiveType" abstract="true">
+ <complexContent>
+ <extension base="gml:AbstractTopologyType">
+ <sequence>
+ <element ref="gml:isolated" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:container" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ========================================================== -->
+ <element name="isolated" type="gml:IsolatedPropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:isolated">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ========================================================== -->
+ <complexType name="IsolatedPropertyType">
+ <choice minOccurs="0">
+ <element ref="gml:Node"/>
+ <element ref="gml:Edge"/>
+ </choice>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ========================================================== -->
+ <element name="container" type="gml:ContainerPropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:containerProperty">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ========================================================== -->
+ <complexType name="ContainerPropertyType">
+ <sequence minOccurs="0">
+ <choice>
+ <element ref="gml:Face"/>
+ <element ref="gml:TopoSolid"/>
+ </choice>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- primitive topology objects -->
+ <!-- ========================================================== -->
+ <element name="Node" type="gml:NodeType" substitutionGroup="gml:_TopoPrimitive"/>
+ <!-- =========================================================== -->
+ <complexType name="NodeType">
+ <annotation>
+ <documentation>Its optional co-boundary is a set of connected directedEdges. The orientation of one of these dirEdges is "+" if the Node is the "to" node of the Edge, and "-" if it is the "from" node.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopoPrimitiveType">
+ <sequence>
+ <element ref="gml:directedEdge" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:pointProperty" minOccurs="0"/>
+ <!-- <element name="geometry" type="gml:PointPropertyType" minOccurs="0"/> -->
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ===== Property for topology association - by Value or by Reference ===== -->
+ <element name="directedNode" type="gml:DirectedNodePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:directedNode">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="DirectedNodePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:Node"/>
+ </sequence>
+ <attribute name="orientation" type="gml:SignType" default="+"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- primitive topology objects (1-dimensional) -->
+ <!-- ========================================================== -->
+ <element name="Edge" type="gml:EdgeType" substitutionGroup="gml:_TopoPrimitive"/>
+ <!-- ========================================================== -->
+ <complexType name="EdgeType">
+ <annotation>
+ <documentation>There is precisely one positively directed and one negatively directed node in the boundary of every edge. The negatively and positively directed nodes correspond to the start and end nodes respectively. The optional coboundary of an edge is a circular sequence of directed faces which are incident on this edge in document order. Faces which use a particular boundary edge in its positive orientation appear with positive orientation on the coboundary of the same edge. In the 2D case, the orientation of the face on the left of the edge is "+"; the orientation of the face on the right on its right is "-". An edge may optionally be realised by a 1-dimensional (curve) geometric primitive.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopoPrimitiveType">
+ <sequence>
+ <element ref="gml:directedNode" minOccurs="2" maxOccurs="2"/>
+ <element ref="gml:directedFace" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:curveProperty" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ===== Property for topology association - by Value or by Reference ===== -->
+ <element name="directedEdge" type="gml:DirectedEdgePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:directedEdge">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="DirectedEdgePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:Edge"/>
+ </sequence>
+ <attribute name="orientation" type="gml:SignType" default="+"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- primitive topology objects (2-dimensional) -->
+ <!-- ========================================================== -->
+ <element name="Face" type="gml:FaceType" substitutionGroup="gml:_TopoPrimitive"/>
+ <!-- ========================================================== -->
+ <complexType name="FaceType">
+ <annotation>
+ <documentation>. The topological boundary of a face consists of a set of directed edges. Note that all edges associated with a Face, including dangling and interior edges, appear in the boundary. Dangling and interior edges are each referenced by pairs of directedEdges with opposing orientations. The optional coboundary of a face is a pair of directed solids which are bounded by this face. If present, there is precisely one positively directed and one negatively directed solid in the coboundary of every face. The positively directed solid corresponds to the solid which lies in the direction of the positively directed normal to the face in any geometric realisation. A face may optionally be realised by a 2-dimensional (surface) geometric primitive.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopoPrimitiveType">
+ <sequence>
+ <element ref="gml:directedEdge" maxOccurs="unbounded"/>
+ <element ref="gml:directedTopoSolid" minOccurs="0" maxOccurs="2"/>
+ <element ref="gml:surfaceProperty" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ===== Property for topology association - by Value or by Reference ===== -->
+ <element name="directedFace" type="gml:DirectedFacePropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:directedFace">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="DirectedFacePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:Face"/>
+ </sequence>
+ <attribute name="orientation" type="gml:SignType" default="+"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- primitive topology objects (3-dimensional) -->
+ <!-- ========================================================== -->
+ <element name="TopoSolid" type="gml:TopoSolidType" substitutionGroup="gml:_TopoPrimitive"/>
+ <!-- ============================================================= -->
+ <complexType name="TopoSolidType">
+ <annotation>
+ <documentation>The topological boundary of a TopoSolid consists of a set of directed faces. Note that all faces associated with the TopoSolid, including dangling faces, appear in the boundary. The coboundary of a TopoSolid is empty and hence requires no representation.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopoPrimitiveType">
+ <sequence>
+ <element ref="gml:directedFace" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ===== Property for topology association - by Value or by Reference ===== -->
+ <element name="directedTopoSolid" type="gml:DirectedTopoSolidPropertyType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:directedTopoSolid">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="DirectedTopoSolidPropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:TopoSolid"/>
+ </sequence>
+ <attribute name="orientation" type="gml:SignType" default="+"/>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ========================================================== -->
+ <element name="TopoPoint" type="gml:TopoPointType"/>
+ <!-- ========================================================== -->
+ <complexType name="TopoPointType">
+ <annotation>
+ <documentation>The intended use of TopoPoint is to appear within a point feature to express the structural and possibly geometric relationships of this point to other features via shared node definitions. Note the orientation assigned to the directedNode has no meaning in this context. It is preserved for symmetry with the types and elements which follow.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopologyType">
+ <sequence>
+ <element ref="gml:directedNode"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ============================================================= -->
+ <!-- ===== Property for topology association - by Value ===== -->
+ <element name="topoPointProperty" type="gml:TopoPointPropertyType"/>
+ <!-- ============================================================= -->
+ <complexType name="TopoPointPropertyType">
+ <sequence>
+ <element ref="gml:TopoPoint"/>
+ </sequence>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ========================================================== -->
+ <element name="TopoCurve" type="gml:TopoCurveType"/>
+ <!-- ============================================================= -->
+ <complexType name="TopoCurveType">
+ <annotation>
+ <documentation>The end Node of each directedEdge of a TopoCurveType
+is the start Node of the next directedEdge of the TopoCurveType in document order. The TopoCurve type and element represent a homogeneous topological expression, a list of directed edges, which if realised are isomorphic to a geometric curve primitive. The intended use of TopoCurve is to appear within a line feature instance to express the structural and geometric relationships of this line to other features via the shared edge definitions.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopologyType">
+ <sequence>
+ <element ref="gml:directedEdge" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ===== Property for topology association - by Value ===== -->
+ <element name="topoCurveProperty" type="gml:TopoCurvePropertyType"/>
+ <!-- ============================================================= -->
+ <complexType name="TopoCurvePropertyType">
+ <sequence>
+ <element ref="gml:TopoCurve"/>
+ </sequence>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ========================================================== -->
+ <element name="TopoSurface" type="gml:TopoSurfaceType"/>
+ <!-- ============================================================= -->
+ <complexType name="TopoSurfaceType">
+ <annotation>
+ <documentation>The TopoSurface type and element represent a homogeneous topological expression, a set of directed faces, which if realised are isomorphic to a geometric surface primitive. The intended use of TopoSurface is to appear within a surface feature instance to express the structural and possibly geometric relationships of this surface to other features via the shared face definitions.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopologyType">
+ <sequence>
+ <element ref="gml:directedFace" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ===== Property for topology association - by Value ===== -->
+ <element name="topoSurfaceProperty" type="gml:TopoSurfacePropertyType"/>
+ <!-- ============================================================= -->
+ <complexType name="TopoSurfacePropertyType">
+ <sequence>
+ <element ref="gml:TopoSurface"/>
+ </sequence>
+ </complexType>
+ <!-- ========================================================== -->
+ <element name="TopoVolume" type="gml:TopoVolumeType"/>
+ <!-- ============================================================= -->
+ <complexType name="TopoVolumeType">
+ <annotation>
+ <documentation>The TopoVolume type and element represent a homogeneous topological expression, a set of directed TopoSolids, which if realised are isomorphic to a geometric solid primitive. The intended use of TopoVolume is to appear within a 3D solid feature instance to express the structural and geometric relationships of this solid to other features via the shared TopoSolid definitions. . Note the orientation assigned to the directedSolid has no meaning in three dimensions. It is preserved for symmetry with the preceding types and elements.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopologyType">
+ <sequence>
+ <element ref="gml:directedTopoSolid" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ===== Property for topology association - by Value ===== -->
+ <element name="topoVolumeProperty" type="gml:TopoVolumePropertyType"/>
+ <!-- ============================================================= -->
+ <complexType name="TopoVolumePropertyType">
+ <sequence>
+ <element ref="gml:TopoVolume"/>
+ </sequence>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ========================================================== -->
+ <element name="TopoComplex" type="gml:TopoComplexType" substitutionGroup="gml:_Topology"/>
+ <!-- ========================================================== -->
+ <complexType name="TopoComplexType">
+ <annotation>
+ <documentation>This type represents a TP_Complex capable of holding topological primitives.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractTopologyType">
+ <sequence>
+ <element ref="gml:maximalComplex"/>
+ <element ref="gml:superComplex" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:subComplex" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:topoPrimitiveMember" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:topoPrimitiveMembers" minOccurs="0"/>
+ </sequence>
+ <attribute name="isMaximal" type="boolean" default="false"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- ===== Property for topology association - by Value or Reference ===== -->
+ <element name="topoComplexProperty" type="gml:TopoComplexMemberType"/>
+ <!-- ========================================================== -->
+ <element name="subComplex" type="gml:TopoComplexMemberType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:subComplex">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ========================================================== -->
+ <element name="superComplex" type="gml:TopoComplexMemberType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:superComplex">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ========================================================== -->
+ <element name="maximalComplex" type="gml:TopoComplexMemberType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:subComplex">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>Need schamatron test here that isMaximal attribute value is true</documentation>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="TopoComplexMemberType">
+ <annotation>
+ <documentation>This Property can be used to embed a TopoComplex in a feature collection.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:TopoComplex" minOccurs="0"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ===== Property for topology association - by Value or Reference ===== -->
+ <element name="topoPrimitiveMember" type="gml:TopoPrimitiveMemberType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:topoPrimitiveMember">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ============================================================= -->
+ <complexType name="TopoPrimitiveMemberType">
+ <annotation>
+ <documentation>This type supports embedding topological primitives in a TopoComplex.</documentation>
+ </annotation>
+ <sequence>
+ <element ref="gml:_TopoPrimitive" minOccurs="0"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ========================================================== -->
+ <!-- ===== Property for topology association - by Value ===== -->
+ <element name="topoPrimitiveMembers" type="gml:TopoPrimitiveArrayAssociationType">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="refAndContent co-occurence prohibited">
+ <sch:rule context="gml:topoPrimitiveMember">
+ <sch:extends rule="hrefOrContent"/>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ </annotation>
+ </element>
+ <!-- ========================================================== -->
+ <complexType name="TopoPrimitiveArrayAssociationType">
+ <annotation>
+ <documentation>This type supports embedding an array of topological primitives in a TopoComplex</documentation>
+ </annotation>
+ <!-- <complexContent>
+ <restriction base="gml:ArrayAssociationType"> -->
+ <sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="gml:_TopoPrimitive"/>
+ </choice>
+ </sequence>
+ <!-- </restriction>
+ </complexContent> -->
+ </complexType>
+ <!-- ========================================================== -->
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/base/units.xsd b/petascope/xml/ogc/gml/3.1.1/base/units.xsd
new file mode 100644
index 0000000..e65a4d8
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/units.xsd
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.1.1" xml:lang="en">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-units:3.1.1"/>
+ <documentation>Builds on gmlBase.xsd to encode units of measure (or uom), including definitions of units of measure and dictionaries of such definitions. GML 3.0 candidate schema, primary editor: Arliss Whiteside. Last updated 2005-06-22.
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr
+ Parts of this schema are based on Subclause 6.5.7 of ISO/CD 19103 Geographic information - Conceptual schema language, on Subclause A.5.2.2.3 of ISO/CD 19118 Geographic information - Encoding, and on most of OpenGIS Recommendation Paper OGC 02-007r4 Units of Measure Use and Definition Recommendations.</documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <include schemaLocation="dictionary.xsd"/>
+ <!-- ==============================================================
+ elements and types
+ ============================================================== -->
+ <element name="unitOfMeasure" type="gml:UnitOfMeasureType"/>
+ <!-- =========================================================== -->
+ <complexType name="UnitOfMeasureType">
+ <annotation>
+ <documentation>Reference to a unit of measure definition that applies to all the numerical values described by the element containing this element. Notice that a complexType which needs to include the uom attribute can do so by extending this complexType. Alternately, this complexType can be used as a pattern for a new complexType.</documentation>
+ </annotation>
+ <sequence/>
+ <attribute name="uom" type="anyURI" use="required">
+ <annotation>
+ <documentation>Reference to a unit of measure definition, usually within the same XML document but possibly outside the XML document which contains this reference. For a reference within the same XML document, the "#" symbol should be used, followed by a text abbreviation of the unit name. However, the "#" symbol may be optional, and still may be interpreted as a reference.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="UnitDefinition" type="gml:UnitDefinitionType" substitutionGroup="gml:Definition"/>
+ <!-- =========================================================== -->
+ <complexType name="UnitDefinitionType">
+ <annotation>
+ <documentation>Definition of a unit of measure (or uom). The definition includes a quantityType property, which indicates the phenomenon to which the units apply, and a catalogSymbol, which gives the short symbol used for this unit. This element is used when the relationship of this unit to other units or units systems is unknown.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:DefinitionType">
+ <sequence>
+ <element ref="gml:quantityType"/>
+ <element ref="gml:catalogSymbol" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="BaseUnit" type="gml:BaseUnitType" substitutionGroup="gml:UnitDefinition"/>
+ <!-- =========================================================== -->
+ <complexType name="BaseUnitType">
+ <annotation>
+ <documentation>Definition of a unit of measure which is a base unit from the system of units. A base unit cannot be derived by combination of other base units within this system. Sometimes known as "fundamental unit".</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:UnitDefinitionType">
+ <sequence>
+ <element name="unitsSystem" type="gml:ReferenceType"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="DerivedUnit" type="gml:DerivedUnitType" substitutionGroup="gml:UnitDefinition"/>
+ <!-- ============================================================ -->
+ <complexType name="DerivedUnitType">
+ <annotation>
+ <documentation>Definition of a unit of measure which is defined through algebraic combination of more primitive units, which are usually base units from a particular system of units. Derived units based directly on base units are usually preferred for quantities other than the base units or fundamental quantities within a system. If a derived unit is not the preferred unit, the ConventionalUnit element should be used instead.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:UnitDefinitionType">
+ <sequence>
+ <element ref="gml:derivationUnitTerm" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="ConventionalUnit" type="gml:ConventionalUnitType" substitutionGroup="gml:UnitDefinition"/>
+ <!-- =========================================================== -->
+ <complexType name="ConventionalUnitType">
+ <annotation>
+ <documentation>Definition of a unit of measure which is related to a preferred unit for this quantity type through a conversion formula. A method for deriving this unit by algebraic combination of more primitive units, may also be provided.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:UnitDefinitionType">
+ <sequence>
+ <choice>
+ <element ref="gml:conversionToPreferredUnit"/>
+ <element ref="gml:roughConversionToPreferredUnit"/>
+ </choice>
+ <element ref="gml:derivationUnitTerm" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="quantityType" type="gml:StringOrRefType">
+ <annotation>
+ <documentation>Informal description of the phenomenon or type of quantity that is measured or observed. For example, "length", "angle", "time", "pressure", or "temperature". When the quantity is the result of an observation or measurement, this term is known as Observable Type or Measurand.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="catalogSymbol" type="gml:CodeType">
+ <annotation>
+ <documentation>For global understanding of a unit of measure, it is often possible to reference an item in a catalog of units, using a symbol in that catalog. The "codeSpace" attribute in "CodeType" identifies a namespace for the catalog symbol value, and might reference the catalog. The "string" value in "CodeType" contains the value of a symbol that is unique within this catalog namespace. This symbol often appears explicitly in the catalog, but it could be a combination of symbols using a specified algebra of units. For example, the symbol "cm" might indicate that it is the "m" symbol combined with the "c" prefix.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="derivationUnitTerm" type="gml:DerivationUnitTermType"/>
+ <!-- =========================================================== -->
+ <complexType name="DerivationUnitTermType">
+ <annotation>
+ <documentation>Definition of one unit term for a derived unit of measure. This unit term references another unit of measure (uom) and provides an integer exponent applied to that unit in defining the compound unit. The exponent can be positive or negative, but not zero.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:UnitOfMeasureType">
+ <attribute name="exponent" type="integer"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="conversionToPreferredUnit" type="gml:ConversionToPreferredUnitType">
+ <annotation>
+ <documentation>This element is included when this unit has an accurate conversion to the preferred unit for this quantity type.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <element name="roughConversionToPreferredUnit" type="gml:ConversionToPreferredUnitType">
+ <annotation>
+ <documentation>This element is included when the correct definition of this unit is unknown, but this unit has a rough or inaccurate conversion to the preferred unit for this quantity type.</documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="ConversionToPreferredUnitType">
+ <annotation>
+ <documentation>Relation of a unit to the preferred unit for this quantity type, specified by an arithmetic conversion (scaling and/or offset). A preferred unit is either a base unit or a derived unit selected for all units of one quantity type. The mandatory attribute "uom" shall reference the preferred unit that this conversion applies to. The conversion is specified by one of two alternative elements: "factor" or "formula".</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:UnitOfMeasureType">
+ <choice>
+ <element name="factor" type="double">
+ <annotation>
+ <documentation>Specification of the scale factor by which a value using this unit of measure can be multiplied to obtain the corresponding value using the preferred unit of measure.</documentation>
+ </annotation>
+ </element>
+ <element name="formula" type="gml:FormulaType">
+ <annotation>
+ <documentation>Specification of the formula by which a value using this unit of measure can be converted to obtain the corresponding value using the preferred unit of measure.</documentation>
+ </annotation>
+ </element>
+ </choice>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <complexType name="FormulaType">
+ <annotation>
+ <documentation>Paremeters of a simple formula by which a value using this unit of measure can be converted to the corresponding value using the preferred unit of measure. The formula element contains elements a, b, c and d, whose values use the XML Schema type "double". These values are used in the formula y = (a + bx) / (c + dx), where x is a value using this unit, and y is the corresponding value using the preferred unit. The elements a and d are optional, and if values are not provided, those parameters are considered to be zero. If values are not provided for both a and d, the formula is equivalent to a fraction with numerator and denominator parameters.</documentation>
+ </annotation>
+ <sequence>
+ <element name="a" type="double" minOccurs="0"/>
+ <element name="b" type="double"/>
+ <element name="c" type="double"/>
+ <element name="d" type="double" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/base/valueObjects.xsd b/petascope/xml/ogc/gml/3.1.1/base/valueObjects.xsd
new file mode 100644
index 0000000..2aa8355
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/base/valueObjects.xsd
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+ attributeFormDefault="unqualified" version="3.1.1">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xsd:valueObjects:3.1.1">valueObjects.xsd</appinfo>
+ <documentation>GML conformant schema for Values in which the
+ * scalar Value types and lists have their values recorded in simpleContent elements
+ * complex Value types are built recursively
+ Copyright (c) 2002-2005 OGC, All Rights Reserved.
+ For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
+ </annotation>
+ <!-- ====================================================================== -->
+ <!-- geometry and temporal included so that _Geometry and _TimeObject can be added to Value choice group -->
+ <include schemaLocation="geometryBasic0d1d.xsd"/>
+ <include schemaLocation="temporal.xsd"/>
+ <!-- ====================================================================== -->
+ <group name="Value">
+ <annotation>
+ <documentation>Utility choice group which unifies generic Values defined in this schema document with
+ Geometry and Temporal objects and the Measures described above,
+ so that any of these may be used within aggregate Values.</documentation>
+ </annotation>
+ <choice>
+ <!-- <element ref="gml:_Value"/> -->
+ <group ref="gml:ValueObject"/>
+ <element ref="gml:_Object"/>
+ <!-- <element ref="gml:_Geometry"/>
+ <element ref="gml:_TimeObject"/> -->
+ <element ref="gml:Null"/>
+ </choice>
+ </group>
+ <!-- ====================================================================== -->
+ <group name="ValueObject">
+ <choice>
+ <group ref="gml:ScalarValue"/>
+ <group ref="gml:ScalarValueList"/>
+ <group ref="gml:ValueExtent"/>
+ <element ref="gml:CompositeValue"/>
+ </choice>
+ </group>
+ <!-- ======================================================================
+ <element name="_Value" abstract="true" substitutionGroup="gml:_Object">
+ <annotation>
+ <documentation>Abstract element which acts as the head of a substitution group which contains _ScalarValue, _ScalarValueList and CompositeValue and (transitively) the elements in their substitution groups. This element may be used in an application schema as a variable, so that in an XML instance document any member of its substitution group may occur.</documentation>
+ </annotation>
+ </element> -->
+ <!-- ====================================================================== -->
+ <!-- ================== Scalar Values =========================
+ <element name="_ScalarValue" abstract="true" substitutionGroup="gml:_Value">
+ <annotation>
+ <documentation>Abstract element which acts as the head of a substitution group which contains Boolean, Category, Count and Quantity, and (transitively) the elements in their substitution groups. This element may be used in an application schema as a variable, so that in an XML instance document any member of its substitution group may occur.</documentation>
+ </annotation>
+ </element> -->
+ <group name="ScalarValue">
+ <choice>
+ <element ref="gml:Boolean"/>
+ <element ref="gml:Category"/>
+ <element ref="gml:Quantity"/>
+ <element ref="gml:Count"/>
+ </choice>
+ </group>
+ <!-- ======================================================================
+ <element name="_ScalarValueList" abstract="true" substitutionGroup="gml:_Value">
+ <annotation>
+ <documentation>Abstract element which acts as the head of a substitution group which contains the compact encodings BooleanList, CategoryList, CountList and QuantityList, and (transitively) the elements in their substitution groups. This element may be used in an application schema as a variable, so that in an XML instance document any member of its substitution group may occur.</documentation>
+ </annotation>
+ </element> -->
+ <group name="ScalarValueList">
+ <choice>
+ <element ref="gml:BooleanList"/>
+ <element ref="gml:CategoryList"/>
+ <element ref="gml:QuantityList"/>
+ <element ref="gml:CountList"/>
+ </choice>
+ </group>
+ <!-- ====================================================================== -->
+ <!-- ======================= Boolean ========================
+ <element name="Boolean" type="boolean" substitutionGroup="gml:_ScalarValue"> -->
+ <element name="Boolean" type="boolean">
+ <annotation>
+ <documentation>A value from two-valued logic, using the XML Schema boolean type. An instance may take the values {true, false, 1, 0}.</documentation>
+ </annotation>
+ </element>
+ <!--
+ <element name="BooleanList" type="gml:booleanOrNullList" substitutionGroup="gml:_ScalarValueList"> -->
+ <element name="BooleanList" type="gml:booleanOrNullList">
+ <annotation>
+ <documentation>XML List based on XML Schema boolean type. An element of this type contains a space-separated list of boolean values {0,1,true,false}</documentation>
+ </annotation>
+ </element>
+ <!-- ====================================================================== -->
+ <!-- ======================= Category ==========================
+ <element name="Category" type="gml:CodeType" substitutionGroup="gml:_ScalarValue"> -->
+ <element name="Category" type="gml:CodeType">
+ <annotation>
+ <documentation>A term representing a classification. It has an optional XML attribute codeSpace, whose value is a URI which identifies a dictionary, codelist or authority for the term.</documentation>
+ </annotation>
+ </element>
+ <!--
+ <element name="CategoryList" type="gml:CodeOrNullListType" substitutionGroup="gml:_ScalarValueList"> -->
+ <element name="CategoryList" type="gml:CodeOrNullListType">
+ <annotation>
+ <documentation>A space-separated list of terms or nulls. A single XML attribute codeSpace may be provided, which authorises all the terms in the list.</documentation>
+ </annotation>
+ </element>
+ <!-- ====================================================================== -->
+ <!-- =========================== Quantity ============================
+ <element name="Quantity" type="gml:MeasureType" substitutionGroup="gml:_ScalarValue"> -->
+ <element name="Quantity" type="gml:MeasureType">
+ <annotation>
+ <documentation>A numeric value with a scale. The content of the element is an amount using the XML Schema type double which permits decimal or scientific notation. An XML attribute uom (unit of measure) is required, whose value is a URI which identifies the definition of the scale or units by which the numeric value must be multiplied.</documentation>
+ </annotation>
+ </element>
+ <!--
+ <element name="QuantityList" type="gml:MeasureOrNullListType" substitutionGroup="gml:_ScalarValueList"> -->
+ <element name="QuantityList" type="gml:MeasureOrNullListType">
+ <annotation>
+ <documentation>A space separated list of amounts or nulls. The amounts use the XML Schema type double. A single XML attribute uom (unit of measure) is required, whose value is a URI which identifies the definition of the scale or units by which all the amounts in the list must be multiplied.</documentation>
+ </annotation>
+ </element>
+ <!-- ====================================================================== -->
+ <!-- ========================== Count ==========================
+ <element name="Count" type="integer" substitutionGroup="gml:_ScalarValue"> -->
+ <element name="Count" type="integer">
+ <annotation>
+ <documentation>An integer representing a frequency of occurrence.</documentation>
+ </annotation>
+ </element>
+ <!--
+ <element name="CountList" type="gml:integerOrNullList" substitutionGroup="gml:_ScalarValueList"> -->
+ <element name="CountList" type="gml:integerOrNullList">
+ <annotation>
+ <documentation>A space-separated list of integers or nulls.</documentation>
+ </annotation>
+ </element>
+ <!-- ====================================================================== -->
+ <!-- aggregate Value types -->
+ <!-- ====================================================================== -->
+ <!-- ===================== ValueCollection ========================== -->
+ <complexType name="CompositeValueType">
+ <annotation>
+ <documentation>Aggregate value built from other Values using the Composite pattern. It contains zero or an arbitrary number of valueComponent elements, and zero or one valueComponents elements. It may be used for strongly coupled aggregates (vectors, tensors) or for arbitrary collections of values.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:AbstractGMLType">
+ <sequence>
+ <element ref="gml:valueComponent" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="gml:valueComponents" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- <element name="CompositeValue" type="gml:CompositeValueType" substitutionGroup="gml:_Value"> -->
+ <element name="CompositeValue" type="gml:CompositeValueType">
+ <annotation>
+ <documentation>Aggregate value built using the Composite pattern.</documentation>
+ </annotation>
+ </element>
+ <!-- ====================================================================== -->
+ <!-- ========================= ValueArray ========================== -->
+ <complexType name="ValueArrayType">
+ <annotation>
+ <documentation>A Value Array is used for homogeneous arrays of primitive and aggregate values. The member values may be scalars, composites, arrays or lists. ValueArray has the same content model as CompositeValue, but the member values must be homogeneous. The element declaration contains a Schematron constraint which expresses this restriction precisely. Since the members are homogeneous, the referenceSystem (uom, codeSpace) may be specified on the ValueArray itself and implicitly inherited by all the members if desired. Note that a_ScalarValueList is preferred for arrays of Scalar Values since this is a more efficient encoding.</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="gml:CompositeValueType">
+ <attributeGroup ref="gml:referenceSystem"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- -->
+ <element name="ValueArray" type="gml:ValueArrayType" substitutionGroup="gml:CompositeValue">
+ <annotation>
+ <appinfo>
+ <sch:pattern name="Check either codeSpace or uom not both">
+ <sch:rule context="gml:ValueArray">
+ <sch:report test="@codeSpace and @uom">ValueArray may not carry both a reference to a codeSpace and a uom</sch:report>
+ </sch:rule>
+ </sch:pattern>
+ <sch:pattern name="Check components are homogeneous">
+ <sch:rule context="gml:ValueArray">
+ <sch:assert test="count(gml:valueComponent/*) = count(gml:valueComponent/*[name() = name(../../gml:valueComponent[1]/*[1])])">All components of <sch:name/> must be of the same type</sch:assert>
+ <sch:assert test="count(gml:valueComponents/*) = count(gml:valueComponents/*[name() = name(../*[1])])">All components of <sch:name/> must be of the same type</sch:assert>
+ </sch:rule>
+ </sch:pattern>
+ </appinfo>
+ <documentation>A Value Array is used for homogeneous arrays of primitive and aggregate values. _ScalarValueList is preferred for arrays of Scalar Values since this is more efficient. Since "choice" is not available for attribute groups, an external constraint (e.g. Schematron) would be required to enforce the selection of only one of these through schema validation</documentation>
+ </annotation>
+ </element>
+ <!-- attribute group required for ValueArray -->
+ <attributeGroup name="referenceSystem">
+ <attribute name="codeSpace" type="anyURI" use="optional"/>
+ <attribute name="uom" type="anyURI" use="optional"/>
+ </attributeGroup>
+ <!-- ====================================================================== -->
+ <!-- ====================== Typed ValueExtents ============================ -->
+ <group name="ValueExtent">
+ <choice>
+ <element ref="gml:CategoryExtent"/>
+ <element ref="gml:QuantityExtent"/>
+ <element ref="gml:CountExtent"/>
+ </choice>
+ </group>
+ <!-- ======================================================================
+ <element name="QuantityExtent" type="gml:QuantityExtentType" substitutionGroup="gml:_Value"> -->
+ <element name="QuantityExtent" type="gml:QuantityExtentType">
+ <annotation>
+ <documentation>Utility element to store a 2-point range of numeric values. If one member is a null, then this is a single ended interval.</documentation>
+ </annotation>
+ </element>
+ <!-- -->
+ <complexType name="QuantityExtentType">
+ <annotation>
+ <documentation>Restriction of list type to store a 2-point range of numeric values. If one member is a null, then this is a single ended interval.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:MeasureOrNullListType">
+ <length value="2"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <!-- ======================================================================
+ <element name="CategoryExtent" type="gml:CategoryExtentType" substitutionGroup="gml:_Value"> -->
+ <element name="CategoryExtent" type="gml:CategoryExtentType">
+ <annotation>
+ <documentation>Utility element to store a 2-point range of ordinal values. If one member is a null, then this is a single ended interval.</documentation>
+ </annotation>
+ </element>
+ <!-- -->
+ <complexType name="CategoryExtentType">
+ <annotation>
+ <documentation>Restriction of list type to store a 2-point range of ordinal values. If one member is a null, then this is a single ended interval.</documentation>
+ </annotation>
+ <simpleContent>
+ <restriction base="gml:CodeOrNullListType">
+ <length value="2"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <!-- ======================================================================
+ <element name="CountExtent" type="gml:CountExtentType" substitutionGroup="gml:_Value"> -->
+ <element name="CountExtent" type="gml:CountExtentType">
+ <annotation>
+ <documentation>Utility element to store a 2-point range of frequency values. If one member is a null, then this is a single ended interval.</documentation>
+ </annotation>
+ </element>
+ <!-- -->
+ <simpleType name="CountExtentType">
+ <annotation>
+ <documentation>Restriction of list type to store a 2-point range of frequency values. If one member is a null, then this is a single ended interval.</documentation>
+ </annotation>
+ <restriction base="gml:integerOrNullList">
+ <length value="2"/>
+ </restriction>
+ </simpleType>
+ <!-- ====================================================================== -->
+ <!-- ===================== pieces needed for compositing ==================== -->
+ <element name="valueProperty" type="gml:ValuePropertyType">
+ <annotation>
+ <documentation>Element which refers to, or contains, a Value</documentation>
+ </annotation>
+ </element>
+ <!-- ====================================================================== -->
+ <element name="valueComponent" type="gml:ValuePropertyType">
+ <annotation>
+ <documentation>Element which refers to, or contains, a Value. This version is used in CompositeValues.</documentation>
+ </annotation>
+ </element>
+ <!-- ====================================================================== -->
+ <complexType name="ValuePropertyType">
+ <annotation>
+ <documentation>GML property which refers to, or contains, a Value</documentation>
+ </annotation>
+ <sequence minOccurs="0">
+ <group ref="gml:Value"/>
+ </sequence>
+ <attributeGroup ref="gml:AssociationAttributeGroup"/>
+ </complexType>
+ <!-- ====================================================================== -->
+ <!-- ====================================================================== -->
+ <element name="valueComponents" type="gml:ValueArrayPropertyType">
+ <annotation>
+ <documentation>Element which refers to, or contains, a set of homogeneously typed Values.</documentation>
+ </annotation>
+ </element>
+ <!-- ====================================================================== -->
+ <complexType name="ValueArrayPropertyType">
+ <annotation>
+ <documentation>GML property which refers to, or contains, a set of homogeneously typed Values.</documentation>
+ </annotation>
+ <sequence>
+ <group ref="gml:Value" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <!-- ====================== utility typed valueProperty types =================== -->
+ <complexType name="ScalarValuePropertyType">
+ <annotation>
+ <documentation>Property whose content is a scalar value.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:ValuePropertyType">
+ <sequence minOccurs="0">
+ <!-- <element ref="gml:_ScalarValue"/> -->
+ <group ref="gml:ScalarValue"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="BooleanPropertyType">
+ <annotation>
+ <documentation>Property whose content is a Boolean value.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:ValuePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:Boolean"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="CategoryPropertyType">
+ <annotation>
+ <documentation>Property whose content is a Category.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:ValuePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:Category"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="QuantityPropertyType">
+ <annotation>
+ <documentation>Property whose content is a Quantity.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:ValuePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:Quantity"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="CountPropertyType">
+ <annotation>
+ <documentation>Property whose content is a Count.</documentation>
+ </annotation>
+ <complexContent>
+ <restriction base="gml:ValuePropertyType">
+ <sequence minOccurs="0">
+ <element ref="gml:Count"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <!-- ====================================================================== -->
+</schema> \ No newline at end of file
diff --git a/petascope/xml/ogc/gml/3.1.1/readme.txt b/petascope/xml/ogc/gml/3.1.1/readme.txt
new file mode 100644
index 0000000..e57cae5
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/readme.txt
@@ -0,0 +1,50 @@
+GML 3.1.1 Schema Package Readme
+
+The schema package contained in this directory is the normative GML
+3.1.1 schema set as approved by the OGC membership in May 2005. This
+version corrects a number of errors in the GML 3.1.0 schemas that
+prevented validation.
+
+Reason for Changes: The XML Schema for GML 3.1 fails to validate using
+several of the most popular XML processing software applications.
+
+Four sets of errors have been found in the GML 3.1 Schema, with
+corrections applied as described:
+
+1. the content model for "metaDataProperty" is non-determinstic: you
+can't have a choice group containing <any> with anything else
+ - delete _MetaData from the choice group
+
+2. membership of the _timeLength, _Value, _ScalarValue,
+_ScalarValueList substitution groups relies on an interpretation of the
+XML Schema specification which is not uniformly accepted
+ - replace with an explicit <choice> groups
+
+3. axisName (type="string") in grids.xsd clashes with axisName
+(different type) in coordinateSystems.xsd
+ - Remove the latter, use the gml:name property instead
+
+4. a "derivation-by-restriction" pattern used widely throughout the
+schema has a cardinality constraint (minOccurs="0", and sometimes
+maxOccurs="unbounded") applied to a "property" element in a base type,
+where the property element is the head of a substitution group; in a
+type derived by restriction in which one or more members of the
+substitution group is selected, the validation procedure described in
+the W3C XML Schema specification requires that the validation
+constraint appear on a <choice> container element, rather than on the
+substitution group member element
+ - move the cardinality constraint up to the <sequence>
+ container element
+ - remove unnecessary derivation-by-restriction chains,
+ particularly concerning derivation of property elements
+
+As this pattern is used pervasively in GML, there are numerous changes
+in almost all of the schema documents.
+
+The revised schema has been tested with Xerces-J, XSV, .NET, MSXML and
+no validation errors are found.
+
+http://schemas.opengis.net/gml/3.1.1/
+
+2005-08-11
+
diff --git a/petascope/xml/ogc/gml/3.1.1/smil/smil20-language.xsd b/petascope/xml/ogc/gml/3.1.1/smil/smil20-language.xsd
new file mode 100644
index 0000000..6608c90
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/smil/smil20-language.xsd
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+=================== OpenGIS ============================
+ This schema is here because there are errors in publicly available smil schemas at w3c site.
+ One is acknowledged by w3c - it is typographical error described in SMIL errata document at:
+ http://www.w3.org/2001/07/REC-SMIL20-20010731-errata
+ under:
+ E30: Correction in the SMIL 2.0 utility Schema, section B.3.48 (revised 29 03 2002)
+ Others (at least one) are assumed after failed validation using Visual Studio .NET.
+ These smil schemas are reorganized to include in minimum number of files all and only definitions required by
+ defaultStyle.xsd. It was done to enable the validation of GML3.0 schemas.
+ When w3c fixes the public schemas these will be discarded
+ comment: Milan Trninic, Galdos Systems Inc., May 2002
+=================== OpenGIS ============================
+-->
+<!--
+XML Schema for the SMIL 2.0 Language
+
+This is SMIL 2.0
+Copyright: 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+See http://www.w3.org/Consortium/Legal/.
+
+Public URI: http://www.w3.org/2001/SMIL20/smil20-language.xsd
+Author: Aaron Michael Cohen (Intel)
+
+Revision: 2001/07/15
+
+Note: <any> wildcard element content is missing from most of the SMIL 2.0 elements because of a conflict
+between substitutionGroups and wildcard content.
+-->
+<schema targetNamespace="http://www.w3.org/2001/SMIL20/Language" xmlns:smil20lang="http://www.w3.org/2001/SMIL20/Language" xmlns:smil20="http://www.w3.org/2001/SMIL20/" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <!-- import the smil20 namespaces -->
+ <import namespace="http://www.w3.org/2001/SMIL20/" schemaLocation="smil20.xsd"/>
+ <element name="animate" type="smil20lang:animateType"/>
+ <complexType name="animateType">
+ <complexContent>
+ <extension base="smil20:animatePrototype">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##other" processContents="lax"/>
+ </choice>
+ <attributeGroup ref="smil20lang:CoreAttrs"/>
+ <attributeGroup ref="smil20lang:TimingAttrs"/>
+ <attributeGroup ref="smil20:animTargetAttrs"/>
+ <attributeGroup ref="smil20:animModeAttrs"/>
+ <attributeGroup ref="smil20:skipContentAttrs"/>
+ <anyAttribute namespace="##any" processContents="strict"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <attributeGroup name="CoreAttrs">
+ <attributeGroup ref="smil20:structureModuleAttrs"/>
+ <attributeGroup ref="smil20:alternateContentAttrs"/>
+ </attributeGroup>
+ <attributeGroup name="TimingAttrs">
+ <attributeGroup ref="smil20lang:BasicTimingAttrs"/>
+ <attributeGroup ref="smil20:syncBehaviorAttrs"/>
+ <attributeGroup ref="smil20:syncBehaviorDefaultAttrs"/>
+ <attributeGroup ref="smil20:restartTimingAttrs"/>
+ <attributeGroup ref="smil20:restartDefaultAttrs"/>
+ <attributeGroup ref="smil20:fillTimingAttrs"/>
+ <attributeGroup ref="smil20:fillDefaultAttrs"/>
+ </attributeGroup>
+ <attributeGroup name="BasicTimingAttrs">
+ <attributeGroup ref="smil20:beginEndTimingAttrs"/>
+ <attributeGroup ref="smil20:durTimingAttrs"/>
+ <attributeGroup ref="smil20:repeatTimingAttrs"/>
+ <attributeGroup ref="smil20:deprecatedRepeatTiming"/>
+ <attributeGroup ref="smil20:minMaxTimingAttrs"/>
+ </attributeGroup>
+ <element name="animateMotion" type="smil20lang:animateMotionType"/>
+ <complexType name="animateMotionType">
+ <complexContent>
+ <extension base="smil20:animateMotionPrototype">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##other" processContents="lax"/>
+ </choice>
+ <attributeGroup ref="smil20lang:CoreAttrs"/>
+ <attributeGroup ref="smil20lang:TimingAttrs"/>
+ <attributeGroup ref="smil20:animTargetAttrs"/>
+ <attributeGroup ref="smil20:animModeAttrs"/>
+ <attributeGroup ref="smil20:skipContentAttrs"/>
+ <anyAttribute namespace="##any" processContents="strict"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="animateColor" type="smil20lang:animateColorType"/>
+ <complexType name="animateColorType">
+ <complexContent>
+ <extension base="smil20:animateColorPrototype">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##other" processContents="lax"/>
+ </choice>
+ <attributeGroup ref="smil20lang:CoreAttrs"/>
+ <attributeGroup ref="smil20lang:TimingAttrs"/>
+ <attributeGroup ref="smil20:animTargetAttrs"/>
+ <attributeGroup ref="smil20:animModeAttrs"/>
+ <attributeGroup ref="smil20:skipContentAttrs"/>
+ <anyAttribute namespace="##any" processContents="strict"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="set" type="smil20lang:setType"/>
+ <complexType name="setType">
+ <complexContent>
+ <extension base="smil20:setPrototype">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##other" processContents="lax"/>
+ </choice>
+ <attributeGroup ref="smil20lang:CoreAttrs"/>
+ <attributeGroup ref="smil20lang:TimingAttrs"/>
+ <attributeGroup ref="smil20:animTargetAttrs"/>
+ <attributeGroup ref="smil20:skipContentAttrs"/>
+ <anyAttribute namespace="##any" processContents="strict"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/smil/smil20.xsd b/petascope/xml/ogc/gml/3.1.1/smil/smil20.xsd
new file mode 100644
index 0000000..4a4f829
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/smil/smil20.xsd
@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+=================== OpenGIS ============================
+ This schema is here because there are errors in publicly available smil schemas at w3c site.
+ One is acknowledged by w3c - it is typographical error described in SMIL errata document at:
+ http://www.w3.org/2001/07/REC-SMIL20-20010731-errata
+ under:
+ E30: Correction in the SMIL 2.0 utility Schema, section B.3.48 (revised 29 03 2002)
+ Others (at least one) are assumed after failed validation using Visual Studio .NET.
+ These smil schemas are reorganized to include in minimum number of files all and only definitions required by
+ defaultStyle.xsd. It was done to enable the validation of GML3.0 schemas.
+ When w3c fixes the public schemas these will be discarded
+ comment: Milan Trninic, Galdos Systems Inc., May 2002
+
+ comment#2: Milan Trninic, Galdos Systems Inc., Dec 2002
+ In order to validate with xerces, changed the "x:" prefix to "xml:" in the namespace declaration and reference to "lang" attribute
+=================== OpenGIS ============================
+-->
+<!--
+XML Schema for the SMIL 2.0 modules
+
+This is SMIL 2.0
+Copyright: 1998-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+See http://www.w3.org/Consortium/Legal/.
+
+Public URI: http://www.w3.org/2001/SMIL20/smil20.xsd
+Author: Aaron Michael Cohen (Intel)
+Revision: 2001/07/31
+-->
+<schema targetNamespace="http://www.w3.org/2001/SMIL20/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:smil20="http://www.w3.org/2001/SMIL20/" xmlns:smil20lang="http://www.w3.org/2001/SMIL20/Language" elementFormDefault="qualified">
+ <import namespace="http://www.w3.org/2001/SMIL20/Language" schemaLocation="smil20-language.xsd"/>
+ <!-- =============================================================
+ struct.xsd
+ ============================================================== -->
+ <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml-mod.xsd"/>
+ <attributeGroup name="structureModuleAttrs">
+ <attribute name="id" type="ID" use="optional"/>
+ <attribute name="class" type="string" use="optional"/>
+ <attribute ref="xml:lang" use="optional"/>
+ </attributeGroup>
+ <!-- =============================================================
+ content.xsd
+ ============================================================== -->
+ <attributeGroup name="skipContentAttrs">
+ <attribute name="skip-content" type="boolean" use="optional" default="true"/>
+ </attributeGroup>
+ <!-- =============================================================
+ media.xsd
+ ============================================================== -->
+ <attributeGroup name="alternateContentAttrs">
+ <attribute name="alt" type="string" use="optional"/>
+ <attribute name="longdesc" type="anyURI" use="optional"/>
+ </attributeGroup>
+ <!-- =============================================================
+ utility.xsd
+ ============================================================== -->
+ <simpleType name="nonNegativeDecimalType">
+ <restriction base="decimal">
+ <minInclusive value="0.0"/>
+ </restriction>
+ </simpleType>
+ <!-- =============================================================
+ animate.xsd
+ ============================================================== -->
+ <element name="animate" type="smil20lang:animateType" substitutionGroup="smil20lang:animate"/>
+ <complexType name="animatePrototype">
+ <attributeGroup ref="smil20:animNamedTargetAttrs"/>
+ <attributeGroup ref="smil20:animAddAccumAttrs"/>
+ <attributeGroup ref="smil20:animValuesAttrs"/>
+ </complexType>
+ <attributeGroup name="animNamedTargetAttrs">
+ <attribute name="attributeName" type="string" use="required"/>
+ <attribute name="attributeType" use="optional" default="auto">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="XML"/>
+ <enumeration value="CSS"/>
+ <enumeration value="auto"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </attributeGroup>
+ <attributeGroup name="animAddAccumAttrs">
+ <attribute name="additive" use="optional" default="replace">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="replace"/>
+ <enumeration value="sum"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="accumulate" use="optional" default="none">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="none"/>
+ <enumeration value="sum"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </attributeGroup>
+ <attributeGroup name="animValuesAttrs">
+ <attributeGroup ref="smil20:animSetValuesAttrs"/>
+ <attribute name="from" type="string" use="optional"/>
+ <attribute name="by" type="string" use="optional"/>
+ <attribute name="values" type="string" use="optional"/>
+ </attributeGroup>
+ <attributeGroup name="animSetValuesAttrs">
+ <attribute name="to" type="string" use="optional"/>
+ </attributeGroup>
+ <attributeGroup name="animTargetAttrs">
+ <attribute name="targetElement" type="IDREF" use="optional"/>
+ </attributeGroup>
+ <attributeGroup name="animModeAttrs">
+ <attribute name="calcMode" use="optional" default="linear">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="discrete"/>
+ <enumeration value="linear"/>
+ <enumeration value="paced"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </attributeGroup>
+ <element name="animateMotion" type="smil20lang:animateMotionType" substitutionGroup="smil20lang:animateMotion"/>
+ <complexType name="animateMotionPrototype">
+ <attributeGroup ref="smil20:animAddAccumAttrs"/>
+ <attributeGroup ref="smil20:animValuesAttrs"/>
+ <attribute name="origin" type="string" use="optional"/>
+ </complexType>
+ <element name="animateColor" type="smil20lang:animateColorType" substitutionGroup="smil20lang:animateColor"/>
+ <complexType name="animateColorPrototype">
+ <attributeGroup ref="smil20:animNamedTargetAttrs"/>
+ <attributeGroup ref="smil20:animAddAccumAttrs"/>
+ <attributeGroup ref="smil20:animValuesAttrs"/>
+ </complexType>
+ <element name="set" type="smil20lang:setType" substitutionGroup="smil20lang:set"/>
+ <complexType name="setPrototype">
+ <attributeGroup ref="smil20:animNamedTargetAttrs"/>
+ <attributeGroup ref="smil20:animSetValuesAttrs"/>
+ </complexType>
+ <!-- =============================================================
+ timing.xsd
+ ============================================================== -->
+ <attributeGroup name="syncBehaviorAttrs">
+ <attribute name="syncBehavior" type="smil20:syncBehaviorType" default="default"/>
+ <attribute name="syncTolerance" type="string" use="optional"/>
+ </attributeGroup>
+ <simpleType name="syncBehaviorType">
+ <restriction base="string">
+ <enumeration value="canSlip"/>
+ <enumeration value="locked"/>
+ <enumeration value="independent"/>
+ <enumeration value="default"/>
+ </restriction>
+ </simpleType>
+ <attributeGroup name="syncBehaviorDefaultAttrs">
+ <attribute name="syncBehaviorDefault" type="smil20:syncBehaviorDefaultType" default="inherit"/>
+ <attribute name="syncToleranceDefault" type="string" default="inherit"/>
+ </attributeGroup>
+ <simpleType name="syncBehaviorDefaultType">
+ <restriction base="string">
+ <enumeration value="canSlip"/>
+ <enumeration value="locked"/>
+ <enumeration value="independent"/>
+ <enumeration value="inherit"/>
+ </restriction>
+ </simpleType>
+ <attributeGroup name="restartTimingAttrs">
+ <attribute name="restart" type="smil20:restartTimingType" default="default"/>
+ </attributeGroup>
+ <simpleType name="restartTimingType">
+ <restriction base="string">
+ <enumeration value="never"/>
+ <enumeration value="always"/>
+ <enumeration value="whenNotActive"/>
+ <enumeration value="default"/>
+ </restriction>
+ </simpleType>
+ <attributeGroup name="restartDefaultAttrs">
+ <attribute name="restartDefault" type="smil20:restartDefaultType" default="inherit"/>
+ </attributeGroup>
+ <simpleType name="restartDefaultType">
+ <restriction base="string">
+ <enumeration value="never"/>
+ <enumeration value="always"/>
+ <enumeration value="whenNotActive"/>
+ <enumeration value="inherit"/>
+ </restriction>
+ </simpleType>
+ <attributeGroup name="fillTimingAttrs">
+ <attribute name="fill" type="smil20:fillTimingAttrsType" default="default"/>
+ </attributeGroup>
+ <simpleType name="fillTimingAttrsType">
+ <restriction base="string">
+ <enumeration value="remove"/>
+ <enumeration value="freeze"/>
+ <enumeration value="hold"/>
+ <enumeration value="auto"/>
+ <enumeration value="default"/>
+ <enumeration value="transition"/>
+ </restriction>
+ </simpleType>
+ <attributeGroup name="fillDefaultAttrs">
+ <attribute name="fillDefault" type="smil20:fillDefaultType" default="inherit"/>
+ </attributeGroup>
+ <simpleType name="fillDefaultType">
+ <restriction base="string">
+ <enumeration value="remove"/>
+ <enumeration value="freeze"/>
+ <enumeration value="hold"/>
+ <enumeration value="auto"/>
+ <enumeration value="inherit"/>
+ <enumeration value="transition"/>
+ </restriction>
+ </simpleType>
+ <attributeGroup name="beginEndTimingAttrs">
+ <attribute name="begin" type="string"/>
+ <attribute name="end" type="string"/>
+ </attributeGroup>
+ <attributeGroup name="durTimingAttrs">
+ <attribute name="dur" type="string"/>
+ </attributeGroup>
+ <attributeGroup name="repeatTimingAttrs">
+ <attribute name="repeatDur" type="string"/>
+ <attribute name="repeatCount" type="smil20:nonNegativeDecimalType"/>
+ </attributeGroup>
+ <attributeGroup name="deprecatedRepeatTiming">
+ <attribute name="repeat" type="nonNegativeInteger"/>
+ </attributeGroup>
+ <attributeGroup name="minMaxTimingAttrs">
+ <attribute name="min" type="string"/>
+ <attribute name="max" type="string"/>
+ </attributeGroup>
+</schema>
diff --git a/petascope/xml/ogc/gml/3.1.1/smil/xml-mod.xsd b/petascope/xml/ogc/gml/3.1.1/smil/xml-mod.xsd
new file mode 100644
index 0000000..272e19e
--- /dev/null
+++ b/petascope/xml/ogc/gml/3.1.1/smil/xml-mod.xsd
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+=================== OpenGIS ============================
+ This schema is required by SMIL schemas.
+ There are errors in publicly available smil schemas at w3c site.
+ One is acknowledged by w3c - it is typographical error described in SMIL errata document at:
+ http://www.w3.org/2001/07/REC-SMIL20-20010731-errata
+ under:
+ E30: Correction in the SMIL 2.0 utility Schema, section B.3.48 (revised 29 03 2002)
+ Others (at least one) are assumed after failed validation using Visual Studio .NET.
+ These smil schemas are reorganized to include in minimum number of files all and only definitions required by
+ defaultStyle.xsd. It was done to enable the validation of GML3.0 schemas.
+ When w3c fixes the public schemas these will be discarded
+ comment: Milan Trninic, Galdos Systems Inc., May 2002
+
+ comment#2: Milan Trninic, Galdos Systems Inc., Dec 2002
+ In order to validate with xerces, changed the "x:" prefix to "xml:" in the namespace declaration and references to "lang" and "space" attributes
+=================== OpenGIS ============================
+-->
+<schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns="http://www.w3.org/2001/XMLSchema">
+ <attribute name="lang" type="language">
+ <annotation>
+ <documentation>In due course, we should install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values . . .</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="space" default="preserve">
+ <simpleType>
+ <restriction base="NCName">
+ <enumeration value="default"/>
+ <enumeration value="preserve"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attributeGroup name="specialAttrs">
+ <attribute ref="xml:lang"/>
+ <attribute ref="xml:space"/>
+ </attributeGroup>
+</schema>
diff --git a/petascope/xml/ogc/gml/ReadMe.txt b/petascope/xml/ogc/gml/ReadMe.txt
new file mode 100644
index 0000000..b29177e
--- /dev/null
+++ b/petascope/xml/ogc/gml/ReadMe.txt
@@ -0,0 +1,27 @@
+OpenGIS GML ReadMe.txt
+
+NOTICE: GML 2.1.2 will link to the newest version of GML 2.1.2.x . As
+of 5 September 2007, the contents of 2.1.2 contain GML 2.1.2.1 per OGC
+06-189. If you have questions, please contact the webmaster (at)
+opengeospatial.org.
+
+2007-09-06 Kevin Stegemoller
+
+ * v3.2.1 Published GML 3.2.1 schemas from OGC 07-036
+
+2007-08-27 Chris Holmes
+
+ * v2.1.2: update 2.1.2.1 and ReadMe.txt changes
+ * v2.1.2.0: Contains previous version of GML 2.1.2 (pre- 5 Sep 2007)
+ * v2.1.2.1: Contains Corrigendum 1 for GML 2.1.2 schema fix (OGC 06-189).
+
+2005-11-22 Arliss Whiteside
+
+ * GML versions 2.0.0 through 3.1.1: The sets of XML Schema Documents for
+ OpenGIS GML Versions 2.0.0 through 3.1.1 have been edited to reflect the
+ corrigenda to all those OGC documents that is based on the change requests:
+ OGC 05-068r1 "Store xlinks.xsd file at a fixed location"
+ OGC 05-081r2 "Change to use relative paths"
+
+ * Note: check each OGC numbered document for detailed changes.
+
diff --git a/petascope/xml/ogc/wcps/1.0.0/wcpsAll.xsd b/petascope/xml/ogc/wcps/1.0.0/wcpsAll.xsd
new file mode 100644
index 0000000..cbb2edf
--- /dev/null
+++ b/petascope/xml/ogc/wcps/1.0.0/wcpsAll.xsd
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns="http://www.opengis.net/wcps/1.0"
+ targetNamespace="http://www.opengis.net/wcps/1.0"
+ xmlns:wcs="http://www.opengis.net/wcs/1.1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0.0" xml:lang="en">
+ <xs:annotation>
+ <xs:appinfo>wcps.xsd 2009-03-09</xs:appinfo>
+ <xs:documentation>
+ This XML Schema Document includes, directly and indirectly, all the XML Schema Documents defined by
+ the OGC Web Coverage Service (WCS) Processing Extension, see OGC 08-059r3.
+
+ WCPS query can be sent either as XML tree or as a string encoded in the Abstract Syntax defined in
+ OGC Web Coverage Processing Service (WCPS), see OGC 08-068r2.
+
+ Copyright (c) 2008 Open Geospatial Consortium, Inc. All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </xs:documentation>
+ </xs:annotation>
+ <!-- =============================================================
+ includes and imports
+ ============================================================== -->
+ <xs:include schemaLocation="wcpsProcessCoverages.xsd"/>
+</xs:schema>
diff --git a/petascope/xml/ogc/wcps/1.0.0/wcpsProcessCoverages.xsd b/petascope/xml/ogc/wcps/1.0.0/wcpsProcessCoverages.xsd
new file mode 100644
index 0000000..8ac2b0a
--- /dev/null
+++ b/petascope/xml/ogc/wcps/1.0.0/wcpsProcessCoverages.xsd
@@ -0,0 +1,582 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns="http://www.opengis.net/wcps/1.0"
+ targetNamespace="http://www.opengis.net/wcps/1.0"
+ xmlns:wcs="http://www.opengis.net/wcs/1.1"
+ xmlns:gml="http://www.opengis.net/gml"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0.0" xml:lang="en">
+ <xs:annotation>
+ <xs:appinfo>wcpsProcessCoverages.xsd</xs:appinfo>
+ <xs:documentation>
+ This schema defines the ProcessCoverages operation request elements and types, used by an OGC Web Coverage Service (WCS) Processing Extension, see OGC 08-059r3.
+ A WCPS query can be sent either as XML tree or as a string encoded in the Abstract Syntax defined in OGC Web Coverage Processing Service (WCPS), see OGC 08-068r2.
+ Copyright (c) 2008 Open Geospatial Consortium, Inc. All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
+ </xs:documentation>
+ </xs:annotation>
+ <!-- =============================================================
+ includes and imports
+ ============================================================== -->
+ <xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
+ <xs:import namespace="http://www.opengis.net/wcs/1.1" schemaLocation="http://schemas.opengis.net/wcs/1.1/wcsAll.xsd"/>
+ <!-- ==============================================================
+ elements and types
+ =============================================================== -->
+ <xs:element name="ProcessCoveragesRequest" type="ProcessCoveragesRequestType">
+ <xs:annotation>
+ <xs:documentation>Request to a WCS, which must implement WCPS, to perform a ProcessCoverages operation.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="ProcessCoveragesRequestType">
+ <xs:complexContent>
+ <xs:extension base="wcs:RequestBaseType">
+ <xs:sequence>
+ <xs:element name="query" type="ProcessOneCoverageType"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="ProcessOneCoverageType">
+ <xs:choice>
+ <xs:element name="xmlSyntax" type="ProcessCoverageXmlRequestType"/>
+ <xs:element name="abstractSyntax" type="xs:string"/>
+ </xs:choice>
+ </xs:complexType>
+ <xs:complexType name="ProcessCoverageXmlRequestType">
+ <xs:annotation>
+ <xs:documentation>ProcessCoverage XML query structure.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="coverageIterator" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="iteratorVar" type="VariableNameType"/>
+ <xs:element name="coverageName" type="wcs:IdentifierType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="where" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="BooleanScalarExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:group ref="ProcessingExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:group name="ProcessingExprType">
+ <xs:choice>
+ <xs:element name="encode" type="EncodeDataExprType"/>
+ <xs:group ref="ScalarExprType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="EncodeDataExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="format" type="xs:string"/>
+ <xs:element name="extraParameters" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="store" type="xs:boolean"/>
+ </xs:complexType>
+ <xs:group name="ScalarExprType">
+ <xs:choice>
+ <xs:group ref="MetadataScalarExprType"/>
+ <xs:group ref="BooleanScalarExprType"/>
+ <xs:group ref="NumericScalarExprType"/>
+ <xs:group ref="ReduceScalarExprType"/>
+ <xs:group ref="StringScalarExprType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="ScalarExprType">
+ <xs:group ref="ScalarExprType"/>
+ </xs:complexType>
+ <xs:group name="MetadataScalarExprType">
+ <xs:choice>
+ <xs:element name="identifier" type="CoverageExprElementType"/>
+ <xs:element name="imageCrs" type="CoverageExprElementType"/>
+ <xs:element name="imageCrsDomain">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="axis" type="AxisNameType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="crsSet" type="CoverageExprElementType"/>
+ <xs:element name="DomainMetadata" type="DomainMetadataExprType"/>
+ <xs:element name="nullSet" type="CoverageExprElementType"/>
+ <xs:element name="interpolationDefault">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="FieldNameType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="interpolationSet">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="FieldNameType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="DomainMetadataExprType">
+ <xs:group ref="DomainMetadataExprType"/>
+ </xs:complexType>
+ <xs:group name="DomainMetadataExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="axis" type="AxisNameType"/>
+ <xs:group ref="CrsNameType"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="BooleanScalarExprType">
+ <xs:choice>
+ <xs:element name="booleanConstant" type="xs:boolean"/>
+ <xs:element name="booleanNot" type="BooleanScalarExprType"/>
+ <xs:element name="booleanAnd" type="BooleanScalarExprPairType"/>
+ <xs:element name="booleanOr" type="BooleanScalarExprPairType"/>
+ <xs:element name="booleanXor" type="BooleanScalarExprPairType"/>
+ <xs:element name="booleanLessThan" type="NumericScalarExprPairType"/>
+ <xs:element name="booleanLessOrEqual" type="NumericScalarExprPairType"/>
+ <xs:element name="booleanGreaterThan" type="NumericScalarExprPairType"/>
+ <xs:element name="booleanGreaterOrEqual" type="NumericScalarExprPairType"/>
+ <xs:element name="booleanEqualNumeric" type="NumericScalarExprPairType"/>
+ <xs:element name="booleanNotEqualNumeric" type="NumericScalarExprPairType"/>
+ <xs:element name="booleanEqualString" type="StringScalarExprPairType"/>
+ <xs:element name="booleanNotEqualString" type="StringScalarExprPairType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="BooleanScalarExprType">
+ <xs:group ref="BooleanScalarExprType"/>
+ </xs:complexType>
+ <xs:complexType name="BooleanScalarExprPairType">
+ <xs:sequence>
+ <xs:group ref="BooleanScalarExprType"/>
+ <xs:group ref="BooleanScalarExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="NumericScalarExprPairType">
+ <xs:sequence>
+ <xs:group ref="NumericScalarExprType"/>
+ <xs:group ref="NumericScalarExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="StringScalarExprPairType">
+ <xs:sequence>
+ <xs:group ref="StringScalarExprType"/>
+ <xs:group ref="StringScalarExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:group name="NumericScalarExprType">
+ <xs:choice>
+ <xs:element name="numericConstant" type="xs:double"/>
+ <xs:element name="complexConstant" type="ComplexConstantType"/>
+ <xs:element name="numericUnaryMinus">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="NumericScalarExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="numericAdd" type="NumericScalarExprPairType"/>
+ <xs:element name="numericMinus" type="NumericScalarExprPairType"/>
+ <xs:element name="numericMult" type="NumericScalarExprPairType"/>
+ <xs:element name="numericDiv" type="NumericScalarExprPairType"/>
+ <xs:element name="condense" type="CondenseScalarExprType"/>
+ <xs:element name="reduce" type="ReduceScalarExprType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="StringScalarExprType">
+ <xs:choice>
+ <xs:element name="stringIdentifier" type="CoverageExprElementType"/>
+ <xs:element name="stringConstant" type="xs:string"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="SetMetadataCoverageExprType">
+ <xs:choice>
+ <xs:element name="setIdentifier">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="identifier" type="wcs:IdentifierType"/>
+ <xs:group ref="CoverageExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="setCrsSet">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="CrsNameType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="setNullSet">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="null" type="RangeExprType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="setInterpolationDefault">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="field" type="FieldNameType"/>
+ <xs:group ref="InterpolationMethodType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="setInterpolationSet">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="field" type="FieldNameType"/>
+ <xs:group ref="InterpolationMethodType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="RangeExprType">
+ <xs:sequence>
+ <xs:element name="component" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="field" type="FieldNameType"/>
+ <xs:group ref="ScalarExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:group name="InterpolationMethodType">
+ <xs:sequence>
+ <xs:element name="interpolationMethod" type="xs:string"/>
+ <xs:element name="nullResistance" type="xs:string"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:complexType name="CoverageExprElementType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:group name="CoverageExprType">
+ <xs:choice>
+ <xs:element name="coverage" type="wcs:IdentifierType"/>
+ <xs:group ref="SetMetadataCoverageExprType"/>
+ <xs:group ref="InducedOperationCoverageExprType"/>
+ <xs:group ref="SubsetOperationCoverageExprType"/>
+ <xs:element name="crsTransform" type="CrsTransformCoverageExprType"/>
+ <xs:element name="scale" type="ScaleCoverageExprType"/>
+ <xs:element name="construct" type="ConstructCoverageExprType"/>
+ <xs:element name="const" type="ConstantCoverageExprType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="InducedOperationCoverageExprType">
+ <xs:choice>
+ <xs:group ref="UnaryOperationCoverageExprType"/>
+ <xs:group ref="BinaryOperationCoverageExprType"/>
+ <xs:element name="rangeConstructor" type="RangeCoverageExprType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="UnaryOperationCoverageExprType">
+ <xs:choice>
+ <xs:element name="unaryPlus" type="CoverageExprElementType"/>
+ <xs:element name="unaryMinus" type="CoverageExprElementType"/>
+ <xs:element name="sqrt" type="CoverageExprElementType"/>
+ <xs:element name="abs" type="CoverageExprElementType"/>
+ <xs:element name="exp" type="CoverageExprElementType"/>
+ <xs:element name="log" type="CoverageExprElementType"/>
+ <xs:element name="ln" type="CoverageExprElementType"/>
+ <xs:element name="sin" type="CoverageExprElementType"/>
+ <xs:element name="cos" type="CoverageExprElementType"/>
+ <xs:element name="tan" type="CoverageExprElementType"/>
+ <xs:element name="sinh" type="CoverageExprElementType"/>
+ <xs:element name="cosh" type="CoverageExprElementType"/>
+ <xs:element name="tanh" type="CoverageExprElementType"/>
+ <xs:element name="arcsin" type="CoverageExprElementType"/>
+ <xs:element name="arccos" type="CoverageExprElementType"/>
+ <xs:element name="arctan" type="CoverageExprElementType"/>
+ <xs:element name="not" type="CoverageExprElementType"/>
+ <xs:element name="re" type="CoverageExprElementType"/>
+ <xs:element name="im" type="CoverageExprElementType"/>
+ <xs:element name="bit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="bitIndex" type="xs:integer"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="cast">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="type" type="RangeFieldType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="fieldSelect">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="field" type="FieldNameType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:group>
+ <xs:simpleType name="RangeFieldType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="bool"/>
+ <xs:enumeration value="char"/>
+ <xs:enumeration value="unsigned char"/>
+ <xs:enumeration value="short"/>
+ <xs:enumeration value="unsigned short"/>
+ <xs:enumeration value="long"/>
+ <xs:enumeration value="unsigned long"/>
+ <xs:enumeration value="float"/>
+ <xs:enumeration value="double"/>
+ <xs:enumeration value="complex"/>
+ <xs:enumeration value="complex2"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:group name="BinaryOperationCoverageExprType">
+ <xs:choice>
+ <xs:element name="plus" type="CoverageExprPairType"/>
+ <xs:element name="minus" type="CoverageExprPairType"/>
+ <xs:element name="mult" type="CoverageExprPairType"/>
+ <xs:element name="div" type="CoverageExprPairType"/>
+ <xs:element name="and" type="CoverageExprPairType"/>
+ <xs:element name="or" type="CoverageExprPairType"/>
+ <xs:element name="xor" type="CoverageExprPairType"/>
+ <xs:element name="equals" type="CoverageExprPairType"/>
+ <xs:element name="lessThan" type="CoverageExprPairType"/>
+ <xs:element name="greaterThan" type="CoverageExprPairType"/>
+ <xs:element name="lessOrEqual" type="CoverageExprPairType"/>
+ <xs:element name="greaterOrEqual" type="CoverageExprPairType"/>
+ <xs:element name="notEqual" type="CoverageExprPairType"/>
+ <xs:element name="overlay" type="CoverageExprPairType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="CoverageExprPairType">
+ <xs:choice>
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:choice>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="ScalarExprType"/>
+ </xs:choice>
+ </xs:sequence>
+ <xs:sequence>
+ <xs:group ref="ScalarExprType"/>
+ <xs:group ref="CoverageExprType"/>
+ </xs:sequence>
+ </xs:choice>
+ </xs:complexType>
+ <xs:complexType name="RangeCoverageExprType">
+ <xs:sequence>
+ <xs:element name="component" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="field" type="FieldNameType"/>
+ <xs:group ref="CoverageExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:group name="SubsetOperationCoverageExprType">
+ <xs:choice>
+ <xs:element name="trim" type="TrimCoverageExprType"/>
+ <xs:element name="slice" type="SliceCoverageExprType"/>
+ <xs:element name="extend" type="ExtendCoverageExprType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="TrimCoverageExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="DimensionIntervalElementType" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="SliceCoverageExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="DimensionPointElementType" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ExtendCoverageExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="DimensionIntervalElementType" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ScaleCoverageExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="DimensionIntervalElementType" maxOccurs="unbounded"/>
+ <xs:group ref="FieldInterpolationElementType" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="CrsTransformCoverageExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:group ref="DimensionIntervalElementType" maxOccurs="unbounded"/>
+ <xs:group ref="FieldInterpolationElementType" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:group name="DimensionIntervalElementType">
+ <xs:sequence>
+ <xs:element name="axis" type="AxisNameType"/>
+ <xs:group ref="CrsNameType" minOccurs="0"/>
+ <xs:choice>
+ <xs:sequence>
+ <xs:element name="lowerBound" type="ScalarExprType"/>
+ <xs:element name="upperBound" type="ScalarExprType"/>
+ </xs:sequence>
+ <xs:group ref="DomainMetadataExprType"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="DimensionPointElementType">
+ <xs:sequence>
+ <xs:element name="axis" type="AxisNameType"/>
+ <xs:group ref="CrsNameType" minOccurs="0"/>
+ <xs:element name="slicingPosition" type="ScalarExprType"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="FieldInterpolationElementType">
+ <xs:sequence>
+ <xs:group ref="FieldNameType"/>
+ <xs:group ref="InterpolationMethodType"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:complexType name="ConstructCoverageExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageNameType"/>
+ <xs:element name="axisIterator" type="AxisIteratorType" maxOccurs="unbounded"/>
+ <xs:group ref="ScalarExprType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ConstantCoverageExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageNameType"/>
+ <xs:element name="axisIterator" type="AxisIteratorType" maxOccurs="unbounded"/>
+ <xs:element name="value" type="ConstantType" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="AxisIteratorType">
+ <xs:sequence>
+ <xs:element name="iteratorVar" type="VariableNameType"/>
+ <xs:element name="axis" type="AxisNameType"/>
+ <xs:choice>
+ <xs:sequence>
+ <xs:group ref="NumericScalarExprType"/>
+ <xs:group ref="NumericScalarExprType"/>
+ </xs:sequence>
+ <xs:group ref="ImageCrsDomainMetadataExprType"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:group name="ImageCrsDomainMetadataExprType">
+ <xs:sequence>
+ <xs:group ref="CoverageExprType"/>
+ <xs:element name="axis" type="AxisNameType"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="ReduceScalarExprType">
+ <xs:choice>
+ <xs:element name="all" type="CoverageExprElementType"/>
+ <xs:element name="some" type="CoverageExprElementType"/>
+ <xs:element name="count" type="CoverageExprElementType"/>
+ <xs:element name="add" type="CoverageExprElementType"/>
+ <xs:element name="avg" type="CoverageExprElementType"/>
+ <xs:element name="min" type="CoverageExprElementType"/>
+ <xs:element name="max" type="CoverageExprElementType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="ReduceScalarExprType">
+ <xs:group ref="ReduceScalarExprType"/>
+ </xs:complexType>
+ <xs:complexType name="CondenseScalarExprType">
+ <xs:choice>
+ <xs:group ref="ReduceScalarExprType"/>
+ <xs:group ref="GeneralCondenseExprType"/>
+ </xs:choice>
+ </xs:complexType>
+ <xs:group name="GeneralCondenseExprType">
+ <xs:sequence>
+ <xs:group ref="CondenseOperationType"/>
+ <xs:element name="iterator" type="AxisIteratorType" maxOccurs="unbounded"/>
+ <xs:element name="where" type="BooleanScalarExprType" minOccurs="0"/>
+ <xs:group ref="ScalarExprType"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="CondenseOperationType">
+ <xs:choice>
+ <xs:element name="opPlus"/>
+ <xs:element name="opMult"/>
+ <xs:element name="opMax"/>
+ <xs:element name="opMin"/>
+ <xs:element name="opAnd"/>
+ <xs:element name="opOr"/>
+ </xs:choice>
+ </xs:group>
+ <xs:simpleType name="VariableNameType">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="[$a-zA-Z_][0-9a-zA-Z_]*"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:group name="CoverageNameType">
+ <xs:choice>
+ <xs:element name="name" type="wcs:IdentifierType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:simpleType name="AxisNameType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="x"/>
+ <xs:enumeration value="y"/>
+ <xs:enumeration value="z"/>
+ <xs:enumeration value="t"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:group name="CrsNameType">
+ <xs:choice>
+ <xs:element ref="gml:srsName"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="FieldNameType">
+ <xs:choice>
+ <xs:element name="name" type="wcs:IdentifierType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="FieldNameType">
+ <xs:group ref="FieldNameType"/>
+ </xs:complexType>
+ <xs:complexType name="ConstantType">
+ <xs:sequence>
+ <xs:group ref="ConstantType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:group name="ConstantType">
+ <xs:choice>
+ <xs:element name="stringConstant" type="xs:string"/>
+ <xs:element name="booleanConstant" type="xs:boolean"/>
+ <xs:element name="integerConstant" type="xs:integer"/>
+ <xs:element name="floatConstant" type="xs:double"/>
+ <xs:element name="complexConstant" type="ComplexConstantType"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="ComplexConstantType">
+ <xs:sequence>
+ <xs:element name="re" type="xs:double"/>
+ <xs:element name="im" type="xs:double"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
diff --git a/petascope/xml/ogc/wcs/1.1.0/wcsCommon.xsd b/petascope/xml/ogc/wcs/1.1.0/wcsCommon.xsd
new file mode 100644
index 0000000..fb1897f
--- /dev/null
+++ b/petascope/xml/ogc/wcs/1.1.0/wcsCommon.xsd
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/1.1"
+xmlns:wcs="http://www.opengis.net/wcs/1.1"
+xmlns:gml="http://www.opengis.net/gml"
+xmlns="http://www.w3.org/2001/XMLSchema"
+elementFormDefault="qualified" version="1.1.0" xml:lang="en">
+ <annotation>
+ <appinfo>wcsContents.xsd 2006-09-23</appinfo>
+ <appinfo>
+ <GMLProfileSchema>http://schemas.opengis.net/wcs/1.1.0/gml4wcs.xsd</GMLProfileSchema>
+ </appinfo>
+ <documentation>This XML Schema Document encodes the elements and types that are shared by multiple WCS operations.
+ Copyright (c) 2006 Open Geospatial Consortium, Inc, All Rights Reserved. </documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <import namespace="http://www.opengis.net/gml" schemaLocation="../../gml/3.1.1/base/gml.xsd"/>
+ <!-- ==============================================================
+ elements and types
+ ============================================================== -->
+ <complexType name="RequestBaseType">
+ <annotation>
+ <documentation>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. </documentation>
+ </annotation>
+ <sequence/>
+ <attribute name="service" type="string" use="required" fixed="WCS">
+ <annotation>
+ <documentation>Service type identifier, where the value is the OWS type abbreviation. For WCS operation requests, the value is "WCS". </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="version" type="string" use="required" fixed="1.1.0">
+ <annotation>
+ <documentation>Specification version for WCS version and operation. See Version parameter Subclause 7.3.1 of OWS Common for more information. </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Identifier" type="wcs:IdentifierType"/>
+ <!-- =========================================================== -->
+ <simpleType name="IdentifierType">
+ <annotation>
+ <documentation>Unambiguous identifier. Although there is no formal restriction on characters included, these identifiers shall be directly usable in GetCoverage operation requests for the specific server, whether those requests are encoded in KVP or XML. Each of these encodings requires that certain characters be avoided, encoded, or escaped (TBR). </documentation>
+ </annotation>
+ <restriction base="string">
+ <pattern value=".+"/>
+ </restriction>
+ </simpleType>
+ <!-- =========================================================== -->
+ <complexType name="TimeSequenceType">
+ <annotation>
+ <documentation>List of time positions and periods. The time positions and periods should be ordered from the oldest to the newest, but this is not required. </documentation>
+ </annotation>
+ <choice maxOccurs="unbounded">
+ <element ref="gml:timePosition"/>
+ <element name="TimePeriod" type="wcs:TimePeriodType"/>
+ </choice>
+ </complexType>
+ <!-- ========================================================= -->
+ <complexType name="TimePeriodType">
+ <annotation>
+ <documentation>This is a variation of the GML TimePeriod, which allows the beginning and end of a time-period to be expressed in short-form inline using the begin/endPosition element, which allows an identifiable TimeInstant to be defined simultaneously with using it, or by reference, using xlinks on the begin/end elements. </documentation>
+ <documentation>(Arliss) What does this mean? What do the TimeResolution and "frame" mean? </documentation>
+ </annotation>
+ <sequence>
+ <element name="BeginPosition" type="gml:TimePositionType"/>
+ <element name="EndPosition" type="gml:TimePositionType"/>
+ <element name="TimeResolution" type="wcs:TimeDurationType" minOccurs="0"/>
+ </sequence>
+ <attribute name="frame" type="anyURI" use="optional" default="#ISO-8601"/>
+ </complexType>
+ <!-- ===================================== -->
+ <simpleType name="TimeDurationType">
+ <annotation>
+ <documentation xml:lang="en">
+ Base type for describing temporal length or distance. The value space is further
+ constrained by subtypes that conform to the ISO 8601 or ISO 11404 standards.
+ </documentation>
+ </annotation>
+ <union memberTypes="duration decimal"/>
+ </simpleType>
+ <!-- ========================================================= -->
+</schema>
diff --git a/petascope/xml/ogc/wcst/1.1.4/wcstActions.xml b/petascope/xml/ogc/wcst/1.1.4/wcstActions.xml
new file mode 100644
index 0000000..9a969f7
--- /dev/null
+++ b/petascope/xml/ogc/wcst/1.1.4/wcstActions.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?> <Dictionary xmlns="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/gml ../../gml/3.1.1/Profiles/SimpleDictionary/1.0.0/gmlSimpleDictionaryProfile.xsd" gml:id="wcsTransactionActions"> <!-- Primary editor: Arliss Whiteside. Last updated 2008-05-15 --> <description>This dictionary specifies the standard identifiers for actions specified in the Transaction extension of WCS 1.1 specification. These values may be used to request actions and to identify actions successfully completed. </description> <name>WCS Transaction action standard values</name> <!-- ===================================================== --> <dictionaryEntry> <Definition gml:id="Add"> <description>Identifier of add coverage action by Transaction operation. This action requests adding a coverage to the set of coverages being offered. </description> <name>Add</name> </Definition> </dictionaryEntry> <!-- ===================================================== --> <dictionaryEntry> <Definition gml:id="UpdateMetadata"> <description>Identifier of update all metadata of coverage action by Transaction operation. This action requests replacing all the metadata for a coverage currently being offered. </description> <name>UpdateMetadata</name> </Definition> </dictionaryEntry> <!-- ===================================================== --> <dictionaryEntry> <Definition gml:id="Delete"> <description>Identifier of delete coverage action by Transaction operation. This action requests deleting all the data and metadata for a coverage currently being offered. </description> <name>Delete</name> </Definition> </dictionaryEntry> <!-- ===================================================== --> <dictionaryEntry> <Definition gml:id="UpdateAll"> <description>Identifier of update all coverage data and metadata action by Transaction operation. This action requests replacing all the data and metadata for a coverage currently being offered. </description> <name>UpdateAll</name> </Definition> </dictionaryEntry> <!-- ===================================================== --> <dictionaryEntry> <Definition gml:id="UpdateDataPart"> <description>Identifier of update data part action by Transaction operation. This action requests replacing range (or pixel) values for part of the domain data of a coverage currently being offered. </description> <name>UpdateDataPart</name> </Definition> </dictionaryEntry> </Dictionary> \ No newline at end of file
diff --git a/petascope/xml/ogc/wcst/1.1.4/wcstTransaction.xsd b/petascope/xml/ogc/wcst/1.1.4/wcstTransaction.xsd
new file mode 100644
index 0000000..14cbe2a
--- /dev/null
+++ b/petascope/xml/ogc/wcst/1.1.4/wcstTransaction.xsd
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.opengis.net/wcs/1.1/wcst"
+ xmlns:wcst="http://www.opengis.net/wcs/1.1/wcst"
+ xmlns:ows="http://www.opengis.net/ows/1.1"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" version="1.1.4" xml:lang="en">
+ <annotation>
+ <appinfo>wcstTransaction.xsd 2009-02-25</appinfo>
+ <documentation>This XML Schema Document defines the Transaction operation request and response elements and types, for the Transaction operation extension to the OGC Web Coverage Service (WCS) version 1.1 corrigendum 2.
+ WCS 1.1 corrigendum 2 and this Transaction operation extension are OGC Standards.
+ Copyright (c) 2009 Open Geospatial Consortium, Inc. All Rights Reserved.
+ To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. </documentation>
+ </annotation>
+ <!-- ==============================================================
+ includes and imports
+ ============================================================== -->
+ <import namespace="http://www.opengis.net/ows/1.1" schemaLocation="http://schemas.opengis.net/ows/1.1.0/owsAll.xsd"/>
+ <!-- ==============================================================
+ elements and types
+ ============================================================== -->
+ <element name="Transaction" type="wcst:TransactionType">
+ <annotation>
+ <documentation>Request to perform the Transaction operation, to a WCS that implements the Transaction operation extension. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="TransactionType">
+ <sequence>
+ <element name="InputCoverages" type="ows:ManifestType">
+ <annotation>
+ <documentation>Ordered list of one or more coverages to be added, modified, or deleted, in the specified sequence. Each coverage with its metadata shall be referenced by one wcst:Coverage element within this ManifestType. Each new or modified coverage provided to a WCS server shall include all the metadata needed to populate one CoverageDescription object, as specified in Subclause 9.3 with the exception of the metadata that is specific to a specific server. If the WCS offers CoverageSummary elements, each new or modified coverage shall also include all the metadata needed to populate one or more CoverageSummary objects, as specified in Subclause 8.3.3 with the exception of the metadata that is specific to a specific server. In addition, each new unrectified but georeferenced coverage (image) shall include the georeferencing coordinate Transformation(s). The coverage data is normally referenced remotely, but can be included in the Transaction request message. </documentation>
+ </annotation>
+ </element>
+ <element ref="wcst:RequestId" minOccurs="0">
+ <annotation>
+ <documentation>Unique identifier of this operation request, included if assigned by the client. </documentation>
+ </annotation>
+ </element>
+ <element name="ResponseHandler" type="anyURI" minOccurs="0">
+ <annotation>
+ <documentation>Location to respond to when server has completed processing this operation request. When this parameter is omitted from the Transaction operation request, this operation shall be executed synchronously and immediately by the server, with the operation response returned to the client following operation execution. When this parameter is included, this operation shall be executed asynchronously by the server. In that case, the server shall return an operation acknowledgement to the client immediately following operation acceptance. When operation execution is later completed, the (normal or exception) operation response shall be sent by the server to the response handler referenced by this parameter value. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="service" type="string" use="required" fixed="WCS">
+ <annotation>
+ <documentation>Service type identifier, where the value is the OWS type abbreviation. For WCS operation requests, the value is "WCS". </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="version" type="string" use="required" fixed="1.1">
+ <annotation>
+ <documentation>Specification version for WCS version and operation. See Version parameter Subclause 7.3.1 of OWS Common for more information. </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ <!-- ========================================================== -->
+ <element name="Coverage" type="wcst:CoverageType" substitutionGroup="ows:ReferenceGroup">
+ <annotation>
+ <documentation>Complete data and metadata for one coverage, referencing each coverage file either remotely or locally in the same message. The Identifier in this data structure shall identify the coverage being updated or deleted, and optionally the suggested identifier for a coverage being added. </documentation>
+ </annotation>
+ </element>
+ <!-- ========================================================== -->
+ <complexType name="CoverageType">
+ <complexContent>
+ <extension base="ows:ReferenceGroupType">
+ <sequence>
+ <element ref="wcst:Action">
+ <annotation>
+ <documentation>The specific add, update, or delete action to be performed on this coverage. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="Action">
+ <annotation>
+ <documentation>Identifier of an action. </documentation>
+ </annotation>
+ <complexType>
+ <simpleContent>
+ <restriction base="ows:CodeType">
+ <attribute name="codeSpace" type="anyURI" use="optional" default="http://schemas.opengis.net/wcs/1.1.0/actions.xml">
+ <annotation>
+ <documentation>Reference to a dictionary that specifies allowed values for action identifier strings. This reference defaults to the standard actions dictionary specified in WCST 1.1.0. </documentation>
+ </annotation>
+ </attribute>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ </element>
+ <!-- ========================================================== -->
+ <!-- ========================================================== -->
+ <element name="Acknowledgement" type="wcst:AcknowledgementType">
+ <annotation>
+ <documentation>XML encoded acknowledgement of an operation request. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="AcknowledgementType">
+ <sequence>
+ <element name="TimeStamp" type="dateTime">
+ <annotation>
+ <documentation>Data and time this Acknowledgement message was generated. </documentation>
+ </annotation>
+ </element>
+ <element ref="wcst:RequestId">
+ <annotation>
+ <documentation>Unique identifier of the operation request to which this acknowledgement corresponds. If the client specifies a RequestId in the operation request, this element shall have that value. If the client does not specify a RequestId in the operation request, the server shall generate a unique RequestId and put this value in this acknowledgement message and in the operation response. </documentation>
+ </annotation>
+ </element>
+ <element name="OperationRequest" type="wcst:TransactionType" minOccurs="0">
+ <annotation>
+ <documentation>Copy of Transaction operation request being acknowledged. This copy may be included when expected to be useful to clients. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <!-- =========================================================== -->
+ <element name="TransactionResponse" type="wcst:TransactionResponseType">
+ <annotation>
+ <documentation>Response from successfully performing the Transaction operation, from a WCS that implements the Transaction operation extension. </documentation>
+ </annotation>
+ </element>
+ <!-- =========================================================== -->
+ <complexType name="TransactionResponseType">
+ <sequence>
+ <element ref="wcst:RequestId">
+ <annotation>
+ <documentation>Unique identifier of the operation request to which this response corresponds. If the client specifies a RequestId in the operation request, this element shall have that value. If the client does not specify a RequestId in the operation request, the server shall generate a unique RequestId and put this value in the acknowledgement message and in this operation response. </documentation>
+ </annotation>
+ </element>
+ <element ref="ows:Identifier" maxOccurs="unbounded">
+ <annotation>
+ <documentation>The coverage identifier for each coverage added, modified, or deleted by the Transaction operation. These Identifier elements shall be listed in the same order as the corresponding input coverages in the Transaction request. </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+ <!-- =========================================================== -->
+ <element name="RequestId" type="anyURI">
+ <annotation>
+ <documentation>Unique identifier of an operation request, which may be generated by the client or the server. </documentation>
+ </annotation>
+ </element>
+</schema>
diff --git a/petascope/xml/ogc/xlink/1.0.0/ReadMe.txt b/petascope/xml/ogc/xlink/1.0.0/ReadMe.txt
new file mode 100644
index 0000000..1499a92
--- /dev/null
+++ b/petascope/xml/ogc/xlink/1.0.0/ReadMe.txt
@@ -0,0 +1,6 @@
+This XML Schema Document named xlinks.xsd has been stored here based
+on the change request:
+OGC 05-068r1 "Store xlinks.xsd file at a fixed location"
+
+Arliss Whiteside, 2005-11-22
+
diff --git a/petascope/xml/ogc/xlink/1.0.0/xlinks.xsd b/petascope/xml/ogc/xlink/1.0.0/xlinks.xsd
new file mode 100644
index 0000000..faef81d
--- /dev/null
+++ b/petascope/xml/ogc/xlink/1.0.0/xlinks.xsd
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- File: xlinks.xsd -->
+<schema targetNamespace="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="2.0">
+ <annotation>
+ <appinfo source="urn:opengis:specification:gml:schema-xlinks:v3.0c2">xlinks.xsd v3.0b2 2001-07</appinfo>
+ <documentation>
+ GML 3.0 candidate xlinks schema. Copyright (c) 2001 OGC, All Rights Reserved.
+ </documentation>
+ </annotation>
+ <!-- ==============================================================
+ global declarations
+ =============================================================== -->
+ <!-- locator attribute -->
+ <attribute name="href" type="anyURI"/>
+ <!-- semantic attributes -->
+ <attribute name="role" type="anyURI"/>
+ <attribute name="arcrole" type="anyURI"/>
+ <attribute name="title" type="string"/>
+ <!-- behavior attributes -->
+ <attribute name="show">
+ <annotation>
+ <documentation>
+ The 'show' attribute is used to communicate the desired presentation
+ of the ending resource on traversal from the starting resource; it's
+ value should be treated as follows:
+ new - load ending resource in a new window, frame, pane, or other
+ presentation context
+ replace - load the resource in the same window, frame, pane, or
+ other presentation context
+ embed - load ending resource in place of the presentation of the
+ starting resource
+ other - behavior is unconstrained; examine other markup in the
+ link for hints
+ none - behavior is unconstrained
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="new"/>
+ <enumeration value="replace"/>
+ <enumeration value="embed"/>
+ <enumeration value="other"/>
+ <enumeration value="none"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="actuate">
+ <annotation>
+ <documentation>
+ The 'actuate' attribute is used to communicate the desired timing
+ of traversal from the starting resource to the ending resource;
+ it's value should be treated as follows:
+ onLoad - traverse to the ending resource immediately on loading
+ the starting resource
+ onRequest - traverse from the starting resource to the ending
+ resource only on a post-loading event triggered for
+ this purpose
+ other - behavior is unconstrained; examine other markup in link
+ for hints
+ none - behavior is unconstrained
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="onLoad"/>
+ <enumeration value="onRequest"/>
+ <enumeration value="other"/>
+ <enumeration value="none"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <!-- traversal attributes -->
+ <attribute name="label" type="string"/>
+ <attribute name="from" type="string"/>
+ <attribute name="to" type="string"/>
+ <!-- ==============================================================
+ Attributes grouped by XLink type, as specified in the W3C
+ Proposed Recommendation (dated 2000-12-20)
+ ============================================================== -->
+ <attributeGroup name="simpleLink">
+ <attribute name="type" type="string" fixed="simple" form="qualified"/>
+ <attribute ref="xlink:href" use="optional"/>
+ <attribute ref="xlink:role" use="optional"/>
+ <attribute ref="xlink:arcrole" use="optional"/>
+ <attribute ref="xlink:title" use="optional"/>
+ <attribute ref="xlink:show" use="optional"/>
+ <attribute ref="xlink:actuate" use="optional"/>
+ </attributeGroup>
+ <attributeGroup name="extendedLink">
+ <attribute name="type" type="string" fixed="extended" form="qualified"/>
+ <attribute ref="xlink:role" use="optional"/>
+ <attribute ref="xlink:title" use="optional"/>
+ </attributeGroup>
+ <attributeGroup name="locatorLink">
+ <attribute name="type" type="string" fixed="locator" form="qualified"/>
+ <attribute ref="xlink:href" use="required"/>
+ <attribute ref="xlink:role" use="optional"/>
+ <attribute ref="xlink:title" use="optional"/>
+ <attribute ref="xlink:label" use="optional"/>
+ </attributeGroup>
+ <attributeGroup name="arcLink">
+ <attribute name="type" type="string" fixed="arc" form="qualified"/>
+ <attribute ref="xlink:arcrole" use="optional"/>
+ <attribute ref="xlink:title" use="optional"/>
+ <attribute ref="xlink:show" use="optional"/>
+ <attribute ref="xlink:actuate" use="optional"/>
+ <attribute ref="xlink:from" use="optional"/>
+ <attribute ref="xlink:to" use="optional"/>
+ </attributeGroup>
+ <attributeGroup name="resourceLink">
+ <attribute name="type" type="string" fixed="resource" form="qualified"/>
+ <attribute ref="xlink:role" use="optional"/>
+ <attribute ref="xlink:title" use="optional"/>
+ <attribute ref="xlink:label" use="optional"/>
+ </attributeGroup>
+ <attributeGroup name="titleLink">
+ <attribute name="type" type="string" fixed="title" form="qualified"/>
+ </attributeGroup>
+ <attributeGroup name="emptyLink">
+ <attribute name="type" type="string" fixed="none" form="qualified"/>
+ </attributeGroup>
+</schema>