Opened 13 years ago
Closed 10 years ago
#7280 closed defect (wontfix)
Bing (unsuccessfully) loads images before attribution data is ready
Reported by: | bastiK | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core imagery | Version: | |
Keywords: | tms bing attribution | Cc: | madnag4u, wiktorn |
Description
After adding Bing layer, I get the following console output
failed loading 13/4246/2754 null failed loading 13/4248/2755 null failed loading 13/4247/2754 null failed loading 13/4246/2756 null failed loading 13/4248/2754 null failed loading 13/4247/2756 null failed loading 13/4246/2755 null failed loading 13/4247/2755 null failed loading 13/4249/2754 null failed loading 13/4249/2755 null failed loading 13/4250/2755 null failed loading 13/4250/2756 null failed loading 13/4250/2754 null failed loading 13/4248/2756 null failed loading 13/4249/2756 null Successfully loaded Bing attribution data.
This indicates, that JOSM tries to load images for Bing before the attribution data is fetched.
Attachments (0)
Change History (30)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Is this fixed? At the moment I get
Successfully loaded Bing attribution data. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded.
follow-up: 7 comment:3 by , 13 years ago
I thought this was fixed in [o27519].
This output makes no sense to me. Is this error reproducible with fresh settings?
comment:4 by , 13 years ago
Yes. I added some debugging output, maybe this helps?
console:
#####paint #####paint #####paint getAttribution() 0 start to get attribution getAttribution() 1 getAttribution() 2 getAttribution() 3 getAttribution() 4 getAttribution() 5 call1 call2 getAttribution() 6 TMSLayer: Successfully loaded Bing attribution data. call3 getAttribution()/TimeoutException 5 Bing: attribution data is not yet loaded. failed loading 10/552/329 null getAttribution()/TimeoutException 4 Bing: attribution data is not yet loaded. failed loading 10/552/328 null getAttribution()/TimeoutException 0 Bing: attribution data is not yet loaded. failed loading 10/548/329 null getAttribution()/TimeoutException 3 Bing: attribution data is not yet loaded. failed loading 10/552/327 null getAttribution()/TimeoutException 2 Bing: attribution data is not yet loaded. failed loading 10/548/327 null getAttribution()/TimeoutException 1 Bing: attribution data is not yet loaded. failed loading 10/548/328 null getAttribution()/TimeoutException 6 Bing: attribution data is not yet loaded. getAttribution() 7 getAttribution()/TimeoutException 7 Bing: attribution data is not yet loaded. getAttribution() 8 call4 getAttribution()/ret 8
-
src/org/openstreetmap/josm/gui/layer/TMSLayer.java
237 237 URL u = getAttributionUrl(); 238 238 UTFInputStreamReader in = UTFInputStreamReader.create(u.openStream(), "utf-8"); 239 239 String r = new Scanner(in).useDelimiter("\\A").next(); 240 System.out.println(" Successfully loaded Bing attribution data.");240 System.out.println("TMSLayer: Successfully loaded Bing attribution data."); 241 241 return r.getBytes("utf-8"); 242 242 } 243 243 } … … 248 248 249 249 @Override 250 250 public List<Attribution> call() throws Exception { 251 System.err.println("call1"); 252 251 253 BingAttributionData attributionLoader = new BingAttributionData(); 254 System.err.println("call2"); 252 255 int waitTimeSec = 1; 253 256 while (true) { 254 257 try { 255 258 String xml = attributionLoader.updateIfRequiredString(); 256 return parseAttributionText(new InputSource(new StringReader((xml)))); 259 System.err.println("call3"); 260 List<Attribution> ret = parseAttributionText(new InputSource(new StringReader((xml)))); 261 System.err.println("call4"); 262 return ret; 257 263 } catch (IOException ex) { 258 264 System.err.println("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds."); 259 265 Thread.sleep(waitTimeSec * 1000L); … … 1160 1166 */ 1161 1167 @Override 1162 1168 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 1169 System.err.println("### TMSLayer/paint"); 1163 1170 //long start = System.currentTimeMillis(); 1164 1171 EastNorth topLeft = mv.getEastNorth(0, 0); 1165 1172 EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight()); -
src/org/openstreetmap/josm/gui/MapView.java
460 460 * Draw the component. 461 461 */ 462 462 @Override public void paint(Graphics g) { 463 System.err.println("#####paint"); 463 464 if (BugReportExceptionHandler.exceptionHandlingInProgress()) 464 465 return;
-
jmapviewer/tilesources/BingAerialTileSource.java
214 214 } 215 215 }; 216 216 } 217 217 static int dd = 0; 218 218 protected List<Attribution> getAttribution() { 219 // Thread.currentThread().dumpStack(); 220 int d = dd++; 221 System.err.println("getAttribution() "+d); 219 222 if (attributions == null) { 220 223 // see http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html 221 224 synchronized (BingAerialTileSource.class) { 222 225 if (attributions == null) { 226 System.err.println("start to get attribution"); 223 227 attributions = Executors.newSingleThreadExecutor().submit(getAttributionLoaderCallable()); 224 228 } 225 229 } 226 230 } 227 231 try { 228 return attributions.get(1000, TimeUnit.MILLISECONDS); 232 List<Attribution> ret = attributions.get(1000, TimeUnit.MILLISECONDS); 233 System.err.println("getAttribution()/ret "+d); 234 return ret; 229 235 } catch (TimeoutException ex) { 236 System.err.println("getAttribution()/TimeoutException "+d); 230 237 System.err.println("Bing: attribution data is not yet loaded."); 231 238 } catch (ExecutionException ex) { 232 239 throw new RuntimeException(ex.getCause());
follow-up: 11 comment:6 by , 13 years ago
Interestingly, the parsing takes a "long" time (call3
to call4
).
To fix this, …:
- we could increase the timeout (from 1000 to e.g. 5000 milliseconds)
- change the console output:
Successfully loaded Bing attribution data --> Successfully fetched Bing attribution data
Bing: attribution data is not yet loaded --> Bing: attribution data is not yet ready
comment:7 by , 13 years ago
Replying to simon04:
I thought this was fixed in [o27519].
I can confirm this update fixed the problem on my config (I was seeing them almost every day but never took time to report the bug, as a zoom/unzoom was enough to reload missing tiles).
comment:8 by , 13 years ago
From #7284: skyper:
It seems to work but I get strange messages on the console:
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2012-01-30 02:32:23 Last Changed Author: stoecker Revision: 4878 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2012-01-30 00:02:54 +0100 (Mon, 30 Jan 2012) Last Changed Rev: 4878 Warnung: Fehlende Einstellungsdatei "$HOME/.josm/preferences.xml". Datei mit Standardeinstellungen wird erstellt. GET http://api.openstreetmap.org/api/capabilities... OK Successfully loaded Bing attribution data. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. GET http://api.openstreetmap.org/api/0.6/map?bbox=....
comment:9 by , 13 years ago
I still have this problem in r5402:
1. Download some OSM data of a given area 2. Add Bing layer 3. All tiles fail to load, and I can see on the console: Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Bing: attribution data is not yet loaded. Failed loading http://ecn.t2.tiles.virtualearth.net/tiles/a1202220232311021121.jpeg?g=1008: null Failed loading http://ecn.t1.tiles.virtualearth.net/tiles/a1202220232311021120.jpeg?g=1008: null Failed loading http://ecn.t0.tiles.virtualearth.net/tiles/a1202220232311021031.jpeg?g=1008: null Failed loading http://ecn.t1.tiles.virtualearth.net/tiles/a1202220232311021103.jpeg?g=1008: null Failed loading http://ecn.t2.tiles.virtualearth.net/tiles/a1202220232311021011.jpeg?g=1008: null Failed loading http://ecn.t0.tiles.virtualearth.net/tiles/a1202220232311021102.jpeg?g=1008: null Failed loading http://ecn.t0.tiles.virtualearth.net/tiles/a1202220232311021101.jpeg?g=1008: null Failed loading http://ecn.t3.tiles.virtualearth.net/tiles/a1202220232311021013.jpeg?g=1008: null Failed loading http://ecn.t1.tiles.virtualearth.net/tiles/a1202220232311021010.jpeg?g=1008: null Failed loading http://ecn.t2.tiles.virtualearth.net/tiles/a1202220232311021012.jpeg?g=1008: null Failed loading http://ecn.t3.tiles.virtualearth.net/tiles/a1202220232311021100.jpeg?g=1008: null Failed loading http://ecn.t3.tiles.virtualearth.net/tiles/a1202220232311021030.jpeg?g=1008: null
Restarting JOSM or refreshing the tiles solve the problem, I think it's maybe cache-related ?
follow-up: 13 comment:11 by , 13 years ago
Replying to simon04:
Interestingly, the parsing takes a "long" time (
call3
tocall4
).
Indeed. The method org.openstreetmap.gui.jmapviewer.tilesources.parseAttributionText()
takes more than 300ms to parse Bing attribution, this is way too long. Replacing all these Xpath expressions with a faster StaX parsing would reduce this time drastically.
comment:12 by , 13 years ago
follow-up: 14 comment:13 by , 13 years ago
Replying to Don-vip:
Replying to simon04:
Interestingly, the parsing takes a "long" time (
call3
tocall4
).
Indeed. The method
org.openstreetmap.gui.jmapviewer.tilesources.parseAttributionText()
takes more than 300ms to parse Bing attribution, this is way too long. Replacing all these Xpath expressions with a faster StaX parsing would reduce this time drastically.
Wow, that's is really slow for such a small document. Someone wrote a DOM parser in #6866, this might speed it up a little.
comment:14 by , 13 years ago
comment:17 by , 12 years ago
Component: | Core → Core imagery |
---|---|
Keywords: | attribution added |
comment:20 by , 12 years ago
Cc: | added |
---|
comment:21 by , 12 years ago
The reason for this issue is that load Bing attribution data (which contains the actual URL for accessing tiles) upon first usage of the layer. At the moment, there's a timeout set to 1 second for accessing the attribution data. If that cannot be fetched from bing.com
and parsed within this time, erroneous tiles will be displayed.
Possible fix: increase the timeout to say 10 seconds in BingAerialTileSource:231
comment:22 by , 11 years ago
I took a closer look into the code. The attribution for Bing actually contains 163 (!) entries:
Attribution: © 2012 DigitalGlobe z[14:21], lat[-67.0:27.0], lon[-179.99:0.0] Attribution: © 2012 DigitalGlobe z[14:21], lat[27.0:87.0], lon[-179.99:-126.5] Attribution: © 2012 DigitalGlobe z[14:21], lat[48.4:87.0], lon[-126.5:-5.75] Attribution: © 2012 DigitalGlobe z[14:21], lat[-67.0:86.5], lon[28.0:179.99] Attribution: © 2012 DigitalGlobe z[14:21], lat[-67.0:37.8], lon[0.0:28.0] Attribution: © 2012 DigitalGlobe z[14:21], lat[37.7:59.8], lon[18.5:28.0] Attribution: © 2012 DigitalGlobe z[14:21], lat[43.0:48.4], lon[-81.6:-10.0] Attribution: © 2012 DigitalGlobe z[14:21], lat[27.0:43.0], lon[-70.0:-10.0] Attribution: © 2012 DigitalGlobe z[14:21], lat[27.0:35.8], lon[-10.0:0.0] Attribution: © 2012 DigitalGlobe z[14:21], lat[27.0:32.3], lon[-120.0:-105.8] Attribution: © 2012 DigitalGlobe z[14:21], lat[43.4:54.9], lon[13.78:18.5] Attribution: Image courtesy of NASA z[1:8], lat[-90.0:90.0], lon[-180.0:180.0] Attribution: © Harris Corp, Earthstar Geographics LLC z[9:13], lat[-90.0:90.0], lon[-180.0:180.0] Attribution: Image courtesy of USGS z[14:17], lat[17.99:61.39], lon[-150.11:-65.57] Attribution: © Getmapping plc z[14:21], lat[49.94:60.17], lon[-6.82:1.78] Attribution: © 2012 GeoEye z[14:21], lat[48.95:65.5], lon[-152.0:-95.4] Attribution: © 2012 GeoEye z[14:21], lat[45.15:48.9], lon[-73.2:-70.2] Attribution: © 2012 GeoEye z[14:21], lat[31.87:49.0], lon[-67.56:-50.46] Attribution: © 2012 GeoEye z[14:21], lat[-23.0:30.0], lon[-180.0:-145.0] Attribution: © 2012 GeoEye z[14:21], lat[-37.7:26.5], lon[-110.0:-33.0] Attribution: © 2012 GeoEye z[14:21], lat[-46.0:67.0], lon[-20.0:180.0] Attribution: © 2012 Pasco z[14:21], lat[23.5:46.65], lon[122.5:151.66] Attribution: © GeoContent / (p) Intergraph z[14:21], lat[47.0:55.5], lon[5.0:16.0] Attribution: © GeoContent / (p) Intergraph z[14:21], lat[46.25:49.2], lon[9.4:17.3] Attribution: © 2012 Intermap z[1:21], lat[49.0:60.0], lon[-11.0:2.0] Attribution: Image courtesy of the IndianaMap z[14:21], lat[37.7:41.9], lon[-88.2:-84.7] Attribution: Image courtesy of the Nevada State Mapping Advisory Committee z[14:21], lat[34.85:42.12], lon[-120.2:-113.91] Attribution: © 2012 InterAtlas z[14:21], lat[48.37:49.28], lon[1.4:3.37] Attribution: © 2012 InterAtlas z[14:21], lat[47.72:48.05], lon[1.67:2.18] Attribution: © 2012 InterAtlas z[14:21], lat[45.55:45.95], lon[4.57:5.33] Attribution: © 2012 InterAtlas z[14:21], lat[43.18:43.77], lon[4.92:5.82] Attribution: © 2012 Eurosense z[14:21], lat[51.0:53.65], lon[3.0:7.67] Attribution: © 2012 Eurosense z[14:21], lat[50.58:51.0], lon[5.42:5.47] Attribution: © 2012 IGP z[14:21], lat[36.88:42.27], lon[-9.6:-6.0] Attribution: © 2012 IGN z[14:21], lat[42.0:51.25], lon[-5.0:8.5] Attribution: © 2012 IGN z[14:21], lat[41.25:43.1], lon[8.3:9.65] Attribution: © 2012 IGN z[14:21], lat[17.85:18.15], lon[-63.17:-62.77] Attribution: © 2012 IGN z[14:21], lat[15.75:16.55], lon[-61.9:-60.9] Attribution: © 2012 IGN z[14:21], lat[14.35:14.95], lon[-61.25:-60.75] Attribution: © 2012 IGN z[14:21], lat[2.25:6.0], lon[-54.65:-51.4] Attribution: © 2012 IGN z[14:21], lat[-21.5:-20.75], lon[55.0:56.0] Attribution: © 2012 IGN z[14:21], lat[46.7:47.2], lon[-56.5:-56.1] Attribution: © Province of British Columbia z[14:18], lat[48.99:60.0], lon[-139.05:-114.05] Attribution: © 2012 Blom z[14:21], lat[36.1:51.04], lon[-9.51:11.67] Attribution: © 2012 Blom z[14:21], lat[55.69:61.17], lon[9.8:13.23] Attribution: © 2012 Blom z[14:21], lat[62.2:62.24], lon[25.82:25.89] Attribution: © 2012 Aerials Express z[14:21], lat[34.63:35.52], lon[-90.41:-89.48] Attribution: Image courtesy of LAR-IAC z[14:21], lat[33.27:34.9], lon[-119.02:-117.59] Attribution: Image courtesy of ImagePatch.com z[14:21], lat[25.74:36.63], lon[-106.76:-93.97] Attribution: Image courtesy of ImagePatch.com z[14:21], lat[34.36:35.44], lon[-93.14:-92.0] Attribution: State of Michigan z[14:21], lat[41.68:45.89], lon[-86.87:-82.91] Attribution: Earthstar Geographics SIO z[1:8], lat[-90.0:90.0], lon[-180.0:180.0] Attribution: Earthstar Geographics SIO z[10:13], lat[70.61:71.52], lon[78.75:81.56] Attribution: Earthstar Geographics SIO z[10:13], lat[68.66:69.66], lon[135.0:137.81] Attribution: Earthstar Geographics SIO z[10:13], lat[67.61:68.66], lon[171.56:174.38] Attribution: Earthstar Geographics SIO z[10:13], lat[67.61:68.66], lon[70.31:73.13] Attribution: Earthstar Geographics SIO z[10:13], lat[66.51:67.61], lon[-180.0:-177.19] Attribution: Earthstar Geographics SIO z[10:13], lat[65.37:66.51], lon[36.56:39.38] Attribution: Earthstar Geographics SIO z[10:13], lat[64.17:65.37], lon[-171.56:-168.75] Attribution: Earthstar Geographics SIO z[10:13], lat[54.16:55.78], lon[-70.31:-67.5] Attribution: Earthstar Geographics SIO z[10:13], lat[52.48:65.37], lon[-180.0:-163.13] Attribution: Earthstar Geographics SIO z[10:13], lat[47.04:58.81], lon[140.63:154.69] Attribution: Earthstar Geographics SIO z[10:13], lat[36.6:40.98], lon[132.19:137.81] Attribution: Earthstar Geographics SIO z[10:13], lat[31.95:34.31], lon[64.69:67.5] Attribution: Earthstar Geographics SIO z[10:13], lat[31.95:34.31], lon[28.13:33.75] Attribution: Earthstar Geographics SIO z[10:13], lat[31.95:38.82], lon[16.88:19.69] Attribution: Earthstar Geographics SIO z[10:13], lat[29.54:31.95], lon[61.88:64.69] Attribution: Earthstar Geographics SIO z[10:13], lat[27.06:31.95], lon[123.75:129.38] Attribution: Earthstar Geographics SIO z[10:13], lat[24.53:27.06], lon[2.81:5.63] Attribution: Earthstar Geographics SIO z[10:13], lat[19.31:27.06], lon[16.88:22.5] Attribution: Earthstar Geographics SIO z[10:13], lat[19.31:27.06], lon[-8.44:-2.81] Attribution: Earthstar Geographics SIO z[10:13], lat[19.31:29.54], lon[-95.63:-84.38] Attribution: Earthstar Geographics SIO z[10:13], lat[16.64:19.31], lon[-87.19:-81.56] Attribution: Earthstar Geographics SIO z[10:13], lat[11.18:16.64], lon[-81.56:-61.88] Attribution: Earthstar Geographics SIO z[10:13], lat[5.62:21.94], lon[106.88:118.13] Attribution: Earthstar Geographics SIO z[10:13], lat[-11.18:-8.41], lon[143.44:146.25] Attribution: Earthstar Geographics SIO z[10:13], lat[-13.92:-11.18], lon[177.19:180.0] Attribution: Earthstar Geographics SIO z[10:13], lat[-13.92:-11.18], lon[137.81:140.63] Attribution: Earthstar Geographics SIO z[10:13], lat[-85.05:85.05], lon[-180.0:180.0] Attribution: Earthstar Geographics SIO z[10:17], lat[76.18:77.47], lon[67.5:70.31] Attribution: Earthstar Geographics SIO z[10:17], lat[74.02:75.5], lon[59.06:61.88] Attribution: Earthstar Geographics SIO z[10:17], lat[71.52:73.23], lon[118.13:120.94] Attribution: Earthstar Geographics SIO z[10:17], lat[70.61:71.52], lon[154.69:157.5] Attribution: Earthstar Geographics SIO z[10:17], lat[70.61:72.4], lon[146.25:151.88] Attribution: Earthstar Geographics SIO z[10:17], lat[70.61:74.78], lon[50.63:56.25] Attribution: Earthstar Geographics SIO z[10:17], lat[70.61:71.52], lon[-11.25:-5.63] Attribution: Earthstar Geographics SIO z[10:17], lat[70.61:72.4], lon[-180.0:-177.19] Attribution: Earthstar Geographics SIO z[10:17], lat[67.61:69.66], lon[-180.0:-177.19] Attribution: Earthstar Geographics SIO z[10:17], lat[62.92:67.61], lon[-25.31:-11.25] Attribution: Earthstar Geographics SIO z[10:17], lat[62.92:70.61], lon[-56.25:-50.63] Attribution: Earthstar Geographics SIO z[10:17], lat[62.92:64.17], lon[-70.31:-67.5] Attribution: Earthstar Geographics SIO z[10:17], lat[58.81:61.61], lon[-47.81:-42.19] Attribution: Earthstar Geographics SIO z[10:17], lat[52.48:54.16], lon[171.56:174.38] Attribution: Earthstar Geographics SIO z[10:17], lat[50.74:54.16], lon[0.0:5.63] Attribution: Earthstar Geographics SIO z[10:17], lat[47.04:61.61], lon[-11.25:0.0] Attribution: Earthstar Geographics SIO z[10:17], lat[38.82:40.98], lon[-33.75:-30.94] Attribution: Earthstar Geographics SIO z[10:17], lat[38.82:40.98], lon[-73.13:-70.31] Attribution: Earthstar Geographics SIO z[10:17], lat[36.6:45.09], lon[-11.25:-2.81] Attribution: Earthstar Geographics SIO z[10:17], lat[36.6:40.98], lon[-30.94:-22.5] Attribution: Earthstar Geographics SIO z[10:17], lat[34.31:38.82], lon[-75.94:-73.13] Attribution: Earthstar Geographics SIO z[10:17], lat[34.31:36.6], lon[-123.75:-120.94] Attribution: Earthstar Geographics SIO z[10:17], lat[31.95:34.31], lon[-67.5:-64.69] Attribution: Earthstar Geographics SIO z[10:17], lat[31.95:34.31], lon[-78.75:-75.94] Attribution: Earthstar Geographics SIO z[10:17], lat[31.95:34.31], lon[-120.94:-118.13] Attribution: Earthstar Geographics SIO z[10:17], lat[27.06:29.54], lon[-95.63:-87.19] Attribution: Earthstar Geographics SIO z[10:17], lat[27.06:29.54], lon[-180.0:-177.19] Attribution: Earthstar Geographics SIO z[10:17], lat[24.53:27.06], lon[-174.38:-171.56] Attribution: Earthstar Geographics SIO z[10:17], lat[16.64:24.53], lon[-163.13:-154.69] Attribution: Earthstar Geographics SIO z[10:17], lat[13.92:19.31], lon[-25.31:-22.5] Attribution: Earthstar Geographics SIO z[10:17], lat[13.92:19.31], lon[-171.56:-168.75] Attribution: Earthstar Geographics SIO z[10:17], lat[11.18:21.94], lon[143.44:146.25] Attribution: Earthstar Geographics SIO z[10:17], lat[8.41:11.18], lon[137.81:140.63] Attribution: Earthstar Geographics SIO z[10:17], lat[8.41:11.18], lon[-109.69:-106.88] Attribution: Earthstar Geographics SIO z[10:17], lat[5.62:8.41], lon[157.5:160.31] Attribution: Earthstar Geographics SIO z[10:17], lat[5.62:11.18], lon[149.06:154.69] Attribution: Earthstar Geographics SIO z[10:17], lat[5.62:8.41], lon[132.19:135.0] Attribution: Earthstar Geographics SIO z[10:17], lat[0.0:2.81], lon[-177.19:-174.38] Attribution: Earthstar Geographics SIO z[10:17], lat[-2.81:0.0], lon[165.94:168.75] Attribution: Earthstar Geographics SIO z[10:17], lat[-2.81:2.81], lon[-92.81:-87.19] Attribution: Earthstar Geographics SIO z[10:17], lat[-2.81:8.41], lon[-163.13:-154.69] Attribution: Earthstar Geographics SIO z[10:17], lat[-5.62:-2.81], lon[53.44:56.25] Attribution: Earthstar Geographics SIO z[10:17], lat[-8.41:-5.62], lon[70.31:73.13] Attribution: Earthstar Geographics SIO z[10:17], lat[-11.18:21.94], lon[160.31:180.0] Attribution: Earthstar Geographics SIO z[10:17], lat[-11.18:-5.62], lon[-140.63:-137.81] Attribution: Earthstar Geographics SIO z[10:17], lat[-13.92:-11.18], lon[174.38:177.19] Attribution: Earthstar Geographics SIO z[10:17], lat[-13.92:-11.18], lon[95.63:98.44] Attribution: Earthstar Geographics SIO z[10:17], lat[-16.64:-13.92], lon[-8.44:-5.63] Attribution: Earthstar Geographics SIO z[10:17], lat[-19.31:-13.92], lon[-154.69:-140.63] Attribution: Earthstar Geographics SIO z[10:17], lat[-21.94:-13.92], lon[174.38:180.0] Attribution: Earthstar Geographics SIO z[10:17], lat[-21.94:-19.31], lon[61.88:64.69] Attribution: Earthstar Geographics SIO z[10:17], lat[-21.94:-19.31], lon[53.44:59.06] Attribution: Earthstar Geographics SIO z[10:17], lat[-24.53:-19.31], lon[-140.63:-132.19] Attribution: Earthstar Geographics SIO z[10:17], lat[38.82:71.52], lon[-180.0:-50.63] Attribution: Earthstar Geographics SIO z[10:17], lat[-24.53:-21.94], lon[-151.88:-146.25] Attribution: Earthstar Geographics SIO z[10:17], lat[-24.53:-16.64], lon[-160.31:-157.5] Attribution: Earthstar Geographics SIO z[10:17], lat[-24.53:0.0], lon[-180.0:-160.31] Attribution: Earthstar Geographics SIO z[10:17], lat[-27.06:-24.53], lon[-81.56:-78.75] Attribution: Earthstar Geographics SIO z[10:17], lat[-27.06:-21.94], lon[-132.19:-126.56] Attribution: Earthstar Geographics SIO z[10:17], lat[-29.54:-27.06], lon[165.94:168.75] Attribution: Earthstar Geographics SIO z[10:17], lat[-29.54:-24.53], lon[-109.69:-106.88] Attribution: Earthstar Geographics SIO z[10:17], lat[-29.54:-27.06], lon[-146.25:-143.44] Attribution: Earthstar Geographics SIO z[10:17], lat[-31.95:-29.54], lon[157.5:160.31] Attribution: Earthstar Geographics SIO z[10:17], lat[-34.31:-31.95], lon[-81.56:-78.75] Attribution: Earthstar Geographics SIO z[10:17], lat[-45.09:74.02], lon[-19.69:180.0] Attribution: Earthstar Geographics SIO z[10:17], lat[-45.09:-43.07], lon[-177.19:-174.38] Attribution: Earthstar Geographics SIO z[10:17], lat[-47.04:-45.09], lon[50.63:53.44] Attribution: Earthstar Geographics SIO z[10:17], lat[-47.04:-45.09], lon[36.56:39.38] Attribution: Earthstar Geographics SIO z[10:17], lat[-48.92:-47.04], lon[177.19:180.0] Attribution: Earthstar Geographics SIO z[10:17], lat[-50.74:-47.04], lon[67.5:73.13] Attribution: Earthstar Geographics SIO z[10:17], lat[-54.16:-34.31], lon[165.94:180.0] Attribution: Earthstar Geographics SIO z[10:17], lat[-54.16:-52.48], lon[73.13:75.94] Attribution: Earthstar Geographics SIO z[10:17], lat[-54.16:-50.74], lon[-61.88:-56.25] Attribution: Earthstar Geographics SIO z[10:17], lat[-55.78:-54.16], lon[157.5:160.31] Attribution: Earthstar Geographics SIO z[10:17], lat[-55.78:-52.48], lon[-39.38:-33.75] Attribution: Earthstar Geographics SIO z[10:17], lat[-57.33:31.95], lon[-120.94:-30.94] Attribution: Earthstar Geographics SIO z[10:17], lat[-58.81:-57.33], lon[-28.13:-25.31] Attribution: Earthstar Geographics SIO z[10:17], lat[-61.61:-60.24], lon[-47.81:-42.19] Attribution: © 2012 DigitalGlobe z[10:17], lat[47.04:48.92], lon[67.5:70.31] Attribution: © 2012 DigitalGlobe z[10:17], lat[21.94:24.53], lon[45.0:47.81] Attribution: © 2012 DigitalGlobe z[10:17], lat[-19.31:-16.64], lon[14.06:16.88] Attribution: © 2012 DigitalGlobe z[10:17], lat[-38.82:-36.6], lon[-64.69:-61.88] Attribution: © 2012 DigitalGlobe z[10:17], lat[-47.04:-45.09], lon[-70.31:-67.5] Attribution: © 2014 Microsoft Corporation z[1:21], lat[-90.0:90.0], lon[-180.0:180.0]
Raising the timeout just fights the symptoms. What happens if Microsoft add tomorrow another 1000 or 10000 attributions? They can only define "rectangular" boundaries.
But why not being pragmatic: Why don't we cache the attribution file like we did with the tiles?
The code could look like this (pseudo code):
// first try to read cached data (new) if (cachedfile.exists()) { // we have valid attribution data, so we must wait for parsing finished - no matter how long it takes set timeout to infinite; try { load cachedfile; } catch Exception { set timeout to default } } else { // we have initially an empty attribution list (this is the actual behaviour) set timeout to default } // try to get attribution data from bing.com (as today); if (successfully downloaded and parsed) { replace the initial list with the loaded data (as today); store new (and valid) attribution data in cache (new); }
What are the differences compared with actual behaviour?
- If no attribution data is cached (first time ever using Bing imagery), nothing will change.
- If we have cached attribution data, this data is used for the first tiles (this will also speed up showing the first tiles). Now it doesn’t matter how long it takes to download and parse the actual attribution data. When this task is finished, he just replace the list used by getAttribution().
- Normally this will result in using old attribution data only for the first few tiles, which is not really a problem, I think.
- If bing.com can deliver tiles, but no attribution data, we use the old attribution data for a little bit longer. But I think the attribution is normally not very volatile, so we have a good chance to use the correct attribution anyway.
- if bing.com can't deliver tiles, it dosen't matter if we have attribution data.
comment:24 by , 10 years ago
Any plans to fix this? If I understand correct, simply change the timeout number would not be the best slution, but would help a lot and has no real disadvantage. Why not just do this? I always first zoom out before I add the bing layer and then zoom in again. That's not fun :)
comment:25 by , 10 years ago
I remember that in the past I had even more problems but a proxy did help. E.g. this is often a question of routing and bandwidth.
Increasing the timeout will force everyone to wait longer. Think caching the attributes for some time and have a background check would be a solution.
comment:26 by , 10 years ago
I thought the timeout is olny the maximum time. If the attribution is loaded earlier, the tiles start to load already. Is this wrong?
comment:27 by , 10 years ago
I thought the timeout is olny the maximum time.
Yes.
Any concerns with …?
-
jmapviewer/tilesources/BingAerialTileSource.java
254 254 } 255 255 } 256 256 try { 257 return attributions.get(1 000, TimeUnit.MILLISECONDS);257 return attributions.get(1, TimeUnit.MINUTES); 258 258 } catch (TimeoutException ex) { 259 259 System.err.println("Bing: attribution data is not yet loaded."); 260 260 } catch (ExecutionException ex) {
comment:29 by , 10 years ago
Replying to simon04:
This should be fixed with r8714, right?
Not exactly this case. I've shrotened the timeout that you've mentioned above, but the timeout on attribution load is more connected with socket.timeout.read
. In r8714 it is only repaint after attribution load.
But my gut feeling is just not to fix this case. There should be nothing wrong in trying to load the tiles before attribution is loaded.
comment:30 by , 10 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I'm closing this, as with r8714 loading of the tiles before attribution is loaded doesn't affect JOSM performance.
One reason this was not reported ealier is that the attributions are loaded when opening the download dialog (#7284).