#11255 closed enhancement (fixed)
[PATCH] Tiling approach to WMS layers
Reported by: | wiktorn | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 15.08 |
Component: | Core imagery | Version: | latest |
Keywords: | WMS | Cc: | bastiK |
Description
Currently, WMS layers has it's own tiling mechanism and it's own cache mechanism, which - in my opinion is apparently less robust than TMS layer. TMS layer has a mechanisms to use tiles from different zoom level to draw current zoom level, if they are available.
I did some Proof Of Concept, where I implemented WMS layer as extension of TMS layer, which overrides the TileSource class and implemented there conversion from tile numbers to X,Y for WMS:
EastNorth ne_en = Main.getProjection().latlon2eastNorth(new LatLon(tileYToLat(tiley, zoom), tileXToLon(tilex+1, zoom))); EastNorth sw_en = Main.getProjection().latlon2eastNorth(new LatLon(tileYToLat(tiley+1, zoom), tileXToLon(tilex, zoom)));
If we would go this way, we could leverage the same cache mechanisms as for TMS, get far more better caching (as we are always requesting the same bbox'es).
This could also be a step forward to support WMTS imagery.
Shall I continue working on such patch, or there is some functionality that I'm not aware of, that we will be missing with this approach
Attachments (1)
Change History (18)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Agree with stoecker, it would be fine if the default mode (auto-zoom) was using TMS zoom levels. But some users may want to request images at a specific scale.
follow-up: 4 comment:3 by , 10 years ago
I'm not sure if I'm following you. You mean that user might select arbitrary PixelPerDegree to work with? How do I achieve it right now?
As I understand, right now we can lock the zoom level on WMS layer, but still - it was one of PPD, that JOSM provided. If I would honour maxzoom specification the same way as for TMS and add no-auto-zoom functionality, as it is now for WMS - would it be sufficient?
comment:4 by , 10 years ago
Replying to wiktorn:
I'm not sure if I'm following you. You mean that user might select arbitrary PixelPerDegree to work with? How do I achieve it right now?
Turn off auto-zoom, zoom to a specific zoom-depth and right click on the layer and select zoom level readjustment.
follow-up: 6 comment:5 by , 10 years ago
So as far as I checked, WMS layer has 2x more zoom levels as TMS.
But to make progress in small steps, I'd like to start with implementing auto-zoom toggle and zoom level readjustment in TMS, once this is ready and works as expected, then I'd introduce the change to make WMS layer as extension of TMS layer.
follow-up: 7 comment:6 by , 10 years ago
Replying to wiktorn:
So as far as I checked, WMS layer has 2x more zoom levels as TMS.
But to make progress in small steps, I'd like to start with implementing auto-zoom toggle and zoom level readjustment in TMS, once this is ready and works as expected, then I'd introduce the change to make WMS layer as extension of TMS layer.
You mean fixing the zoom level to a certain degree for TMS? Is this useful?
comment:7 by , 10 years ago
Replying to stoecker:
You mean fixing the zoom level to a certain degree for TMS? Is this useful?
Yes, that's what I mean. I'm not sure if it's useful, but I guess that the use case would be the same as for WMS. I would use current extra functionality of WMS layer to avoid unnecessary downloads of other zoom levels, as this improves performance. Once I have all TMS functionality, I do not need those.
So to keep our users happy, I'd leave them this functionality, though I find it of little usefulness. But maybe I'm missing something.
by , 10 years ago
Attachment: | wms_jcs_cache.patch added |
---|
comment:8 by , 10 years ago
Summary: | Tiling approach to WMS layers → [PATCH] Tiling approach to WMS layers |
---|
As this is a major change, I'd like first to let everybody review this patch, before I'll commit this into the trunk.
I plan to commit this patch after upcomming freeze on 31.05. This is too big change in my opinion, to commiting it right now.
What's done:
- move most of TMSLayer to AbstractTileSourceLayer - this is shared functionality between WMS, TMS, and upcoming WMTS
- "Precache imagery along GPX track" works for both - TMS Layer and WMS Layer
- Saving WMS and TMS layer also should work. I took some effort to also support current file format
- autozoom, autoload, show errors, show tile info - all integrated within AbstractTileSourceLayer
I decied that TemplatedWMSTileSource
will go to josm tree, not to JMapViewer, as it's too much dependant on JOSM code. The same will be with WMTS, where there is a need to use Projections
.
Code is also available at my GitHub repo:
https://github.com/wiktorn/josm/tree/wms_jsc_cached_imagery_new
comment:9 by , 10 years ago
Milestone: | → 15.06 |
---|
Hmm, that would fix WMS to TMS zoom steps, which probably is not a good idea. You'd need to find a way, that the user-selectable deepest zoom step does not vanish. Otherwise we'll get complaints.
OTOH unifying these two and handling WMS in JMapViewer would be a worthy goal.
Maybe the Auto-zoom variant could be TMS-based and the fixed-zoom variant using freely choosable zoom depth.