Creating ImageMosaic with Geoserver REST API produces inappropriate coverage parameters types

Description

Hi,
I'm using geoserver rest api to control my server.
Recently I encountered problem while creating ImageMosaic.

Running the following command (the file is attached), produces a coverage with inappropriate parameters types:

1 curl -v -u admin:geoserver -XPUT -H "Content-type:application/zip" -T base_coverage.zip http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/dems59/file.imagemosaic

Fetching the coverage properties, gives me the following XML:

1 curl -v -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/dems59/coverages/dems59
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 <coverage> <name>dems59</name> <nativeName>dems59</nativeName> <namespace> <name>cite</name> <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/namespaces/cite.xml" type="application/xml"/> </namespace> <title>dems59</title> <description>Generated from ImageMosaic</description> <keywords> <string>dems59</string> <string>WCS</string> <string>ImageMosaic</string> </keywords> <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:4326</srs> <nativeBoundingBox> <minx>-180.0</minx> <maxx>180.0</maxx> <miny>-79.0</miny> <maxy>78.0</maxy> <crs>EPSG:4326</crs> </nativeBoundingBox> <latLonBoundingBox> <minx>-180.0</minx> <maxx>180.0</maxx> <miny>-79.0</miny> <maxy>78.0</maxy> <crs>EPSG:4326</crs> </latLonBoundingBox> <projectionPolicy>REPROJECT_TO_DECLARED</projectionPolicy> <enabled>true</enabled> <metadata> <entry key="dirName">dems59_null</entry> </metadata> <store class="coverageStore"> <name>cite:dems59</name> <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/dems59.xml" type="application/xml"/> </store> <nativeFormat>ImageMosaic</nativeFormat> <grid dimension="2"> <range> <low>0 0</low> <high>288 157</high> </range> <transform> <scaleX>1.25</scaleX> <scaleY>-1.0</scaleY> <shearX>0.0</shearX> <shearY>0.0</shearY> <translateX>-179.375</translateX> <translateY>77.5</translateY> </transform> <crs>EPSG:4326</crs> </grid> <supportedFormats> <string>GeoPackage (mosaic)</string> <string>ImageMosaic</string> <string>GEOTIFF</string> <string>Gtopo30</string> <string>GIF</string> <string>PNG</string> <string>JPEG</string> <string>TIFF</string> <string>ArcGrid</string> </supportedFormats> <interpolationMethods> <string>nearest neighbor</string> <string>bilinear</string> <string>bicubic</string> </interpolationMethods> <defaultInterpolationMethod>nearest neighbor</defaultInterpolationMethod> <dimensions> <coverageDimension> <name>GRAY_INDEX</name> <description>GridSampleDimension[-Infinity,Infinity]</description> <range> <min>-inf</min> <max>inf</max> </range> <nullValues> <double>9999.0</double> </nullValues> <dimensionType> <name>REAL_32BITS</name> </dimensionType> </coverageDimension> </dimensions> <requestSRS> <string>EPSG:4326</string> </requestSRS> <responseSRS> <string>EPSG:4326</string> </responseSRS> <parameters> <entry> <string>BackgroundValues</string> <string></string> </entry> <entry> <string>OVERVIEW_POLICY</string> <string>QUALITY</string> </entry> <entry> <string>MergeBehavior</string> <string>FLAT</string> </entry> <entry> <string>AllowMultithreading</string> <string>false</string> </entry> <entry> <string>MaxAllowedTiles</string> <string>-1</string> </entry> <entry> <string>ExcessGranuleRemoval</string> <string>NONE</string> </entry> <entry> <string>OutputTransparentColor</string> <string></string> </entry> <entry> <string>USE_JAI_IMAGEREAD</string> <string>true</string> </entry> <entry> <string>Bands</string> <string></string> </entry> <entry> <string>Filter</string> <string></string> </entry> <entry> <string>InputTransparentColor</string> <string></string> </entry> <entry> <string>SUGGESTED_TILE_SIZE</string> <string>512,512</string> </entry> <entry> <string>Accurate resolution computation</string> <string>false</string> </entry> <entry> <string>SORTING</string> <string></string> </entry> <entry> <string>FootprintBehavior</string> <string>None</string> </entry> </parameters> <nativeCoverageName>dems59</nativeCoverageName

You can see, for example, that `USE_JAI_IMAGEREAD` parameter type is defined as 'string' which is wrong (should be 'boolean').

1 2 3 4 <entry> <string>USE_JAI_IMAGEREAD</string> <string>true</string> </entry>

This becomes a real trouble when I'm trying to use the REST api to UPDATE coverage parameters. Using the given (wrong) type, doesn't update the parameter.
This makes it impossible to update those parameters via the api, unless you guess the correct type (which is impossible to do while using this ability in code).

On the other hand, when the coverage is created via Geoserver control GUI, the parameters type are defined correctly:

1 curl -v -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/dems60/coverages/dems60
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 <coverage> <name>dems60</name> <nativeName>dems60</nativeName> <namespace> <name>cite</name> <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/namespaces/cite.xml" type="application/xml"/> </namespace> <title>dems60</title> <description>Generated from ImageMosaic</description> <keywords> <string>dems60</string> <string>WCS</string> <string>ImageMosaic</string> </keywords> <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:4326</srs> <nativeBoundingBox> <minx>34.99986111111111</minx> <maxx>36.000138888888884</maxx> <miny>30.999861111111112</miny> <maxy>32.00013888888889</maxy> <crs>EPSG:4326</crs> </nativeBoundingBox> <latLonBoundingBox> <minx>34.99986111111111</minx> <maxx>36.000138888888884</maxx> <miny>30.999861111111112</miny> <maxy>32.00013888888889</maxy> <crs>EPSG:4326</crs> </latLonBoundingBox> <projectionPolicy>REPROJECT_TO_DECLARED</projectionPolicy> <enabled>true</enabled> <metadata> <entry key="dirName">dems60_dems60</entry> </metadata> <store class="coverageStore"> <name>cite:dems60</name> <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/dems60.xml" type="application/xml"/> </store> <nativeFormat>ImageMosaic</nativeFormat> <grid dimension="2"> <range> <low>0 0</low> <high>3600 3601</high> </range> <transform> <scaleX>2.777777777777778E-4</scaleX> <scaleY>-2.777777777777778E-4</scaleY> <shearX>0.0</shearX> <shearY>0.0</shearY> <translateX>35.0</translateX> <translateY>32.0</translateY> </transform> <crs>EPSG:4326</crs> </grid> <supportedFormats> <string>GeoPackage (mosaic)</string> <string>ImageMosaic</string> <string>GEOTIFF</string> <string>Gtopo30</string> <string>GIF</string> <string>PNG</string> <string>JPEG</string> <string>TIFF</string> <string>ArcGrid</string> </supportedFormats> <interpolationMethods> <string>nearest neighbor</string> <string>bilinear</string> <string>bicubic</string> </interpolationMethods> <defaultInterpolationMethod>nearest neighbor</defaultInterpolationMethod> <dimensions> <coverageDimension> <name>GRAY_INDEX</name> <description>GridSampleDimension[-Infinity,Infinity]</description> <range> <min>-inf</min> <max>inf</max> </range> <nullValues> <double>-32767.0</double> </nullValues> <dimensionType> <name>SIGNED_16BITS</name> </dimensionType> </coverageDimension> </dimensions> <requestSRS> <string>EPSG:4326</string> </requestSRS> <responseSRS> <string>EPSG:4326</string> </responseSRS> <parameters> <entry> <string>BackgroundValues</string> <null/> </entry> <entry> <string>OVERVIEW_POLICY</string> <null/> </entry> <entry> <string>MergeBehavior</string> <string>FLAT</string> </entry> <entry> <string>AllowMultithreading</string> <boolean>false</boolean> </entry> <entry> <string>MaxAllowedTiles</string> <int>-1</int> </entry> <entry> <string>ExcessGranuleRemoval</string> <null/> </entry> <entry> <string>OutputTransparentColor</string> <null/> </entry> <entry> <string>USE_JAI_IMAGEREAD</string> <boolean>true</boolean> </entry> <entry> <string>Bands</string> <null/> </entry> <entry> <string>Filter</string> <null/> </entry> <entry> <string>InputTransparentColor</string> <null/> </entry> <entry> <string>SUGGESTED_TILE_SIZE</string> <string>512,512</string> </entry> <entry> <string>Accurate resolution computation</string> <boolean>false</boolean> </entry> <entry> <string>SORTING</string> <null/> </entry> <entry> <string>FootprintBehavior</string> <string>None</string> </entry> </parameters> <nativeCoverageName>dems60</nativeCoverageName>

Environment

linux, ubuntu 17

Status

Assignee

Unassigned

Reporter

duvi f

Triage

None

Fix versions

None

Affects versions

2.13.0

Components

Priority

High
Configure