问题描述
我无法通过REST API传输REPROJECT_TO_DECLARED参数。 我简化了问题以使其可重现:
首先,我使用命令行通过REST API创建一个新的geotiff coveragestore和图层:
curl -u admin:password -XPUT -d "file:///geotifftest.tiff" -H Content-type:"text/plain" http://mapserver:8080/geoserver/rest/workspaces/my/coveragestores/geotifftest/external.geotiff?configure=none
这将成功创建coverage存储,而无需创建层(configure = none)。 然后创建图层:
curl -u admin:password -XPOST -d @geotifftest.xml -H Content-type:"text/xml" http://mapserver:8080/geoserver/rest/workspaces/my/coveragestores/geotifftest/coverages.xml
这将创建一个使用geotifftest.xml内容的层,即:
<coverage>
<name>geotifftest</name>
<nativeName>geotifftest</nativeName>
<title>geotifftest</title>
<nativeCRS>GEOGCS["WGS 84",DATUM["World Geodetic System 1984",SPHEROID["WGS 84",6378137.0,298.257223563,AUTHORITY["epsg","7030"]],"6326"]],PRIMEM["Greenwich",0.0,"8901"]],UNIT["degree",0.017453292519943295],AXIS["Geodetic longitude",EAST],AXIS["Geodetic latitude",norTH],"4326"]]</nativeCRS>
<srs>epsg:3411</srs>
<nativeBoundingBox>
<minx>67.85481794548498</minx>
<maxx>89.20866745173171</maxx>
<miny>76.3294943493649</miny>
<maxy>81.0710753525806</maxy>
<crs>epsg:4326</crs>
</nativeBoundingBox>
<latLonBoundingBox>
<minx>67.85481794548498</minx>
<maxx>89.20866745173171</maxx>
<miny>76.3294943493649</miny>
<maxy>81.0710753525806</maxy>
<crs>epsg:4326</crs>
</latLonBoundingBox>
<projectionPolicy>REPROJECT_TO_DECLARED</projectionPolicy>
<enabled>true</enabled>
<nativeFormat>GeoTIFF</nativeFormat>
<supportedFormats>
<string>GEOTIFF</string>
</supportedFormats>
<defaultInterpolationMethod>nearest neighbor</defaultInterpolationMethod>
</coverage>
在创建的图层中,未遵守projectionPolicy。它设置为FORCE_DECLARED,而srs设置为epsg:4326。我当然可以使用地理服务器GUI手动将其设置为REPROJECT_TO_DECLARED。
当我使用Geoserver 2.11.5版执行相同的操作时,一切都会按预期进行!因此,我目前无法更新Geoserver。 我正在使用geoserver 2.17.2进行测试。它也不适用于2.14.4。
因此,我怀疑REST API中的错误源自2.11.5之后的某个版本吗?还是我做错了什么? 创建图层后,似乎还无法通过REST API更改参数吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)