Opened 9 years ago
Closed 8 years ago
#12681 closed defect (fixed)
Imagery tiles adjacent to ±180° are not shown
Reported by: | Zverikk | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | 16.08 |
Component: | Core imagery | Version: | latest |
Keywords: | tiles, 180 degrees, regression, projection | Cc: | bastiK, wiktorn, michael2402 |
Description (last modified by )
- Start JOSM.
- Add an imagery layer (e.g. OpenStreetMap).
- Zoom out to z4, or just scroll to 180° east or west.
Tiles near the border are hidden. Even not adjacent: sometimes it's 3-4 columns of tiles.
This is clearly a regression.
Narrowed it down to r9558, a change in AbstractProjection#eastNorth2latlon.
Obviously wrapping of coordinates does not work wrt the viewport, since the center can be moved well off the map.
Attachments (0)
Change History (32)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
Description: | modified (diff) |
---|
comment:3 by , 9 years ago
Description: | modified (diff) |
---|
comment:4 by , 9 years ago
Keywords: | regression added |
---|
comment:5 by , 9 years ago
Cc: | added |
---|---|
Keywords: | projection added |
Milestone: | → 16.03 |
comment:6 by , 9 years ago
Milestone: | 16.03 → 16.04 |
---|
comment:8 by , 9 years ago
In TileSet(EastNorth topLeft, EastNorth botRight, int zoom) coordinates are converted from EastNorth to LatLon, then in line 1218 converted back to EastNorth (sort of). It should help to use the EastNorth coordinates directly for tile index calculation.
Edit: Would only work if current projection is set to Mercator.
comment:9 by , 9 years ago
That's my approach to this bug. Looks a bit dirty, but I do not have a better idea for now:
-
src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
diff --git src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java index 6467fe7..b934223 100644
implements ImageObserver, TileLoaderListener, ZoomChangeListener { 1222 1222 y0 = t1.getYIndex(); 1223 1223 x1 = t2.getXIndex(); 1224 1224 y1 = t2.getYIndex(); 1225 double centerLon = Main.getProjection().eastNorth2latlon(Main.map.mapView.getCenter()).lon(); 1226 1227 if (topLeft.lon() > centerLon) { 1228 x0 = tileSource.getTileXMin(zoom); 1229 } 1230 if (botRight.lon() < centerLon) { 1231 x1 = tileSource.getTileXMax(zoom); 1232 } 1225 1233 1226 1234 if (x0 > x1) { 1227 1235 int tmp = x0;
It checks, where the center of the map is pointing to, to detect, from which side we are getting close to 180 meridian. It still fails, if you zoom out, and the world map takes less than half a screen.
I guess that we could also drop the x0 and x1 switch, that comes just after newly added code.
Shall I commit?
follow-up: 11 comment:10 by , 9 years ago
Certainly an improvement.
Since there doesn't seem to be a proper way to fix this, I'm starting to doubt if r9558 was correct. On a 3D globe, 181 degrees and -179 degrees longitude are the same point, but on the screen they may correspond to two different points in projected screen coordinates.
comment:11 by , 9 years ago
Replying to bastiK:
Certainly an improvement.
Since there doesn't seem to be a proper way to fix this, I'm starting to doubt if r9558 was correct. On a 3D globe, 181 degrees and -179 degrees longitude are the same point, but on the screen they may correspond to two different points in projected screen coordinates.
Indeed, not limiting LatLon to -180,180 degrees within JOSM core, will simplify handling such situations. To show imageries across 180 meridian, we do need minor tweaks around TileSet and in TileSource.
So what do we do for this release?
comment:12 by , 9 years ago
I would prefer to do a possible revert of [9558] after the upcoming release.
As for the patch, I let you decide. :-)
comment:13 by , 9 years ago
Ok, I can commit the patch as I propose, but no sooner than this evening. It should be then rollback'ed together with [9558]
comment:15 by , 9 years ago
Milestone: | 16.04 → 16.05 |
---|
comment:18 by , 9 years ago
@bastiK, @Don-vip: will you be release'ing hotfix with this patch, or this will go with next release?
comment:19 by , 9 years ago
comment:22 by , 9 years ago
I think there is.
Start JOSM, open an empty layer and zoom to ~100 km. Scroll to a map edge.
Add a Bing imagery layer, wait for tiles to load and zoom in.
Now tiles are pixelated, so move inside the map bounds, for tiles to load.
Move to the map edge and back. You will see how tiles become pixelated again, and detailed when an edge is not visible.
comment:23 by , 9 years ago
There is also strange behavior when you zoom out till the end.
- When you reach the lowest zoomlevel and zoom out more it zooms in one step and then again out an in an so on (while always turning the mousewheel the same direction)
- When you move the map to the left or right the imagery disappears. You can see this especially in the low zoom levels since the half earth is missing then.
comment:24 by , 9 years ago
comment:26 by , 9 years ago
Milestone: | 16.06 → 16.07 |
---|
comment:30 by , 8 years ago
Milestone: | 16.07 → 16.08 |
---|
comment:32 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Milestone renamed