NASAWorldWind / WorldWindServerKit

The NASA WorldWind Server Kit (WWSK) is an open source Java project that assembles GeoServer for easy distribution and implementation.
91 stars 54 forks source link

GetMap request throws IllegalArgumentException: "bbox" should not be null #135

Open emxsys opened 6 years ago

emxsys commented 6 years ago

IllegalArgumentExceptions regarding a null "bbox" were being generated by WMS GetMap requests on a layer group that used styles that defined min and max scale denominators. The exceptions were being thrown when the higher resolution layers were requested (e.g., level 15).

Based on empirical evidence, the null bbox errors appear to be related to WMS requests for higher resolution tiles with a "tiled=true" param and without a "tilesOrigin" param. This issue was manifest in the WWSK Explorer but not the Layer Preview. It only occurred in some layer groups with styles defining the min/max scale denominators for the higher resolution imagery.

I removed the "tiled=true" param from the WWSK Explorer and the problem remained. I re-added the "tiled=true" and added a "tilesOrigin=-180,-90" and the problem was abated.

emxsys commented 6 years ago

Issue:

During the rendering of the GetMap request, the request's bbox is transformed to the layer's projection by ProjectionHandler.transformEnvelope. The bbox must be within the projection's "validArea." A null value is returned by transformEnvelope if the bbox is not within the valid area.

For example, assuming a layer group comprised of UTM projections, the bbox for a high-resolution tile on the US east coast would not intersect Hawaii's UTM Zone 4N. For a UTM projection the valid area is +-45 deg from its central meridian (see the TransverseMercatorHandlerFactory constructor).