[Geoserver-devel] [JIRA] (GEOS-8745) Creating ImageMosaic with Geoserver REST API produces inappropriate coverage parameters

duvi f created an issue

GeoServer / BugGEOS-8745

Creating ImageMosaic with Geoserver REST API produces inappropriate coverage parameters

Issue Type:

BugBug

Affects Versions:

2.13.0

Assignee:

Unassigned

Attachments:

base_coverage.zip

Components:

image mosaic, REST

Created:

14/May/18 7:12 PM

Environment:

linux, ubuntu 17

Priority:

HighestHighest

Reporter:

duvi f

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:

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:

curl -v -u admin:geoserver  -XGET http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/dems59/coverages/dems59

<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["WGS 84", 
  DATUM["World Geodetic System 1984", 
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
    AUTHORITY["EPSG","6326"]], 
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
  UNIT["degree", 0.017453292519943295], 
  AXIS["Geodetic longitude", EAST], 
  AXIS["Geodetic latitude", NORTH], 
  AUTHORITY["EPSG","4326"]]</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’).

<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:

curl -v -u admin:geoserver  -XGET http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/dems60/coverages/dems60

 [^base_coverage.zip] 
<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["WGS 84", 
  DATUM["World Geodetic System 1984", 
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
    AUTHORITY["EPSG","6326"]], 
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
  UNIT["degree", 0.017453292519943295], 
  AXIS["Geodetic longitude", EAST], 
  AXIS["Geodetic latitude", NORTH], 
  AUTHORITY["EPSG","4326"]]</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>

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100084-sha1:841e6db)

Atlassian logo