TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.18k stars 362 forks source link

Enhancing ERDDAP's WMS to work better with TerriaJS #2437

Closed rsignell-usgs closed 7 years ago

rsignell-usgs commented 7 years ago

I'd like to help make the ERDDAP WMS service work more effectively with TerriaJS. An example ERDDAP WMS GetCapabilities request is: http://coastwatch.pfeg.noaa.gov/erddap/wms/NWW3_Global_Best/request?service=WMS&request=GetCapabilities&version=1.3.0

A few things so far seem to be:

2017-03-18_13-27-49

This last one I'm not sure is an ERDDAP bug, so I'm asking here before reporting. Could this be a TerriaJS issue?

Does anyone know why half the globe is showing no data in TerriaJS?

This URL should bring up the WMS in question in TerriaJS: http://tinyurl.com/l8pwcsh

kring commented 7 years ago

The problem with the layer showing on only half the world is caused by this bit in GetCapabilities:

        <EX_GeographicBoundingBox>
          <westBoundLongitude>0.0</westBoundLongitude>
          <eastBoundLongitude>359.5</eastBoundLongitude>
          <southBoundLatitude>-77.5</southBoundLatitude>
          <northBoundLatitude>77.5</northBoundLatitude>
        </EX_GeographicBoundingBox>

Notice that the eastLongitude is 359.5 instead of being in the usual -180 to 180 range. I can't say after reading the WMS spec that this is definitely invalid, but it's certainly unusual. We could teach TerriaJS how to deal with it if necessary, though.

rsignell-usgs commented 7 years ago

@kring, I think TerriaJS needs to support longitude [0-360] as well.

This isn't exactly the spec, but on the OGC page http://cite.opengeospatial.org/OGCTestData/wms/1.1.1/spec/wms1.1.1.html, it says:

In the particular case of longitude, the following behavior may apply regarding the anti-meridian at 180 degrees of longitude. There is a legitimate desire for maps that span the anti-meridian (for example, a map centered on the Pacific Ocean). However, a strict interpretation of the previous paragraph suggests that areas beyond 180 degrees should be shown as empty content; this corresponds to the STRICT constraint below. A server may choose to relax this behavior by instead applying the LOOSE constraint below. If minx is the west-most longitude in degrees and maxx is the east-most, then:

STRICT longitude constraint (default): -180 <= minx < maxx <= 180

LOOSE longitude constraint (optional): -180 <= minx < maxx < minx + 360 < 540

Example 1. Earth centered at Greenwich minx=-180, maxx=180

Example 2. Earth with Greenwich at left edge minx=0, maxx=360

Example 3. Pacific Ocean minx=120, maxx=250

rsignell-usgs commented 7 years ago

Closing this in favor of https://github.com/TerriaJS/terriajs/issues/2451