Modify

Opened 8 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 Zverikk)

  1. Start JOSM.
  2. Add an imagery layer (e.g. OpenStreetMap).
  3. 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 Zverikk, 8 years ago

Description: modified (diff)

comment:2 by Zverikk, 8 years ago

Description: modified (diff)

comment:3 by Zverikk, 8 years ago

Description: modified (diff)

comment:4 by Klumbumbus, 8 years ago

Keywords: regression added

comment:5 by Don-vip, 8 years ago

Cc: bastiK wiktorn added
Keywords: projection added
Milestone: 16.03

comment:6 by Don-vip, 8 years ago

Milestone: 16.0316.04

Milestone renamed

comment:7 by Don-vip, 8 years ago

@bastiK: do you know how to fix this?

comment:8 by bastiK, 8 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.

Last edited 8 years ago by bastiK (previous) (diff)

comment:9 by wiktorn, 8 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 {  
    12221222            y0 = t1.getYIndex();
    12231223            x1 = t2.getXIndex();
    12241224            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            }
    12251233
    12261234            if (x0 > x1) {
    12271235                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?

comment:10 by bastiK, 8 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.

Last edited 8 years ago by bastiK (previous) (diff)

in reply to:  10 comment:11 by wiktorn, 8 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 bastiK, 8 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 wiktorn, 8 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:14 by wiktorn, 8 years ago

In 10155/josm:

Temporary fix for #12681.

Check, from which side we are approaching 180 meridian and use min/max X tile as index.

During planned rollback of [9558] this change should be also removed

See: #12681

comment:15 by wiktorn, 8 years ago

Milestone: 16.0416.05

comment:16 by bastiK, 8 years ago

[10155] caused a regression, see #12810.

comment:17 by wiktorn, 8 years ago

In 10167/josm:

Fix for large imagery offsets.

See: #12681
Closes: #12810

comment:18 by wiktorn, 8 years ago

@bastiK, @Don-vip: will you be release'ing hotfix with this patch, or this will go with next release?

comment:19 by bastiK, 8 years ago

I don't think a hotfix is needed specifically for #12810. But with [10166] pressing for Java 8 switch and other bugfixes it may be a good idea to update the tested version once more. Vincent, any opinion?

comment:20 by bastiK, 8 years ago

Updated tested to r10168.

comment:21 by Don-vip, 8 years ago

is this ticket fixed, or is there still something to do?

comment:22 by Zverikk, 8 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 Klumbumbus, 8 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.

in reply to:  21 comment:24 by wiktorn, 8 years ago

Replying to Don-vip:

is this ticket fixed, or is there still something to do?

Proper fix, that @bastiK mentioned.

bastiK:

I would prefer to do a possible revert of [9558] after the upcoming release.

I'm not sure, if reverting [9558] should be followed by some other changes.

comment:25 by Don-vip, 8 years ago

Milestone: 16.0516.06

ok let's do it for next release then.

comment:26 by Don-vip, 8 years ago

Milestone: 16.0616.07

comment:27 by wiktorn, 8 years ago

In 10534/josm:

Do not use 180 meridian hack when drawing tiles from different zoom

  • 180 meridian hack works improperly, when tileset doesn't cover whole screen. In case when we are creating small tilesets, we do not execute the hack
  • always load placeholder tile if the tile is not loaded
  • use shifted LatLon when computing the tileset for tiles from different zoom level

See: #12681
Closes: #13147

comment:28 by Don-vip, 8 years ago

Cc: michael2402 added

is it fixed?

comment:29 by michael2402, 8 years ago

No, the problem is still there in the current version.

comment:30 by Don-vip, 8 years ago

Milestone: 16.0716.08

comment:31 by michael2402, 8 years ago

A fix is contained in the patch of #13287

comment:32 by Don-vip, 8 years ago

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.