mapserv服务+gdal程序请求WCS服务
最近用GDAL做地图开发,做重投影时遇到“Returned tile does not match expected configuration.”错误
- 地图服务:mapserver;
- c++请求:GDAL;
- 请求链接://GDALDataset* psrcData1 =
(GDALDataset*)GDALOpenEx(“WCS:http://ip:port/mapserv/mapserv?map=dom.map&SERVICE=WCS&VERSION=2.0.0&REQUEST=GetCoverage&CoverageID=dom_layer&FORMAT=image/tiff”,
GDAL_OF_RASTER, nullptr, nullptr, nullptr);
问题原因:
1.GDAL请求WCS数据时,会根据WCS请求中DescribeCoverage返回中的
gml:posx y</gml:pos>
和
<gml:offsetVector srsName=“http://www.opengis.net/def/crs/EPSG/0/4326”>0 0.000005</gml:offsetVector>
重新计算投影,
若mapserv发布的原始tif为地理坐标系,因为<gml:offsetVector >返回值仅仅保留6位小数,精度丢失,导致出现“Returned tile does not match expected configuration.”错误。
2.GDAL请求WCS数据时,会分块请求数据,若源数据的宽和高不能2被整除,也会出现此问题。
解决办法:
原因2的问题暂时没找到解决办法。
原因1的解决办法:修改mapserv源码。mapwcs20.c文件中msWCSCommon20_CreateDomainSe函数,将
psOrigin = xmlNewChild(psGrid, psGmlNs, BAD_CAST "origin", NULL);{if (swapAxes == MS_FALSE) {*snprintf(point, sizeof(point), "%f %f", x0, y0);*} else {*snprintf(point, sizeof(point), "%f %f", y0, x0);*}psOrigin = xmlNewChild(psOrigin, psGmlNs, BAD_CAST "Point", NULL);snprintf(id, sizeof(id), "grid_origin_%s", layer->name);xmlNewNsProp(psOrigin, psGmlNs, BAD_CAST "id", BAD_CAST id);xmlNewProp(psOrigin, BAD_CAST "srsName", BAD_CAST cm->srs_uri);xmlNewChild(psOrigin, psGmlNs, BAD_CAST "pos", BAD_CAST point);}if (swapAxes == MS_FALSE) {*snprintf(offsetVector1, sizeof(offsetVector1), "%f 0", resx);snprintf(offsetVector2, sizeof(offsetVector2), "0 %f", resy);*} else {*snprintf(offsetVector1, sizeof(offsetVector1), "0 %f", resx);snprintf(offsetVector2, sizeof(offsetVector2), "%f 0", resy);*}
修改为
psOrigin = xmlNewChild(psGrid, psGmlNs, BAD_CAST "origin", NULL);{if (swapAxes == MS_FALSE) {*snprintf(point, sizeof(point), "%.15g %.15g", x0, y0);*} else {*snprintf(point, sizeof(point), "%.15g %.15g", y0, x0);*}psOrigin = xmlNewChild(psOrigin, psGmlNs, BAD_CAST "Point", NULL);snprintf(id, sizeof(id), "grid_origin_%s", layer->name);xmlNewNsProp(psOrigin, psGmlNs, BAD_CAST "id", BAD_CAST id);xmlNewProp(psOrigin, BAD_CAST "srsName", BAD_CAST cm->srs_uri);xmlNewChild(psOrigin, psGmlNs, BAD_CAST "pos", BAD_CAST point);}if (swapAxes == MS_FALSE) {*snprintf(offsetVector1, sizeof(offsetVector1), "%.15g 0", resx);snprintf(offsetVector2, sizeof(offsetVector2), "0 %.15g", resy);*} else {*snprintf(offsetVector1, sizeof(offsetVector1), "0 %.15g", resx);snprintf(offsetVector2, sizeof(offsetVector2), "%.15g 0", resy);*}
mapserv服务+gdal程序请求WCS服务相关推荐
- Android应用程序请求SurfaceFlinger服务渲染Surface的过程分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/7932268 在前面一篇文章中,我们分析了And ...
- Android应用程序请求SurfaceFlinger服务创建Surface的过程分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/7884628 前面我们已经学习过Android应 ...
- 计算机启动显示安装程序正在启动服务,安装程序正在启动服务需要多久
大家好,我是时间财富网智能客服时间君,上述问题将由我为大家进行解答. 安装程序正在启动服务需要多久,这个主要看软件大小,安装完成就会自动运行的,要是系统不断的提示,这个就不一定了,时间可能会很久的,需 ...
- Android应用程序是如何请求SurfaceFlinger服务渲染一个Surface的?
在前面一篇文章中,我们分析了Android应用程序请求SurfaceFlinger服务创建Surface的过程.有了Surface之后,Android应用程序就可以在上面绘制自己的UI了,接着再请求S ...
- Android应用程序与SurfaceFlinger服务之间的共享UI元数据(SharedClient)的创建过程分析...
在前面一篇文章中,我们分析了Android应用程序与SurfaceFlinger服务的连接过程.Android应用程序成功连接上SurfaceFlinger服务之后,还需要一块匿名共享内存来和Surf ...
- Sharepoin学习笔记—架构系列—07nSharepoint服务(Services)与服务应用程序框架(Service Application Framework) 2
上一篇我们以问答的方式明确了Sharepoint服务的一些概念,这里我们重点来看两个方面:Sharepoint服务器构架对象模型以及Sharepoint 服务应用程序的某些拓扑结构 一.Sharepo ...
- Sharepoin学习笔记—架构系列—Sharepoint服务(Services)与服务应用程序框架(Service Application Framework) 2
上一篇我们以问答的方式明确了Sharepoint服务的一些概念,这里我们重点来看两个方面:Sharepoint服务器构架对象模型以及Sharepoint 服务应用程序的某些拓扑结构 一.Sharepo ...
- Windows服务应用程序
Windows服务应用程序 一.Windows服务应用程序简介 二.创建Windows服务应用程序 2.1 基于ServiceBase创建服务 2.1.1 使用Visual Studio中的Windo ...
- 使用Delphi编写自动关闭Windows信使服务窗体程序
使用Delphi编写自动关闭Windows信使服务窗体程序 Windows信使服务是Windows为了方便尽心系统管理而设置的一项工具,初衷是很好的可以使得管理员方便的在局域网内发布消息给各个用户. ...
最新文章
- 无监督学习距离监督学习还有多远?Hinton组新作解读
- java绘图机器猫_用绘图语句画机器猫(初学 C 语言的同学必看)
- python闭包的延迟绑定_浅析Python的闭包和延迟绑定
- (无限级、递归)DropDownList显示树形分类
- php artisan快捷命令
- 高级技巧之使用定时任务
- JavaScript之字符串类型
- SSM框架02--mybatis(1)
- linux卸载keystone服务,OpenStack —— 认证服务Keystone(二)
- 机器视觉算法(数据结构)
- R语言作图入门——软件安装,数据导入
- win10系统打开tftp服务器,win10设置tftp服务器配置
- pkg_resources.ContextualVersionConflict: (pyasn1 0.1.9 (c:\users\dell\anaconda3\lib\site-packages)
- 几种常用的Web安全认证方式
- 重装系统win7教程
- Django框架学习--4--分布式路由ORM基础
- mysql数据库怎么导出到excel_mysql数据库表如何导出到excel
- java 获取最近12个月(包含当月)
- android11用石墨文档,轻协作 | 石墨文档 for Android 版轻体验
- arduino数字端口输出电压可驱动多大继电器呢_单片机实例分享,自制数字示波器...