提交 40ea7b9ae3d657c104b8d38ec67bf7d5c9e022c4

作者 WZP 万忠平
1 个父辈 99fe22c0

wzp

@@ -70,18 +70,18 @@ IF(WITH_CORE) @@ -70,18 +70,18 @@ IF(WITH_CORE)
70 #FIND_PACKAGE(Spatialindex REQUIRED) 70 #FIND_PACKAGE(Spatialindex REQUIRED)
71 71
72 # optional 72 # optional
73 - IF (WITH_POSTGRESQL)  
74 - FIND_PACKAGE(Postgres) # PostgreSQL provider  
75 - ENDIF (WITH_POSTGRESQL) 73 + # IF (WITH_POSTGRESQL)
  74 + # FIND_PACKAGE(Postgres) # PostgreSQL provider
  75 + # ENDIF (WITH_POSTGRESQL)
76 76
77 #[[ 77 #[[
78 IF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND) 78 IF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
79 MESSAGE (SEND_ERROR "Some dependencies were not found! Proj: ${PROJ_FOUND}, Geos: ${GEOS_FOUND}, GDAL: ${GDAL_FOUND}") 79 MESSAGE (SEND_ERROR "Some dependencies were not found! Proj: ${PROJ_FOUND}, Geos: ${GEOS_FOUND}, GDAL: ${GDAL_FOUND}")
80 ENDIF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND) 80 ENDIF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
81 ]] 81 ]]
82 - IF (POSTGRES_FOUND)  
83 - SET (HAVE_POSTGRESQL TRUE)  
84 - ENDIF (POSTGRES_FOUND) 82 + # IF (POSTGRES_FOUND)
  83 + # SET (HAVE_POSTGRESQL TRUE)
  84 + # ENDIF (POSTGRES_FOUND)
85 85
86 ENDIF(WITH_CORE) 86 ENDIF(WITH_CORE)
87 87
@@ -52,8 +52,8 @@ void DmpServerManager::init(const boost::filesystem::path &modulePath) @@ -52,8 +52,8 @@ void DmpServerManager::init(const boost::filesystem::path &modulePath)
52 52
53 if(!LoadServices()) 53 if(!LoadServices())
54 { 54 {
55 - std::cout << "加载服务失败!" << std::endl;  
56 - LOGGER_ERROR("加载服务失败!"); 55 + std::cout << "加载服务失败!" << std::endl;
  56 + LOGGER_ERROR("加载服务失败!");
57 } 57 }
58 } 58 }
59 59
@@ -34,6 +34,7 @@ class SERVER_EXPORT DmpService @@ -34,6 +34,7 @@ class SERVER_EXPORT DmpService
34 virtual std::string name() const = 0; 34 virtual std::string name() const = 0;
35 virtual std::string version() const = 0; 35 virtual std::string version() const = 0;
36 virtual std::string description() const = 0; 36 virtual std::string description() const = 0;
  37 + virtual bool validate() const { return true; }
37 virtual bool allowMethod(DmpServerRequest::Method) const { return true; } 38 virtual bool allowMethod(DmpServerRequest::Method) const { return true; }
38 virtual void executeRequest(const DmpServerContext &context) = 0; 39 virtual void executeRequest(const DmpServerContext &context) = 0;
39 }; 40 };
@@ -105,16 +105,27 @@ bool DmpTileServer::publish(const std::string &serviceName, const std::string &t @@ -105,16 +105,27 @@ bool DmpTileServer::publish(const std::string &serviceName, const std::string &t
105 if(!wmtsservice) { 105 if(!wmtsservice) {
106 return false; 106 return false;
107 } 107 }
  108 + else if(!wmtsservice.validate())
  109 + {
  110 + return false;
  111 + }
108 } 112 }
109 if(capability & DmpServiceType::TMS) { 113 if(capability & DmpServiceType::TMS) {
110 DmpService* tmsservice = getService("TMSService"); 114 DmpService* tmsservice = getService("TMSService");
111 if(!tmsservice) { 115 if(!tmsservice) {
112 return false; 116 return false;
113 } 117 }
  118 + else if(!tmsservice.validate())
  119 + {
  120 + return false;
  121 + }
114 } 122 }
115 DmpServerProject* serverProject = new DmpServerProject(serviceName, title, &project); 123 DmpServerProject* serverProject = new DmpServerProject(serviceName, title, &project);
116 serverProjects_[serviceName] = serverProject; 124 serverProjects_[serviceName] = serverProject;
117 125
  126 +
  127 +
  128 +
118 return true; 129 return true;
119 } 130 }
120 131
@@ -40,11 +40,14 @@ namespace DmpWmts @@ -40,11 +40,14 @@ namespace DmpWmts
40 { 40 {
41 LOGGER_DEBUG("Destructing WmtsService"); 41 LOGGER_DEBUG("Destructing WmtsService");
42 } 42 }
43 - bool allowMethod(DmpServerRequest::Method method) 43 + bool DmpWMTSService::allowMethod(DmpServerRequest::Method method)
44 { 44 {
45 return method == DmpServerRequest::GET_METHOD; 45 return method == DmpServerRequest::GET_METHOD;
46 } 46 }
47 - 47 + bool DmpWMTSService::validate()
  48 + {
  49 + return false;
  50 + }
48 void DmpWMTSService::executeRequest(const DmpServerContext &context) 51 void DmpWMTSService::executeRequest(const DmpServerContext &context)
49 { 52 {
50 DmpWmtsParameters *params = nullptr; 53 DmpWmtsParameters *params = nullptr;
@@ -79,6 +82,10 @@ namespace DmpWmts @@ -79,6 +82,10 @@ namespace DmpWmts
79 std::shared_ptr<DmpTileProvider> provider = TileProviderFactory::GetProvider(tileLayer); 82 std::shared_ptr<DmpTileProvider> provider = TileProviderFactory::GetProvider(tileLayer);
80 provider->WriteTile(tileRow, tileCol, tileMatrix, f, *context.response()); 83 provider->WriteTile(tileRow, tileCol, tileMatrix, f, *context.response());
81 } 84 }
  85 + else if(boost::iequals(req, "GetThumbnail"))
  86 + {
  87 +
  88 + }
82 else if (boost::iequals(req, "GetCapabilities")) 89 else if (boost::iequals(req, "GetCapabilities"))
83 { 90 {
84 const std::string host=context.request()->domain()+":"+context.request()->port();; 91 const std::string host=context.request()->domain()+":"+context.request()->port();;
@@ -24,6 +24,7 @@ namespace DmpWmts @@ -24,6 +24,7 @@ namespace DmpWmts
24 std::string name() const override { return std::string("WMTSService"); } 24 std::string name() const override { return std::string("WMTSService"); }
25 std::string version() const override { return std::string("1.0.0"); } 25 std::string version() const override { return std::string("1.0.0"); }
26 std::string description() const override { return std::string("WMTS瓦片服务"); } 26 std::string description() const override { return std::string("WMTS瓦片服务"); }
  27 + bool validate() const override;
27 bool allowMethod(DmpServerRequest::Method method) const override { return method == DmpServerRequest::GET_METHOD;} 28 bool allowMethod(DmpServerRequest::Method method) const override { return method == DmpServerRequest::GET_METHOD;}
28 void executeRequest(const DmpServerContext &context) override; 29 void executeRequest(const DmpServerContext &context) override;
29 30
注册登录 后发表评论