When adding a new geotiff via REST API the REPROJECT_TO_DECLARED Parameter in the JSON or XML File is ignored.
Steps for reproducing:
Create a new geotiff coveragestore and layer via REST API using the command line:
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
This successfully creates the coveragestore without creating a layer (configure=none).
create the layer:
curl -u admin:password -XPOST -d @geotifftest.xml -H Content-type:"text/xml" http://mapserver:8080/geoserver/rest/workspaces/my/coveragestores/geotifftest/coverages.xml
This creates a layer that uses the contents of geotifftest.xml which is:
<coverage>
<name>geotifftest</name>
<nativeName>geotifftest</nativeName>
<title>geotifftest</title>
<nativeCRS>GEOGCS[&quot;WGS 84&quot;,
DATUM[&quot;World Geodetic System 1984&quot;,
SPHEROID[&quot;WGS 84&quot;, 6378137.0, 298.257223563, AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],
AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],
PRIMEM[&quot;Greenwich&quot;, 0.0, AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],
UNIT[&quot;degree&quot;, 0.017453292519943295],
AXIS[&quot;Geodetic longitude&quot;, EAST],
AXIS[&quot;Geodetic latitude&quot;, NORTH],
AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]</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>
In the created layer the projectionPolicy is set to FORCE_DECLARED and the SRS set to EPSG:4326.
I can manually set it to REPROJECT_TO_DECLARED in the GUI.
In geoserver version 2.11.5 everything works as expected.
It does not work with 2.14.4 and not with 2.17.2.
|