diff --git a/CCDFDataModel/CCDFVariable.h b/CCDFDataModel/CCDFVariable.h index 86997a2e3..0bb1b942f 100644 --- a/CCDFDataModel/CCDFVariable.h +++ b/CCDFDataModel/CCDFVariable.h @@ -292,20 +292,20 @@ namespace CDF { size_t getSize() { return currentSize; } Attribute *getAttribute(const char *name) const { + Attribute *a = getAttributeNE(name); + if (a == nullptr) { + throw(CDF_E_ATTNOTFOUND); + } + return a; + } + + Attribute *getAttributeNE(const char *name) const { for (size_t j = 0; j < attributes.size(); j++) { if (attributes[j]->name.equals(name)) { return attributes[j]; } } - throw(CDF_E_ATTNOTFOUND); - return NULL; - } - Attribute *getAttributeNE(const char *name) const { - try { - return getAttribute(name); - } catch (int e) { - return NULL; - } + return nullptr; } /** diff --git a/CCDFDataModel/CTime.cpp b/CCDFDataModel/CTime.cpp index 5f5198dd7..e873760e1 100644 --- a/CCDFDataModel/CTime.cpp +++ b/CCDFDataModel/CTime.cpp @@ -878,7 +878,7 @@ CT::string CTime::currentDateTime() { strftime(buffer, 80, "%Y-%m-%dT%H:%M:%S", gmtime(&curTime.tv_sec)); char currentTime[100] = ""; - snprintf(currentTime, 99, "%s:%03dZ", buffer, milli); + snprintf(currentTime, 99, "%s.%03dZ", buffer, milli); return currentTime; } diff --git a/Dockerfile b/Dockerfile index 2030ae901..eddfea351 100755 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ USER root LABEL maintainer="adaguc@knmi.nl" # Version should be same as in Definitions.h -LABEL version="2.27.0" +LABEL version="2.28.0" # Try to update image packages RUN apt-get -q -y update \ @@ -88,7 +88,7 @@ COPY python /adaguc/adaguc-server-master/python # To run the tests against a postgres db, see docs/test_postgesql.md FROM base AS test -ENV TEST_IN_CONTAINER 1 +ENV TEST_IN_CONTAINER=1 COPY requirements-dev.txt /adaguc/adaguc-server-master/requirements-dev.txt RUN pip install --no-cache-dir -r requirements-dev.txt diff --git a/NEWS.md b/NEWS.md index 6f027f05b..beb03a41a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +**Version 2.28.0 2024-09-11** +- Metadata for layer items like variables, projections, dimensions and styles are now stored in a database table called `layermetadata`. This can be disabled via the `enablemetadatacache` property in [Settings](doc/configuration/Settings.md). + + + **Version 2.27.0 2024-09-02** - PostgreSQL query from `getFilesAndIndicesForDimensions` has been rewritten, which fixes https://github.com/KNMI/adaguc-server/issues/341. - Optimized existing PostgreSQL queries and reduced number of PostgreSQL queries in general. This results in better performance, the benchmark tool runs 9% faster. diff --git a/adagucserverEC/CAutoConfigure.cpp b/adagucserverEC/CAutoConfigure.cpp index c69e59399..f218ac03f 100644 --- a/adagucserverEC/CAutoConfigure.cpp +++ b/adagucserverEC/CAutoConfigure.cpp @@ -463,31 +463,13 @@ int CAutoConfigure::autoConfigureStyles(CDataSource *dataSource) { return 0; } -int CAutoConfigure::justLoadAFileHeader(CDataSource *dataSource) { +int CAutoConfigure::getFileNameForDataSource(CDataSource *dataSource, std::string &fileName) { - if (dataSource == NULL) { - CDBError("datasource == NULL"); - return 1; - } - if (dataSource->cfgLayer == NULL) { - CDBError("datasource->cfgLayer == NULL"); - return 1; - } - if (dataSource->getNumDataObjects() == 0) { - CDBError("dataSource->getNumDataObjects()==0"); - return 1; - } - if (dataSource->getDataObject(0)->cdfVariable != NULL) { -#ifdef CAUTOCONFIGURE_DEBUG - CDBDebug("already loaded: dataSource->getDataObject(0)->cdfVariable!=NULL"); -#endif - return 0; + CT::string foundFileName = dataSource->getFileName(); + if (foundFileName.empty()) { + /* Use the file specified as header file */ + foundFileName = dataSource->headerFileName.c_str(); } - - CT::string foundFileName; - - /* Use the file specified as header file */ - foundFileName = dataSource->headerFileName.c_str(); if (foundFileName.empty()) { /* Try to get a file from DB */ @@ -498,7 +480,12 @@ int CAutoConfigure::justLoadAFileHeader(CDataSource *dataSource) { if (dataSource->requiredDims.size() == 0) { removeRequiredDims = true; if (dataSource->cfgLayer->Dimension.size() > 0) { - CRequest::fillDimValuesForDataSource(dataSource, dataSource->srvParams); + try { + CRequest::fillDimValuesForDataSource(dataSource, dataSource->srvParams); + } catch (ServiceExceptionCode e) { + CDBDebug("Unable to fillDimValuesForDataSource"); + return 1; + } } else { CDBDebug("Required dims is still zero, add none now"); COGCDims *ogcDim = new COGCDims(); @@ -509,7 +496,7 @@ int CAutoConfigure::justLoadAFileHeader(CDataSource *dataSource) { ogcDim->netCDFDimName.copy("none"); } } - CDBStore::Store *store = CDBFactory::getDBAdapter(dataSource->srvParams->cfg)->getFilesAndIndicesForDimensions(dataSource, 1000); + CDBStore::Store *store = CDBFactory::getDBAdapter(dataSource->srvParams->cfg)->getFilesAndIndicesForDimensions(dataSource, 1); if (store != NULL && store->getSize() > 0) { CT::string fileNamestr = store->getRecord(0)->get(0)->c_str(); // CDBDebug("fileName from DB: %s", fileNamestr.c_str()); @@ -531,7 +518,36 @@ int CAutoConfigure::justLoadAFileHeader(CDataSource *dataSource) { return 1; } } + fileName = foundFileName.c_str(); + return 0; +} +int CAutoConfigure::justLoadAFileHeader(CDataSource *dataSource) { + if (dataSource == NULL) { + CDBError("datasource == NULL"); + return 1; + } + if (dataSource->cfgLayer == NULL) { + CDBError("datasource->cfgLayer == NULL"); + return 1; + } + if (dataSource->getNumDataObjects() == 0) { + CDBError("dataSource->getNumDataObjects()==0"); + return 1; + } + if (dataSource->getDataObject(0)->cdfVariable != NULL) { +#ifdef CAUTOCONFIGURE_DEBUG + CDBDebug("already loaded: dataSource->getDataObject(0)->cdfVariable!=NULL"); +#endif + return 0; + } + + std::string foundFileName; + + if (getFileNameForDataSource(dataSource, foundFileName) != 0) { + CDBDebug("Unable to getFileNameForDataSource"); + return 1; + } /* Open a file */ try { // CDBDebug("Loading header [%s]", foundFileName.c_str()); diff --git a/adagucserverEC/CAutoConfigure.h b/adagucserverEC/CAutoConfigure.h index e8dba75ad..81bd3cc3f 100644 --- a/adagucserverEC/CAutoConfigure.h +++ b/adagucserverEC/CAutoConfigure.h @@ -56,5 +56,13 @@ class CAutoConfigure { public: static int autoConfigureDimensions(CDataSource *dataSource); static int autoConfigureStyles(CDataSource *dataSource); + + /** + * Find the default filename for a datasource from the database + * @param dataSource + * @param fileName - The filename to return + * @returns Zero on success. + */ + static int getFileNameForDataSource(CDataSource *dataSource, std::string &fileName); }; #endif diff --git a/adagucserverEC/CDBAdapter.h b/adagucserverEC/CDBAdapter.h index 11bfa2070..56422c49c 100644 --- a/adagucserverEC/CDBAdapter.h +++ b/adagucserverEC/CDBAdapter.h @@ -16,7 +16,7 @@ class CDBAdapter { public: CDBAdapter() {} - virtual ~CDBAdapter(){}; + virtual ~CDBAdapter() {}; class GeoOptions { public: @@ -96,6 +96,13 @@ class CDBAdapter { /** First use setFile as many times as you whish, second use addFilesToDataBase to make it final*/ virtual int addFilesToDataBase() = 0; + + virtual int storeLayerMetadata(const char *datasetName, const char *layerName, const char *metadataKey, const char *metadatablob) = 0; + virtual CDBStore::Store *getLayerMetadataStore(const char *datasetName) = 0; + virtual int dropLayerFromLayerMetadataStore(const char *datasetName, const char *layerName) = 0; + + virtual bool tryAdvisoryLock(size_t key) = 0; + virtual bool advisoryUnLock(size_t key) = 0; }; #endif diff --git a/adagucserverEC/CDBAdapterPostgreSQL.cpp b/adagucserverEC/CDBAdapterPostgreSQL.cpp index d8b9aac8f..a8387d112 100644 --- a/adagucserverEC/CDBAdapterPostgreSQL.cpp +++ b/adagucserverEC/CDBAdapterPostgreSQL.cpp @@ -44,6 +44,10 @@ CDBAdapterPostgreSQL::~CDBAdapterPostgreSQL() { #ifdef CDBAdapterPostgreSQL_DEBUG CDBDebug("~CDBAdapterPostgreSQL()"); #endif + if (layerMetaDataStore != nullptr) { + delete layerMetaDataStore; + layerMetaDataStore = nullptr; + } if (dataBaseConnection != NULL) { dataBaseConnection->close2(); } @@ -423,7 +427,7 @@ CDBStore::Store *CDBAdapterPostgreSQL::getFilesAndIndicesForDimensions(CDataSour CT::string whereStatement; std::vector requestedDimVals = requestedDimMap[m.first]; - for (int i = 0; i < requestedDimVals.size(); ++i) { + for (size_t i = 0; i < requestedDimVals.size(); ++i) { if (requestedDimVals[i].equals("*")) continue; if (i != 0) { @@ -620,6 +624,7 @@ void CDBAdapterPostgreSQL::addToLookupTable(const char *path, const char *filter CT::string CDBAdapterPostgreSQL::generateRandomTableName() { CT::string tableName; tableName.print("t%s_%s", CTime::currentDateTime().c_str(), CServerParams::randomString(20).c_str()); + tableName.replaceSelf(".", ""); tableName.replaceSelf(":", ""); tableName.replaceSelf("-", ""); tableName.replaceSelf("Z", ""); @@ -717,7 +722,7 @@ std::map CDBAdapterPostgreSQL::getTableNamesForPathFilterAn } // Found all tablenames for requested dimensions in lookup table - int found = tableDimStore->size(); + size_t found = tableDimStore->size(); delete tableDimStore; if (found == mapping.size()) { #ifdef MEASURETIME @@ -1080,3 +1085,139 @@ int CDBAdapterPostgreSQL::addFilesToDataBase() { #endif return 0; } + +int CDBAdapterPostgreSQL::storeLayerMetadata(const char *datasetName, const char *layerName, const char *metadataKey, const char *metadataBlob) { +#ifdef MEASURETIME + StopWatch_Stop(">CDBAdapterPostgreSQL::storeLayerMetadata"); +#endif + CPGSQLDB *dataBaseConnection = getDataBaseConnection(); + if (dataBaseConnection == NULL) { + return -1; + } + + CT::string tableColumns("datasetname varchar (511), layername varchar (511), metadatakey varchar (255), updatetime TIMESTAMPTZ, blob JSONB, PRIMARY KEY (datasetname, layername, metadatakey)"); + + int status = dataBaseConnection->checkTable("layermetadata", tableColumns.c_str()); + if (status == 1) { + CDBError("\nFAIL: Table layermetadata could not be created: %s", tableColumns.c_str()); + throw(__LINE__); + } + + CT::string updateTime = CTime::currentDateTime().c_str(); + CT::string query; + query.print("INSERT INTO layermetadata (datasetname, layername, metadatakey, updatetime, blob) " + "VALUES (E'%s',E'%s', E'%s', E'%s', E'%s') " + "ON CONFLICT (datasetname, layername, metadatakey) " + "DO UPDATE SET blob = excluded.blob, updatetime = excluded.updatetime;", + datasetName, layerName, metadataKey, updateTime.c_str(), metadataBlob); + + status = dataBaseConnection->query(query.c_str()); + if (status != 0) { + CDBError("Unable to insert records: \"%s\"", query.c_str()); + throw(__LINE__); + } +#ifdef MEASURETIME + StopWatch_Stop("CDBAdapterPostgreSQL::getLayerMetadata"); +#endif + + if (this->layerMetaDataStore == nullptr) { +#ifdef CDBAdapterPostgreSQL_DEBUG + CDBDebug("Need to query layer metadata for %s/%s/%s", datasetName, layerName, metadataKey); +#endif + CPGSQLDB *dataBaseConnection = getDataBaseConnection(); + if (dataBaseConnection == NULL) { + return nullptr; + } + + CT::string query; + if (datasetName != nullptr) { + if (CServerParams::checkForValidTokens(datasetName, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-:/.") == false) { + CDBError("Invalid dataset name. "); + throw(__LINE__); + } + query.print("SELECT datasetname, layername, metadatakey, blob FROM layermetadata WHERE datasetname = '%s';", datasetName); + } else { + query.print("SELECT datasetname, layername, metadatakey, blob FROM layermetadata"); + } + + this->layerMetaDataStore = dataBaseConnection->queryToStore(query.c_str()); + if (layerMetaDataStore == nullptr) { +#ifdef CDBAdapterPostgreSQL_DEBUG + CDBDebug("Unable query: \"%s\"", query.c_str()); +#endif + return nullptr; + } + } + +#ifdef MEASURETIME + StopWatch_Stop("query(query.c_str()); +} + +bool CDBAdapterPostgreSQL::tryAdvisoryLock(size_t key) { + CPGSQLDB *dataBaseConnection = getDataBaseConnection(); + if (dataBaseConnection == NULL) { + return false; + } + CT::string query; + query.print("SELECT pg_try_advisory_lock(%d) as \"result\";", key); + auto *store = dataBaseConnection->queryToStore(query.c_str()); + if (store == nullptr || store->getSize() != 1) { + CDBError("Query failed [%s]:", dataBaseConnection->getError()); + return false; + } + auto result = store->getRecord(0)->get("result"); + bool succesfullylocked = result != nullptr && result->equals("t"); + if (succesfullylocked) { + CDBDebug("pg_try_advisory_lock succesfullylocked"); + } else { + CDBDebug("pg_try_advisory_lock NOT succesfullylocked"); + } + delete store; + return succesfullylocked; +} + +bool CDBAdapterPostgreSQL::advisoryUnLock(size_t key) { + CPGSQLDB *dataBaseConnection = getDataBaseConnection(); + if (dataBaseConnection == NULL) { + return false; + } + CT::string query; + + query.print("SELECT pg_advisory_unlock(%d) as \"result\";", key); + auto store = dataBaseConnection->queryToStore(query.c_str()); + if (store == nullptr || store->getSize() != 1) { + CDBError("Query failed [%s]:", dataBaseConnection->getError()); + return false; + } + auto result = store->getRecord(0)->get("result"); + bool succesfullyunlocked = result != nullptr && result->equals("t"); + if (succesfullyunlocked) { + CDBDebug("pg_advisory_unlock succesfullyunlocked"); + } else { + CDBWarning("pg_advisory_unlock NOT succesfullyunlocked"); + } + delete store; + return succesfullyunlocked; +} \ No newline at end of file diff --git a/adagucserverEC/CDBAdapterPostgreSQL.h b/adagucserverEC/CDBAdapterPostgreSQL.h index e75b69e09..43bb97908 100644 --- a/adagucserverEC/CDBAdapterPostgreSQL.h +++ b/adagucserverEC/CDBAdapterPostgreSQL.h @@ -22,7 +22,8 @@ * limitations under the License. * ******************************************************************************/ - +#ifndef CDBADAPTERPOSTGRESQL_H +#define CDBADAPTERPOSTGRESQL_H #include "CDBAdapter.h" #include "CDebugger.h" #include "CPGSQLDB.h" @@ -43,6 +44,8 @@ class CDBAdapterPostgreSQL : public CDBAdapter { std::map> fileListPerTable; int createDimTableOfType(const char *dimname, const char *tablename, int type); + CDBStore::Store *layerMetaDataStore = nullptr; + public: CDBAdapterPostgreSQL(); ~CDBAdapterPostgreSQL(); @@ -87,4 +90,11 @@ class CDBAdapterPostgreSQL : public CDBAdapter { int setFileString(const char *tablename, const char *file, const char *dimvalue, int dimindex, const char *filedate, GeoOptions *geoOptions); int setFileTimeStamp(const char *tablename, const char *file, const char *dimvalue, int dimindex, const char *filedate, GeoOptions *geoOptions); int addFilesToDataBase(); + int storeLayerMetadata(const char *datasetName, const char *layerName, const char *metadataKey, const char *metadatablob); + CDBStore::Store *getLayerMetadataStore(const char *datasetName); + int dropLayerFromLayerMetadataStore(const char *datasetName, const char *layerName); + bool tryAdvisoryLock(size_t); + bool advisoryUnLock(size_t); }; + +#endif diff --git a/adagucserverEC/CDBAdapterSQLLite.cpp b/adagucserverEC/CDBAdapterSQLLite.cpp index 641a1a9dc..86a1b1ed2 100644 --- a/adagucserverEC/CDBAdapterSQLLite.cpp +++ b/adagucserverEC/CDBAdapterSQLLite.cpp @@ -694,11 +694,6 @@ CDBStore::Store *CDBAdapterSQLLite::getFilesAndIndicesForDimensions(CDataSource int CDBAdapterSQLLite::autoUpdateAndScanDimensionTables(CDataSource *dataSource) { CServerParams *srvParams = dataSource->srvParams; - ; - // if(srvParams->isAutoLocalFileResourceEnabled()==false){ - // CDBDebug("Auto update is not available"); - // return 0; - // } CServerConfig::XMLE_Layer *cfgLayer = dataSource->cfgLayer; CSQLLiteDB *dataBaseConnection = getDataBaseConnection(); if (dataBaseConnection == NULL) { @@ -927,6 +922,7 @@ CT::string CDBAdapterSQLLite::getTableNameForPathFilterAndDimension(const char * randomTableString.concat("_"); randomTableString.concat(CServerParams::randomString(20)); randomTableString.replaceSelf(":", ""); + randomTableString.replaceSelf(".", ""); randomTableString.replaceSelf("-", ""); randomTableString.replaceSelf("Z", ""); @@ -1310,4 +1306,8 @@ CDBStore::Store *CDBAdapterSQLLite::getFilesForIndices(CDataSource *dataSource, return store; } +int CDBAdapterSQLLite::storeLayerMetadata(const char *, const char *, const char *, const char *) { return 0; } +CDBStore::Store *CDBAdapterSQLLite::getLayerMetadataStore(const char *) { return nullptr; } +int CDBAdapterSQLLite::dropLayerFromLayerMetadataStore(const char *, const char *) { return 0; }; + #endif diff --git a/adagucserverEC/CDBAdapterSQLLite.h b/adagucserverEC/CDBAdapterSQLLite.h index 7bfada783..88983e811 100644 --- a/adagucserverEC/CDBAdapterSQLLite.h +++ b/adagucserverEC/CDBAdapterSQLLite.h @@ -23,6 +23,10 @@ * ******************************************************************************/ #ifdef ADAGUC_USE_SQLITE + +#ifndef CDBADAPTERSQLLITE_H +#define CDBADAPTERSQLLITE_H + #include "CDBAdapter.h" #include "CDebugger.h" #include @@ -119,5 +123,14 @@ class CDBAdapterSQLLite : public CDBAdapter { int setFileString(const char *tablename, const char *file, const char *dimvalue, int dimindex, const char *filedate, GeoOptions *geoOptions); int setFileTimeStamp(const char *tablename, const char *file, const char *dimvalue, int dimindex, const char *filedate, GeoOptions *geoOptions); int addFilesToDataBase(); + int storeLayerMetadata(const char *datasetName, const char *layerName, const char *metadataKey, const char *metadatablob); + CDBStore::Store *getLayerMetadataStore(const char *datasetName); + int dropLayerFromLayerMetadataStore(const char *datasetName, const char *layerName); + + bool tryAdvisoryLock(size_t) { return true; }; + bool advisoryUnLock(size_t) { return true; } }; + +#endif + #endif diff --git a/adagucserverEC/CDBFileScanner.cpp b/adagucserverEC/CDBFileScanner.cpp index 1ae23a10b..7d855f675 100644 --- a/adagucserverEC/CDBFileScanner.cpp +++ b/adagucserverEC/CDBFileScanner.cpp @@ -31,6 +31,8 @@ #include "CNetCDFDataWriter.h" #include "CCreateTiles.h" #include +#include "utils/LayerMetadataStore.h" +#include "utils/ConfigurationUtils.h" const char *CDBFileScanner::className = "CDBFileScanner"; std::vector CDBFileScanner::tableNamesDone; // #define CDBFILESCANNER_DEBUG @@ -820,7 +822,7 @@ int CDBFileScanner::DBLoopFiles(CDataSource *dataSource, int removeNonExistingFi // delete cdfObject;cdfObject=NULL; // cdfObject=CDFObjectStore::getCDFObjectStore()->deleteCDFObject(&cdfObject); } catch (int linenr) { - CDBError("Exception in DBLoopFiles at line %d"); + CDBError("Exception in DBLoopFiles at line %d", linenr); CDBError(" *** SKIPPING FILE %s ***", (*fileList)[j].c_str()); // Close cdfObject. this is only needed if an exception occurs, otherwise it does nothing... // delete cdfObject;cdfObject=NULL; @@ -950,7 +952,28 @@ int CDBFileScanner::updatedb(CDataSource *dataSource, CT::string *_tailPath, CT: if (fileToUpdate.length() == 0) { // No file specified, just scan the directory for matching filenames. try { - fileList = searchFileNames(dataSource->cfgLayer->FilePath[0]->value.c_str(), filter.c_str(), tailPath.c_str()); + if (scanFlags & CDBFILESCANNER_UPDATEDB_ONLYFILEFROMDEFAULTQUERY) { + if (checkIfPathIsFile(dataSource->cfgLayer->FilePath[0]->value.c_str())) { + fileList.push_back(dataSource->cfgLayer->FilePath[0]->value.c_str()); + CDBDebug("Obtained filename from layer configuration [%s]", dataSource->cfgLayer->FilePath[0]->value.c_str()); + } else { + std::string fileName; + if (dataSource->requiredDims.size() == 0) { + if (CAutoConfigure::autoConfigureDimensions(dataSource) != 0) { + CDBWarning("Unable to autoconfigure dims"); + } + } + if (CAutoConfigure::getFileNameForDataSource(dataSource, fileName) != 0) { + CDBDebug("Unable to getFileNameForDataSource"); + return 1; + } + fileList.push_back(fileName); + CDBDebug("Queried file from database with filename [%s]", fileName.c_str()); + } + } else { + fileList = searchFileNames(dataSource->cfgLayer->FilePath[0]->value.c_str(), filter.c_str(), tailPath.c_str()); + } + } catch (int linenr) { CDBDebug("Exception in searchFileNames [%s] [%s]", dataSource->cfgLayer->FilePath[0]->value.c_str(), filter.c_str(), tailPath.c_str()); return 0; @@ -1052,6 +1075,10 @@ int CDBFileScanner::updatedb(CDataSource *dataSource, CT::string *_tailPath, CT: } } + if (scanFlags & CDBFILESCANNER_UPDATEDB) { + updateMetaDataTable(dataSource); + } + CDBDebug(" ==> *** Finished update layer [%s] ***", dataSource->cfgLayer->Name[0]->value.c_str()); return 0; } @@ -1084,10 +1111,8 @@ std::vector CDBFileScanner::searchFileNames(const char *path, CT::s } } } - // CDBDebug("Checking if this is a file: [%s]", filePath.c_str()); - if (filePath.endsWith(".nc") || filePath.endsWith(".h5") || filePath.endsWith(".hdf5") || filePath.endsWith(".he5") || filePath.endsWith(".png") || filePath.endsWith(".csv") || - filePath.endsWith(".geojson") || filePath.endsWith(".json") || filePath.startsWith("http://") || filePath.startsWith("https://") || filePath.startsWith("dodsc://")) { - // Add single file or opendap URL. + + if (checkIfPathIsFile(filePath)) { std::vector fileList; fileList.push_back(filePath.c_str()); // CDBDebug("%s is a file",filePath.c_str()); @@ -1101,7 +1126,7 @@ std::vector CDBFileScanner::searchFileNames(const char *path, CT::s if (expr.empty() == false) { // dataSource->cfgLayer->FilePath[0]->attr.filter.c_str() fileFilterExpr.copy(&expr); } - CDBDebug("Reading directory %s with filter %s", filePath.c_str(), fileFilterExpr.c_str()); + // CDBDebug("Reading directory %s with filter %s", filePath.c_str(), fileFilterExpr.c_str()); CDirReader *dirReader = CCachedDirReader::getDirReader(filePath.c_str(), fileFilterExpr.c_str()); dirReader->listDirRecursive(filePath.c_str(), fileFilterExpr.c_str()); diff --git a/adagucserverEC/CDBFileScanner.h b/adagucserverEC/CDBFileScanner.h index 316024310..157efb038 100644 --- a/adagucserverEC/CDBFileScanner.h +++ b/adagucserverEC/CDBFileScanner.h @@ -42,6 +42,8 @@ #define CDBFILESCANNER_RECREATETABLES 32 #define CDBFILESCANNER_CLEANFILES 64 #define CDBFILESCANNER_DONOTTILE 128 +#define CDBUPDATE_LAYER_METADATA 256 +#define CDBFILESCANNER_UPDATEDB_ONLYFILEFROMDEFAULTQUERY 512 // Return type to indicate nothing was found. #define CDBFILESCANNER_RETURN_FILEDOESNOTMATCH 100 diff --git a/adagucserverEC/CDataPostProcessors/CDataPostProcessor_IncludeLayer.cpp b/adagucserverEC/CDataPostProcessors/CDataPostProcessor_IncludeLayer.cpp index 330e39fae..4da0d76aa 100644 --- a/adagucserverEC/CDataPostProcessors/CDataPostProcessor_IncludeLayer.cpp +++ b/adagucserverEC/CDataPostProcessors/CDataPostProcessor_IncludeLayer.cpp @@ -1,6 +1,7 @@ #include #include "CDataPostProcessor_IncludeLayer.h" #include "CRequest.h" +#include /************************/ /*CDPPIncludeLayer */ /************************/ @@ -20,7 +21,7 @@ CDataSource *CDPPIncludeLayer::getDataSource(CServerConfig::XMLE_DataPostProc *p size_t additionalLayerNo = 0; for (size_t j = 0; j < dataSource->srvParams->cfg->Layer.size(); j++) { CT::string layerName; - dataSource->srvParams->makeUniqueLayerName(&layerName, dataSource->srvParams->cfg->Layer[j]); + makeUniqueLayerName(&layerName, dataSource->srvParams->cfg->Layer[j]); // CDBDebug("comparing for additionallayer %s==%s", additionalLayerName.c_str(), layerName.c_str()); if (additionalLayerName.equals(layerName)) { additionalLayerNo = j; diff --git a/adagucserverEC/CDataPostProcessors/CDataPostProcessor_Operator.cpp b/adagucserverEC/CDataPostProcessors/CDataPostProcessor_Operator.cpp index 89da86b91..5ebf00b76 100644 --- a/adagucserverEC/CDataPostProcessors/CDataPostProcessor_Operator.cpp +++ b/adagucserverEC/CDataPostProcessors/CDataPostProcessor_Operator.cpp @@ -64,8 +64,8 @@ int CDPPOperator::execute(CServerConfig::XMLE_DataPostProc *proc, CDataSource *d newDataObject->cdfVariable->setAttributeText("units", proc->attr.units); } - short attrData[3]; - attrData[0] = -1; + double attrData[1]; + attrData[0] = 0; newDataObject->cdfVariable->setAttribute("_FillValue", newDataObject->cdfVariable->getType(), attrData, 1); newDataObject->cdfVariable->setCustomReader(CDF::Variable::CustomMemoryReaderInstance); diff --git a/adagucserverEC/CDataPostProcessors/CDataPostProcessor_WFP.cpp b/adagucserverEC/CDataPostProcessors/CDataPostProcessor_WFP.cpp index 186b98eca..bac7dc5d5 100644 --- a/adagucserverEC/CDataPostProcessors/CDataPostProcessor_WFP.cpp +++ b/adagucserverEC/CDataPostProcessors/CDataPostProcessor_WFP.cpp @@ -1,6 +1,7 @@ #include "CDataPostProcessor_WFP.h" #include "CRequest.h" #include "CGenericDataWarper.h" +#include /************************/ /* CDPPWFP */ @@ -25,7 +26,7 @@ CDataSource *CDPPWFP::getDataSource(CDataSource *dataSource, CT::string baseLaye size_t additionalLayerNo = 0; for (size_t j = 0; j < dataSource->srvParams->cfg->Layer.size(); j++) { CT::string layerName; - dataSource->srvParams->makeUniqueLayerName(&layerName, dataSource->srvParams->cfg->Layer[j]); + makeUniqueLayerName(&layerName, dataSource->srvParams->cfg->Layer[j]); if (baseLayerName.equals(layerName)) { additionalLayerNo = j; break; diff --git a/adagucserverEC/CDataReader.cpp b/adagucserverEC/CDataReader.cpp index 7189287c2..c30cf6b49 100755 --- a/adagucserverEC/CDataReader.cpp +++ b/adagucserverEC/CDataReader.cpp @@ -421,7 +421,6 @@ int CDataReader::parseDimensions(CDataSource *dataSource, int mode, int x, int y #ifdef CDATAREADER_DEBUG CDBDebug("Number of dimensions = %d", dataSource->dNetCDFNumDims); #endif - // Determine the X and Y dimensions and variables. determineXAndYDimIndices(dataSource, dataSourceVar); if (!determineXandYVars(dataSource, dataSourceVar, cdfObject)) { @@ -847,15 +846,10 @@ int CDataReader::open(CDataSource *dataSource, int mode, int x, int y, int *grid if (x != -1 && y != -1) { singleCellMode = true; } - CT::string dataSourceFilename; dataSourceFilename.copy(dataSource->getFileName()); - - // CCache cache; - // CT::string cacheFilename; - // pthread_mutex_lock(&CDataReader_open_lock); CStyleConfiguration *styleConfiguration = dataSource->getStyle(); - // pthread_mutex_unlock(&CDataReader_open_lock); + // Use autoscale of legendcolors when the legendscale factor has been set to zero. if (styleConfiguration != NULL) { if (dataSource->stretchMinMaxDone == false) { @@ -867,7 +861,6 @@ int CDataReader::open(CDataSource *dataSource, int mode, int x, int y, int *grid } CDFObject *cdfObject = NULL; - #ifdef CDATAREADER_DEBUG CDBDebug("Working on [%s] with mode %d and (%d,%d)", dataSourceFilename.c_str(), mode, x, y); @@ -876,11 +869,9 @@ int CDataReader::open(CDataSource *dataSource, int mode, int x, int y, int *grid CDBDebug("Working on [%s]", dataSourceFilename.c_str()); } #endif - if (mode == CNETCDFREADER_MODE_OPEN_DIMENSIONS || mode == CNETCDFREADER_MODE_OPEN_HEADER) { cdfObject = CDFObjectStore::getCDFObjectStore()->getCDFObjectHeader(dataSource, dataSource->srvParams, dataSourceFilename.c_str(), enableObjectCache); } - if (mode == CNETCDFREADER_MODE_OPEN_ALL || mode == CNETCDFREADER_MODE_GET_METADATA || mode == CNETCDFREADER_MODE_OPEN_EXTENT) { cdfObject = CDFObjectStore::getCDFObjectStore()->getCDFObject(dataSource, dataSourceFilename.c_str(), enableObjectCache); } @@ -888,7 +879,6 @@ int CDataReader::open(CDataSource *dataSource, int mode, int x, int y, int *grid CDBError("Unable to get CDFObject from store"); return 1; } - if (dataSource->attachCDFObject(cdfObject) != 0) { CDBError("Unable to attach CDFObject"); return 1; @@ -914,7 +904,6 @@ int CDataReader::open(CDataSource *dataSource, int mode, int x, int y, int *grid #ifdef MEASURETIME StopWatch_Stop("parseDimensions done"); #endif - if (dataSource->useLonTransformation != -1 && gridExtent == NULL) { for (size_t varNr = 0; varNr < dataSource->getNumDataObjects(); varNr++) { Proc::swapPixelsAtLocation(dataSource, dataSource->getDataObject(varNr)->cdfVariable, 0); diff --git a/adagucserverEC/CDataSource.cpp b/adagucserverEC/CDataSource.cpp index cb61b1d70..974e1e0ab 100644 --- a/adagucserverEC/CDataSource.cpp +++ b/adagucserverEC/CDataSource.cpp @@ -26,6 +26,7 @@ #include "CDataSource.h" #include "CDBFileScanner.h" #include "CConvertGeoJSON.h" +#include "utils/LayerUtils.h" const char *CDataSource::className = "CDataSource"; // #define CDATASOURCE_DEBUG @@ -368,7 +369,7 @@ int CDataSource::setCFGLayer(CServerParams *_srvParams, CServerConfig::XMLE_Conf // Set the layername CT::string layerUniqueName; if (_layerName == NULL) { - if (srvParams->makeUniqueLayerName(&layerUniqueName, cfgLayer) != 0) layerUniqueName = "undefined"; + if (makeUniqueLayerName(&layerUniqueName, cfgLayer) != 0) layerUniqueName = "undefined"; _layerName = layerUniqueName.c_str(); } @@ -433,13 +434,6 @@ void CDataSource::addStep(const char *fileName, CCDFDims *dims) { if (dims != NULL) { timeStep->dims.copy(dims); } - // for(size_t j=0;jVariable.size();j++){ - // DataObject *newDataObject = new DataObject(); - // newDataObject->variableName.copy(cfgLayer->Variable[j]->value.c_str()); - // - // getDataObjectsVector()->push_back(newDataObject); - // - // } } const char *CDataSource::getFileName() { @@ -860,6 +854,7 @@ CT::PointerList *CDataSource::getStyleListForDataSource(C #ifdef CDATASOURCE_DEBUG CDBDebug("getStyleListForDataSource %s", dataSource->layerName.c_str()); #endif + CT::PointerList *styleConfigurationList = new CT::PointerList(); CServerConfig::XMLE_Configuration *serverCFG = dataSource->cfg; @@ -869,13 +864,11 @@ CT::PointerList *CDataSource::getStyleListForDataSource(C // Auto configure styles, if no legends or styles are defined if (dataSource->cfgLayer->Styles.size() == 0 && dataSource->cfgLayer->Legend.size() == 0) { - renderMethods = getRenderMethodListForDataSource(dataSource, NULL); if (renderMethods->size() > 0) { CAutoConfigure::autoConfigureStyles(dataSource); } } - delete renderMethods; renderMethods = NULL; @@ -1453,4 +1446,6 @@ int CDataSource::readVariableDataForCDFDims(CDF::Variable *variableToRead, CDFTy } } return variableToRead->readData(dataTypeToReturnData, start, count, stride, true); -} \ No newline at end of file +} + +std::string CDataSource::getDataSetName() { return std::string(this->srvParams->datasetLocation.c_str()); } \ No newline at end of file diff --git a/adagucserverEC/CDataSource.h b/adagucserverEC/CDataSource.h index c25a4a56b..d9b6589f3 100644 --- a/adagucserverEC/CDataSource.h +++ b/adagucserverEC/CDataSource.h @@ -373,6 +373,8 @@ class CDataSource { * @return 0 on succes, 1 on failure */ int readVariableDataForCDFDims(CDF::Variable *variableToRead, CDFType dataTypeToReturnData); + + std::string getDataSetName(); }; #endif diff --git a/adagucserverEC/CMakeLists.txt b/adagucserverEC/CMakeLists.txt index 942d0bc4a..69b234c70 100644 --- a/adagucserverEC/CMakeLists.txt +++ b/adagucserverEC/CMakeLists.txt @@ -68,6 +68,20 @@ add_library( CDBFileScannerCleanFiles.cpp CDFObjectStore.cpp CDFObjectStore.h + utils/LayerMetadataStore.h + utils/LayerMetadataStore.cpp + utils/XMLGenUtils.h + utils/XMLGenUtils.cpp + utils/CXMLTemplates.h + utils/LayerUtils.h + utils/LayerUtils.cpp + utils/LayerMetadataToJson.h + utils/LayerMetadataToJson.cpp + utils/UpdateLayerMetadata.h + utils/UpdateLayerMetadata.cpp + utils/ConfigurationUtils.h + utils/ConfigurationUtils.cpp + Types/LayerMetadataType.h CDataPostProcessors/CDataPostProcessor_AddFeatures.cpp CDataPostProcessors/CDataPostProcessor_AddFeatures.h CDataPostProcessors/CDataPostProcessor_CDPDBZtoRR.cpp diff --git a/adagucserverEC/COpenDAPHandler.cpp b/adagucserverEC/COpenDAPHandler.cpp index ff8717558..537735db5 100644 --- a/adagucserverEC/COpenDAPHandler.cpp +++ b/adagucserverEC/COpenDAPHandler.cpp @@ -2,6 +2,7 @@ #include "CRequest.h" #include "CDBFactory.h" #include "CAutoResource.h" +#include "utils/LayerUtils.h" const char *COpenDAPHandler::className = "COpenDAPHandler"; // References: http://opendap.org/pdf/ESE-RFC-004v1.2.pdf @@ -580,7 +581,7 @@ int COpenDAPHandler::handleOpenDAPRequest(const char *path, const char *_query, if (srvParam->cfg->Layer[layerNo]->attr.type.equals("database")) { CT::string intLayerName; - srvParam->makeUniqueLayerName(&intLayerName, srvParam->cfg->Layer[layerNo]); + makeUniqueLayerName(&intLayerName, srvParam->cfg->Layer[layerNo]); if (layerName.length() == 0) { layerName = intLayerName; } diff --git a/adagucserverEC/CRequest.cpp b/adagucserverEC/CRequest.cpp index 4e615e4f0..573397aea 100644 --- a/adagucserverEC/CRequest.cpp +++ b/adagucserverEC/CRequest.cpp @@ -41,6 +41,11 @@ #include "LayerTypeLiveUpdate/LayerTypeLiveUpdate.h" #include #include "Definitions.h" +#include "utils/LayerUtils.h" +#include "utils/XMLGenUtils.h" +#include "utils/LayerMetadataStore.h" +#include +#include "utils/LayerMetadataToJson.h" const char *CRequest::className = "CRequest"; int CRequest::CGI = 0; @@ -143,6 +148,7 @@ int CRequest::setConfigFile(const char *pszConfigFile) { value0Cap.toUpperCaseSelf(); if (value0Cap.equals("DATASET")) { if (srvParam->datasetLocation.empty()) { + srvParam->datasetLocation.copy(values[1].c_str()); status = CAutoResource::configureDataset(srvParam, false); if (status != 0) { @@ -412,151 +418,6 @@ int CRequest::generateGetReferenceTimesDoc(CT::string *result, CDataSource *data return 0; } -int CRequest::process_wms_getstyles_request() { - // int status; - // if(srvParam->serviceType==SERVICE_WMS){ - // if(srvParam->Geo->dWidth>MAX_IMAGE_WIDTH){ - // CDBError("Parameter WIDTH must be smaller than %d",MAX_IMAGE_WIDTH); - // return 1; - // } - // if(srvParam->Geo->dHeight>MAX_IMAGE_HEIGHT){ - // CDBError("Parameter HEIGHT must be smaller than %d",MAX_IMAGE_HEIGHT); - // return 1; - // } - // } - // CDrawImage plotCanvas; - // plotCanvas.setTrueColor(true); - // plotCanvas.createImage(int(srvParam->Geo->dWidth),int(srvParam->Geo->dHeight)); - // plotCanvas.create685Palette(); - // - // CImageDataWriter imageDataWriter; - // - // CDataSource * dataSource = new CDataSource(); - // //dataSource->setCFGLayer(srvParam,srvParam->configObj->Configuration[0],srvParam->cfg->Layer[0],"prediction",0); - // dataSource->addStep("",NULL); - // dataSource->getCDFDims()->addDimension("time","0",0); - // dataSource->setTimeStep(0); - // dataSource->srvParams=srvParam; - // dataSource->cfg=srvParam->configObj->Configuration[0]; - // dataSource->cfgLayer=srvParam->cfg->Layer[0]; - // CDataSource::DataObject *newDataObject = new CDataSource::DataObject(); - // newDataObject->variableName.copy("test"); - // dataSource->getDataObjectsVector()->push_back(newDataObject); - // dataSource->dLayerType=CConfigReaderLayerTypeStyled; - // - // - // - // - // plotCanvas.rectangle(0,0,plotCanvas.Geo->dWidth,plotCanvas.Geo->dHeight,CColor(255,255,255,255),CColor(255,255,255,255)); - // - // int legendWidth = 200; - // int legendHeight = 600; - // - // - // - // - // - // - // int posX=0; - // int posY=0; - // - // bool errorOccured = false; - // - // bool legendOnlyMode = true; - // try{ - // - // for(size_t j=0;jcfg->Style.size();j++){ - // CServerConfig::XMLE_Style* style = srvParam->cfg->Style[j]; - // CDBDebug("style %s",style->attr.name.c_str()); - // - // CT::PointerList *legendList = NULL; - // - // if(legendOnlyMode == false){ - // legendList = CServerParams::getLegendNames(style->Legend); - // }else{ - // legendList = new CT::PointerList(); - // for(size_t j=0;jcfg->Legend.size();j++){ - // - // legendList->push_back(new CT::string(srvParam->cfg->Legend[j]->attr.name.c_str())); - // - // } - // } - // - // CDBDebug("Found %d legends",legendList->size()); - // for(size_t i=0;isize();i++){ - // CDBDebug("legend %s",(*legendList)[i]->c_str()); - // - // int legendIndex = - // CImageDataWriter::getServerLegendIndexByName((*legendList)[i]->c_str(),srvParam->cfg->Legend); - // if(legendIndex == -1){ - // CDBError("Legend %s is not configured"); - // delete legendList; - // throw (__LINE__); - // } - // CDBDebug("Found legend index %d",legendIndex); - // - // CT::PointerList *renderMethodList = - // CImageDataWriter::getRenderMethodListForDataSource(dataSource,style); - // - // CDBDebug("Found %d rendermethods",renderMethodList->size()); - // // for(size_t r=0;rsize();r++){ - // // CDBDebug("Using - // %s->%s->%s",style->attr.name.c_str(),(*legendList)[i]->c_str(),(*renderMethodList)[r]->c_str()); - // // CT::string styleName; - // // styleName.print("%s/%s",style->attr.name.c_str(),(*renderMethodList)[r]->c_str()); - // // if(legendOnlyMode){ - // // styleName.print("%s",(*legendList)[i]->c_str()); - // // } - // // - // // - // // - // CImageDataWriter::makeStyleConfig(dataSource->styleConfiguration,dataSource);//,style->attr.name.c_str(),(*legendList)[i]->c_str(),(*renderMethodList)[r]->c_str()); - // // - // // CDrawImage legendImage; - // // legendImage.enableTransparency(true); - // // legendImage.createImage(&plotCanvas,legendWidth,legendHeight); - // // status = legendImage.createGDPalette(srvParam->cfg->Legend[legendIndex]);if(status != - // 0)throw(__LINE__); - // // - // // - // // - // legendImage.rectangle(0,0,legendImage.Geo->dWidth-1,legendImage.Geo->dHeight-1,CColor(255,255,255,255),CColor(0,0,255,255)); - // // status = imageDataWriter.createLegend(dataSource,&legendImage);if(status != 0)throw(__LINE__); - // // //posX = (legendNr++)*legendWidth; - // // - // // plotCanvas.draw(posX,posY,0,0,&legendImage); - // // - // plotCanvas.drawText(posX+4,posY+legendHeight-4,srvParam->cfg->WMS[0]->SubTitleFont[0]->attr.location.c_str(),8,0,styleName.c_str(),CColor(0,0,0,255),textBGColor); - // // - // // posX+=legendWidth; - // // if(posX>plotCanvas.Geo->dWidth){ - // // posX=0; - // // posY+=legendHeight; - // // } - // // if(legendOnlyMode)break; - // // } - // delete renderMethodList; - // } - // delete legendList; - // if(legendOnlyMode)break; - // } - // }catch(int e){ - // errorOccured = true; - // } - // - // - // - // - // delete dataSource; - // - // if(errorOccured){ - // return 1; - // } - // printf("%s%c%c\n","Content-Type:image/png",13,10); - // plotCanvas.printImagePng(); - return 0; -} - int CRequest::process_wms_getlegendgraphic_request() { if (srvParam->WMSLayers != NULL) for (size_t j = 0; j < srvParam->WMSLayers->count; j++) { @@ -700,12 +561,6 @@ int CRequest::getDocFromDocCache(CSimpleStore *simpleStore, CT::string *docName, int CRequest::generateOGCGetCapabilities(CT::string *XMLdocument) { CXMLGen XMLGen; - // Set WMSLayers: - srvParam->WMSLayers = new CT::string[srvParam->cfg->Layer.size()]; - for (size_t j = 0; j < srvParam->cfg->Layer.size(); j++) { - srvParam->makeUniqueLayerName(&srvParam->WMSLayers[j], srvParam->cfg->Layer[j]); - srvParam->WMSLayers[j].count = srvParam->cfg->Layer.size(); - } return XMLGen.OGCGetCapabilities(srvParam, XMLdocument); } @@ -760,7 +615,7 @@ int CRequest::generateOGCDescribeCoverage(CT::string *XMLdocument) { } int CRequest::process_wms_getcap_request() { - CDBDebug("WMS GETCAPABILITIES"); + CDBDebug("WMS GETCAPABILITIES [%s]", srvParam->datasetLocation.c_str()); CT::string XMLdocument; if (srvParam->enableDocumentCache == true) { @@ -806,7 +661,7 @@ int CRequest::process_wms_getcap_request() { } int CRequest::process_wms_getreferencetimes_request() { - CDBDebug("WMS GETREFERENCETIMES"); + CDBDebug("WMS GETREFERENCETIMES [%s]", srvParam->datasetLocation.c_str()); return process_all_layers(); } @@ -1585,7 +1440,7 @@ int CRequest::process_all_layers() { srvParam->requestType = REQUEST_WCS_DESCRIBECOVERAGE; srvParam->WMSLayers = new CT::string[srvParam->cfg->Layer.size()]; for (size_t j = 0; j < srvParam->cfg->Layer.size(); j++) { - srvParam->makeUniqueLayerName(&srvParam->WMSLayers[j], srvParam->cfg->Layer[j]); + makeUniqueLayerName(&srvParam->WMSLayers[j], srvParam->cfg->Layer[j]); srvParam->WMSLayers[j].count = srvParam->cfg->Layer.size(); } } else { @@ -1607,7 +1462,7 @@ int CRequest::process_all_layers() { size_t layerNo = 0; for (layerNo = 0; layerNo < srvParam->cfg->Layer.size(); layerNo++) { - srvParam->makeUniqueLayerName(&layerName, srvParam->cfg->Layer[layerNo]); + makeUniqueLayerName(&layerName, srvParam->cfg->Layer[layerNo]); // CDBError("comparing (%d) %s==%s",j,layerName.c_str(),srvParam->WMSLayers[j].c_str()); if (layerName.equals(srvParam->WMSLayers[j].c_str())) { CDataSource *dataSource = new CDataSource(); @@ -1635,7 +1490,7 @@ int CRequest::process_all_layers() { size_t additionalLayerNo = 0; for (additionalLayerNo = 0; additionalLayerNo < srvParam->cfg->Layer.size(); additionalLayerNo++) { CT::string additional; - srvParam->makeUniqueLayerName(&additional, srvParam->cfg->Layer[additionalLayerNo]); + makeUniqueLayerName(&additional, srvParam->cfg->Layer[additionalLayerNo]); // CDBDebug("comparing for additionallayer %s==%s", additionalLayerName.c_str(), additional.c_str()); if (additionalLayerName.equals(additional)) { // CDBDebug("Found additionalLayer [%s]", additional.c_str()); @@ -2293,6 +2148,7 @@ int CRequest::process_all_layers() { CT::string dumpString = CDF::dump(dataSources[j]->getDataObject(0)->cdfObject); printf("%s", dumpString.c_str()); reader.close(); + return 0; } if (srvParam->requestType == REQUEST_WMS_GETREFERENCETIMES) { @@ -2939,8 +2795,6 @@ int CRequest::process_querystring() { srvParam->requestType = REQUEST_WMS_GETLEGENDGRAPHIC; else if (REQUEST.equals("GETMETADATA")) srvParam->requestType = REQUEST_WMS_GETMETADATA; - else if (REQUEST.equals("GETSTYLES")) - srvParam->requestType = REQUEST_WMS_GETSTYLES; else if (REQUEST.equals("GETREFERENCETIMES")) srvParam->requestType = REQUEST_WMS_GETREFERENCETIMES; else { @@ -3065,13 +2919,6 @@ int CRequest::process_querystring() { // WMS Service if (dErrorOccured == 0 && srvParam->serviceType == SERVICE_WMS) { // CDBDebug("Entering WMS service"); - - if (srvParam->requestType == REQUEST_WMS_GETSTYLES) { - - if (process_wms_getstyles_request() != 0) return 1; - return 0; - } - if (srvParam->requestType == REQUEST_WMS_GETREFERENCETIMES) { int status = process_wms_getreferencetimes_request(); if (status != 0) { @@ -3357,6 +3204,16 @@ int CRequest::process_querystring() { CDBError("ADAGUC Server: GetMetaData is restricted"); return 1; } + + if (srvParam->Format.equals("application/json")) { + // GetMetadata for specific dataset and layer + json result; + getLayerMetadataAsJson(srvParam, result); + printf("%s%c%c\n", "Content-Type:application/json", 13, 10); + printf("%s", result.dump().c_str()); + return 0; + } + if (dFound_WMSLAYER == 0) { CDBError("ADAGUC Server: Parameter LAYER missing"); dErrorOccured = 1; @@ -3580,11 +3437,11 @@ int CRequest::updatedb(CT::string *tailPath, CT::string *layerPathToScan, int sc } else { CDBDebug("***** Finished DB Update *****"); } - + // TODO: 2024-09-20: Probably not the right place to clear these CDFObjectStore::getCDFObjectStore()->clear(); CConvertGeoJSON::clearFeatureStore(); CDFStore::clear(); - CDBFactory::clear(); + return errorHasOccured > 0; } diff --git a/adagucserverEC/CRequest.h b/adagucserverEC/CRequest.h index 57b264958..a6f47e13a 100644 --- a/adagucserverEC/CRequest.h +++ b/adagucserverEC/CRequest.h @@ -200,7 +200,6 @@ class CRequest { int process_wms_getmap_request(); int process_wms_getmetadata_request(); int process_wms_getfeatureinfo_request(); - int process_wms_getstyles_request(); int process_wms_getlegendgraphic_request(); int process_wcs_getcap_request(); int process_wcs_describecov_request(); diff --git a/adagucserverEC/CSLD.cpp b/adagucserverEC/CSLD.cpp index d5539321f..76c06471c 100644 --- a/adagucserverEC/CSLD.cpp +++ b/adagucserverEC/CSLD.cpp @@ -4,6 +4,7 @@ #include "CSLD.h" #include "../hclasses/CXMLParser.h" #include "../hclasses/CHTTPTools.h" +#include "utils/LayerUtils.h" const char *CSLD::className = "CSLD"; @@ -62,7 +63,7 @@ int CSLD::processSLDUrl(CT::string sldUrl) { // Generate unique layer name for layer in Server Config CT::string layerUniqueName; - if (this->serverParams->makeUniqueLayerName(&layerUniqueName, this->serverConfig->Layer[j]) != 0) { + if (makeUniqueLayerName(&layerUniqueName, this->serverConfig->Layer[j]) != 0) { CDBError("Unable to compose layer name"); return 1; } diff --git a/adagucserverEC/CServerConfig_CPPXSD.h b/adagucserverEC/CServerConfig_CPPXSD.h index e0f51837b..c1e0bda52 100644 --- a/adagucserverEC/CServerConfig_CPPXSD.h +++ b/adagucserverEC/CServerConfig_CPPXSD.h @@ -294,7 +294,10 @@ class CServerConfig : public CXMLSerializerInterface { CXMLSerializerInterface *base = (CXMLSerializerInterface *)baseClass; base->currentNode = (CXMLObjectInterface *)this; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { pt2Class = NULL; if (equals("palette", name)) { @@ -636,7 +639,10 @@ class CServerConfig : public CXMLSerializerInterface { CXMLSerializerInterface *base = (CXMLSerializerInterface *)baseClass; base->currentNode = (CXMLObjectInterface *)this; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { pt2Class = NULL; if (equals("Dir", name)) { @@ -893,7 +899,10 @@ class CServerConfig : public CXMLSerializerInterface { base->currentNode = (CXMLObjectInterface *)this; pt2Class = NULL; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { if (equals("Thinning", name)) { @@ -1300,10 +1309,13 @@ class CServerConfig : public CXMLSerializerInterface { public: class Cattr { public: - CT::string enablecleanupsystem, cleanupsystemlimit, cache_age_cacheableresources, cache_age_volatileresources; + CT::string enablemetadatacache, enablecleanupsystem, cleanupsystemlimit, cache_age_cacheableresources, cache_age_volatileresources; } attr; void addAttribute(const char *attrname, const char *attrvalue) { - if (equals("enablecleanupsystem", attrname)) { + if (equals("enablemetadatacache", attrname)) { + attr.enablemetadatacache.copy(attrvalue); + return; + } else if (equals("enablecleanupsystem", attrname)) { attr.enablecleanupsystem.copy(attrvalue); return; } else if (equals("cleanupsystemlimit", attrname)) { @@ -1369,7 +1381,10 @@ class CServerConfig : public CXMLSerializerInterface { CXMLSerializerInterface *base = (CXMLSerializerInterface *)baseClass; base->currentNode = (CXMLObjectInterface *)this; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { pt2Class = NULL; if (equals("LatLonBox", name)) { @@ -1435,7 +1450,10 @@ class CServerConfig : public CXMLSerializerInterface { CXMLSerializerInterface *base = (CXMLSerializerInterface *)baseClass; base->currentNode = (CXMLObjectInterface *)this; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { pt2Class = NULL; if (equals("Name", name)) { @@ -1470,7 +1488,10 @@ class CServerConfig : public CXMLSerializerInterface { CXMLSerializerInterface *base = (CXMLSerializerInterface *)baseClass; base->currentNode = (CXMLObjectInterface *)this; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { pt2Class = NULL; if (equals("ViewServiceCSW", name)) { @@ -1522,7 +1543,10 @@ class CServerConfig : public CXMLSerializerInterface { CXMLSerializerInterface *base = (CXMLSerializerInterface *)baseClass; base->currentNode = (CXMLObjectInterface *)this; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { pt2Class = NULL; if (equals("Title", name)) { @@ -1590,7 +1614,10 @@ class CServerConfig : public CXMLSerializerInterface { CXMLSerializerInterface *base = (CXMLSerializerInterface *)baseClass; base->currentNode = (CXMLObjectInterface *)this; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { pt2Class = NULL; if (equals("Name", name)) { @@ -1837,7 +1864,10 @@ class CServerConfig : public CXMLSerializerInterface { base->currentNode = (CXMLObjectInterface *)this; pt2Class = NULL; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { if (equals("Name", name)) { @@ -1977,7 +2007,10 @@ class CServerConfig : public CXMLSerializerInterface { CXMLSerializerInterface *base = (CXMLSerializerInterface *)baseClass; base->currentNode = (CXMLObjectInterface *)this; if (rc == 0) - if (value != NULL) this->value.copy(value); + if (value != NULL) { + this->value.copy(value); + this->value.trimSelf(true); + } if (rc == 1) { pt2Class = NULL; if (equals("Legend", name)) { diff --git a/adagucserverEC/CServerParams.cpp b/adagucserverEC/CServerParams.cpp index 1615991ce..4c74c5166 100644 --- a/adagucserverEC/CServerParams.cpp +++ b/adagucserverEC/CServerParams.cpp @@ -211,46 +211,6 @@ void CServerParams::makeCorrectTableName(CT::string *tableName, CT::string *dimN void CServerParams::showWCSNotEnabledErrorMessage() { CDBError("WCS is not enabled because GDAL was not compiled into the server. "); } -int CServerParams::makeUniqueLayerName(CT::string *layerName, CServerConfig::XMLE_Layer *cfgLayer) { - /* - if(cfgLayer->Variable.size()!=0){ - _layerName=cfgLayer->Variable[0]->value.c_str(); -}*/ - - layerName->copy(""); - if (cfgLayer->Group.size() == 1) { - if (cfgLayer->Group[0]->attr.value.empty() == false) { - layerName->copy(cfgLayer->Group[0]->attr.value.c_str()); - layerName->concat("/"); - } - } - if (cfgLayer->Name.size() == 0) { - CServerConfig::XMLE_Name *name = new CServerConfig::XMLE_Name(); - cfgLayer->Name.push_back(name); - if (cfgLayer->Variable.size() == 0) { - name->value.copy("undefined_variable"); - } else { - name->value.copy(cfgLayer->Variable[0]->value.c_str()); - } - } - - if (!cfgLayer->Name[0]->attr.force.equals("true")) { - layerName->concat(cfgLayer->Name[0]->value.c_str()); - // layerName->replaceSelf(".","_");//TODO CHECK WHY? - layerName->replaceSelf(" ", "_"); - } else { - layerName->copy(cfgLayer->Name[0]->value.c_str()); - } - - /*if(cfgLayer->Title.size()==0){ - CServerConfig::XMLE_Title *title=new CServerConfig::XMLE_Title(); - cfgLayer->Title.push_back(title); - title->value.copy(cfgLayer->Name[0]->value.c_str()); - } */ - - return 0; -} - int CServerParams::makeLayerGroupName(CT::string *groupName, CServerConfig::XMLE_Layer *cfgLayer) { /* if(cfgLayer->Variable.size()!=0){ @@ -724,4 +684,15 @@ std::tuple CServerParams::getLegendFont() { } return std::make_tuple(legendFontSize, legendfontLocation); +} + +bool CServerParams::useMetadataTable() { + size_t numSettings = this->cfg->Settings.size(); + if (numSettings > 0 && this->cfg->Settings[numSettings - 1]) { + auto settings = this->cfg->Settings[numSettings - 1]; + if (settings->attr.enablemetadatacache.equalsIgnoreCase("false")) { + return false; + } + } + return true; } \ No newline at end of file diff --git a/adagucserverEC/CServerParams.h b/adagucserverEC/CServerParams.h index f0b7d0b1a..5fcb49166 100644 --- a/adagucserverEC/CServerParams.h +++ b/adagucserverEC/CServerParams.h @@ -146,13 +146,6 @@ class CServerParams { */ ~CServerParams(); - /** - * Function which generates a unique layername from the Layer's configuration - * @param layerName the returned name - * @param cfgLayer the configuration object of the corresponding layer - */ - int makeUniqueLayerName(CT::string *layerName, CServerConfig::XMLE_Layer *cfgLayer); - /** * Function which generates a group name from the Layer's configuration * @param groupName the returned name @@ -338,6 +331,8 @@ class CServerParams { * Returns the fontsize in px for legend */ std::tuple getLegendFont(); + + bool useMetadataTable(); }; #endif diff --git a/adagucserverEC/CXMLGen.cpp b/adagucserverEC/CXMLGen.cpp index 062ce81ae..ebd21a808 100644 --- a/adagucserverEC/CXMLGen.cpp +++ b/adagucserverEC/CXMLGen.cpp @@ -29,847 +29,85 @@ #include "CXMLGen.h" #include "CDBFactory.h" #include "LayerTypeLiveUpdate/LayerTypeLiveUpdate.h" +#include +#include "utils/LayerMetadataStore.h" +#include "utils/XMLGenUtils.h" +#include "utils/CXMLTemplates.h" +#include "utils/LayerUtils.h" + // #define CXMLGEN_DEBUG // #define MEASURE_TIME -const char *CFile::className = "CFile"; const char *CXMLGen::className = "CXMLGen"; int CXMLGen::WCSDescribeCoverage(CServerParams *srvParam, CT::string *XMLDocument) { return OGCGetCapabilities(srvParam, XMLDocument); } -bool compareStringCase(const std::string &s1, const std::string &s2) { return strcmp(s1.c_str(), s2.c_str()) <= 0; } - -const WMSLayer *getFirstLayerWithoutError(std::vector *myWMSLayerList) { - if (myWMSLayerList->size() == 0) { +const MetadataLayer *getFirstLayerWithoutError(std::vector *metadataLayerList) { + if (metadataLayerList->size() == 0) { return nullptr; } - for (size_t lnr = 0; lnr < myWMSLayerList->size(); lnr++) { - WMSLayer *layer = (*myWMSLayerList)[lnr]; + for (size_t lnr = 0; lnr < metadataLayerList->size(); lnr++) { + MetadataLayer *layer = (*metadataLayerList)[lnr]; if (layer->hasError == 0) { return layer; } } - return (*myWMSLayerList)[0]; -} - -void addErrorInXMLForMisconfiguredLayer(CT::string *XMLDoc, WMSLayer *layer) { XMLDoc->printconcat("\n\n", layer->name.c_str()); } - -int CXMLGen::getFileNameForLayer(WMSLayer *myWMSLayer) { -#ifdef CXMLGEN_DEBUG - CDBDebug("getFileNameForLayer"); -#endif - - /**********************************************/ - /* Read the file to obtain BBOX parameters */ - /**********************************************/ - - // Create a new datasource and set configuration for it - if (myWMSLayer->dataSource == NULL) { - myWMSLayer->dataSource = new CDataSource(); - if (myWMSLayer->dataSource->setCFGLayer(srvParam, srvParam->configObj->Configuration[0], myWMSLayer->layer, myWMSLayer->name.c_str(), -1) != 0) { - return 1; - } - } - - int status; - - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeDataBase || myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeStyled) { - if (myWMSLayer->dataSource->cfgLayer->Dimension.size() == 0) { - - myWMSLayer->fileName.copy(myWMSLayer->dataSource->cfgLayer->FilePath[0]->value.c_str()); - if (CAutoConfigure::autoConfigureDimensions(myWMSLayer->dataSource) != 0) { - CDBError("Unable to autoconfigure dimensions"); - return 1; - } - } - - bool dataBaseDimension = true; - - /* A dimension where the default value is set to filetimedate should not be queried from the db */ - if (myWMSLayer->layer->Dimension.size() == 1 && myWMSLayer->layer->Dimension[0]->attr.defaultV.equals("filetimedate")) { - dataBaseDimension = false; - } - - // Check if any dimension is given: - if (dataBaseDimension == false || (myWMSLayer->layer->Dimension.size() == 0) || (myWMSLayer->layer->Dimension.size() == 1 && myWMSLayer->layer->Dimension[0]->attr.name.equals("none"))) { -#ifdef CXMLGEN_DEBUG - CDBDebug("Layer %s has no dimensions", myWMSLayer->dataSource->layerName.c_str()); -#endif - // If not, just return the filename - std::vector fileList; - try { - fileList = CDBFileScanner::searchFileNames(myWMSLayer->dataSource->cfgLayer->FilePath[0]->value.c_str(), myWMSLayer->dataSource->cfgLayer->FilePath[0]->attr.filter, NULL); - } catch (int linenr) { - }; - if (fileList.size() == 1) { - myWMSLayer->fileName.copy(fileList[0].c_str()); - } else { - myWMSLayer->fileName.copy(myWMSLayer->layer->FilePath[0]->value.c_str()); - } - return 0; - } - - status = CDBFactory::getDBAdapter(srvParam->cfg)->autoUpdateAndScanDimensionTables(myWMSLayer->dataSource); - if (status != 0) { - CDBError("Unable to checkDimTables"); - return 1; - } - - // Find the first occuring filename. - CT::string tableName; - CT::string dimName(myWMSLayer->layer->Dimension[0]->attr.name.c_str()); - try { - tableName = - CDBFactory::getDBAdapter(srvParam->cfg) - ->getTableNameForPathFilterAndDimension(myWMSLayer->layer->FilePath[0]->value.c_str(), myWMSLayer->layer->FilePath[0]->attr.filter.c_str(), dimName.c_str(), myWMSLayer->dataSource); - } catch (int e) { - CDBError("Unable to create tableName from '%s' '%s' '%s'", myWMSLayer->layer->FilePath[0]->value.c_str(), myWMSLayer->layer->FilePath[0]->attr.filter.c_str(), dimName.c_str()); - return 1; - } - - bool databaseError = false; - - CDBStore::Store *values = CDBFactory::getDBAdapter(srvParam->cfg)->getUniqueValuesOrderedByValue("path", 1, false, tableName.c_str()); - - if (values == NULL) { - CDBError("No files found for %s ", myWMSLayer->dataSource->layerName.c_str()); - databaseError = true; - } - if (databaseError == false) { - if (values->getSize() > 0) { -#ifdef CXMLGEN_DEBUG - CDBDebug("Query succeeded: Filename = %s", values->getRecord(0)->get(0)->c_str()); -#endif - myWMSLayer->fileName.copy(values->getRecord(0)->get(0)); - } else { - // The file is not in the database, probably an error during the database scan has been detected earlier. - // Ignore the file for now too - CDBError("Query for '%s' not succeeded", myWMSLayer->layer->FilePath[0]->value.c_str()); - databaseError = true; - } - delete values; - } - -#ifdef CXMLGEN_DEBUG - CDBDebug("/Database"); -#endif - if (databaseError) { - return 1; - } - } - // If this layer is a file type layer (not a database type layer) TODO type file is deprecated... - if (myWMSLayer->layer->attr.type.equals("file")) { - CDBWarning("Type 'file' is deprecated"); - CT::string pathFileName(""); - if (myWMSLayer->fileName.c_str()[0] != '/') { - pathFileName.copy(srvParam->cfg->Path[0]->attr.value.c_str()); - pathFileName.concat("/"); - } - pathFileName.concat(&myWMSLayer->fileName); - myWMSLayer->fileName.copy(pathFileName.c_str(), pathFileName.length()); - } - - return 0; -} - -/** - * - * - */ -int CXMLGen::getDataSourceForLayer(WMSLayer *myWMSLayer) { -#ifdef CXMLGEN_DEBUG - CDBDebug("getDataSourceForLayer"); -#endif - - // Get abstract for layer - if (myWMSLayer->dataSource->cfgLayer->Abstract.size() > 0) { - const char *v = myWMSLayer->dataSource->cfgLayer->Abstract[0]->value.c_str(); - if (v != NULL) { - myWMSLayer->abstract.copy(v); - } - } - // Is this a cascaded WMS server? - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded) { -#ifdef CXMLGEN_DEBUG - CDBDebug("Cascaded layer"); -#endif - if (myWMSLayer->dataSource->cfgLayer->Title.size() != 0) { - myWMSLayer->title.copy(myWMSLayer->dataSource->cfgLayer->Title[0]->value.c_str()); - } else { - myWMSLayer->title.copy(myWMSLayer->dataSource->cfgLayer->Name[0]->value.c_str()); - } - return 0; - } - // This a liveupdate layer - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeLiveUpdate) { -#ifdef CXMLGEN_DEBUG - CDBDebug("Live update layer"); -#endif - return layerTypeLiveUpdateConfigureWMSLayerForGetCapabilities(myWMSLayer); - } - if (myWMSLayer->fileName.empty()) { - CDBError("No file name specified for layer %s", myWMSLayer->dataSource->layerName.c_str()); - return 1; - } - - // Is this a local file based WMS server? - if (myWMSLayer->dataSource->dLayerType != CConfigReaderLayerTypeCascaded) { -#ifdef CXMLGEN_DEBUG - CDBDebug("Database layer"); -#endif - CDataReader reader; - // CNETCDFREADER_MODE_OPEN_DIMENSIONS - int status = reader.open(myWMSLayer->dataSource, CNETCDFREADER_MODE_OPEN_DIMENSIONS); - if (status != 0) { - CDBError("Could not open file: %s", myWMSLayer->dataSource->getFileName()); - return 1; - } - // Get a nice name for this layer (if not configured) - if (myWMSLayer->dataSource->cfgLayer->Title.size() == 0) { - // By default title is the same as the name of the layer. - myWMSLayer->title.copy(myWMSLayer->dataSource->cfgLayer->Name[0]->value.c_str()); - // Try to get longname: - // reader.cdfObject-> - - try { - CT::string attributeValue; - myWMSLayer->dataSource->getDataObject(0)->cdfVariable->getAttribute("long_name")->getDataAsString(&attributeValue); - myWMSLayer->title.copy(attributeValue.c_str()); - myWMSLayer->title.printconcat(" (%s)", myWMSLayer->dataSource->getDataObject(0)->cdfVariable->name.c_str()); - } catch (int e) { - CT::string errorMessage; - CDF::getErrorMessage(&errorMessage, e); -#ifdef CXMLGEN_DEBUG - CDBDebug("No long_name: %s (%d)", errorMessage.c_str(), e); -#endif - try { - CT::string attributeValue; - myWMSLayer->dataSource->getDataObject(0)->cdfVariable->getAttribute("standard_name")->getDataAsString(&attributeValue); - // CDBDebug("attributeValue %s",attributeValue.c_str()); - myWMSLayer->title.copy(attributeValue.c_str()); - } catch (int e) { - CT::string errorMessage; - CDF::getErrorMessage(&errorMessage, e); -#ifdef CXMLGEN_DEBUG - CDBDebug("No standard_name: %s (%d)", errorMessage.c_str(), e); -#endif - } - } - } else { - myWMSLayer->title.copy(myWMSLayer->dataSource->cfgLayer->Title[0]->value.c_str()); - } - - return 0; - } - CDBWarning("Unknown layer type"); - return 0; -} - -int CXMLGen::getProjectionInformationForLayer(WMSLayer *myWMSLayer) { -#ifdef CXMLGEN_DEBUG - CDBDebug("getProjectionInformationForLayer"); -#endif - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded) { - if (myWMSLayer->dataSource->cfgLayer->LatLonBox.size() == 0) { - return 0; - } - } - - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeLiveUpdate) { - if (myWMSLayer->dataSource->cfgLayer->LatLonBox.size() == 0) { - return 0; - } - } - - CGeoParams geo; - - int status; - for (size_t p = 0; p < srvParam->cfg->Projection.size(); p++) { - geo.CRS.copy(srvParam->cfg->Projection[p]->attr.id.c_str()); - -#ifdef MEASURETIME - StopWatch_Stop("start initreproj %s", geo.CRS.c_str()); -#endif - CImageWarper warper; - status = warper.initreproj(myWMSLayer->dataSource, &geo, &srvParam->cfg->Projection); - -#ifdef MEASURETIME - StopWatch_Stop("finished initreproj"); -#endif - -#ifdef CXMLGEN_DEBUG - if (status != 0) { - warper.closereproj(); - CDBDebug("Unable to initialize projection "); - } -#endif - if (status != 0) { - warper.closereproj(); - return 1; - } - - // Find the max extent of the image - WMSLayer::Projection *myProjection = new WMSLayer::Projection(); - myWMSLayer->projectionList.push_back(myProjection); - - // Set the projection string - myProjection->name.copy(srvParam->cfg->Projection[p]->attr.id.c_str()); - - // Calculate the extent for this projection - -#ifdef MEASURETIME - StopWatch_Stop("start findExtent"); -#endif - - warper.findExtent(myWMSLayer->dataSource, myProjection->dfBBOX); - -#ifdef MEASURETIME - StopWatch_Stop("finished findExtent"); -#endif - -#ifdef CXMLGEN_DEBUG - CDBDebug("PROJ=%s\tBBOX=(%f,%f,%f,%f)", myProjection->name.c_str(), myProjection->dfBBOX[0], myProjection->dfBBOX[1], myProjection->dfBBOX[2], myProjection->dfBBOX[3]); -#endif - // Calculate the latlonBBOX - if (srvParam->cfg->Projection[p]->attr.id.equals("EPSG:4326")) { - for (int k = 0; k < 4; k++) myWMSLayer->dfLatLonBBOX[k] = myProjection->dfBBOX[k]; - } - - warper.closereproj(); - } - - // Add the layers native projection as well - if (!myWMSLayer->dataSource->nativeEPSG.empty()) { - WMSLayer::Projection *myProjection = new WMSLayer::Projection(); - myWMSLayer->projectionList.push_back(myProjection); - myProjection->name.copy(myWMSLayer->dataSource->nativeEPSG.c_str()); - myProjection->dfBBOX[0] = myWMSLayer->dataSource->dfBBOX[0]; - myProjection->dfBBOX[3] = myWMSLayer->dataSource->dfBBOX[1]; - myProjection->dfBBOX[2] = myWMSLayer->dataSource->dfBBOX[2]; - myProjection->dfBBOX[1] = myWMSLayer->dataSource->dfBBOX[3]; - } - - return 0; -} - -int CXMLGen::getDimsForLayer(WMSLayer *myWMSLayer) { -#ifdef CXMLGEN_DEBUG - CDBDebug("getDimsForLayer"); -#endif - char szMaxTime[32]; - char szMinTime[32]; - // char szInterval[32]; - // int hastimedomain = 0; - - // Dimensions - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeDataBase || myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeStyled) { - /* if(myWMSLayer->dataSource->cfgLayer->Dimension.size()!=0){ - #ifdef CXMLGEN_DEBUG - CDBDebug("Check"); - #endif - //Check if all dimensions are configured properly by the user (X and Y are never configured by the user, so +2) - if(myWMSLayer->dataSource->cfgLayer->Dimension.size()+2!=myWMSLayer->dataSource->getDataObject(0)->cdfVariable->dimensionlinks.size()){ - CDBError("Warning: Dimensions for layer %s are not configured properly! (configured: %d!=variable: - %d)",myWMSLayer->dataSource->cfgLayer->Name[0]->value.c_str()+2,myWMSLayer->dataSource->cfgLayer->Dimension.size(),myWMSLayer->dataSource->getDataObject(0)->cdfVariable->dimensionlinks.size()); - } - }*/ -#ifdef CXMLGEN_DEBUG - CDBDebug("Start looping dimensions"); - CDBDebug("Number of dimensions is %d", myWMSLayer->dataSource->cfgLayer->Dimension.size()); -#endif - /* Auto configure dimensions */ - for (size_t i = 0; i < myWMSLayer->dataSource->cfgLayer->Dimension.size(); i++) { - - /* This dimension is a filetimedate type, its values come from the modification date of the file */ - if (myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.defaultV.equals("filetimedate")) { - CT::string fileDate = CDirReader::getFileDate(myWMSLayer->layer->FilePath[0]->value.c_str()); - WMSLayer::Dim *dim = new WMSLayer::Dim(); - myWMSLayer->dimList.push_back(dim); - dim->name.copy("time"); - dim->units.copy("ISO8601"); - dim->values.copy(fileDate.c_str()); - dim->defaultValue.copy(fileDate.c_str()); - dim->hasMultipleValues = true; - break; - } -#ifdef CXMLGEN_DEBUG - CDBDebug("%d = %s / %s", i, myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.name.c_str(), myWMSLayer->dataSource->cfgLayer->Dimension[i]->value.c_str()); -#endif - if (i == 0 && myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.name.equals("none")) break; - // Shorthand dimName - const char *pszDimName = myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.name.c_str(); - - // Create a new dim to store in the layer - WMSLayer::Dim *dim = new WMSLayer::Dim(); - myWMSLayer->dimList.push_back(dim); - dim->name.copy(myWMSLayer->dataSource->cfgLayer->Dimension[i]->value.c_str()); - // Get the tablename - CT::string tableName; - try { - tableName = CDBFactory::getDBAdapter(srvParam->cfg) - ->getTableNameForPathFilterAndDimension(myWMSLayer->layer->FilePath[0]->value.c_str(), myWMSLayer->layer->FilePath[0]->attr.filter.c_str(), pszDimName, myWMSLayer->dataSource); - } catch (int e) { - CDBError("Unable to create tableName from '%s' '%s' '%s'", myWMSLayer->layer->FilePath[0]->value.c_str(), myWMSLayer->layer->FilePath[0]->attr.filter.c_str(), pszDimName); - return 1; - } - - bool hasMultipleValues = false; - bool isTimeDim = false; - if (myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.interval.empty()) { - hasMultipleValues = true; - - /* Automatically scan the time dimension, two types are avaible, start/stop/resolution and individual values */ - // TODO try to detect automatically the time resolution of the layer. - CT::string varName = myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.name.c_str(); - // CDBDebug("VarName = [%s]",varName.c_str()); - int ind = varName.indexOf("time"); - if (ind >= 0) { - // CDBDebug("VarName = [%s] and this is a time dim at %d!",varName.c_str(),ind); - CT::string units; - isTimeDim = true; - try { - myWMSLayer->dataSource->getDataObject(0)->cdfObject->getVariable("time")->getAttribute("units")->getDataAsString(&units); - - } catch (int e) { - } - if (units.length() > 0) { -#ifdef CXMLGEN_DEBUG - CDBDebug("Time dimension units = %s", units.c_str()); -#endif - -#ifdef MEASURETIME - StopWatch_Stop("Get the first 100 values from the database, and determine whether the time resolution is continous or multivalue."); -#endif - - // Get the first 100 values from the database, and determine whether the time resolution is continous or multivalue. - CDBStore::Store *store = CDBFactory::getDBAdapter(srvParam->cfg)->getUniqueValuesOrderedByValue(pszDimName, 100, true, tableName.c_str()); - bool dataHasBeenFoundInStore = false; - if (store != NULL) { - if (store->size() != 0) { - dataHasBeenFoundInStore = true; - tm tms[store->size()]; - - try { - - for (size_t j = 0; j < store->size(); j++) { - store->getRecord(j)->get("time")->setChar(10, 'T'); - const char *isotime = store->getRecord(j)->get("time")->c_str(); -#ifdef CXMLGEN_DEBUG - // CDBDebug("isotime = %s",isotime); -#endif - CT::string year, month, day, hour, minute, second; - year.copy(isotime + 0, 4); - tms[j].tm_year = year.toInt() - 1900; - month.copy(isotime + 5, 2); - tms[j].tm_mon = month.toInt() - 1; - day.copy(isotime + 8, 2); - tms[j].tm_mday = day.toInt(); - hour.copy(isotime + 11, 2); - tms[j].tm_hour = hour.toInt(); - minute.copy(isotime + 14, 2); - tms[j].tm_min = minute.toInt(); - second.copy(isotime + 17, 2); - tms[j].tm_sec = second.toInt(); - } - size_t nrTimes = store->size() - 1; - bool isConst = true; - if (store->size() < 4) { - isConst = false; - } - try { - CTime *time = CTime::GetCTimeInstance(myWMSLayer->dataSource->getDataObject(0)->cdfObject->getVariable("time")); - if (time == nullptr) { - CDBDebug(CTIME_GETINSTANCE_ERROR_MESSAGE); - return 1; - } - if (time->getMode() != 0) { - isConst = false; - } - } catch (int e) { - } - - CT::string iso8601timeRes = "P"; - CT::string yearPart = ""; - if (tms[1].tm_year - tms[0].tm_year != 0) { - if (tms[1].tm_year - tms[0].tm_year == (tms[nrTimes < 10 ? nrTimes : 10].tm_year - tms[0].tm_year) / double(nrTimes < 10 ? nrTimes : 10)) { - yearPart.printconcat("%dY", abs(tms[1].tm_year - tms[0].tm_year)); - } else { - isConst = false; -#ifdef CXMLGEN_DEBUG - CDBDebug("year is irregular"); -#endif - } - } - if (tms[1].tm_mon - tms[0].tm_mon != 0) { - if (tms[1].tm_mon - tms[0].tm_mon == (tms[nrTimes < 10 ? nrTimes : 10].tm_mon - tms[0].tm_mon) / double(nrTimes < 10 ? nrTimes : 10)) - yearPart.printconcat("%dM", abs(tms[1].tm_mon - tms[0].tm_mon)); - else { - isConst = false; -#ifdef CXMLGEN_DEBUG - CDBDebug("month is irregular"); -#endif - } - } - - if (tms[1].tm_mday - tms[0].tm_mday != 0) { - if (tms[1].tm_mday - tms[0].tm_mday == (tms[nrTimes < 10 ? nrTimes : 10].tm_mday - tms[0].tm_mday) / double(nrTimes < 10 ? nrTimes : 10)) - yearPart.printconcat("%dD", abs(tms[1].tm_mday - tms[0].tm_mday)); - else { - isConst = false; -#ifdef CXMLGEN_DEBUG - CDBDebug("day irregular"); - for (size_t j = 0; j < nrTimes; j++) { - CDBDebug("Day %d = %d", j, tms[j].tm_mday); - } -#endif - } - } - - CT::string hourPart = ""; - if (tms[1].tm_hour - tms[0].tm_hour != 0) { - hourPart.printconcat("%dH", abs(tms[1].tm_hour - tms[0].tm_hour)); - } - if (tms[1].tm_min - tms[0].tm_min != 0) { - hourPart.printconcat("%dM", abs(tms[1].tm_min - tms[0].tm_min)); - } - if (tms[1].tm_sec - tms[0].tm_sec != 0) { - hourPart.printconcat("%dS", abs(tms[1].tm_sec - tms[0].tm_sec)); - } - - int sd = (tms[1].tm_hour * 3600 + tms[1].tm_min * 60 + tms[1].tm_sec) - (tms[0].tm_hour * 3600 + tms[0].tm_min * 60 + tms[0].tm_sec); - for (size_t j = 2; j < store->size() && isConst; j++) { - int d = (tms[j].tm_hour * 3600 + tms[j].tm_min * 60 + tms[j].tm_sec) - (tms[j - 1].tm_hour * 3600 + tms[j - 1].tm_min * 60 + tms[j - 1].tm_sec); - if (d > 0) { - if (sd != d) { - isConst = false; -#ifdef CXMLGEN_DEBUG - CDBDebug("hour/min/sec is irregular %d ", j); -#endif - } - } - } - - // Check whether we found a time resolution - if (isConst == false) { - hasMultipleValues = true; -#ifdef CXMLGEN_DEBUG - CDBDebug("Not a continous time dimension, multipleValues required"); -#endif - } else { -#ifdef CXMLGEN_DEBUG - CDBDebug("Continous time dimension, Time resolution needs to be calculated"); -#endif - hasMultipleValues = false; - } - - if (isConst) { - if (yearPart.length() > 0) { - iso8601timeRes.concat(&yearPart); - } - if (hourPart.length() > 0) { - iso8601timeRes.concat("T"); - iso8601timeRes.concat(&hourPart); - } -#ifdef CXMLGEN_DEBUG - CDBDebug("Calculated a timeresolution of %s", iso8601timeRes.c_str()); -#endif - myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.interval.copy(iso8601timeRes.c_str()); - myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.units.copy("ISO8601"); - } - } catch (int e) { - } - } - delete store; - store = NULL; - } - if (dataHasBeenFoundInStore == false) { - CDBDebug("No data available in database for dimension %s", pszDimName); - } - } - } - } - CDBStore::Store *values = NULL; - // This is a multival dim, defined as val1,val2,val3,val4,val5,etc... - if (hasMultipleValues == true) { - // Get all dimension values from the db - if (isTimeDim) { - values = CDBFactory::getDBAdapter(srvParam->cfg)->getUniqueValuesOrderedByValue(pszDimName, 0, true, tableName.c_str()); - } else { - // query.print("select distinct %s,dim%s from %s order by dim%s,%s",pszDimName,pszDimName,tableName.c_str(),pszDimName,pszDimName); - values = CDBFactory::getDBAdapter(srvParam->cfg)->getUniqueValuesOrderedByIndex(pszDimName, 0, true, tableName.c_str()); - } - - if (values == NULL) { - CDBError("Query failed"); - return 1; - } - - if (values->getSize() > 0) { - // if(srvParam->requestType==REQUEST_WMS_GETCAPABILITIES) - { - - dim->name.copy(myWMSLayer->dataSource->cfgLayer->Dimension[i]->value.c_str()); - - // Try to get units from the variable - dim->units.copy("NA"); - if (myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.units.empty()) { - CT::string units; - try { - myWMSLayer->dataSource->getDataObject(0)->cdfObject->getVariable(dim->name.c_str())->getAttribute("units")->getDataAsString(&units); - dim->units.copy(&units); - } catch (int e) { - } - } - - dim->hasMultipleValues = 1; - if (isTimeDim == true) { - dim->units.copy("ISO8601"); - for (size_t j = 0; j < values->getSize(); j++) { - // 2011-01-01T22:00:01Z - // 01234567890123456789 - values->getRecord(j)->get(0)->setChar(10, 'T'); - if (values->getRecord(j)->get(0)->length() == 19) { - values->getRecord(j)->get(0)->printconcat("Z"); - } - } - dim->units.copy("ISO8601"); - } - - if (!myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.units.empty()) { - // Units are configured in the configuration file. - dim->units.copy(myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.units.c_str()); - } - - const char *pszDefaultV = myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.defaultV.c_str(); - CT::string defaultV; - if (pszDefaultV != NULL) defaultV = pszDefaultV; - - if (defaultV.length() == 0 || defaultV.equals("max", 3)) { - dim->defaultValue.copy(values->getRecord(values->getSize() - 1)->get(0)->c_str()); - } else if (defaultV.equals("min", 3)) { - dim->defaultValue.copy(values->getRecord(0)->get(0)->c_str()); - } else { - dim->defaultValue.copy(&defaultV); - } - - dim->values.copy(values->getRecord(0)->get(0)); - for (size_t j = 1; j < values->getSize(); j++) { - dim->values.printconcat(",%s", values->getRecord(j)->get(0)->c_str()); - } - } - } - delete values; - } - - // This is an interval defined as start/stop/resolution - if (hasMultipleValues == false) { - // Retrieve the max dimension value - CDBStore::Store *values = CDBFactory::getDBAdapter(srvParam->cfg)->getMax(pszDimName, tableName.c_str()); - if (values == NULL) { - CDBError("Query failed"); - return 1; - } - if (values->getSize() > 0) { - snprintf(szMaxTime, 31, "%s", values->getRecord(0)->get(0)->c_str()); - szMaxTime[10] = 'T'; - } - delete values; - // Retrieve the minimum dimension value - values = CDBFactory::getDBAdapter(srvParam->cfg)->getMin(pszDimName, tableName.c_str()); - if (values == NULL) { - CDBError("Query failed"); - return 1; - } - if (values->getSize() > 0) { - snprintf(szMinTime, 31, "%s", values->getRecord(0)->get(0)->c_str()); - szMinTime[10] = 'T'; - } - delete values; - - // Retrieve all values for time position - // if(srvParam->serviceType==SERVICE_WCS){ - - /* - query.print("select %s from %s",dimName,tableName.c_str()); - values = DB.query_select(query.c_str(),0); - if(values == NULL){CDBError("Query failed");DB.close();return 1;} - if(values->count>0){ - if(TimePositions!=NULL){ - delete[] TimePositions; - TimePositions=NULL; - } - TimePositions=new CT::string[values->count]; - char szTemp[32]; - for(size_t l=0;lcount;l++){ - snprintf(szTemp,31,"%s",values[l].c_str());szTemp[10]='T'; - TimePositions[l].copy(szTemp); - TimePositions[l].count=values[l].count; - } - } - delete[] values;*/ - - if (myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.interval.empty()) { - // TODO - CDBError("Dimension interval '%d' not defined", i); - return 1; - } - // strncpy(szInterval,myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.interval.c_str(),32);szInterval[31]='\0'; - const char *pszInterval = myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.interval.c_str(); - // hastimedomain = 1; - // if(srvParam->requestType==REQUEST_WMS_GETCAPABILITIES) - { - CT::string dimUnits("ISO8601"); - if (myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.units.empty() == false) { - dimUnits.copy(myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.units.c_str()); - } - dim->name.copy(myWMSLayer->dataSource->cfgLayer->Dimension[i]->value.c_str()); - dim->units.copy(dimUnits.c_str()); - dim->hasMultipleValues = 0; - // myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.defaultV.c_str() - const char *pszDefaultV = myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.defaultV.c_str(); - CT::string defaultV; - if (pszDefaultV != NULL) defaultV = pszDefaultV; - if (defaultV.length() == 0 || defaultV.equals("max", 3)) { - dim->defaultValue.copy(szMaxTime); - } else if (defaultV.equals("min", 3)) { - dim->defaultValue.copy(szMinTime); - } else { - dim->defaultValue.copy(&defaultV); - } - if (dim->defaultValue.length() == 19) { - dim->defaultValue.concat("Z"); - } - - CT::string minTime = szMinTime; - if (minTime.equals(szMaxTime)) { - dim->values.print("%s", szMinTime); - } else { - dim->values.print("%s/%s/%s", szMinTime, szMaxTime, pszInterval); - } - } - } - - // Check for forced values - if (!myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.fixvalue.empty()) { - dim->values = myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.fixvalue; - dim->defaultValue = myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.fixvalue; - dim->hasMultipleValues = false; - } - - // Check if it should be hidden - if (myWMSLayer->dataSource->cfgLayer->Dimension[i]->attr.hidden == true) { - dim->hidden = true; - } - } - } - - return 0; + return (*metadataLayerList)[0]; } -int CXMLGen::getStylesForLayer(WMSLayer *myWMSLayer) { - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded) { - return 0; - } - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeLiveUpdate) { - return 0; - } - - CT::PointerList *styleList = myWMSLayer->dataSource->getStyleListForDataSource(myWMSLayer->dataSource); - - if (styleList == NULL) return 1; - // for(size_t j=0;jsize();j++){ - // CImageDataWriter::getStyleConfigurationByName(styleList->get(j)->c_str(),myWMSLayer->dataSource); - // - // if(myWMSLayer->dataSource->styleConfiguration->hasError){ - // CDBError("Style %s has an error",styleList->get(j)->c_str()); - // } - // - // WMSLayer::Style *style = new WMSLayer::Style(); - // style->name.copy(styleList->get(j)); - // if(myWMSLayer->dataSource->styleConfiguration->styleTitle.length()>0){ - // style->title.copy(myWMSLayer->dataSource->styleConfiguration->styleTitle.c_str()); - // }else{ - // style->title.copy(styleList->get(j)); - // } - // style->abstract.copy(myWMSLayer->dataSource->styleConfiguration->styleAbstract.c_str()); - // myWMSLayer->styleList.push_back(style); - // - // - // } - // - - for (size_t j = 0; j < styleList->size(); j++) { - - WMSLayer::Style *style = new WMSLayer::Style(); - style->name.copy(styleList->get(j)->styleCompositionName.c_str()); - style->title.copy(styleList->get(j)->styleTitle.c_str()); - style->abstract.copy(styleList->get(j)->styleAbstract.c_str()); - - myWMSLayer->styleList.push_back(style); - } - - delete styleList; - - return 0; -} +void addErrorInXMLForMisconfiguredLayer(CT::string *XMLDoc, MetadataLayer *layer) { XMLDoc->printconcat("\n\n", layer->layerMetadata.name.c_str()); } -int CXMLGen::getWMS_1_0_0_Capabilities(CT::string *XMLDoc, std::vector *myWMSLayerList) { - CFile header; +int CXMLGen::getWMS_1_0_0_Capabilities(CT::string *XMLDoc, std::vector *metadataLayerList) { CT::string onlineResource = srvParam->getOnlineResource(); onlineResource.concat("SERVICE=WMS&"); - int status = header.open(srvParam->cfg->Path[0]->attr.value.c_str(), WMS_1_0_0_HEADERFILE); - if (status != 0) return 1; - - XMLDoc->copy(header.data); + XMLDoc->copy(WMS_1_0_0_GetCapabilities_Header); XMLDoc->replaceSelf("[SERVICETITLE]", srvParam->cfg->WMS[0]->Title[0]->value.c_str()); XMLDoc->replaceSelf("[SERVICEABSTRACT]", srvParam->cfg->WMS[0]->Abstract[0]->value.c_str()); XMLDoc->replaceSelf("[GLOBALLAYERTITLE]", srvParam->cfg->WMS[0]->RootLayer[0]->Title[0]->value.c_str()); XMLDoc->replaceSelf("[SERVICEONLINERESOURCE]", onlineResource.c_str()); XMLDoc->replaceSelf("[SERVICEINFO]", serviceInfo.c_str()); - const auto firstWMLayer = getFirstLayerWithoutError(myWMSLayerList); + const auto firstWMLayer = getFirstLayerWithoutError(metadataLayerList); if (firstWMLayer != nullptr) { - for (size_t p = 0; p < firstWMLayer->projectionList.size(); p++) { - WMSLayer::Projection *proj = firstWMLayer->projectionList[p]; + for (auto projection : firstWMLayer->layerMetadata.projectionList) { XMLDoc->concat(""); - XMLDoc->concat(&proj->name); + XMLDoc->concat(&projection.name); XMLDoc->concat("\n"); } - for (size_t lnr = 0; lnr < myWMSLayerList->size(); lnr++) { - WMSLayer *layer = (*myWMSLayerList)[lnr]; + for (size_t lnr = 0; lnr < metadataLayerList->size(); lnr++) { + MetadataLayer *layer = (*metadataLayerList)[lnr]; if (layer->hasError != 0) { addErrorInXMLForMisconfiguredLayer(XMLDoc, layer); } if (layer->hasError == 0) { - XMLDoc->printconcat("\n", layer->isQuerable); + XMLDoc->printconcat("\n", layer->layerMetadata.isQueryable); XMLDoc->concat(""); - XMLDoc->concat(&layer->name); + XMLDoc->concat(&layer->layerMetadata.name); XMLDoc->concat("\n"); - CT::string layerTitle = layer->title; + CT::string layerTitle = layer->layerMetadata.title; layerTitle.encodeXMLSelf(); XMLDoc->concat(""); XMLDoc->concat(&layerTitle); XMLDoc->concat("\n"); XMLDoc->concat(""); - for (size_t p = 0; p < layer->projectionList.size(); p++) { - WMSLayer::Projection *proj = layer->projectionList[p]; - XMLDoc->concat(&proj->name); - if (p + 1 < layer->projectionList.size()) XMLDoc->concat(" "); + for (size_t p = 0; p < layer->layerMetadata.projectionList.size(); p++) { + XMLDoc->concat(&layer->layerMetadata.projectionList[p].name); + if (p + 1 < layer->layerMetadata.projectionList.size()) XMLDoc->concat(" "); } XMLDoc->concat("\n"); - XMLDoc->printconcat("\n", layer->dfLatLonBBOX[0], layer->dfLatLonBBOX[1], layer->dfLatLonBBOX[2], layer->dfLatLonBBOX[3]); + XMLDoc->printconcat("\n", layer->layerMetadata.dfLatLonBBOX[0], layer->layerMetadata.dfLatLonBBOX[1], + layer->layerMetadata.dfLatLonBBOX[2], layer->layerMetadata.dfLatLonBBOX[3]); // Dims - for (size_t d = 0; d < layer->dimList.size(); d++) { - WMSLayer::Dim *dim = layer->dimList[d]; - if (dim->hidden) continue; - XMLDoc->printconcat("\n", dim->name.c_str(), dim->units.c_str()); - XMLDoc->printconcat("", dim->name.c_str(), dim->defaultValue.c_str(), 1); - XMLDoc->concat(dim->values.c_str()); + for (auto dim : layer->layerMetadata.dimList) { + if (dim.hidden) continue; + XMLDoc->printconcat("\n", dim.serviceName.c_str(), dim.units.c_str()); + XMLDoc->printconcat("", dim.serviceName.c_str(), dim.defaultValue.c_str(), 1); + XMLDoc->concat(dim.values.c_str()); XMLDoc->concat("\n"); } XMLDoc->concat("\n"); } else { - CDBError("Skipping layer %s", layer->name.c_str()); + CDBError("Skipping layer %s", layer->layerMetadata.name.c_str()); } } } @@ -877,34 +115,29 @@ int CXMLGen::getWMS_1_0_0_Capabilities(CT::string *XMLDoc, std::vector *myWMSLayerList) { - CFile header; +int CXMLGen::getWMS_1_1_1_Capabilities(CT::string *XMLDoc, std::vector *metadataLayerList) { CT::string onlineResource = srvParam->getOnlineResource(); onlineResource.concat("SERVICE=WMS&"); - int status = header.open(srvParam->cfg->Path[0]->attr.value.c_str(), WMS_1_1_1_HEADERFILE); - if (status != 0) return 1; - - XMLDoc->copy(header.data); + XMLDoc->copy(WMS_1_1_1_GetCapabilities_Header); XMLDoc->replaceSelf("[SERVICETITLE]", srvParam->cfg->WMS[0]->Title[0]->value.c_str()); XMLDoc->replaceSelf("[SERVICEABSTRACT]", srvParam->cfg->WMS[0]->Abstract[0]->value.c_str()); XMLDoc->replaceSelf("[GLOBALLAYERTITLE]", srvParam->cfg->WMS[0]->RootLayer[0]->Title[0]->value.c_str()); XMLDoc->replaceSelf("[SERVICEONLINERESOURCE]", onlineResource.c_str()); XMLDoc->replaceSelf("[SERVICEINFO]", serviceInfo.c_str()); - const auto firstWMLayer = getFirstLayerWithoutError(myWMSLayerList); + const auto firstWMLayer = getFirstLayerWithoutError(metadataLayerList); if (firstWMLayer != nullptr) { - for (size_t p = 0; p < firstWMLayer->projectionList.size(); p++) { - WMSLayer::Projection *proj = firstWMLayer->projectionList[p]; + for (auto proj : firstWMLayer->layerMetadata.projectionList) { XMLDoc->concat(""); - XMLDoc->concat(&proj->name); + XMLDoc->concat(&proj.name); XMLDoc->concat("\n"); } // Make a unique list of all groups std::vector groupKeys; - for (size_t lnr = 0; lnr < myWMSLayerList->size(); lnr++) { - WMSLayer *layer = (*myWMSLayerList)[lnr]; + for (size_t lnr = 0; lnr < metadataLayerList->size(); lnr++) { + MetadataLayer *layer = (*metadataLayerList)[lnr]; std::string key = ""; - if (layer->group.length() > 0) key = layer->group.c_str(); + if (layer->layerMetadata.group.length() > 0) key = layer->layerMetadata.group.c_str(); size_t j = 0; for (j = 0; j < groupKeys.size(); j++) { if (groupKeys[j] == key) break; @@ -974,66 +207,62 @@ int CXMLGen::getWMS_1_1_1_Capabilities(CT::string *XMLDoc, std::vectorsize(); lnr++) { - WMSLayer *layer = (*myWMSLayerList)[lnr]; - if (layer->group.equals(groupKeys[groupIndex])) { + for (size_t lnr = 0; lnr < metadataLayerList->size(); lnr++) { + MetadataLayer *layer = (*metadataLayerList)[lnr]; + if (layer->layerMetadata.group.equals(groupKeys[groupIndex])) { // CDBError("layer %d %s",groupDepth,layer->name.c_str()); if (layer->hasError != 0) { addErrorInXMLForMisconfiguredLayer(XMLDoc, layer); } if (layer->hasError == 0) { - XMLDoc->printconcat("\n", layer->isQuerable, layer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded ? 1 : 0); + XMLDoc->printconcat("\n", layer->layerMetadata.isQueryable, layer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded ? 1 : 0); XMLDoc->concat(""); - XMLDoc->concat(&layer->name); + XMLDoc->concat(&layer->layerMetadata.name); XMLDoc->concat("\n"); - CT::string layerTitle = layer->title; + CT::string layerTitle = layer->layerMetadata.title; layerTitle.encodeXMLSelf(); XMLDoc->concat(""); XMLDoc->concat(&layerTitle); XMLDoc->concat("\n"); - for (size_t p = 0; p < layer->projectionList.size(); p++) { - WMSLayer::Projection *proj = layer->projectionList[p]; + for (auto proj : layer->layerMetadata.projectionList) { XMLDoc->concat(""); - XMLDoc->concat(&proj->name); + XMLDoc->concat(&proj.name); XMLDoc->concat("\n"); - XMLDoc->printconcat("\n", proj->name.c_str(), proj->dfBBOX[0], proj->dfBBOX[1], proj->dfBBOX[2], - proj->dfBBOX[3]); + XMLDoc->printconcat("\n", proj.name.c_str(), proj.dfBBOX[0], proj.dfBBOX[1], proj.dfBBOX[2], proj.dfBBOX[3]); } - XMLDoc->printconcat("\n", layer->dfLatLonBBOX[0], layer->dfLatLonBBOX[1], layer->dfLatLonBBOX[2], - layer->dfLatLonBBOX[3]); + XMLDoc->printconcat("\n", layer->layerMetadata.dfLatLonBBOX[0], layer->layerMetadata.dfLatLonBBOX[1], + layer->layerMetadata.dfLatLonBBOX[2], layer->layerMetadata.dfLatLonBBOX[3]); // Dims - for (size_t d = 0; d < layer->dimList.size(); d++) { - WMSLayer::Dim *dim = layer->dimList[d]; - if (dim->hidden) continue; - XMLDoc->printconcat("\n", dim->name.c_str(), dim->units.c_str()); - XMLDoc->printconcat("", dim->name.c_str(), dim->defaultValue.c_str(), 1); - XMLDoc->concat(dim->values.c_str()); + for (auto dim : layer->layerMetadata.dimList) { + if (dim.hidden) continue; + XMLDoc->printconcat("\n", dim.serviceName.c_str(), dim.units.c_str()); + XMLDoc->printconcat("", dim.serviceName.c_str(), dim.defaultValue.c_str(), 1); + XMLDoc->concat(dim.values.c_str()); XMLDoc->concat("\n"); } // Styles - for (size_t s = 0; s < layer->styleList.size(); s++) { - WMSLayer::Style *style = layer->styleList[s]; + for (auto style : layer->layerMetadata.styleList) { XMLDoc->concat(" "); } - if (layer->dataSource->cfgLayer->MetadataURL.size() > 0) { - CT::string layerMetaDataURL = firstWMLayer->dataSource->cfgLayer->MetadataURL[0]->value.c_str(); + if (layer->layer->MetadataURL.size() > 0) { + CT::string layerMetaDataURL = layer->layer->MetadataURL[0]->value.c_str(); layerMetaDataURL.replaceSelf("&", "&"); XMLDoc->concat(" \n"); XMLDoc->concat(" text/xml\n"); @@ -1044,7 +273,7 @@ int CXMLGen::getWMS_1_1_1_Capabilities(CT::string *XMLDoc, std::vectorconcat(" \n"); XMLDoc->concat("\n"); } else { - CDBError("Skipping layer %s", layer->name.c_str()); + CDBError("Skipping layer %s", layer->layerMetadata.name.c_str()); } } } @@ -1059,14 +288,10 @@ int CXMLGen::getWMS_1_1_1_Capabilities(CT::string *XMLDoc, std::vector *myWMSLayerList) { - CFile header; +int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vector *metadataLayerList) { CT::string onlineResource = srvParam->getOnlineResource(); onlineResource.concat("SERVICE=WMS&"); - int status = header.open(srvParam->cfg->Path[0]->attr.value.c_str(), WMS_1_3_0_HEADERFILE); - if (status != 0) return 1; - - XMLDoc->copy(header.data); + XMLDoc->copy(WMS_1_3_0_GetCapabilities_Header); XMLDoc->replaceSelf("[SERVICETITLE]", srvParam->cfg->WMS[0]->Title[0]->value.c_str()); XMLDoc->replaceSelf("[SERVICEABSTRACT]", srvParam->cfg->WMS[0]->Abstract[0]->value.c_str()); // XMLDoc->replaceSelf("[GLOBALLAYERTITLE]",srvParam->cfg->WMS[0]->RootLayer[0]->Title[0]->value.c_str()); @@ -1236,24 +461,22 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vectorconcat("\n"); XMLDoc->printconcat("%s\n", srvParam->cfg->WMS[0]->RootLayer[0]->Title[0]->value.c_str()); - const auto firstWMLayer = getFirstLayerWithoutError(myWMSLayerList); + const auto firstWMLayer = getFirstLayerWithoutError(metadataLayerList); if (firstWMLayer != nullptr) { - for (size_t p = 0; p < firstWMLayer->projectionList.size(); p++) { - WMSLayer::Projection *proj = firstWMLayer->projectionList[p]; - if (!proj->name.empty()) { + for (auto proj : firstWMLayer->layerMetadata.projectionList) { + if (!proj.name.empty()) { XMLDoc->concat(""); - XMLDoc->concat(&proj->name); + XMLDoc->concat(&proj.name); XMLDoc->concat("\n"); } } - for (size_t p = 0; p < firstWMLayer->projectionList.size(); p++) { - WMSLayer::Projection *proj = firstWMLayer->projectionList[p]; - if (!proj->name.empty()) { - if (srvParam->checkBBOXXYOrder(proj->name.c_str()) == true) { - XMLDoc->printconcat("\n", proj->name.c_str(), proj->dfBBOX[1], proj->dfBBOX[0], proj->dfBBOX[3], proj->dfBBOX[2]); + for (auto proj : firstWMLayer->layerMetadata.projectionList) { + if (!proj.name.empty()) { + if (srvParam->checkBBOXXYOrder(proj.name.c_str()) == true) { + XMLDoc->printconcat("\n", proj.name.c_str(), proj.dfBBOX[1], proj.dfBBOX[0], proj.dfBBOX[3], proj.dfBBOX[2]); } else { - XMLDoc->printconcat("\n", proj->name.c_str(), proj->dfBBOX[0], proj->dfBBOX[1], proj->dfBBOX[2], proj->dfBBOX[3]); + XMLDoc->printconcat("\n", proj.name.c_str(), proj.dfBBOX[0], proj.dfBBOX[1], proj.dfBBOX[2], proj.dfBBOX[3]); } } } @@ -1271,10 +494,10 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vector groupKeys; - for (size_t lnr = 0; lnr < myWMSLayerList->size(); lnr++) { - WMSLayer *layer = (*myWMSLayerList)[lnr]; + for (size_t lnr = 0; lnr < metadataLayerList->size(); lnr++) { + MetadataLayer *layer = (*metadataLayerList)[lnr]; std::string key = ""; - if (layer->group.length() > 0) key = layer->group.c_str(); + if (layer->layerMetadata.group.length() > 0) key = layer->layerMetadata.group.c_str(); size_t j = 0; for (j = 0; j < groupKeys.size(); j++) { if (groupKeys[j] == key) break; @@ -1347,13 +570,13 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vectorsize(); lnr++) { - WMSLayer *layer = (*myWMSLayerList)[lnr]; + for (size_t lnr = 0; lnr < metadataLayerList->size(); lnr++) { + MetadataLayer *layer = (*metadataLayerList)[lnr]; #ifdef CXMLGEN_DEBUG CDBDebug("Comparing %s == %s", layer->group.c_str(), groupKeys[groupIndex].c_str()); #endif - if (layer->group.equals(groupKeys[groupIndex])) { + if (layer->layerMetadata.group.equals(groupKeys[groupIndex])) { #ifdef CXMLGEN_DEBUG CDBDebug("layer %d %s", groupDepth, layer->name.c_str()); #endif @@ -1362,20 +585,20 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vectorhasError == 0) { - XMLDoc->printconcat("\n", layer->isQuerable, layer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded ? 1 : 0); + XMLDoc->printconcat("\n", layer->layerMetadata.isQueryable, layer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded ? 1 : 0); XMLDoc->concat(""); - XMLDoc->concat(&layer->name); + XMLDoc->concat(&layer->layerMetadata.name); XMLDoc->concat("\n"); - CT::string layerTitle = layer->title; + CT::string layerTitle = layer->layerMetadata.title; layerTitle.encodeXMLSelf(); XMLDoc->concat(""); XMLDoc->concat(&layerTitle); XMLDoc->concat("\n"); // TODO - if (layer->abstract.length() > 0) { + if (layer->layerMetadata.abstract.length() > 0) { XMLDoc->concat(""); - XMLDoc->concat(layer->abstract.encodeXML().c_str()); + XMLDoc->concat(layer->layerMetadata.abstract.encodeXML().c_str()); XMLDoc->concat("\n"); } #ifdef ENABLE_INSPIRE @@ -1390,7 +613,7 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vectorconcat(""); XMLDoc->concat(&layer->abstract);XMLDoc->concat("\n"); - /*if(layer->dataSource->cfgLayer->MetadataURL.size()>0){ + /*if(layer->layerMetadata.cfgLayer->MetadataURL.size()>0){ XMLDoc->concat(" precipitation_amount\n"); }*/ XMLDoc->printconcat("\n" @@ -1399,22 +622,18 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vector%f\n" " %f\n" "", - layer->dfLatLonBBOX[0], layer->dfLatLonBBOX[2], layer->dfLatLonBBOX[1], layer->dfLatLonBBOX[3]); + layer->layerMetadata.dfLatLonBBOX[0], layer->layerMetadata.dfLatLonBBOX[2], layer->layerMetadata.dfLatLonBBOX[1], layer->layerMetadata.dfLatLonBBOX[3]); - for (size_t p = 0; p < layer->projectionList.size(); p++) { - WMSLayer::Projection *proj = layer->projectionList[p]; - - if (srvParam->checkBBOXXYOrder(proj->name.c_str()) == true) { - XMLDoc->printconcat("\n", proj->name.c_str(), proj->dfBBOX[1], proj->dfBBOX[0], proj->dfBBOX[3], - proj->dfBBOX[2]); + for (auto proj : layer->layerMetadata.projectionList) { + if (srvParam->checkBBOXXYOrder(proj.name.c_str()) == true) { + XMLDoc->printconcat("\n", proj.name.c_str(), proj.dfBBOX[1], proj.dfBBOX[0], proj.dfBBOX[3], proj.dfBBOX[2]); } else { - XMLDoc->printconcat("\n", proj->name.c_str(), proj->dfBBOX[0], proj->dfBBOX[1], proj->dfBBOX[2], - proj->dfBBOX[3]); + XMLDoc->printconcat("\n", proj.name.c_str(), proj.dfBBOX[0], proj.dfBBOX[1], proj.dfBBOX[2], proj.dfBBOX[3]); } } - if (firstWMLayer->dataSource->cfgLayer->MetadataURL.size() > 0) { - CT::string layerMetaDataURL = firstWMLayer->dataSource->cfgLayer->MetadataURL[0]->value.c_str(); + if (firstWMLayer->layer->MetadataURL.size() > 0) { + CT::string layerMetaDataURL = firstWMLayer->layer->MetadataURL[0]->value.c_str(); layerMetaDataURL.replaceSelf("&", "&"); XMLDoc->concat(" \n"); XMLDoc->concat(" application/gml+xml; version=3.2\n"); @@ -1428,17 +647,16 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vectordimList.size(); d++) { - WMSLayer::Dim *dim = layer->dimList[d]; - if (dim->hidden) continue; - if (dim->name.indexOf("time") != -1) { - XMLDoc->printconcat("", dim->name.c_str(), dim->units.c_str(), - dim->defaultValue.c_str(), 1); + for (auto dim : layer->layerMetadata.dimList) { + if (dim.hidden) continue; + if (dim.serviceName.indexOf("time") != -1) { + XMLDoc->printconcat("", dim.serviceName.c_str(), dim.units.c_str(), + dim.defaultValue.c_str(), 1); } else { - XMLDoc->printconcat("", dim->name.c_str(), dim->units.c_str(), dim->defaultValue.c_str(), - 1); + XMLDoc->printconcat("", dim.serviceName.c_str(), dim.units.c_str(), + dim.defaultValue.c_str(), 1); } - XMLDoc->concat(dim->values.c_str()); + XMLDoc->concat(dim.values.c_str()); XMLDoc->concat("\n"); } if (inspireMetadataIsAvailable) { @@ -1459,31 +677,30 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vectorprintconcat(" \n", authorityName.c_str(), authorityOnlineResource.c_str()); // XMLDoc->printconcat(" %s\n",identifierAuthority.c_str(),identifierId.c_str()); - XMLDoc->printconcat(" %s\n", identifierAuthority.c_str(), layer->name.c_str()); + XMLDoc->printconcat(" %s\n", identifierAuthority.c_str(), layer->layerMetadata.name.c_str()); } // Styles - for (size_t s = 0; s < layer->styleList.size(); s++) { - WMSLayer::Style *style = layer->styleList[s]; + for (auto style : layer->layerMetadata.styleList) { XMLDoc->concat(" "); } XMLDoc->concat("\n"); } else { - CDBError("Skipping layer %s", layer->name.c_str()); + CDBError("Skipping layer %s", layer->layerMetadata.name.c_str()); } } } @@ -1498,14 +715,11 @@ int CXMLGen::getWMS_1_3_0_Capabilities(CT::string *XMLDoc, std::vector *myWMSLayerList) { - CFile header; +int CXMLGen::getWCS_1_0_0_Capabilities(CT::string *XMLDoc, std::vector *metadataLayerList) { CT::string onlineResource = srvParam->getOnlineResource(); onlineResource.concat("SERVICE=WCS&"); - int status = header.open(srvParam->cfg->Path[0]->attr.value.c_str(), WCS_1_0_HEADERFILE); - if (status != 0) return 1; - XMLDoc->copy(header.data); + XMLDoc->copy(WCS_1_0_0_GetCapabilities_Header); if (srvParam->cfg->WCS[0]->Title.size() == 0) { CDBError("No title defined for WCS"); return 1; @@ -1524,22 +738,22 @@ int CXMLGen::getWCS_1_0_0_Capabilities(CT::string *XMLDoc, std::vectorreplaceSelf("[SERVICEONLINERESOURCE]", onlineResource.c_str()); XMLDoc->replaceSelf("[SERVICEINFO]", serviceInfo.c_str()); - if (myWMSLayerList->size() > 0) { + if (metadataLayerList->size() > 0) { - for (size_t lnr = 0; lnr < myWMSLayerList->size(); lnr++) { - WMSLayer *layer = (*myWMSLayerList)[lnr]; + for (size_t lnr = 0; lnr < metadataLayerList->size(); lnr++) { + MetadataLayer *layer = (*metadataLayerList)[lnr]; if (layer->hasError != 0) { addErrorInXMLForMisconfiguredLayer(XMLDoc, layer); } if (layer->hasError == 0) { XMLDoc->printconcat("\n"); XMLDoc->concat(""); - XMLDoc->concat(&layer->name); + XMLDoc->concat(&layer->layerMetadata.name); XMLDoc->concat("\n"); XMLDoc->concat(""); - XMLDoc->concat(&layer->name); + XMLDoc->concat(&layer->layerMetadata.name); XMLDoc->concat("\n"); - CT::string layerTitle = layer->title; + CT::string layerTitle = layer->layerMetadata.title; layerTitle.encodeXMLSelf(); XMLDoc->concat("\n"); } else { - CDBError("Skipping layer %s", layer->name.c_str()); + CDBError("Skipping layer %s", layer->layerMetadata.name.c_str()); } } } @@ -1561,7 +775,7 @@ int CXMLGen::getWCS_1_0_0_Capabilities(CT::string *XMLDoc, std::vector *myWMSLayerList) { +int CXMLGen::getWCS_1_0_0_DescribeCoverage(CT::string *XMLDoc, std::vector *metadataLayerList) { XMLDoc->copy("\n" "\n"); - const auto firstWMLayer = getFirstLayerWithoutError(myWMSLayerList); + const auto firstWMLayer = getFirstLayerWithoutError(metadataLayerList); if (firstWMLayer != nullptr) { for (size_t layerIndex = 0; layerIndex < (unsigned)srvParam->WMSLayers->count; layerIndex++) { - for (size_t lnr = 0; lnr < myWMSLayerList->size(); lnr++) { - WMSLayer *layer = (*myWMSLayerList)[lnr]; - if (layer->name.equals(&srvParam->WMSLayers[layerIndex])) { + for (size_t lnr = 0; lnr < metadataLayerList->size(); lnr++) { + MetadataLayer *layer = (*metadataLayerList)[lnr]; + if (layer->layerMetadata.name.equals(&srvParam->WMSLayers[layerIndex])) { if (layer->hasError != 0) { addErrorInXMLForMisconfiguredLayer(XMLDoc, layer); } @@ -1585,34 +799,35 @@ int CXMLGen::getWCS_1_0_0_DescribeCoverage(CT::string *XMLDoc, std::vectordimList.size(); d++) { - WMSLayer::Dim *dim = layer->dimList[d]; - // if(dim->hasMultipleValues==0){ - if (dim->units.equals("ISO8601")) { + int d = 0; + for (auto dim : layer->layerMetadata.dimList) { + // if(dim.hasMultipleValues==0){ + if (dim.units.equals("ISO8601")) { timeDimIndex = d; } + d++; } if (srvParam->requestType == REQUEST_WCS_DESCRIBECOVERAGE) { // XMLDoc->print("\n"); - CT::string layerTitle = layer->title; + CT::string layerTitle = layer->layerMetadata.title; layerTitle.encodeXMLSelf(); XMLDoc->printconcat(" \n" " %s\n" " %s\n" " \n", - layer->name.c_str(), layer->name.c_str(), layerTitle.c_str()); - if (layer->dataSource->dataObjects.size() > 0) { - XMLDoc->printconcat(" %s\n", layer->dataSource->dataObjects[0]->getUnits().c_str()); + layer->layerMetadata.name.c_str(), layer->layerMetadata.name.c_str(), layerTitle.c_str()); + if (layer->layerMetadata.variableList.size() > 0) { + XMLDoc->printconcat(" %s\n", layer->layerMetadata.variableList[0].units.c_str()); } XMLDoc->printconcat(" \n" " %f %f\n" " %f %f\n", - layer->dfLatLonBBOX[0], layer->dfLatLonBBOX[1], layer->dfLatLonBBOX[2], layer->dfLatLonBBOX[3]); + layer->layerMetadata.dfLatLonBBOX[0], layer->layerMetadata.dfLatLonBBOX[1], layer->layerMetadata.dfLatLonBBOX[2], layer->layerMetadata.dfLatLonBBOX[3]); if (timeDimIndex >= 0) { // For information about this, visit http://www.galdosinc.com/archives/151 - CT::string *timeDimSplit = layer->dimList[timeDimIndex]->values.splitToArray("/"); + CT::string *timeDimSplit = layer->layerMetadata.dimList[timeDimIndex].values.splitToArray("/"); if (timeDimSplit->count == 3) { XMLDoc->concat(" \n"); XMLDoc->printconcat(" %s\n", timeDimSplit[0].c_str()); @@ -1625,19 +840,19 @@ int CXMLGen::getWCS_1_0_0_DescribeCoverage(CT::string *XMLDoc, std::vectorconcat(" \n" " \n" " \n"); - for (size_t p = 0; p < layer->projectionList.size(); p++) { - WMSLayer::Projection *proj = layer->projectionList[p]; - CT::string encodedProjString(proj->name.c_str()); + for (auto proj : layer->layerMetadata.projectionList) { + + CT::string encodedProjString(proj.name.c_str()); // encodedProjString.encodeURLSelf(); XMLDoc->printconcat(" \n" " %f %f\n" " %f %f\n" " \n", - encodedProjString.c_str(), proj->dfBBOX[0], proj->dfBBOX[1], proj->dfBBOX[2], proj->dfBBOX[3]); + encodedProjString.c_str(), proj.dfBBOX[0], proj.dfBBOX[1], proj.dfBBOX[2], proj.dfBBOX[3]); } - int width = layer->dataSource->dWidth - 1; - int height = layer->dataSource->dHeight - 1; + int width = layer->layerMetadata.width - 1; + int height = layer->layerMetadata.height - 1; if (width <= 1) { width = 999; } @@ -1661,14 +876,14 @@ int CXMLGen::getWCS_1_0_0_DescribeCoverage(CT::string *XMLDoc, std::vector\n" " \n", width, height, - layer->dataSource->dfBBOX[0], //+layer->dataSource->dfCellSizeX/2, - layer->dataSource->dfBBOX[3], //+layer->dataSource->dfCellSizeY/2, - layer->dataSource->dfCellSizeX, layer->dataSource->dfCellSizeY); + layer->layerMetadata.dfBBOX[0], //+layer->layerMetadata.dfCellSizeX/2, + layer->layerMetadata.dfBBOX[3], //+layer->layerMetadata.dfCellSizeY/2, + layer->layerMetadata.cellsizeX, layer->layerMetadata.cellsizeY); if (timeDimIndex >= 0) { XMLDoc->concat(" \n"); - if (layer->dimList[timeDimIndex]->hasMultipleValues == 0) { - CT::string *timeDimSplit = layer->dimList[timeDimIndex]->values.splitToArray("/"); + if (layer->layerMetadata.dimList[timeDimIndex].hasMultipleValues == 0) { + CT::string *timeDimSplit = layer->layerMetadata.dimList[timeDimIndex].values.splitToArray("/"); if (timeDimSplit->count == 3) { XMLDoc->concat(" \n"); XMLDoc->printconcat(" %s\n", timeDimSplit[0].c_str()); @@ -1679,7 +894,7 @@ int CXMLGen::getWCS_1_0_0_DescribeCoverage(CT::string *XMLDoc, std::vectordimList[timeDimIndex]->values.splitToArray(","); + CT::string *positions = layer->layerMetadata.dimList[timeDimIndex].values.splitToArray(","); for (size_t p = 0; p < positions->count; p++) { XMLDoc->printconcat(" %s\n", (positions[p]).c_str()); } @@ -1706,14 +921,12 @@ int CXMLGen::getWCS_1_0_0_DescribeCoverage(CT::string *XMLDoc, std::vectorconcat(" \n"); - for (size_t p = 0; p < layer->projectionList.size(); p++) { - WMSLayer::Projection *proj = firstWMLayer->projectionList[p]; - CT::string encodedProjString(proj->name.c_str()); - + for (auto proj : layer->layerMetadata.projectionList) { + CT::string encodedProjString(proj.name.c_str()); XMLDoc->printconcat(" %s\n", encodedProjString.c_str()); } - CT::string prettyCRS = layer->dataSource->nativeEPSG.c_str(); + CT::string prettyCRS = layer->layerMetadata.nativeEPSG.c_str(); XMLDoc->printconcat(" %s\n \n", prettyCRS.c_str()); XMLDoc->concat(" \n" @@ -1745,133 +958,29 @@ int CXMLGen::OGCGetCapabilities(CServerParams *_srvParam, CT::string *XMLDocumen this->srvParam = _srvParam; int status = 0; - std::vector myWMSLayerList; + std::vector metadataLayerList; for (size_t j = 0; j < srvParam->cfg->Layer.size(); j++) { if (srvParam->cfg->Layer[j]->attr.type.equals("autoscan")) { continue; } - bool hideLayer = false; - if (srvParam->cfg->Layer[j]->attr.hidden.equals("true")) hideLayer = true; - - if (hideLayer == false) { - // For web: URL encoding is necessary - // layerUniqueName.encodeURLSelf(); - - CT::string layerGroup = ""; - if (srvParam->cfg->Layer[j]->Group.size() > 0) { - if (srvParam->cfg->Layer[j]->Group[0]->attr.value.empty() == false) { - layerGroup.copy(srvParam->cfg->Layer[j]->Group[0]->attr.value.c_str()); - } - } - // Create a new layer and push it in the list - WMSLayer *myWMSLayer = new WMSLayer(); - myWMSLayerList.push_back(myWMSLayer); - CT::string layerUniqueName; - if (srvParam->makeUniqueLayerName(&layerUniqueName, srvParam->cfg->Layer[j]) != 0) myWMSLayer->hasError = true; - - bool foundWMSLayer = false; - for (size_t i = 0; i < srvParam->WMSLayers->count; i++) { - if (srvParam->WMSLayers[i].equals(&layerUniqueName)) { - foundWMSLayer = true; - break; - } - } - if (foundWMSLayer == false) { - // WMS layer is not in the list, so we can skip it already - myWMSLayer->hasError = true; - } - - if (myWMSLayer->hasError == false) { - - myWMSLayer->name.copy(&layerUniqueName); - - myWMSLayer->group.copy(&layerGroup); - // Set the configuration layer for this layer, as easy reference - myWMSLayer->layer = srvParam->cfg->Layer[j]; - - // Check if this layer is querable - int datasetRestriction = CServerParams::checkDataRestriction(); - if ((datasetRestriction & ALLOW_GFI)) { - myWMSLayer->isQuerable = 1; - } - - // Get a default file name for this layer to obtain some information - status = getFileNameForLayer(myWMSLayer); - if (status != 0) myWMSLayer->hasError = 1; - if (myWMSLayer->hasError == false) { - // Try to open the file, and make a datasource for the layer - myWMSLayer->dataSource->addStep(myWMSLayer->fileName.c_str(), NULL); - - if (myWMSLayer->hasError == false) { - status = getDataSourceForLayer(myWMSLayer); - if (status != 0) myWMSLayer->hasError = 1; - } - - if (myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeCascaded || myWMSLayer->dataSource->dLayerType == CConfigReaderLayerTypeLiveUpdate) { - myWMSLayer->isQuerable = 0; - if (srvParam->serviceType == SERVICE_WCS) { - myWMSLayer->hasError = true; - } - } - // Generate a common projection list information - if (myWMSLayer->hasError == false) { -#ifdef MEASURETIME - StopWatch_Stop("start getProjectionInformationForLayer"); -#endif - - status = getProjectionInformationForLayer(myWMSLayer); -#ifdef MEASURETIME - StopWatch_Stop("finished getProjectionInformationForLayer"); -#endif - - if (status != 0) myWMSLayer->hasError = 1; - } - - // Get the dimensions and its extents for this layer - if (myWMSLayer->hasError == false) { -#ifdef MEASURETIME - StopWatch_Stop("Start getDimsForLayer"); -#endif - - status = getDimsForLayer(myWMSLayer); - if (status != 0) myWMSLayer->hasError = 1; -#ifdef MEASURETIME - StopWatch_Stop("Finished getDimsForLayer"); -#endif - } - - // Auto configure styles - if (myWMSLayer->hasError == false) { - if (myWMSLayer->dataSource->cfgLayer->Styles.size() == 0) { - if (myWMSLayer->dataSource->dLayerType != CConfigReaderLayerTypeCascaded && myWMSLayer->dataSource->dLayerType != CConfigReaderLayerTypeLiveUpdate) { -#ifdef CXMLGEN_DEBUG - CDBDebug("cfgLayer->attr.type %d", myWMSLayer->dataSource->dLayerType); -#endif - status = CAutoConfigure::autoConfigureStyles(myWMSLayer->dataSource); - if (status != 0) { - myWMSLayer->hasError = 1; - CDBError("Unable to autoconfigure styles for layer %s", layerUniqueName.c_str()); - } - // Get the defined styles for this layer - } - } - } - - // Get the defined styles for this layer - status = getStylesForLayer(myWMSLayer); - if (status != 0) myWMSLayer->hasError = 1; - } - } + if (srvParam->cfg->Layer[j]->attr.hidden.equals("true")) { + continue; } + // Create a new layer and push it in the list + MetadataLayer *metadataLayer = new MetadataLayer(); + metadataLayerList.push_back(metadataLayer); + metadataLayer->layer = srvParam->cfg->Layer[j]; + metadataLayer->srvParams = srvParam; + populateMetadataLayerStruct(metadataLayer, true); } #ifdef CXMLGEN_DEBUG - if (myWMSLayerList.size() > 0) { + if (metadataLayerList.size() > 0) { CT::string finalLayerList; - finalLayerList = myWMSLayerList[0]->name.c_str(); - for (size_t j = 1; j < myWMSLayerList.size(); j++) { - finalLayerList.printconcat(",%s", myWMSLayerList[j]->name.c_str()); + finalLayerList = metadataLayerList[0]->name.c_str(); + for (size_t j = 1; j < metadataLayerList.size(); j++) { + finalLayerList.printconcat(",%s", metadataLayerList[j]->name.c_str()); } CDBDebug("Final layerlist: \"%s\"", finalLayerList.c_str()); } @@ -1884,13 +993,13 @@ int CXMLGen::OGCGetCapabilities(CServerParams *_srvParam, CT::string *XMLDocumen status = 0; if (srvParam->requestType == REQUEST_WMS_GETCAPABILITIES) { if (srvParam->OGCVersion == WMS_VERSION_1_0_0) { - status = getWMS_1_0_0_Capabilities(&XMLDoc, &myWMSLayerList); + status = getWMS_1_0_0_Capabilities(&XMLDoc, &metadataLayerList); } if (srvParam->OGCVersion == WMS_VERSION_1_1_1) { - status = getWMS_1_1_1_Capabilities(&XMLDoc, &myWMSLayerList); + status = getWMS_1_1_1_Capabilities(&XMLDoc, &metadataLayerList); } if (srvParam->OGCVersion == WMS_VERSION_1_3_0) { - status = getWMS_1_3_0_Capabilities(&XMLDoc, &myWMSLayerList); + status = getWMS_1_3_0_Capabilities(&XMLDoc, &metadataLayerList); } } try { @@ -1899,7 +1008,7 @@ int CXMLGen::OGCGetCapabilities(CServerParams *_srvParam, CT::string *XMLDocumen CServerParams::showWCSNotEnabledErrorMessage(); throw(__LINE__); #else - status = getWCS_1_0_0_Capabilities(&XMLDoc, &myWMSLayerList); + status = getWCS_1_0_0_Capabilities(&XMLDoc, &metadataLayerList); #endif } @@ -1908,7 +1017,7 @@ int CXMLGen::OGCGetCapabilities(CServerParams *_srvParam, CT::string *XMLDocumen CServerParams::showWCSNotEnabledErrorMessage(); throw(__LINE__); #else - status = getWCS_1_0_0_DescribeCoverage(&XMLDoc, &myWMSLayerList); + status = getWCS_1_0_0_DescribeCoverage(&XMLDoc, &metadataLayerList); #endif } } catch (int e) { @@ -1917,10 +1026,10 @@ int CXMLGen::OGCGetCapabilities(CServerParams *_srvParam, CT::string *XMLDocumen bool errorsHaveOccured = false; - for (size_t j = 0; j < myWMSLayerList.size(); j++) { - if (myWMSLayerList[j]->hasError) errorsHaveOccured = true; - delete myWMSLayerList[j]; - myWMSLayerList[j] = NULL; + for (size_t j = 0; j < metadataLayerList.size(); j++) { + if (metadataLayerList[j]->hasError) errorsHaveOccured = true; + delete metadataLayerList[j]; + metadataLayerList[j] = NULL; } if (status != 0) { diff --git a/adagucserverEC/CXMLGen.h b/adagucserverEC/CXMLGen.h index 678e8148a..161766fd9 100644 --- a/adagucserverEC/CXMLGen.h +++ b/adagucserverEC/CXMLGen.h @@ -40,160 +40,25 @@ #include "CRequest.h" #include "CDebugger.h" #include "CStyleConfiguration.h" +#include "./Types/LayerMetadataType.h" #define CXMLGEN_FATAL_ERROR_OCCURED 1 #define CXML_NON_FATAL_ERRORS_OCCURED 100 -class WMSLayer { -public: - class Dim { - public: - CT::string name; - CT::string units; - CT::string values; - CT::string defaultValue; - int hasMultipleValues; - bool hidden = false; - }; - class Projection { - public: - CT::string name; - double dfBBOX[4]; - }; - class Style { - public: - CT::string name; - CT::string title; - CT::string abstract; - }; - WMSLayer() { - isQuerable = 0; - hasError = 0; - dataSource = NULL; - dfLatLonBBOX[0] = -180; - dfLatLonBBOX[1] = -90; - dfLatLonBBOX[2] = 180; - dfLatLonBBOX[3] = 90; - abstract = ""; - } - ~WMSLayer() { - delete dataSource; - dataSource = NULL; - for (size_t j = 0; j < projectionList.size(); j++) { - delete projectionList[j]; - projectionList[j] = NULL; - } - for (size_t j = 0; j < dimList.size(); j++) { - delete dimList[j]; - dimList[j] = NULL; - } - for (size_t j = 0; j < styleList.size(); j++) { - delete styleList[j]; - styleList[j] = NULL; - } - } - CServerConfig::XMLE_Layer *layer; - CT::string name, title, group, abstract, fileName; - int isQuerable, hasError; - CDataSource *dataSource; - std::vector projectionList; - std::vector dimList; - std::vector index @@ -130,25 +130,25 @@ 0.250000 47.099998 49.099998 - + + + + + + + + - - - - - - - + - -2018-12-04T12:00:00Z,2018-12-04T12:05:00Z 2018-12-04T12:00:00Z,2018-12-04T12:05:00Z,2018-12-04T12:10:00Z +2018-12-04T12:00:00Z,2018-12-04T12:05:00Z name @@ -158,25 +158,25 @@ 0.250000 47.099998 49.099998 - + + + + + + + + - - - - - - - + - -2018-12-04T12:00:00Z,2018-12-04T12:05:00Z 2018-12-04T12:00:00Z,2018-12-04T12:05:00Z,2018-12-04T12:10:00Z +2018-12-04T12:00:00Z,2018-12-04T12:05:00Z diff --git a/tests/expectedoutputs/TestDataPostProcessor/test_DataPostProcessor_SubstractLevels_GetCapabilities.xml b/tests/expectedoutputs/TestDataPostProcessor/test_DataPostProcessor_SubstractLevels_GetCapabilities.xml index 23484e182..286a716bc 100644 --- a/tests/expectedoutputs/TestDataPostProcessor/test_DataPostProcessor_SubstractLevels_GetCapabilities.xml +++ b/tests/expectedoutputs/TestDataPostProcessor/test_DataPostProcessor_SubstractLevels_GetCapabilities.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.28.0, of Sep 12 2024 17:14:13 @@ -60,42 +60,40 @@ WMS of adaguc.tests.datapostproc +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - - + - - output Data at height 2000 minus data at height 8000 @@ -104,24 +102,23 @@ 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - - + - - 2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z member6,member5,member4,member3,member2,member1 @@ -133,24 +130,24 @@ 10.856452 48.895303 55.973600 - + + + + + + + + - - - - - - - + - - + 2021-06-22T20:00:00Z @@ -161,24 +158,23 @@ 32.676474 37.353267 65.888228 - + + + + + + + + - - - - - - - + - - diff --git a/tests/expectedoutputs/TestDataPostProcessor/test_DataPostProcessor_SubstractLevels_GetMap.png b/tests/expectedoutputs/TestDataPostProcessor/test_DataPostProcessor_SubstractLevels_GetMap.png index 33f436474..d01586339 100644 Binary files a/tests/expectedoutputs/TestDataPostProcessor/test_DataPostProcessor_SubstractLevels_GetMap.png and b/tests/expectedoutputs/TestDataPostProcessor/test_DataPostProcessor_SubstractLevels_GetMap.png differ diff --git a/tests/expectedoutputs/TestGeoJSON/test_GeoJSON_time_GetCapabilities.xml b/tests/expectedoutputs/TestGeoJSON/test_GeoJSON_time_GetCapabilities.xml index fca9b7376..dee1dbdf5 100644 --- a/tests/expectedoutputs/TestGeoJSON/test_GeoJSON_time_GetCapabilities.xml +++ b/tests/expectedoutputs/TestGeoJSON/test_GeoJSON_time_GetCapabilities.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,40 +60,40 @@ WMS of adaguc.testGeoJSONReader_time +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - - - - - - - + - features Features @@ -102,23 +102,23 @@ 30.937500 43.580391 50.064192 - + + + + + + + + - - - - - - - + - 2018-12-04T12:00:00Z,2018-12-04T12:05:00Z,2018-12-04T12:10:00Z diff --git a/tests/expectedoutputs/TestMetadataRequest/test_GetMetadataRequest_arcus_uwcw.json b/tests/expectedoutputs/TestMetadataRequest/test_GetMetadataRequest_arcus_uwcw.json new file mode 100644 index 000000000..7c64ba394 --- /dev/null +++ b/tests/expectedoutputs/TestMetadataRequest/test_GetMetadataRequest_arcus_uwcw.json @@ -0,0 +1 @@ +{"adaguc.tests.arcus_uwcw":{"air_temperature_hagl":{"dims":{"height_above_ground_level_in_m":{"cdfName":"temp_at_hagl","defaultValue":"2","hasMultipleValues":1,"hidden":true,"serviceName":"height_above_ground_level_in_m","units":"m","values":"2"},"member":{"cdfName":"member","defaultValue":"1","hasMultipleValues":1,"hidden":false,"serviceName":"member","units":"-","values":"1,2,3,4,5"},"reference_time":{"cdfName":"forecast_reference_time","defaultValue":"2024-05-23T00:00:00Z","hasMultipleValues":1,"hidden":false,"serviceName":"reference_time","units":"ISO8601","values":"2024-05-23T00:00:00Z"},"time":{"cdfName":"time","defaultValue":"2024-05-23T01:00:00Z","hasMultipleValues":0,"hidden":false,"serviceName":"time","units":"ISO8601","values":"2024-05-23T01:00:00Z/2024-05-25T12:00:00Z/PT1H"}},"layer":{"abstract":"","gridspec":{"bbox":[-0.014499999999999957,48.99100000000001,11.2955,56.011],"cellsizex":2.262,"cellsizey":-1.404,"height":5,"projstring":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","width":5},"group":"","isqueryable":1,"latlonbox":[-0.014499999999999957,48.99100000000001,11.2955,56.011],"layername":"air_temperature_hagl","nativeepsg":"PROJ4:%2Bproj%3Dlonglat%20%2Bellps%3DWGS84%20%2Bdatum%3DWGS84%20%2Bno_defs","title":"UWCW_HA43ENS(NL) Air temperature at 2 m","variables":[{"label":"Air temperature at height above ground level","units":"C","variableName":"air-temperature-hagl"}]}},"baselayer":{"dims":null,"layer":{"abstract":"","gridspec":{"bbox":[-180.0,83.64513,180.0000000000001,-90.0],"cellsizex":180.00000000000006,"cellsizey":86.822565,"height":2,"projstring":"","width":2},"group":"baselayers","isqueryable":1,"latlonbox":[-180.0,-90.0,180.0000000000001,83.64513],"layername":"baselayer","nativeepsg":"","title":"baselayer","variables":[{"label":"Feature index","units":"","variableName":"features"}]}},"overlay":{"dims":null,"layer":{"abstract":"","gridspec":{"bbox":[-180.0,83.64513,180.0000000000001,-90.0],"cellsizex":180.00000000000006,"cellsizey":86.822565,"height":2,"projstring":"","width":2},"group":"baselayers","isqueryable":1,"latlonbox":[-180.0,-90.0,180.0000000000001,83.64513],"layername":"overlay","nativeepsg":"","title":"overlay","variables":[{"label":"Feature index","units":"","variableName":"features"}]}},"wind_speed_hagl_kts":{"dims":{"height_above_ground_level_in_m":{"cdfName":"wind_at_hagl","defaultValue":"10","hasMultipleValues":1,"hidden":true,"serviceName":"height_above_ground_level_in_m","units":"m","values":"10"},"member":{"cdfName":"member","defaultValue":"1","hasMultipleValues":1,"hidden":false,"serviceName":"member","units":"-","values":"1,2,3,4,5"},"reference_time":{"cdfName":"forecast_reference_time","defaultValue":"2024-06-05T03:00:00Z","hasMultipleValues":1,"hidden":false,"serviceName":"reference_time","units":"ISO8601","values":"2024-06-05T03:00:00Z"},"time":{"cdfName":"time","defaultValue":"2024-06-05T04:00:00Z","hasMultipleValues":0,"hidden":false,"serviceName":"time","units":"ISO8601","values":"2024-06-05T04:00:00Z/2024-06-07T15:00:00Z/PT1H"}},"layer":{"abstract":"","gridspec":{"bbox":[237556.04779691307,6429395.966709785,1008078.3936105771,7241407.977298031],"cellsizex":154104.4691627328,"cellsizey":-162402.4021176491,"height":5,"projstring":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs","width":5},"group":"","isqueryable":1,"latlonbox":[2.1340022857099457,49.902432406618686,9.055722285710363,54.37452297558314],"layername":"wind_speed_hagl_kts","nativeepsg":"PROJ4:%2Bproj%3Dmerc%20%2Ba%3D6378137%20%2Bb%3D6378137%20%2Blat_ts%3D0%2E0%20%2Blon_0%3D0%2E0%20%2Bx_0%3D0%2E0%20%2By_0%3D0%20%2Bk%3D1%2E0%20%2Bunits%3Dm%20%2Bnadgrids%3D@null%20%2Bwktext%20%20%2Bno_defs","title":"UWCW_HA43ENS(NL) Wind speed at height above ground level in Knots","variables":[{"label":"Wind speed at height above ground level","units":"kts","variableName":"wind-speed-hagl"}]}},"wind_speed_hagl_ms":{"dims":{"height_above_ground_level_in_m":{"cdfName":"wind_at_hagl","defaultValue":"10","hasMultipleValues":1,"hidden":true,"serviceName":"height_above_ground_level_in_m","units":"m","values":"10"},"member":{"cdfName":"member","defaultValue":"1","hasMultipleValues":1,"hidden":false,"serviceName":"member","units":"-","values":"1,2,3,4,5"},"reference_time":{"cdfName":"forecast_reference_time","defaultValue":"2024-06-05T03:00:00Z","hasMultipleValues":1,"hidden":false,"serviceName":"reference_time","units":"ISO8601","values":"2024-06-05T03:00:00Z"},"time":{"cdfName":"time","defaultValue":"2024-06-05T04:00:00Z","hasMultipleValues":0,"hidden":false,"serviceName":"time","units":"ISO8601","values":"2024-06-05T04:00:00Z/2024-06-07T15:00:00Z/PT1H"}},"layer":{"abstract":"","gridspec":{"bbox":[237556.04779691307,6429395.966709785,1008078.3936105771,7241407.977298031],"cellsizex":154104.4691627328,"cellsizey":-162402.4021176491,"height":5,"projstring":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs","width":5},"group":"","isqueryable":1,"latlonbox":[2.1340022857099457,49.902432406618686,9.055722285710363,54.37452297558314],"layername":"wind_speed_hagl_ms","nativeepsg":"PROJ4:%2Bproj%3Dmerc%20%2Ba%3D6378137%20%2Bb%3D6378137%20%2Blat_ts%3D0%2E0%20%2Blon_0%3D0%2E0%20%2Bx_0%3D0%2E0%20%2By_0%3D0%20%2Bk%3D1%2E0%20%2Bunits%3Dm%20%2Bnadgrids%3D@null%20%2Bwktext%20%20%2Bno_defs","title":"UWCW_HA43ENS(NL) Wind speed at height above ground level in ms","variables":[{"label":"Wind speed at height above ground level","units":"kts","variableName":"wind-speed-hagl"}]}},"wind_speed_hagl_ms_member_3":{"dims":{"height_above_ground_level_in_m":{"cdfName":"wind_at_hagl","defaultValue":"10","hasMultipleValues":1,"hidden":true,"serviceName":"height_above_ground_level_in_m","units":"m","values":"10"},"member":{"cdfName":"member","defaultValue":"3","hasMultipleValues":1,"hidden":true,"serviceName":"member","units":"-","values":"3"},"reference_time":{"cdfName":"forecast_reference_time","defaultValue":"2024-06-05T03:00:00Z","hasMultipleValues":1,"hidden":false,"serviceName":"reference_time","units":"ISO8601","values":"2024-06-05T03:00:00Z"},"time":{"cdfName":"time","defaultValue":"2024-06-05T04:00:00Z","hasMultipleValues":0,"hidden":false,"serviceName":"time","units":"ISO8601","values":"2024-06-05T04:00:00Z/2024-06-07T15:00:00Z/PT1H"}},"layer":{"abstract":"","gridspec":{"bbox":[237556.04779691307,6429395.966709785,1008078.3936105771,7241407.977298031],"cellsizex":154104.4691627328,"cellsizey":-162402.4021176491,"height":5,"projstring":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs","width":5},"group":"","isqueryable":1,"latlonbox":[2.1340022857099457,49.902432406618686,9.055722285710363,54.37452297558314],"layername":"wind_speed_hagl_ms_member_3","nativeepsg":"PROJ4:%2Bproj%3Dmerc%20%2Ba%3D6378137%20%2Bb%3D6378137%20%2Blat_ts%3D0%2E0%20%2Blon_0%3D0%2E0%20%2Bx_0%3D0%2E0%20%2By_0%3D0%20%2Bk%3D1%2E0%20%2Bunits%3Dm%20%2Bnadgrids%3D@null%20%2Bwktext%20%20%2Bno_defs","title":"UWCW_HA43ENS(NL) Wind speed at height above ground level in ms for member 3","variables":[{"label":"Wind speed at height above ground level","units":"kts","variableName":"wind-speed-hagl"}]}},"wind_speed_hagl_ms_wrong_dim_order":{"dims":{"height_above_ground_level_in_m":{"cdfName":"wind_at_hagl","defaultValue":"10","hasMultipleValues":1,"hidden":true,"serviceName":"height_above_ground_level_in_m","units":"m","values":"10"},"member":{"cdfName":"member","defaultValue":"1","hasMultipleValues":1,"hidden":false,"serviceName":"member","units":"-","values":"1,2,3,4,5"},"reference_time":{"cdfName":"forecast_reference_time","defaultValue":"2024-06-05T03:00:00Z","hasMultipleValues":1,"hidden":false,"serviceName":"reference_time","units":"ISO8601","values":"2024-06-05T03:00:00Z"},"time":{"cdfName":"time","defaultValue":"2024-06-05T04:00:00Z","hasMultipleValues":0,"hidden":false,"serviceName":"time","units":"ISO8601","values":"2024-06-05T04:00:00Z/2024-06-07T15:00:00Z/PT1H"}},"layer":{"abstract":"","gridspec":{"bbox":[237556.04779691307,6429395.966709785,1008078.3936105771,7241407.977298031],"cellsizex":154104.4691627328,"cellsizey":-162402.4021176491,"height":5,"projstring":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs","width":5},"group":"","isqueryable":1,"latlonbox":[2.1340022857099457,49.902432406618686,9.055722285710363,54.37452297558314],"layername":"wind_speed_hagl_ms_wrong_dim_order","nativeepsg":"PROJ4:%2Bproj%3Dmerc%20%2Ba%3D6378137%20%2Bb%3D6378137%20%2Blat_ts%3D0%2E0%20%2Blon_0%3D0%2E0%20%2Bx_0%3D0%2E0%20%2By_0%3D0%20%2Bk%3D1%2E0%20%2Bunits%3Dm%20%2Bnadgrids%3D@null%20%2Bwktext%20%20%2Bno_defs","title":"UWCW_HA43ENS(NL) Wind speed at height above ground level in ms","variables":[{"label":"Wind speed at height above ground level","units":"kts","variableName":"wind-speed-hagl"}]}}}} \ No newline at end of file diff --git a/tests/expectedoutputs/TestWCS/test_WCSDescribeCoverage_testdatanc.xml b/tests/expectedoutputs/TestWCS/test_WCSDescribeCoverage_testdatanc.xml index c91bb3dc1..c4485c4ef 100644 --- a/tests/expectedoutputs/TestWCS/test_WCSDescribeCoverage_testdatanc.xml +++ b/tests/expectedoutputs/TestWCS/test_WCSDescribeCoverage_testdatanc.xml @@ -18,6 +18,30 @@ + + -68.275833 12.130000 + 7.149322 55.399166 + + + -9906758.676129 1341055.638469 + 951836.432640 8605856.308089 + + + -11426227.343341 1341612.511753 + 382800.244818 9034799.679759 + + + -8805606.109966 -4164572.069133 + 372143.463211 3233625.747402 + + + -13588402.263697 1423498.626368 + -747816.881762 12453122.100930 + + + -7498001.230434 -8223848.076474 + 3272454.133168 535002.459267 + -3942117.046146 -9975996.132113 7877215.337643 -2369697.552660 @@ -34,6 +58,10 @@ -7600430.977505 1360506.839359 795858.888223 7439724.721958 + + -9555333.229813 -10285561.445145 + 1280134.942825 -1473840.584239 + -68.275833 12.130000 7.149322 55.399166 @@ -42,26 +70,6 @@ -68.275833 12.130000 7.149322 55.399166 - - -68.275833 12.130000 - 7.149322 55.399166 - - - -9906758.676129 1341055.638469 - 951836.432640 8605856.308089 - - - -11426227.343341 1341612.511753 - 382800.244818 9034799.679759 - - - -8805606.109966 -4164572.069133 - 372143.463211 3233625.747402 - - - -6748084.942175 1495513.911739 - 706607.743114 6426594.553880 - -2000000.000000 -2000000.000000 10000000.000000 8500000.000000 @@ -70,22 +78,14 @@ -6408021.286199 1297326.829390 670998.883042 5878649.483190 - - -7498001.230434 -8223848.076474 - 3272454.133168 535002.459267 - - - -9555333.229813 -10285561.445145 - 1280134.942825 -1473840.584239 + + -6748084.942175 1495513.911739 + 706607.743114 6426594.553880 -7600430.977505 1360506.839359 795858.888223 7439724.721958 - - -13588402.263697 1423498.626368 - -747816.881762 12453122.100930 - @@ -122,23 +122,23 @@ + CRS:84 + EPSG:25831 + EPSG:25832 + EPSG:28992 + EPSG:3067 + EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 + EPSG:40000 EPSG:4258 EPSG:4326 - CRS:84 - EPSG:25831 - EPSG:25832 - EPSG:28992 - EPSG:7399 EPSG:50001 EPSG:54030 - EPSG:32661 - EPSG:40000 + EPSG:7399 EPSG:900913 - EPSG:3067 @@ -165,6 +165,30 @@ + + -68.275833 12.130000 + 7.149322 55.399166 + + + -9906758.676129 1341055.638469 + 951836.432640 8605856.308089 + + + -11426227.343341 1341612.511753 + 382800.244818 9034799.679759 + + + -8805606.109966 -4164572.069133 + 372143.463211 3233625.747402 + + + -13588402.263697 1423498.626368 + -747816.881762 12453122.100930 + + + -7498001.230434 -8223848.076474 + 3272454.133168 535002.459267 + -3942117.046146 -9975996.132113 7877215.337643 -2369697.552660 @@ -181,6 +205,10 @@ -7600430.977505 1360506.839359 795858.888223 7439724.721958 + + -9555333.229813 -10285561.445145 + 1280134.942825 -1473840.584239 + -68.275833 12.130000 7.149322 55.399166 @@ -189,26 +217,6 @@ -68.275833 12.130000 7.149322 55.399166 - - -68.275833 12.130000 - 7.149322 55.399166 - - - -9906758.676129 1341055.638469 - 951836.432640 8605856.308089 - - - -11426227.343341 1341612.511753 - 382800.244818 9034799.679759 - - - -8805606.109966 -4164572.069133 - 372143.463211 3233625.747402 - - - -6748084.942175 1495513.911739 - 706607.743114 6426594.553880 - -2000000.000000 -2000000.000000 10000000.000000 8500000.000000 @@ -217,22 +225,14 @@ -6408021.286199 1297326.829390 670998.883042 5878649.483190 - - -7498001.230434 -8223848.076474 - 3272454.133168 535002.459267 - - - -9555333.229813 -10285561.445145 - 1280134.942825 -1473840.584239 + + -6748084.942175 1495513.911739 + 706607.743114 6426594.553880 -7600430.977505 1360506.839359 795858.888223 7439724.721958 - - -13588402.263697 1423498.626368 - -747816.881762 12453122.100930 - @@ -269,23 +269,23 @@ + CRS:84 + EPSG:25831 + EPSG:25832 + EPSG:28992 + EPSG:3067 + EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 + EPSG:40000 EPSG:4258 EPSG:4326 - CRS:84 - EPSG:25831 - EPSG:25832 - EPSG:28992 - EPSG:7399 EPSG:50001 EPSG:54030 - EPSG:32661 - EPSG:40000 + EPSG:7399 EPSG:900913 - EPSG:3067 @@ -312,6 +312,30 @@ + + -68.275833 12.130000 + 7.149322 55.399166 + + + -9906758.676129 1341055.638469 + 951836.432640 8605856.308089 + + + -11426227.343341 1341612.511753 + 382800.244818 9034799.679759 + + + -8805606.109966 -4164572.069133 + 372143.463211 3233625.747402 + + + -13588402.263697 1423498.626368 + -747816.881762 12453122.100930 + + + -7498001.230434 -8223848.076474 + 3272454.133168 535002.459267 + -3942117.046146 -9975996.132113 7877215.337643 -2369697.552660 @@ -328,6 +352,10 @@ -7600430.977505 1360506.839359 795858.888223 7439724.721958 + + -9555333.229813 -10285561.445145 + 1280134.942825 -1473840.584239 + -68.275833 12.130000 7.149322 55.399166 @@ -336,26 +364,6 @@ -68.275833 12.130000 7.149322 55.399166 - - -68.275833 12.130000 - 7.149322 55.399166 - - - -9906758.676129 1341055.638469 - 951836.432640 8605856.308089 - - - -11426227.343341 1341612.511753 - 382800.244818 9034799.679759 - - - -8805606.109966 -4164572.069133 - 372143.463211 3233625.747402 - - - -6748084.942175 1495513.911739 - 706607.743114 6426594.553880 - -2000000.000000 -2000000.000000 10000000.000000 8500000.000000 @@ -364,22 +372,14 @@ -6408021.286199 1297326.829390 670998.883042 5878649.483190 - - -7498001.230434 -8223848.076474 - 3272454.133168 535002.459267 - - - -9555333.229813 -10285561.445145 - 1280134.942825 -1473840.584239 + + -6748084.942175 1495513.911739 + 706607.743114 6426594.553880 -7600430.977505 1360506.839359 795858.888223 7439724.721958 - - -13588402.263697 1423498.626368 - -747816.881762 12453122.100930 - @@ -416,23 +416,23 @@ + CRS:84 + EPSG:25831 + EPSG:25832 + EPSG:28992 + EPSG:3067 + EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 + EPSG:40000 EPSG:4258 EPSG:4326 - CRS:84 - EPSG:25831 - EPSG:25832 - EPSG:28992 - EPSG:7399 EPSG:50001 EPSG:54030 - EPSG:32661 - EPSG:40000 + EPSG:7399 EPSG:900913 - EPSG:3067 diff --git a/tests/expectedoutputs/TestWCS/test_WCSGetCapabilities_testdatanc b/tests/expectedoutputs/TestWCS/test_WCSGetCapabilities_testdatanc index c061dc34e..8dd6b5097 100644 --- a/tests/expectedoutputs/TestWCS/test_WCSGetCapabilities_testdatanc +++ b/tests/expectedoutputs/TestWCS/test_WCSGetCapabilities_testdatanc @@ -1,17 +1,17 @@ ADAGUC_AUTO_WCS_AutoResource testdata.nc ADAGUC_AUTO_WCS_AutoResource testdata.nc - ADAGUCServer version 2.5.13, of Sep 1 2021 15:34:53 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 NONE NONE @@ -60,8 +60,7 @@ application/vnd.ogc.se_xml - - + testdata testdata diff --git a/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizehigh.xml b/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizehigh.xml index 935cc6f36..d7eac1e62 100644 --- a/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizehigh.xml +++ b/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizehigh.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,40 +60,40 @@ WMS of adaguc.tests.quantizehigh +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - - - - - - - + - wind Wind @@ -102,23 +102,23 @@ 0.250000 47.099998 49.099998 - + + + + + + + + - - - - - - - + - 2018-12-04T12:10:00Z/2018-12-04T13:00:00Z/PT10M diff --git a/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizelow.xml b/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizelow.xml index 4925c4050..ee01e12cb 100644 --- a/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizelow.xml +++ b/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizelow.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,40 +60,40 @@ WMS of adaguc.tests.quantizelow +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - - - - - - - + - wind Wind @@ -102,23 +102,23 @@ 0.250000 47.099998 49.099998 - + + + + + + + + - - - - - - - + - 2018-12-04T12:00:00Z,2018-12-04T12:10:00Z,2018-12-04T12:20:00Z,2018-12-04T12:40:00Z diff --git a/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizeround.xml b/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizeround.xml index d23596997..9d1313854 100644 --- a/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizeround.xml +++ b/tests/expectedoutputs/TestWMS/testWMSGetCapabilities_quantizeround.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,40 +60,40 @@ WMS of adaguc.tests.quantizeround +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - - - - - - - + - wind Wind @@ -102,23 +102,23 @@ 0.250000 47.099998 49.099998 - + + + + + + + + - - - - - - - + - 2018-12-04T12:00:00Z/2018-12-04T12:40:00Z/PT10M diff --git a/tests/expectedoutputs/TestWMS/test_WMSCMDUpdateDBPathFileInSubfoldersGetCapabilities.xml b/tests/expectedoutputs/TestWMS/test_WMSCMDUpdateDBPathFileInSubfoldersGetCapabilities.xml index e0e198f45..e5f44bbfd 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSCMDUpdateDBPathFileInSubfoldersGetCapabilities.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSCMDUpdateDBPathFileInSubfoldersGetCapabilities.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,41 +60,41 @@ WMS of adaguc.testScanPathSubfolder +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 PROJ4:%2Bproj%3Dstere%20%2Blat_0%3D90%20%2Blon_0%3D0%20%2Blat_ts%3D60%20%2Ba%3D6378%2E14%20%2Bb%3D6356%2E75%20%2Bx_0%3D0%20y_0%3D0 + + + + + + + - - - - - - - + - RAD_NL25_PCP_CM @@ -104,23 +104,23 @@ 10.856452 48.895303 55.973600 - + + + + + + + + - - - - - - - + - 2021-06-22T20:00:00Z diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_DimensionUnits.xml b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_DimensionUnits.xml index 548f9701e..08591ef6f 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_DimensionUnits.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_DimensionUnits.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,41 +60,41 @@ WMS of adaguc.tests.311-getcapabilities-dimension-units +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 PROJ4:%2Bproj%3Dlonglat%20%2Bellps%3DWGS84%20%2Bdatum%3DWGS84%20%2Bno_defs + + + + + + + - - - - - - - + - wind-speed-of-gust-hagl @@ -104,27 +104,27 @@ 1.050000 48.950000 49.650000 - + + + + + + + + - - - - - - - + - 2023-10-26T05:00:00Z -10 2023-10-26T00:00:00Z +10 diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_KMDS_PointNetCDF_pointstylepoint.xml b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_KMDS_PointNetCDF_pointstylepoint.xml index 009af073a..ea4d9d15d 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_KMDS_PointNetCDF_pointstylepoint.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_KMDS_PointNetCDF_pointstylepoint.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.23.0, of Jul 9 2024 12:13:41 + ADAGUCServer version 2.28.0, of Sep 9 2024 21:05:01 @@ -60,44 +60,94 @@ WMS of adaguc.testKMDS_PointNetCDF +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - + + + + + +stationname +stationsnaam +stationnaam + + -68.275833 + 7.149322 + 12.130000 + 55.399166 + - + + + + + + + + + + + + + +height +stationshoogte [m] +stationshoogte [m] + + -68.275833 + 7.149322 + 12.130000 + 55.399166 + + + + + + + + + + + + + + - - - - - + dd windrichting [graden] @@ -107,23 +157,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -135,51 +185,51 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z ff_dd -windsnelheid [m/s] en windrichting [graden] +windsnelheid [m/s] en windrichting [graden] windsnelheid [m/s] en windrichting [graden] 10 min. gemiddelden -68.275833 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -191,23 +241,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -219,23 +269,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -247,23 +297,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -275,23 +325,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -303,23 +353,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -331,23 +381,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -359,23 +409,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -387,23 +437,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -415,23 +465,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -443,23 +493,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -471,23 +521,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -499,23 +549,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -527,23 +577,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -555,23 +605,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -583,23 +633,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -611,23 +661,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -639,27 +689,27 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z -pr +rg neerslagintensiteit(neerslagmeter) [mm/uur] neerslagintensiteit(neerslagmeter) [mm/uur] @@ -667,25 +717,25 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z - + pg neerslagintensiteit(PWS) [mm/uur] @@ -695,23 +745,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -723,23 +773,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -751,23 +801,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -779,23 +829,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -807,23 +857,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -835,23 +885,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -863,23 +913,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -891,23 +941,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -919,23 +969,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -947,23 +997,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -975,23 +1025,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1003,23 +1053,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1031,23 +1081,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1059,23 +1109,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1087,23 +1137,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1115,23 +1165,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1143,23 +1193,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1171,23 +1221,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1199,23 +1249,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z @@ -1227,26 +1277,24 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - -2020-12-20T12:30:00Z/2020-12-20T12:40:00Z/PT5M +2020-12-20T12:30:00Z/2020-12-20T12:40:00Z/PT5M ww-10 @@ -1257,23 +1305,23 @@ 7.149322 12.130000 55.399166 - + + + + + + + + - - - - - - - + - 2020-12-20T12:30:00Z,2020-12-20T12:40:00Z diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_multidimnc_autostyle.xml b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_multidimnc_autostyle.xml index a9bb574ed..046f659cc 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_multidimnc_autostyle.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_multidimnc_autostyle.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.23.0, of Jul 9 2024 12:13:41 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,75 +60,72 @@ WMS of AutoResource nc_5D_20170101000000-20170101001000.nc +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_multidimncdataset_autostyle.xml b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_multidimncdataset_autostyle.xml index 826d6343a..ea7de9dce 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_multidimncdataset_autostyle.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_multidimncdataset_autostyle.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,71 +60,68 @@ WMS of adaguc.testmultidimautostyle +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_no_error_on_existing_dataset_misconfigured_layer.xml b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_no_error_on_existing_dataset_misconfigured_layer.xml index 0c7e5ff6e..35e667c95 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_no_error_on_existing_dataset_misconfigured_layer.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_no_error_on_existing_dataset_misconfigured_layer.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.23.0, of Jul 9 2024 12:13:41 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,42 +60,40 @@ WMS of adaguc.tests.datasetwithmisconfiguredlayer +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:28992 + + + + + + + - - - - - - - + - - testdata Testdata (testdata) @@ -104,24 +102,23 @@ 32.676474 37.353267 65.888228 - + + + + + + + + - - - - - - - + - - diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_testdatanc b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_testdatanc index a827d01ec..108f30c44 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_testdatanc +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_testdatanc @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.21.2, of May 24 2024 11:28:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,42 +60,40 @@ WMS of AutoResource testdata.nc +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:28992 + + + + + + + - - - - - - - + - - testdata Testdata (testdata) @@ -104,24 +102,23 @@ 32.676474 37.353267 65.888228 - + + + + + + + + - - - - - - - + - - diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_testdatanc_autostyle.xml b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_testdatanc_autostyle.xml index 9b40d877b..e82212dfa 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_testdatanc_autostyle.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_testdatanc_autostyle.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.23.0, of Jul 9 2024 12:13:41 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,42 +60,40 @@ WMS of AutoResource testdata.nc +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:28992 + + + + + + + - - - - - - - + - - @@ -108,24 +106,23 @@ 32.676474 37.353267 65.888228 - + + + + + + + + - - - - - - - + - - diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_path_netcdf_5dims_seq1 b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_path_netcdf_5dims_seq1 index 6b3286576..531a205f0 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_path_netcdf_5dims_seq1 +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_path_netcdf_5dims_seq1 @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,71 +60,68 @@ Root Layer Title +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_path_netcdf_5dims_seq2 b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_path_netcdf_5dims_seq2 index 74beb35f4..ec94f7e58 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_path_netcdf_5dims_seq2 +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_path_netcdf_5dims_seq2 @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,71 +60,68 @@ Root Layer Title +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1 b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1 index 6b3286576..531a205f0 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1 +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1 @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,71 +60,68 @@ Root Layer Title +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1_and_seq2 b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1_and_seq2 index c923c0c30..ec94f7e58 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1_and_seq2 +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1_and_seq2 @@ -15,11 +15,11 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 - + no conditions apply None @@ -60,71 +60,68 @@ Root Layer Title +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_twofiles b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_twofiles index 74beb35f4..ec94f7e58 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_twofiles +++ b/tests/expectedoutputs/TestWMS/test_WMSGetCapabilities_timeseries_twofiles @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,71 +60,68 @@ Root Layer Title +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetMap_IrregularGrid_1Dimensional_latlon_nextdimensionstep_getcapabilities.xml b/tests/expectedoutputs/TestWMS/test_WMSGetMap_IrregularGrid_1Dimensional_latlon_nextdimensionstep_getcapabilities.xml index cf7638e46..b4395479d 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetMap_IrregularGrid_1Dimensional_latlon_nextdimensionstep_getcapabilities.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSGetMap_IrregularGrid_1Dimensional_latlon_nextdimensionstep_getcapabilities.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.15.0, of Feb 2 2024 11:40:13 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,40 +60,40 @@ WMS of AutoResource example_file_irregular_1Dlat1Dlon_grid.nc +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - - - - - - - + - data_var_1 data_var_1 (data_var_1) @@ -102,25 +102,25 @@ 12.000000 48.000000 56.000000 - + + + + + + + + - - - - - - - + - -0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9 2017-01-01T00:10:00Z,2017-01-01T00:11:00Z +0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9 diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetMap_IrregularGrid_2Dimensional_latlon_nextdimensionstep_getcapabilities.xml b/tests/expectedoutputs/TestWMS/test_WMSGetMap_IrregularGrid_2Dimensional_latlon_nextdimensionstep_getcapabilities.xml index 3aa6b8c1c..b6b5c9027 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetMap_IrregularGrid_2Dimensional_latlon_nextdimensionstep_getcapabilities.xml +++ b/tests/expectedoutputs/TestWMS/test_WMSGetMap_IrregularGrid_2Dimensional_latlon_nextdimensionstep_getcapabilities.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.15.1, of Feb 2 2024 15:50:33 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,40 +60,40 @@ WMS of AutoResource example_file_irregular_2Dlat2Dlon_grid.nc +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - - - - - - - + - data_var_1 data_var_1 (data_var_1) @@ -102,25 +102,25 @@ 14.878220 50.047555 68.959048 - + + + + + + + + - - - - - - - + - -0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9 2017-01-01T00:10:00Z,2017-01-01T00:11:00Z +0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9 diff --git a/tests/expectedoutputs/TestWMS/test_WMSGetMap_Report_nounits b/tests/expectedoutputs/TestWMS/test_WMSGetMap_Report_nounits index 4ec143a22..7b3167478 100644 --- a/tests/expectedoutputs/TestWMS/test_WMSGetMap_Report_nounits +++ b/tests/expectedoutputs/TestWMS/test_WMSGetMap_Report_nounits @@ -4,7 +4,7 @@ Content-Type:text/xml No time units found for variable time; - Exception in DBLoopFiles at line -1232049787; + Exception in DBLoopFiles at line 611; *** SKIPPING FILE /home/plieger/code/github/KNMI/adaguc-server/data/datasets/test/testdata_report_nounits.nc ***; Invalid dimensions values: No data available for layer sow_a1; WMS GetMap Request failed; diff --git a/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1 b/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1 index 9a22324d3..638c2a235 100644 --- a/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1 +++ b/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1 @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,71 +60,68 @@ WMS of adaguc.testtimeseriescached +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z,2017-01-01T00:05:00Z,2017-01-01T00:10:00Z diff --git a/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1_and_seq2 b/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1_and_seq2 index 51d105d3c..aade83f8a 100644 --- a/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1_and_seq2 +++ b/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_tailpath_netcdf_5dims_seq1_and_seq2 @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,71 +60,68 @@ WMS of adaguc.testtimeseriescached +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M diff --git a/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_twofiles b/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_twofiles index 51d105d3c..aade83f8a 100644 --- a/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_twofiles +++ b/tests/expectedoutputs/TestWMSDocumentCache/test_WMSGetCapabilities_timeseries_twofiles @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,71 +60,68 @@ WMS of adaguc.testtimeseriescached +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:4326 + + + + + + + - - - - - - + - - + - - data -data +data (data) -180.494446 179.505554 -90.488892 89.511108 - + + + + + + + + - - - - - - + - - + - - +2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M member6,member5,member4,member3,member2,member1 1000,2000,3000,4000,5000,6000,7000,8000,9000 -2017-01-01T00:00:00Z/2017-01-01T00:25:00Z/PT5M diff --git a/tests/expectedoutputs/TestWMSSLD/test_WMSGetMap_testdatanc_NOSLDURL.xml b/tests/expectedoutputs/TestWMSSLD/test_WMSGetMap_testdatanc_NOSLDURL.xml index 81ff2237d..0fe988b28 100644 --- a/tests/expectedoutputs/TestWMSSLD/test_WMSGetMap_testdatanc_NOSLDURL.xml +++ b/tests/expectedoutputs/TestWMSSLD/test_WMSGetMap_testdatanc_NOSLDURL.xml @@ -1 +1 @@ -SLD parameter value needs to be a url pointed to a .xml file \ No newline at end of file +Unable to read configuration file. diff --git a/tests/expectedoutputs/TestWMSTimeHeightProfiles/test_WMSGetCapabilities_TimeHeightProfiles.xml b/tests/expectedoutputs/TestWMSTimeHeightProfiles/test_WMSGetCapabilities_TimeHeightProfiles.xml index a0c27f990..ad18800b8 100644 --- a/tests/expectedoutputs/TestWMSTimeHeightProfiles/test_WMSGetCapabilities_TimeHeightProfiles.xml +++ b/tests/expectedoutputs/TestWMSTimeHeightProfiles/test_WMSGetCapabilities_TimeHeightProfiles.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.14.0, of Dec 15 2023 15:44:55 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,40 +60,40 @@ WMS of CHM15k Nimbus +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - - - - - - - + - beta_raw normalized range corrected signal @@ -104,23 +104,23 @@ with P_raw = sum(P_raw_hr) * range_gate_hr / range_gate (beta_raw) 4.095820 50.941341 51.941341 - + + + + + + + + - - - - - - - + - 2023-12-02T06:40:00Z diff --git a/tests/expectedoutputs/TestWMSTimeHeightProfiles/test_wmsgetcapabilities_timeheightprofiles_as_dataset.xml b/tests/expectedoutputs/TestWMSTimeHeightProfiles/test_wmsgetcapabilities_timeheightprofiles_as_dataset.xml index 242f468e9..398d9e378 100644 --- a/tests/expectedoutputs/TestWMSTimeHeightProfiles/test_wmsgetcapabilities_timeheightprofiles_as_dataset.xml +++ b/tests/expectedoutputs/TestWMSTimeHeightProfiles/test_wmsgetcapabilities_timeheightprofiles_as_dataset.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.14.1, of Dec 18 2023 11:19:06 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,42 +60,42 @@ WMS of adaguc.tests.timeheightprofiles -GFI:TIME_ELEVATION +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 - +GFI:TIME_ELEVATION + + + + + + + - - - - - - - + - + beta_raw ceilonet 06310 eprofile @@ -104,24 +104,24 @@ 4.095820 50.941341 51.941341 - + + + + + + + - - - - - - - + - + 2023-12-02T06:40:00Z diff --git a/tests/expectedoutputs/TestWMSTimeSeries/test_WMSGetCapabilities_testdatanc.xml b/tests/expectedoutputs/TestWMSTimeSeries/test_WMSGetCapabilities_testdatanc.xml index 90a58a962..108f30c44 100644 --- a/tests/expectedoutputs/TestWMSTimeSeries/test_WMSGetCapabilities_testdatanc.xml +++ b/tests/expectedoutputs/TestWMSTimeSeries/test_WMSGetCapabilities_testdatanc.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,42 +60,40 @@ WMS of AutoResource testdata.nc +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 -EPSG:28992 + + + + + + + - - - - - - - + - - testdata Testdata (testdata) @@ -104,24 +102,23 @@ 32.676474 37.353267 65.888228 - + + + + + + + + - - - - - - - + - - diff --git a/tests/expectedoutputs/TestWMSVolScan/test_WMSGetCapabilities_VolScan.xml b/tests/expectedoutputs/TestWMSVolScan/test_WMSGetCapabilities_VolScan.xml index 941e87d45..a9becf451 100644 --- a/tests/expectedoutputs/TestWMSVolScan/test_WMSGetCapabilities_VolScan.xml +++ b/tests/expectedoutputs/TestWMSVolScan/test_WMSGetCapabilities_VolScan.xml @@ -15,7 +15,7 @@ view infoMapAccessService - ADAGUCServer version 2.13.7, of Nov 1 2023 11:45:57 + ADAGUCServer version 2.27.0, of Sep 6 2024 09:44:02 @@ -60,40 +60,40 @@ WMS of AutoResource RAD_NL62_VOL_NA_202106181850.h5 +CRS:84 +EPSG:25831 +EPSG:25832 +EPSG:28992 +EPSG:3067 +EPSG:32661 EPSG:3411 EPSG:3412 EPSG:3575 EPSG:3857 +EPSG:40000 EPSG:4258 EPSG:4326 -CRS:84 -EPSG:25831 -EPSG:25832 -EPSG:28992 -EPSG:7399 EPSG:50001 EPSG:54030 -EPSG:32661 -EPSG:40000 +EPSG:7399 EPSG:900913 -EPSG:3067 + + + + + + + - - - - - - - + - KDP KDP (KDP) @@ -102,23 +102,23 @@ 10.000000 48.000000 58.000000 - + + + + + + + + - - - - - - - + - 2021-06-18T18:50:00Z 0.3,0.3l,0.8,1.2,2,2.8,4,6,8 @@ -130,23 +130,23 @@ 10.000000 48.000000 58.000000 - + + + + + + + + - - - - - - - + - 2021-06-18T18:50:00Z 0.3,0.3l,0.8,1.2,2,2.8,4,6,8 @@ -158,23 +158,23 @@ 10.000000 48.000000 58.000000 - + + + + + + + + - - - - - - - + - 2021-06-18T18:50:00Z 0.3,0.3l,0.8,1.2,2,2.8,4,6,8 @@ -186,23 +186,23 @@ 10.000000 48.000000 58.000000 - + + + + + + + + - - - - - - - + - 2021-06-18T18:50:00Z 0.3,0.3l,0.8,1.2,2,2.8,4,6,8 @@ -214,23 +214,23 @@ 10.000000 48.000000 58.000000 - + + + + + + + + - - - - - - - + - 2021-06-18T18:50:00Z 0.3,0.3l,0.8,1.2,2,2.8,4,6,8 @@ -242,23 +242,23 @@ 10.000000 48.000000 58.000000 - + + + + + + + + - - - - - - - + - 2021-06-18T18:50:00Z 0.3,0.3l,0.8,1.2,2,2.8,4,6,8 @@ -270,23 +270,23 @@ 10.000000 48.000000 58.000000 - + + + + + + + + - - - - - - - + - 2021-06-18T18:50:00Z 0.3,0.3l,0.8,1.2,2,2.8,4,6,8 @@ -298,23 +298,23 @@ 10.000000 48.000000 58.000000 - + + + + + + + + - - - - - - - + - 2021-06-18T18:50:00Z 0.3,0.3l,0.8,1.2,2,2.8,4,6,8 diff --git a/tests/functional_test.py b/tests/functional_test.py index d7a969d0b..7915958f3 100644 --- a/tests/functional_test.py +++ b/tests/functional_test.py @@ -5,6 +5,7 @@ """ import unittest import sys +from AdagucTests.TestMetadataRequest import TestMetadataRequest from AdagucTests.TestWMSTimeSeries import TestWMSTimeSeries from AdagucTests.TestWMS import TestWMS from AdagucTests.TestWCS import TestWCS @@ -22,8 +23,11 @@ from AdagucTests.TestDataPostProcessor import TestDataPostProcessor from AdagucTests.TestWMSTimeHeightProfiles import TestWMSTimeHeightProfiles + + suites = [] TestLoader = unittest.TestLoader +suites.append(TestLoader().loadTestsFromTestCase(TestMetadataRequest)) suites.append(TestLoader().loadTestsFromTestCase(TestWMSTimeSeries)) suites.append(TestLoader().loadTestsFromTestCase(TestWMS)) suites.append(TestLoader().loadTestsFromTestCase(TestWCS))