提交 a952e65705281ce24209cb2ee187b7d6cb851228
Merge branch 'master' of http://gitlab.ctune.cn/DMapServer/DMapServer4.1
正在显示
31 个修改的文件
包含
38 行增加
和
124 行删除
... | ... | @@ -34,7 +34,6 @@ class SERVER_EXPORT DmpService |
34 | 34 | virtual std::string name() const = 0; |
35 | 35 | virtual std::string version() const = 0; |
36 | 36 | virtual std::string description() const = 0; |
37 | - virtual bool validate(std::string &filePath) { return true; } | |
38 | 37 | virtual bool allowMethod(DmpServerRequest::Method) const { return true; } |
39 | 38 | virtual void executeRequest(const DmpServerContext &context) = 0; |
40 | 39 | }; | ... | ... |
... | ... | @@ -19,10 +19,10 @@ namespace tileserver |
19 | 19 | |
20 | 20 | DmpTileServer::DmpTileServer() |
21 | 21 | { |
22 | - DmpService* wmtsServer = new DmpWmts::DmpWMTSService(); | |
22 | + DmpService* wmtsServer = new DmpWMTSService(); | |
23 | 23 | services_[wmtsServer->name()] = wmtsServer; |
24 | 24 | |
25 | - DmpService* tmsServer = new DmpTms::DmpTMSService(); | |
25 | + DmpService* tmsServer = new DmpTMSService(); | |
26 | 26 | services_[tmsServer->name()] = tmsServer; |
27 | 27 | } |
28 | 28 | |
... | ... | @@ -105,7 +105,7 @@ bool DmpTileServer::publish(const std::string &serviceName, const std::string &t |
105 | 105 | std::string filePath=tileLayer->getDataSource(); |
106 | 106 | |
107 | 107 | if(capability & DmpServiceType::WMTS) { |
108 | - DmpService* wmtsservice = getService("WMTSService"); | |
108 | + DmpWMTSService* wmtsservice = dynamic_cast<DmpWMTSService*>(getService("WMTSService")); | |
109 | 109 | if(!wmtsservice) { |
110 | 110 | return false; |
111 | 111 | } |
... | ... | @@ -115,7 +115,7 @@ bool DmpTileServer::publish(const std::string &serviceName, const std::string &t |
115 | 115 | } |
116 | 116 | } |
117 | 117 | if(capability & DmpServiceType::TMS) { |
118 | - DmpService* tmsservice = getService("TMSService"); | |
118 | + DmpTMSService* tmsservice = dynamic_cast<DmpTMSService*>(getService("TMSService")); | |
119 | 119 | if(!tmsservice) { |
120 | 120 | return false; |
121 | 121 | } |
... | ... | @@ -135,7 +135,7 @@ DmpService* DmpTileServer::getService(const std::string &serviceType) |
135 | 135 | ServiceMap::const_iterator iter = services_.find(serviceType); |
136 | 136 | if (iter != services_.end()) |
137 | 137 | { |
138 | - service = iter->second; | |
138 | + service = dynamic_cast<DmpWMTSService*>(iter->second); | |
139 | 139 | } |
140 | 140 | return service; |
141 | 141 | } | ... | ... |
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | #include "dmpservice.h" |
14 | 14 | #include <iostream> |
15 | 15 | |
16 | -namespace DmpTms | |
16 | +namespace tileserver | |
17 | 17 | { |
18 | 18 | class DmpTMSService : public DmpService |
19 | 19 | { |
... | ... | @@ -23,7 +23,7 @@ namespace DmpTms |
23 | 23 | std::string name() const override { return std::string("TMSService"); } |
24 | 24 | std::string version() const override { return std::string("1.0.0"); } |
25 | 25 | std::string description() const override { return std::string("TMS瓦片服务"); } |
26 | - bool validate(std::string &filePath) override; | |
26 | + bool validate(std::string &filePath); | |
27 | 27 | bool allowMethod(DmpServerRequest::Method method) const override { return method == DmpServerRequest::GET_METHOD;} |
28 | 28 | void executeRequest(const DmpServerContext &context) override; |
29 | 29 | ... | ... |
... | ... | @@ -22,13 +22,12 @@ |
22 | 22 | #include "dmplogger.h" |
23 | 23 | #include "dmptileproviderfactory.h" |
24 | 24 | #include "dmpserverrequest.h" |
25 | -#include "dmpwmtsservice.h" | |
26 | 25 | #include "dmpwmts.h" |
27 | 26 | #include "dmptilelayer.h" |
28 | 27 | |
29 | 28 | using namespace std; |
30 | 29 | |
31 | -namespace DmpWmts | |
30 | +namespace tileserver | |
32 | 31 | { |
33 | 32 | |
34 | 33 | DmpWMTSService::DmpWMTSService() |
... | ... | @@ -136,4 +135,4 @@ namespace DmpWmts |
136 | 135 | |
137 | 136 | } |
138 | 137 | } |
139 | -} // namespace DmpWmts | |
\ No newline at end of file | ||
138 | +} // namespace tileserver | |
\ No newline at end of file | ... | ... |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | #include "dmpwmtsparameters.h" |
15 | 15 | #include "dmplogger.h" |
16 | 16 | |
17 | -namespace DmpWmts | |
17 | +namespace tileserver | |
18 | 18 | { |
19 | 19 | class DmpWMTSService : public DmpService |
20 | 20 | { |
... | ... | @@ -24,7 +24,7 @@ namespace DmpWmts |
24 | 24 | std::string name() const override { return std::string("WMTSService"); } |
25 | 25 | std::string version() const override { return std::string("1.0.0"); } |
26 | 26 | std::string description() const override { return std::string("WMTS瓦片服务"); } |
27 | - bool validate(std::string &filePath) override; | |
27 | + bool validate(std::string &filePath); | |
28 | 28 | bool allowMethod(DmpServerRequest::Method method) const override { return method == DmpServerRequest::GET_METHOD;} |
29 | 29 | void executeRequest(const DmpServerContext &context) override; |
30 | 30 | ... | ... |
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | #include <boost/algorithm/string.hpp> |
14 | 14 | #include "dmplogger.h" |
15 | 15 | #include "dmpserverutils.h" |
16 | -namespace DmpWmts | |
16 | +namespace tileserver | |
17 | 17 | { |
18 | 18 | DmpWmtsParameters::DmpWmtsParameters() |
19 | 19 | : DmpServerParameters() |
... | ... | @@ -146,4 +146,4 @@ namespace DmpWmts |
146 | 146 | } |
147 | 147 | return Format::NONE; |
148 | 148 | } |
149 | -} // namespace DmpWmts | |
\ No newline at end of file | ||
149 | +} // namespace tileserver | |
\ No newline at end of file | ... | ... |
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | |
14 | 14 | #include "dmpserverparameters.h" |
15 | 15 | |
16 | -namespace DmpWmts | |
16 | +namespace tileserver | |
17 | 17 | { |
18 | 18 | class DmpWmtsParameters : public DmpServerParameters |
19 | 19 | { |
... | ... | @@ -39,5 +39,5 @@ namespace DmpWmts |
39 | 39 | int TileRow() const; |
40 | 40 | int TileCol() const; |
41 | 41 | }; |
42 | -} // namespace DmpWmts | |
42 | +} // namespace tileserver | |
43 | 43 | #endif //__dmpwmtsparameters_h__ | ... | ... |
1 | -/************************************************************************** | |
2 | -* file: dmpwmtsservice.cpp | |
3 | - | |
4 | -* Author: wanzhongping | |
5 | -* Date: 2021-07-28 11:34:16 | |
6 | -* Email: zhongpingw@chinadci.com | |
7 | -* copyright: 广州城市信息研究所有限公司 | |
8 | -***************************************************************************/ | |
9 | -#include "dmpwmtsservice.h" | |
10 | - | |
11 | -// DmpWMTSService::DmpWMTSService() | |
12 | -// : DmpService() | |
13 | -// { | |
14 | -// map_type_ = MapServerType::WMTS_SERVER; | |
15 | -// //AddProperty("tilePath","/usr/local/dmap4/gdmap/_alllayers"); | |
16 | -// //AddProperty("tilePath","/mnt/d/Code/tiles/gdmap/_alllayers"); | |
17 | -// //AddProperty("tileVersion","1"); | |
18 | -// } | |
19 | -// DmpWMTSService::~DmpWMTSService() | |
20 | -// { | |
21 | -// } | |
22 | -// bool DmpWMTSService::Read(boost::property_tree::ptree &pt_node) | |
23 | -// { | |
24 | -// try { | |
25 | -// enabled_ = pt_node.get<bool>("enabled"); | |
26 | -// capabilities_ = pt_node.get<std::string>("capabilities"); | |
27 | - | |
28 | -// //读取属性 | |
29 | -// for (auto property : pt_node.get_child("properties")) | |
30 | -// { | |
31 | -// std::string key = property.first; | |
32 | -// std::string val = property.second.data(); | |
33 | -// AddProperty(key, val); | |
34 | -// } | |
35 | - | |
36 | -// } | |
37 | -// catch(std::exception ex) { | |
38 | -// return false; | |
39 | -// } | |
40 | -// return true; | |
41 | -// } | |
42 | -// bool DmpWMTSService::Write(boost::property_tree::ptree &pt_node) | |
43 | -// { | |
44 | -// pt_node.put("typeName", (int)map_type_); | |
45 | -// pt_node.put("capabilities", capabilities_); | |
46 | -// pt_node.put("enabled", enabled_); | |
47 | - | |
48 | -// boost::property_tree::ptree pt_subitem; | |
49 | -// std::map<std::string, std::string>::iterator iter = properties_.begin(); | |
50 | -// while(iter != properties_.end()) | |
51 | -// { | |
52 | -// pt_subitem.put(iter->first, iter->second); | |
53 | -// ++iter; | |
54 | -// } | |
55 | -// pt_node.put_child("properties", pt_subitem); | |
56 | - | |
57 | -// return true; | |
58 | -// } |
1 | -/************************************************************************** | |
2 | -* file: dmpwmtsservice.h | |
3 | - | |
4 | -* Author: wanzhongping | |
5 | -* Date: 2021-07-28 11:34:06 | |
6 | -* Email: zhongpingw@chinadci.com | |
7 | -* copyright: 广州城市信息研究所有限公司 | |
8 | -***************************************************************************/ | |
9 | - | |
10 | -#ifndef __dmpwmtsservice_h__ | |
11 | -#define __dmpwmtsservice_h__ | |
12 | -#include "dmpservice.h" | |
13 | - | |
14 | - | |
15 | -// class DmpWMTSService : public DmpService | |
16 | -// { | |
17 | -// public: | |
18 | -// DmpWMTSService(); | |
19 | -// virtual ~DmpWMTSService(); | |
20 | -// virtual bool Read(boost::property_tree::ptree &pt_node) override; | |
21 | -// virtual bool Write(boost::property_tree::ptree &pt_node) override; | |
22 | - | |
23 | - | |
24 | -// protected: | |
25 | -// std::string capabilities_; | |
26 | -// bool enabled_; | |
27 | -// }; | |
28 | - | |
29 | -#endif // __dmpwmtsservice_h__ |
请
注册
或
登录
后发表评论