Dear GeoServer users,
I need some advice about how to configure raster layers covering Pacific ocean so that I can view them continuously.
I have a raster dataset spanning from India to Hawaii. I tried to publish it with GeoServer in EPSG:3857 as usual. However, if a GetMap request spans the 180 meridian, empty image is returned (and the message "The destination envelope does not intersect the envelope of the source coverage" is found in log file). I guess it's because WMS continuous map wrapping is not supported on raster data.
So I used GDAL to reproject it to EPSG:3832 ( https://epsg.io/3832 ). Unfortunately, the problem remains: I get transparent image if I request a BBOX spanning the 180 meridian. On the other hand, the Countries shapefile from Natural Earth is displayed correctly with the same BBOX.
What do you do to visualize rasters over Pacific?
I can provide you with more information about this particular case. I am not aware of any raster dataset spaning the 180 meridian in the sample data included with GeoServer instalation, so my report is based on my custom data (but I had basically the same problem with publicli available Cross-blended Hypsometric Tints from Natural Earth: http://www.naturalearthdata.com/downloads/10m-raster-data/10m-cross-blend-hypso/ ).
I am using GeoServer 2.9.0 on Linux, deployed in Apache Tomcat 8.0.30 running on Oracle Java 1.8.0_9.
Let's try to view Fiji on the map, the lat lon BBOX spanning the 180 meridian (with longitude as first axis) would be:
175 -20 185 -15
Which is (according to the GeoServer's own reprojecting console) the following in EPSG:3832:
2782987.269831839 -2258423.649096379 3896182.1777645703 -1678147.5163917786
So, my WMS request is the following
The response is a completely blank image. Unfortunately, nothing unusual is shown in the log file:
2016-09-12 12:47:10,689 INFO [geoserver.wms] -
Request: getServiceInfo
2016-09-12 12:47:10,689 DEBUG [geotools.util] - CRSConverter: Converting object of class java.lang.String to org.opengis.referencing.crs.CoordinateReferenceSystem
2016-09-12 12:47:10,689 DEBUG [geotools.util] - CRSConverterFactory can be applied from Strings to CRS only.
2016-09-12 12:47:10,689 DEBUG [geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
2016-09-12 12:47:10,689 DEBUG [geoserver.ows] - Getting layers and styles from LAYERS and STYLES
2016-09-12 12:47:10,689 DEBUG [geoserver.ows] - establishing raster style for test:test_NAT_3832
2016-09-12 12:47:10,690 DEBUG [geoserver.flow] - BasicOWSController(wms.getmap,4) queue size 1
2016-09-12 12:47:10,690 DEBUG [geoserver.flow] - UserFlowController(6,GS_CFLOW_17530d87:15708f9125c:-69ed) queue size 1
2016-09-12 12:47:10,690 DEBUG [geoserver.flow] - UserFlowController(6,GS_CFLOW_17530d87:15708f9125c:-69ed) total queues 2
2016-09-12 12:47:10,690 DEBUG [geoserver.flow] - UserFlowController(6) purged 1 stale queues
2016-09-12 12:47:10,690 DEBUG [geoserver.flow] - GlobalFlowController(20) queue size 1
2016-09-12 12:47:10,690 DEBUG [geoserver.wms] - setting up map
2016-09-12 12:47:10,690 DEBUG [wms.map] - setting up 500x250 image
2016-09-12 12:47:10,691 DEBUG [geotools.util] - CRSConverterFactory can be applied from Strings to CRS only.
2016-09-12 12:47:10,691 TRACE [geotools.factory] - ENTRY (GridCoverageFactory)
2016-09-12 12:47:10,691 TRACE [geotools.factory] - RETURN (GridCoverageFactory): found implementation GridCoverageFactory.
2016-09-12 12:47:10,691 DEBUG [lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationNearest@anonymised.com
2016-09-12 12:47:10,691 DEBUG [geotools.util] - CRSConverterFactory can be applied from Strings to CRS only.
2016-09-12 12:47:10,691 DEBUG [lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationNearest@anonymised.com
2016-09-12 12:47:10,691 DEBUG [lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationNearest@anonymised.com
2016-09-12 12:47:10,692 DEBUG [coverage.grid] - Coverage read: width = 7921 height = 13389
2016-09-12 12:47:10,693 DEBUG [coverage.grid] - Coverage read: width = 7921 height = 13389
2016-09-12 12:47:10,695 INFO [geoserver.wms] -
Request: getMap
Time =
Elevation =
StyleBody = null
SldVersion = null
StyleVersion = null
ScaleMethod = null
Exceptions = SE_XML
FeatureId = null
FeatureVersion = null
Styles = [StyleImpl[ name=raster]]
SRS = EPSG:3832
Crs = PROJCS["WGS 84 / PDC Mercator",
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"]],
PROJECTION["Mercator_1SP", AUTHORITY["EPSG","9804"]],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", 150.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["Easting", EAST],
AXIS["Northing", NORTH],
AUTHORITY["EPSG","3832"]]
Width = 500
Height = 250
FormatOptions = {}
ViewParams = null
Angle = 0.0
Layers = [org.geoserver.wms.MapLayerInfo@anonymised.com]
Bbox = SRSEnvelope[2782987.269831839 : 3896182.1777645703, -2258423.649096379 : -1678147.5163917786]
RemoteOwsType = null
RemoteOwsURL = null
Env = {}
CQLFilter = null
StartIndex = null
MaxFeatures = null
Buffer = 0
Format = image/jpeg
SldBody = null
ValidateSchema = false
Sld = null
StyleUrl = null
BgColor = java.awt.Color[r=255,g=255,b=255]
Transparent = false
StyleFormat = sld
Interpolations =
TilesOrigin = null
Filter = null
Filters = null
Tiled = false
Palette = null
Version = 1.3
RequestCharset = UTF-8
Get = true
RawKvp = {REQUEST=GetMap, FORMAT=image/jpeg, CRS=EPSG:3832, BBOX=2782987.269831839,-2258423.649096379,3896182.1777645703,-1678147.5163917786, VERSION=1.3, SERVICE=WMS, WIDTH=500, HEIGHT=250, LAYERS=test:test_NAT_3832}
Request = GetMap
BaseUrl = http://geo.mstep:80/geoserver/
2016-09-12 12:47:10,695 DEBUG [geotools.util] - CRSConverterFactory can be applied from Strings to CRS only.
2016-09-12 12:47:10,695 DEBUG [geotools.image] - Encoding input image to write out as JPEG.
2016-09-12 12:47:10,695 DEBUG [geotools.image] - Getting a JPEG writer and configuring it.
2016-09-12 12:47:10,696 DEBUG [geotools.image] - Writing out...
2016-09-12 12:47:10,716 DEBUG [geotools.image] - Writing out... Done!
2016-09-12 12:47:10,716 DEBUG [geoserver.filters] - Not compressing output for mimetype: image/jpeg
If I request a BBOX not spanning the 180 meridian, everything is OK. What can I do about it?
Here is output of gdalinfo on my raster file:
Driver: GTiff/GeoTIFF
Files: test_NAT_3832.tiff
Size is 7921, 13389
Coordinate System is:
PROJCS["WGS 84 / PDC Mercator",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",150],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH],
AUTHORITY["EPSG","3832"]]
Origin = (-10084059.149144990369678,15295862.617682032287121)
Pixel Size = (2284.854826220066570,-2284.854826220066570)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_RESOLUTIONUNIT=1 (unitless)
TIFFTAG_XRESOLUTION=1
TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
COMPRESSION=YCbCr JPEG
INTERLEAVE=PIXEL
SOURCE_COLOR_SPACE=YCbCr
Corner Coordinates:
Upper Left (-10084059.149,15295862.618) ( 59d24'48.08"E, 79d40'55.01"N)
Lower Left (-10084059.149,-15296058.651) ( 59d24'48.08"E, 79d40'56.14"S)
Upper Right ( 8014275.929,15295862.618) (138d 0'23.52"W, 79d40'55.01"N)
Lower Right ( 8014275.929,-15296058.651) (138d 0'23.52"W, 79d40'56.14"S)
Center (-1034891.610, -98.016) (140d42'12.28"E, 0d 0' 3.19"S)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
NoData Value=4.85184469334797292e-33
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
NoData Value=4.85184469334797292e-33
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
NoData Value=4.85184469334797292e-33
And finally the coverage.xml for this layer:
<coverage>
<id>CoverageInfoImpl--2d5f6d1:1570f9abf84:-751e</id>
<name>test_NAT_3832</name>
<nativeName>test_NAT_3832</nativeName>
<namespace>
<id>NamespaceInfoImpl--557cd803:155c9ee07a0:-3b85</id>
</namespace>
<title>test_NAT_3832</title>
<description>Generated from GeoTIFF</description>
<keywords>
<string>WCS</string>
<string>GeoTIFF</string>
<string>test_NAT_3832</string>
</keywords>
<nativeCRS class="projected">PROJCS["WGS 84 / PDC Mercator",
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"]],
PROJECTION["Mercator_1SP", AUTHORITY["EPSG","9804"]],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", 150.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["Easting", EAST],
AXIS["Northing", NORTH],
AUTHORITY["EPSG","3832"]]</nativeCRS>
<srs>EPSG:3832</srs>
<nativeBoundingBox>
<minx>-1.9628687512850948E7</minx>
<maxx>1.5807367692644846E7</maxx>
<miny>-8362698.548500745</miny>
<maxy>1.0023392492023032E7</maxy>
<crs class="projected">EPSG:3832</crs>
</nativeBoundingBox>
<latLonBoundingBox>
<minx>-180.0</minx>
<maxx>180.0</maxx>
<miny>-59.99999999999866</miny>
<maxy>66.66999999999982</maxy>
<crs>GEOGCS["WGS84(DD)",
DATUM["WGS84",
SPHEROID["WGS84", 6378137.0, 298.257223563]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Geodetic longitude", EAST],
AXIS["Geodetic latitude", NORTH]]</crs>
</latLonBoundingBox>
<projectionPolicy>REPROJECT_TO_DECLARED</projectionPolicy>
<enabled>true</enabled>
<metadata>
<entry key="NetCDFOutput.Key">
<netcdfLayerSettingsContainer>
<compressionLevel>0</compressionLevel>
<shuffle>true</shuffle>
<dataPacking>NONE</dataPacking>
<layerUOM>W.m-2.Sr-1</layerUOM>
</netcdfLayerSettingsContainer>
</entry>
<entry key="dirName">test_NAT_3832_test_NAT_3832</entry>
</metadata>
<store class="coverageStore">
<id>CoverageStoreInfoImpl--2d5f6d1:1570f9abf84:-751f</id>
</store>
<nativeFormat>GeoTIFF</nativeFormat>
<grid dimension="2">
<range>
<low>0 0</low>
<high>7921 13389</high>
</range>
<transform>
<scaleX>2284.8548262200666</scaleX>
<scaleY>-2284.8548262200666</scaleY>
<shearX>0.0</shearX>
<shearY>0.0</shearY>
<translateX>-1.008291672173188E7</translateX>
<translateY>1.5294720190268923E7</translateY>
</transform>
<crs>EPSG:3832</crs>
</grid>
<supportedFormats>
<string>GIF</string>
<string>PNG</string>
<string>JPEG</string>
<string>TIFF</string>
<string>ImageMosaic</string>
<string>GRIB</string>
<string>ArcGrid</string>
<string>NetCDF</string>
<string>GEOTIFF</string>
<string>Gtopo30</string>
</supportedFormats>
<interpolationMethods>
<string>nearest neighbor</string>
<string>bilinear</string>
<string>bicubic</string>
</interpolationMethods>
<defaultInterpolationMethod>nearest neighbor</defaultInterpolationMethod>
<dimensions>
<coverageDimension>
<name>RED_BAND</name>
<description>GridSampleDimension[4.851844693347973E-33,4.851844693347973E-33]</description>
<range>
<min>0.0</min>
<max>0.0</max>
</range>
<nullValues>
<double>4.851844693347973E-33</double>
</nullValues>
<unit>W.m-2.Sr-1</unit>
<dimensionType>
<name>UNSIGNED_8BITS</name>
</dimensionType>
</coverageDimension>
<coverageDimension>
<name>GREEN_BAND</name>
<description>GridSampleDimension[4.851844693347973E-33,4.851844693347973E-33]</description>
<range>
<min>0.0</min>
<max>0.0</max>
</range>
<nullValues>
<double>4.851844693347973E-33</double>
</nullValues>
<unit>W.m-2.Sr-1</unit>
<dimensionType>
<name>UNSIGNED_8BITS</name>
</dimensionType>
</coverageDimension>
<coverageDimension>
<name>BLUE_BAND</name>
<description>GridSampleDimension[4.851844693347973E-33,4.851844693347973E-33]</description>
<range>
<min>0.0</min>
<max>0.0</max>
</range>
<nullValues>
<double>4.851844693347973E-33</double>
</nullValues>
<unit>W.m-2.Sr-1</unit>
<dimensionType>
<name>UNSIGNED_8BITS</name>
</dimensionType>
</coverageDimension>
</dimensions>
<requestSRS>
<string>EPSG:3832</string>
</requestSRS>
<responseSRS>
<string>EPSG:3832</string>
</responseSRS>
<parameters>
<entry>
<string>InputTransparentColor</string>
<null/>
</entry>
<entry>
<string>SUGGESTED_TILE_SIZE</string>
<string>512,512</string>
</entry>
</parameters>
<nativeCoverageName>test_NAT_3832</nativeCoverageName>
</coverage>
--
Peter Kovac
IMS Programmer
MicroStep-MIS
peter.kovac@anonymised.com