Ticket #2754 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

WMS tiles not loading when map region crossing international date line(IDL)

Reported by: Senthil Owned by: euzuro
Priority: critical Milestone: 2.11 Release
Component: Layer Version: 2.9
Keywords: Cc: senthil
State: Review

Description

I used Openlayers to load the map with GeoServer & GeoWebcache. Initially loaded layers to New Zealand region and then moved map to IDL(International date line) where longitude changes from +ve to -ve. Suddenly layers got missing even though base map showing part of New Zealand.

I did some further investigation to findout any issues with geoserver/geowebcache and finally with WMS Inspector plugin, i was able to see parameters passed by OpenLayers to backend, which confirmed the issue with OpenLayers.

Here some settings used to create OpenLayers Map: maxExtent: new OpenLayers.Bounds(-2.003750834E7,-2.003750834E7,2.003750834E7,2.003750834E7)

For example: And When used in zoom level 6, i was able to 42 WMS tile requests to GeoWebcache (7 latitute divisions * 6 longitude divisions) which has longitude parameters between 1.69...E7 to 2.003..E7 range (SRID 900913) even though visible map has 1.821..E7 to -1.990..E7 longitudes.

And when moved map to load more from -ve of longitude and found less number of tile requests such as 28 requests (7 latitute divisions * 4 longitude divisions).. Once center line move to -ve longitude area, it was totally loading on -ve longitude region tiles..

Bug in the tile parameter calculations. I may try to find more details/patch, Hope that openlayers development team could able give more details on fixes sooner.

Attachments

2754.patch Download (0.6 KB) - added by senthil 4 years ago.

Change History

  Changed 4 years ago by ahocevar

  • state set to Awaiting User Feedback

Have you tried to use the layer's  wrapDateLine option?

  Changed 4 years ago by ahocevar

Also see the  wrapDateLine.html example.

  Changed 4 years ago by Senthil

Thanks for details and i tried that. It made some thing better than earlier.. but did not solve the issue completely.

I'm using OpenLayers.Layer.Google as base layer and set the wrapDateLine option to that and then my overlays as OpenLayers.Layer.WMS and set to that as well. Backend GeoServer/GeoWebcache.

Now i have seen that +ve longtitude layers didn't disappear when move to -ve. That is great thing with fixes for #487

but, i noticed that part of the layer covered island next to new zealand was get missing at some point (the island which lays in -ve longtitude and note that dateline was not linear in that area). It happens when center of the visible map move +ve, it did not consider -ve part to load.

The fix could be triggered when center is -ve only. Not consider when center of map is +ve and map has visible areas of +ve and -ve.

  Changed 4 years ago by Senthil

  • state changed from Awaiting User Feedback to Needs Discussion

Changed state to "Needs Discussion"

  Changed 4 years ago by Senthil

  • state changed from Needs Discussion to Review

follow-up: ↓ 7   Changed 4 years ago by Senthil

Any updates from OpenLayers development team for possible fixes/workaround?

The layer getting missing when move towards to -ve longtitude from +ve for Chatham Islands which next to New Zealand..

Thanks

in reply to: ↑ 6   Changed 4 years ago by Senthil

Correction:

The layer covers Chatham Islands which next to New Zealand, only visible when center of map is -ve longtitude. This can be easily noticed when drag the map from +ve to -ve.

Replying to Senthil:

Any updates from OpenLayers development team for possible fixes/workaround? The layer getting missing when move towards to -ve longtitude from +ve for Chatham Islands which next to New Zealand.. Thanks

  Changed 4 years ago by crschmidt

  • state Review deleted

Speaking as an OpenLayers developer, I'm not aware of anyone currently working on this issue. Dropping 'review' keyword, as that is for review of existing patches.

  Changed 4 years ago by fredj

  • milestone changed from 2.9.1 Release to 2.11 Release

No patch, bumping.

  Changed 4 years ago by Senthil

found workaround for the issue, not sure any fixes needed in openlayers.

Changes done in GeoServer: Added bounds box, max X coordinates to 185 (instead of 180)

The above changes enabled to load the tiles continously however missing vector data in that tile(Chatham islands data). When i used latest GeoServer 2.1 (Snapshot/beta 1), it was creating correct tile for the layer and which loaded properly with openlayers.

  Changed 4 years ago by senthil

  • cc senthil added
  • owner set to euzuro
  • state set to Review
  • component changed from Tile.WFS to Layer
  • priority changed from minor to critical

Finally i got chance to spent time on this issue as earlier workaround did not work well with GWC & geoserver layergroup.

Root cause of this issue in Openlayers wrapDateLine fix which not considered tolerance value for both sides.

I modified the Layer.js (line 1292) code segment

if (this.wrapDateLine) {

// wrap around the date line, within the limits of rounding error var wrappingOptions = {

'rightTolerance':this.getResolution()

}; bounds = bounds.wrapDateLine(this.maxExtent, wrappingOptions);

}

As below:

if (this.wrapDateLine) {

// wrap around the date line, within the limits of rounding error var wrappingOptions = {

'rightTolerance':this.getResolution(), 'leftTolerance':this.getResolution()

}; bounds = bounds.wrapDateLine(this.maxExtent, wrappingOptions);

}

Then it works fine. Pls include this fix to next release as prefer to use realase version as it helps to get other fixes and new features.

  Changed 4 years ago by senthil

  • type changed from feature to bug

Changed 4 years ago by senthil

  Changed 4 years ago by senthil

  • state Review deleted

  Changed 4 years ago by senthil

  • state set to Review

  Changed 3 years ago by crschmidt

  • status changed from new to closed
  • resolution set to fixed

(In [11708]) When using wrapDateLine, pass both a rightTolerance and a leftTolerance at the Layer level. This is fix a report from a user: "WMS tiles not loading when map region crossing international date line(IDL)". All tests continue to pass, and the lack of this tolerance here seems clear enough given the surrounding code. Thanks to senthil for the patch, (Closes #2754)

Note: See TracTickets for help on using tickets.