提交 61747d726d00f641518928b5f1bdd514b2e4e9e7

作者 qingxiongf
1 个父辈 871aa67d

能力文档

  1 +[2022-02-25 10:04:23.737564] [00:00:00.000390] [static bool DmpMainServer::Init() (/mnt/d/dmap/git/DMapServer4.1/src/server/dmpmainserver.cpp:44)] <info> -------------------dmap server init start--------------------
  2 +[2022-02-25 10:04:23.738737] [00:00:00.001565] [static bool DmpMainServer::Init() (/mnt/d/dmap/git/DMapServer4.1/src/server/dmpmainserver.cpp:50)] <debug> Initializing server modules from /mnt/d/dmap/git/DMapServer4.1/build/output/lib/dmap/server
  3 +[2022-02-25 10:04:23.824362] [00:00:00.087187] [virtual void mapserver::DmpMapServerModule::registerSelf(DmpServerRegistry&) (/mnt/d/dmap/git/DMapServer4.1/src/server/services/mapserver/dmpmapserver.h:60)] <debug> DmpTileServerModule::registerSelf called
  4 +[2022-02-25 10:04:23.824797] [00:00:00.087624] [DmpWms::DmpWMSService::DmpWMSService() (/mnt/d/dmap/git/DMapServer4.1/src/server/services/mapserver/wms/dmpwms.cpp:31)] <debug> Constructing WmsService
  5 +[2022-02-25 10:04:23.825122] [00:00:00.087950] [DmpWfs::DmpWFSService::DmpWFSService() (/mnt/d/dmap/git/DMapServer4.1/src/server/services/mapserver/wfs/dmpwfs.cpp:34)] <debug> Constructing WmsService
  6 +[2022-02-25 10:04:23.825656] [00:00:00.088483] [DmpMapping::DmpMappingService::DmpMappingService() (/mnt/d/dmap/git/DMapServer4.1/src/server/services/mapserver/mapping/dmpmapping.cpp:30)] <debug> Constructing WmsService
  7 +[2022-02-25 10:04:23.860343] [00:00:00.123169] [virtual void tileserver::DmpTileServerModule::registerSelf(DmpServerRegistry&) (/mnt/d/dmap/git/DMapServer4.1/src/server/services/tileserver/dmptileserver.h:62)] <debug> DmpTileServerModule::registerSelf called
  8 +[2022-02-25 10:04:23.860599] [00:00:00.123427] [tileserver::DmpWMTSService::DmpWMTSService() (/mnt/d/dmap/git/DMapServer4.1/src/server/services/tileserver/wmts/dmpwmts.cpp:35)] <debug> Constructing WmtsService
  9 +[2022-02-25 10:04:23.861817] [00:00:00.124644] [tileserver::DmpTMSService::DmpTMSService() (/mnt/d/dmap/git/DMapServer4.1/src/server/services/tileserver/tms/dmptms.cpp:25)] <debug> Constructing TmsService
  10 +[2022-02-25 10:04:24.019719] [00:00:00.282545] [static bool DmpMainServer::Init() (/mnt/d/dmap/git/DMapServer4.1/src/server/dmpmainserver.cpp:58)] <debug> ------------------dmap server init end-------------------
  11 +[2022-02-25 10:04:26.675269] [00:00:02.938096] [] <debug> DmpMainServer: HandleRequest
... ...
1 1 /**************************************************************************
2   -* file: DmpGeometry.cpp
  2 +* file: dmpgeometry.cpp
3 3
4 4 * Author: qingxiongf
5 5 * Date: 2022-02-22 10:13:27
6 6 * Email: qingxiongf@chinadci.com
7 7 * copyright: 广州城市信息研究所有限公司
8 8 ***************************************************************************/
9   -#include "DmpGeometry.h"
  9 +#include "dmpgeometry.h"
10 10 #include <iostream>
11 11 #include <string.h>
12 12 #include <sstream>
... ...
... ... @@ -11,6 +11,9 @@
11 11 #include "dmpserverrequest.h"
12 12 #include "dmpserverproject.h"
13 13 #include "dmpmapserverutil.h"
  14 +#include "dmppgsqlsourcepools.h"
  15 +
  16 +using namespace mapserver;
14 17 namespace DmpWms
15 18 {
16 19 void writeGetCapabilities( const DmpServerContext &context, const DmpWmsParameters& params,
... ... @@ -66,7 +69,7 @@ namespace DmpWms
66 69 // xmlRoot.add("<xmlattr>.xmlns","http://www.opengis.net/wms");
67 70 // xmlRoot.add("<xmlattr>.xmlns:sld","http://www.opengis.net/sld");
68 71 // xmlRoot.add("<xmlattr>.xsi:schemaLocation","http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd");
69   - xmlRoot.add("<xmlattr>.version", version);
  72 + xmlRoot.add("<xmlattr>.version", "1.3.0");
70 73 }
71 74
72 75 boost::property_tree::ptree ptService;
... ... @@ -147,14 +150,9 @@ namespace DmpWms
147 150
148 151 void addCapabilitiesLayers(boost::property_tree::ptree &pt,const DmpProject* project, std::string& name, std::string& title)
149 152 {
  153 +
150 154 std::string srs = "EPSG:" + std::__cxx11::to_string(project->crs().srid());
151 155
152   - boost::property_tree::ptree ptProject;
153   - // ptProject.add("<xmlattr>.queryable","1");
154   - ptProject.add("Name", name);
155   - ptProject.add("Title", title);
156   - ptProject.add("CRS", srs);
157   -
158 156
159 157 double minx,miny,maxx,maxy;
160 158
... ... @@ -162,12 +160,25 @@ namespace DmpWms
162 160 for (int i=0; i<vectorLayers.size(); i++)
163 161 {
164 162 DmpMapLayer* layer = vectorLayers[i];
  163 + DmpVectorLayer* vectorLayer = (DmpVectorLayer*)layer;
  164 + if( vectorLayer->srid().empty())
  165 + {
  166 + shared_ptr<mapserver::DmpPgsql> pPgsqlConn = mapserver::DmpPgsqlSourcePools::get_instance()->GetPgsqlConn(layer->source());
  167 + if (pPgsqlConn == nullptr) break;
  168 + DmpMapServerUtil::initVectorLayerSrid(pPgsqlConn, vectorLayer);
  169 + }
  170 +
165 171 if(i ==0)
166 172 {
167 173 minx = layer->extent().xmin();
168 174 miny = layer->extent().ymin();
169 175 maxx = layer->extent().xmax();
170 176 maxy = layer->extent().ymax();
  177 + if(project->crs().srid()==0)
  178 + {
  179 + DmpVectorLayer* vectorLayer = (DmpVectorLayer*)layer;
  180 + srs = "EPSG:" + vectorLayer->srid();
  181 + }
171 182 }
172 183 else
173 184 {
... ... @@ -177,13 +188,19 @@ namespace DmpWms
177 188 if(maxy < layer->extent().ymax()) maxy = layer->extent().ymax();
178 189 }
179 190 }
  191 +
  192 + boost::property_tree::ptree ptProject;
  193 + // ptProject.add("<xmlattr>.queryable","1");
  194 + ptProject.add("Name", name);
  195 + ptProject.add("Title", title);
  196 + ptProject.add("CRS", srs);
180 197
181   - boost::property_tree::ptree ptGeographicBoundingbox;
182   - ptGeographicBoundingbox.add("westBoundLongitude", minx);
183   - ptGeographicBoundingbox.add("eastBoundLongitude", maxx);
184   - ptGeographicBoundingbox.add("southBoundLatitude", miny);
185   - ptGeographicBoundingbox.add("northBoundLatitude", maxy);
186   - ptProject.add_child("EX_GeographicBoundingBox",ptGeographicBoundingbox);
  198 + //boost::property_tree::ptree ptGeographicBoundingbox;
  199 + //ptGeographicBoundingbox.add("westBoundLongitude", minx);
  200 + //ptGeographicBoundingbox.add("eastBoundLongitude", maxx);
  201 + //ptGeographicBoundingbox.add("southBoundLatitude", miny);
  202 + //ptGeographicBoundingbox.add("northBoundLatitude", maxy);
  203 + //ptProject.add_child("EX_GeographicBoundingBox",ptGeographicBoundingbox);
187 204
188 205 boost::property_tree::ptree ptBoundingbox;
189 206 ptBoundingbox.add("<xmlattr>.CRS", srs);
... ... @@ -216,15 +233,15 @@ namespace DmpWms
216 233 boost::property_tree::ptree ptLayer;
217 234 ptLayer.add("<xmlattr>.queryable","1");
218 235 ptLayer.add("Name", layer->name());
219   - ptLayer.add("Title", layer->title());
  236 + ptLayer.add("Title", layer->title().empty()? layer->name():layer->title());
220 237 ptLayer.add("CRS", srs);
221 238
222   - boost::property_tree::ptree ptGeographicBoundingbox;
223   - ptGeographicBoundingbox.add("westBoundLongitude", layer->extent().xmin());
224   - ptGeographicBoundingbox.add("eastBoundLongitude", layer->extent().xmax());
225   - ptGeographicBoundingbox.add("southBoundLatitude", layer->extent().ymin());
226   - ptGeographicBoundingbox.add("northBoundLatitude", layer->extent().ymax());
227   - ptLayer.add_child("EX_GeographicBoundingBox",ptGeographicBoundingbox);
  239 + //boost::property_tree::ptree ptGeographicBoundingbox;
  240 + //ptGeographicBoundingbox.add("westBoundLongitude", layer->extent().xmin());
  241 + //ptGeographicBoundingbox.add("eastBoundLongitude", layer->extent().xmax());
  242 + //ptGeographicBoundingbox.add("southBoundLatitude", layer->extent().ymin());
  243 + //ptGeographicBoundingbox.add("northBoundLatitude", layer->extent().ymax());
  244 + //ptLayer.add_child("EX_GeographicBoundingBox",ptGeographicBoundingbox);
228 245
229 246 boost::property_tree::ptree ptBoundingbox;
230 247 ptBoundingbox.add("<xmlattr>.CRS", srs);
... ...
... ... @@ -10,9 +10,16 @@
10 10
11 11 namespace DmpWms
12 12 {
13   - bool DmpPrintCompass::DrawData(clsCrSurf* pClsCS,DmpWmsParameters::Format format)
  13 + bool DmpPrintCompass::DrawData(clsCrSurf* pClsCS,DmpWmsParameters::Format format)
14 14 {
15   -
  15 + cairo_set_antialias(pClsCS->m_pCr,cairo_antialias_t::CAIRO_ANTIALIAS_BEST);
  16 + cairo_set_source_rgb(pClsCS->m_pCr, 0, 0, 0 );
  17 + cairo_select_font_face(pClsCS->m_pCr, compassfont_.c_str(), CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  18 + cairo_set_font_size(pClsCS->m_pCr,size_);
  19 +
  20 + cairo_move_to(pClsCS->m_pCr,localtionX_, localtionY_);
  21 +
  22 + cairo_show_text(pClsCS->m_pCr, compasstext_.c_str());
16 23 return false;
17 24 }
18 25
... ... @@ -25,6 +32,7 @@ namespace DmpWms
25 32
26 33 this->ReadXmlAttribute(pt, boundSize_, "bound_size", para, paraList);
27 34 this->ReadXmlAttribute(pt, showbound_, "showBound", para, paraList);
  35 + this->ReadXmlAttribute(pt, compasstype, "compasstype", para, paraList);
28 36
29 37 this->pPrintParameter_ = pPrintParameter;
30 38
... ...
... ... @@ -19,8 +19,13 @@ namespace DmpWms
19 19
20 20 shared_ptr<DmpPrintParameter> pPrintParameter_ = nullptr;
21 21
22   - string type = "undefine";
23   -
  22 + string compasstype = "undefine";
  23 +
  24 + int size_ = 40;
  25 + private:
  26 + string compasstext_ = "\45";
  27 + string compassfont_ = "ESRI Cartography";
  28 +
24 29 public:
25 30 //bool DrawImage();
26 31 bool DrawData(clsCrSurf* pClsCS,DmpWmsParameters::Format format);
... ...
注册登录 后发表评论