From e6195486ae1a9707816b7897d35299bddbde946a Mon Sep 17 00:00:00 2001 From: Erik Broberg Date: Mon, 25 Apr 2016 16:01:09 -0400 Subject: [PATCH] GDAL trying opening WMS config file --- .../TERRA_CR_B143_2016-04-12.wms | 8 +++++ .../globebrowsing/rendering/patchrenderer.h | 1 + .../rendering/renderableglobe.cpp | 2 +- tests/main.cpp | 4 +-- tests/test_gdalwms.inl | 30 ++++++++----------- 5 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms diff --git a/data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms b/data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms new file mode 100644 index 0000000000..974c7da85f --- /dev/null +++ b/data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms @@ -0,0 +1,8 @@ + + + http://map1.vis.earthdata.nasa.gov/twms-geo/twms.cgi? + MODIS TERRA tileset + 2016-04-12 + + 20 + diff --git a/modules/globebrowsing/rendering/patchrenderer.h b/modules/globebrowsing/rendering/patchrenderer.h index 8335ad86d5..feeda0bb6c 100644 --- a/modules/globebrowsing/rendering/patchrenderer.h +++ b/modules/globebrowsing/rendering/patchrenderer.h @@ -63,6 +63,7 @@ namespace openspace { unique_ptr _programObject; TextureTileSet _tileSet; + }; diff --git a/modules/globebrowsing/rendering/renderableglobe.cpp b/modules/globebrowsing/rendering/renderableglobe.cpp index 24c7274e4c..3093493c48 100644 --- a/modules/globebrowsing/rendering/renderableglobe.cpp +++ b/modules/globebrowsing/rendering/renderableglobe.cpp @@ -66,7 +66,7 @@ namespace openspace { // Mainly for debugging purposes @AA addProperty(_rotation); - //addSwitchValue(std::shared_ptr(new ClipMapGlobe(dictionary)), 1e7); + addSwitchValue(std::shared_ptr(new ClipMapGlobe(dictionary)), 1e7); addSwitchValue(std::shared_ptr(new ChunkLodGlobe(dictionary)), 1e9); addSwitchValue(std::shared_ptr(new GlobeMesh(dictionary)), 1e10); diff --git a/tests/main.cpp b/tests/main.cpp index dec919ab56..95e1200112 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -34,8 +34,8 @@ //#include //#include //#include -#include -#include +//#include +//#include //#include //#include diff --git a/tests/test_gdalwms.inl b/tests/test_gdalwms.inl index 9ec559ac37..b7561bbf55 100644 --- a/tests/test_gdalwms.inl +++ b/tests/test_gdalwms.inl @@ -25,38 +25,32 @@ #include "gtest/gtest.h" #include "gdal.h" - #include "gdal_priv.h" #include #include "cpl_conv.h" +#include "cpl_string.h" -//#include "wms/wmsdriver.h" +// Error: cannot open source file "wms/wmsdriver.h" +//#include "wms/wmsdriver.h" + +// Error: cannot open source file "wms/wmsmetadataset.h" //#include "wms/wmsmetadataset.h" class GdalWmsTest : public testing::Test {}; TEST_F(GdalWmsTest, Simple) { - //GDALRegister_WMS(); + GDALDataset *poDataset; + GDALAllRegister(); + + std::string testFile = absPath("../data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms"); + poDataset = (GDALDataset *)GDALOpen(testFile.c_str(), GA_ReadOnly); + // This assertion fails + ASSERT_NE(poDataset, nullptr) << "Failed to load testFile"; - GDALWMSDataset* wms_dataset = GDALOpen("../test.xml", GA_ReadOnly); - if (wms_dataset) - { - ; - } - - - /* - GDALDataset *poDataset; - GDALAllRegister(); - poDataset = (GDALDataset *)GDALOpen("filename", GA_ReadOnly); - if (poDataset == NULL) - { - std::cout << "NULL" << std::endl; - }*/ }