Hi-
This is report of a recent discovery I made after repeatedly banging my
head against the wall, so I thought I should write it up here to help
future users. Basically, you MUST define your elevation dimension as a
Double in your schema (using ImageMosaic indexer.xml), even if your NetCDF
files define the z dimension as a float. Otherwise you get exceptions when
making WCS requests that say "illegal dataType: String not supported in
netcdf-3"
I was getting the following error when accessing my NetCDF-based
ImageMosaic with a request (to a private host) such as this:
http://nnew-vm9:8089/geoserver/RAL_WCS/wcs?service=WCS&version=2.0.0&request=GetCoverage&coverageId=RAL_WCS:CAT_GPML_GTG&subset=time(
"2016-04-14T02:00:00.000Z")&subset=elevation("13.411")&subset=LEADSECONDS("0")&format=application/x-netcdf4
(LEADSECONDS is a custom variable I've defined for our ImageMosaic)
Error returned in browser (similar in GeoServer logs):
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>
java.lang.IllegalArgumentException: illegal dataType: String not supported
in netcdf-3 illegal dataType: String not supported in netcdf-3 []
</ows:ExceptionText>
</ows:Exception>
FYI, a the equivalent WMS request worked fine:
http://nnew-vm9:8089/geoserver/RAL_WCS/wms?service=WMS&version=1.1.0&request=GetMap&layers=RAL_WCS:CAT_GPML_GTG&styles=gtg&bbox=-120.0,22.0,-60.0,50.0&width=768&height=573&srs=EPSG:4326&format=image/png&time=2016-04-14T02:00:00.000Z&elevation=13.411&DIM_LEADSECONDS=0
When I changed the schema config from this:
<schema name="default" >
<attributes>the_geom:Polygon,location:String,imageindex:Integer,time:java.util.Date,z:Float,fileDate:java.util.Date,leadSeconds:Integer</attributes>
</schema>
to this:
<schema name="default" >
<attributes>the_geom:Polygon,location:String,imageindex:Integer,time:java.util.Date,z:Double,fileDate:java.util.Date,leadSeconds:Integer</attributes>
</schema>
the request started to work, returning a NetCDF file, instead of the
misleading exception text.
Also FYI, the NetCDF file headers look like this (note the float data type
for dimension z):
/d1/nnew/GeoServer/8089_server/GTG_index: ncdump -h
../GTG_granules/lambert_sample_20160414T020000000Z_l_0000000.nc
netcdf lambert_sample_20160414T020000000Z_l_0000000 {
dimensions:
time = 1 ;
x = 451 ;
y = 337 ;
z = 46 ;
variables:
double time(time) ;
time:standard_name = "time" ;
time:long_name = "data valid time" ;
time:units = "seconds since 1970-01-01T00:00:00Z" ;
time:calendar = "gregorian" ;
time:axis = "T" ;
time:reference_date = "2016-04-14T02:00:00Z" ;
float x(x) ;
x:standard_name = "projection_x_coordinate" ;
x:units = "km" ;
x:axis = "X" ;
float y(y) ;
y:standard_name = "projection_y_coordinate" ;
y:units = "km" ;
y:axis = "Y" ;
float lat(y, x) ;
lat:standard_name = "latitude" ;
lat:units = "degrees_north" ;
float lon(y, x) ;
lon:standard_name = "longitude" ;
lon:units = "degrees_east" ;
float z(z) ;
z:standard_name = "altitude" ;
z:long_name = "Specific altitude above mean sea level" ;
z:units = "km" ;
z:positive = "up" ;
z:axis = "Z" ;
int grid_mapping ;
grid_mapping:grid_mapping_name = "lambert_conformal_conic" ;
grid_mapping:longitude_of_central_meridian = -95.f ;
grid_mapping:latitude_of_projection_origin = 25.f ;
grid_mapping:standard_parallel = 25.f ;
float CAT_GPML(time, z, y, x) ;
CAT_GPML:valid_min = 0.f ;
CAT_GPML:valid_max = 0.5949897f ;
CAT_GPML:_FillValue = -9999.f ;
CAT_GPML:long_name = "Clear Air Turbulence (CAT)" ;
CAT_GPML:units = "%" ;
CAT_GPML:coordinates = "lon lat" ;
CAT_GPML:grid_mapping = "grid_mapping" ;
// global attributes:
:Conventions = "CF-1.6" ;
:source = "US NWS - NCEP - Aviation Weather Center" ;
:title = "Rapid Refresh (RAP)" ;
:history = "Converted to NetCDF from Grib2 with Grib2toNc from NCAR-RAL." ;
}
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users