-
Notifications
You must be signed in to change notification settings - Fork 7
Dvt improvements 2020 #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dvt improvements 2020 #28
Conversation
…Android into dvt-improvements-2020
Caching only occurs when the system property "worldwind.ImageRetriever.decodeUrlCacheDir" has been set.
Both the layer meta-data as well as individual tiles are cached within
the directory referenced by
System.getProperty("worldwind.ImageRetriever.decodeUrlCacheDir").
|
I have one question. Why do not you use MBTiles SQLite format for tile cache? Storing tiles as separate PNG files will waste inodes in partition table on sdcard. Are you able to replace separate file per tile approach with one MBTiles.db file per map source? |
|
@Sufaev The first blocker I see is that we would need to add an MBTiles library as a dependency to WW Android just for processing. It looks like there is one available (https://github.com/imintel/mbtiles4j and an android-specific fork https://github.com/fullhdpixel/mbtiles4j). That particular library is licensed under Apache 2.0 and I do not know if the license WW uses would allow us to use that as a dependency. After that there is an issue of metadata format. My initial research on MBTiles shows that it represents tiles as a tree, so the first thing we'd have to do is get the lat/lon/zoom from the WMS URL and normalize it to a set of zoom/column/row which would get stored in the MBTiles "tiles" table. (Everything I've learned about MBtiles comes from https://github.com/mapbox/mbtiles-spec/blob/master/1.2/spec.md). I like the concern about inodes; filesystems can bite you in unforseen ways and I'm a huge fan of sqlite. I think this is a good long-term plan, and after looking through the WW codebase it looks like we can use sqlite without a dependency ( @Sufaev do you mind opening an issue about this? It sounds worth pursuing (though I personally cannot promise a huge time investment, work has me busy until March). We can use that to list tasks and track progress a little better than using a closed PR. |
|
MBTiles can be used without any library. It is only a table with x,y,z and tile columns. I agree that it is designed for WebMercator tiles and x,y,z addressing paradigm. I do not know if new task is required now. My product which use WorldWindAndroid will implement MBTiles soon, but we plan to use only WebMercator tile sources. So, may be this approach is not suitable for any WMS layer, but PNG files will definitely not work. It will fill up sdcard inodes very quickly. |
|
Another critical issue of this PR. Any map source does not work by default when system property is not specified.
Please, add fix which correctly skip cache processing when worldwind.ImageRetriever.decodeUrlCacheDir is not specified. P.S.: Generally System.getProperty is antipattern in Android. |
|
Another proposition. Cache should be configurable to use JPG or PNG per map layer, because in case of maps like Google Satellite PNG will consume too much space comparing to JPG. |
|
@Jeffrey-P-McAteer and @PJHogan I propose to follow common process with new features:
Creating PR for each hot-fix and maintaining several features using one branch makes little chaos in commit history. |
|
@Sufaev completely, I was surprised this was merged so quickly. I'm not familiar with the development process WorldWindEarth follows, and I like the quality controls you proposed. I will make improvements to my fork (which include work-related needs that move quickly and break things) and the community can pull anything that looks good enough to be in core. At the moment I'm thinking of adding method overloads to (Actually these thoughts would probably go best in an issue which tracks work done on network layers and their caches. I have a specific requirement but the stuff in core should be broad enough to apply to non-WMS network-backed layers.) |
|
@Jeffrey-P-McAteer To make the correct process you need to create separate branch for each new feature in your repository fork. So it will be possible to create and append separate PRs for each feature till it will be completely tested. Now I am thinking how to reorganize already committed code. We already have two unfinished features in one branch and cannot maintain them separately.
We need to revert somehow and make normal process of this two features implementation as both of them are still not completely tested. @PJHogan and @Jeffrey-P-McAteer what is your propositions what to do with current situation? |
|
I'm just trying to help by merging code when requested. Are you both able to merge? If so, I won't be merging anymore. If not, we'll need to get you merge capabilities. |
|
@PJHogan I have rights to merge PRs and I can do review in Android repository if necessary. |
|
Eugene,
You are the man!
My apologies for just hitting 'Merge'
For some reason I thought I was some kind of Admin,
but as long as you guys also have the power,
I will certainly not be doing that anymore!
:~}}}
On Tuesday, January 14, 2020, 12:02:25 PM PST, Eugene Maksymenko <notifications@github.com> wrote:
@PJHogan I have rights to merge PRs and I can do review in Android repository if necessary.
Will it be Ok?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
@Jeffrey-P-McAteer I have reverted develop head. |
|
Eugene, |
Description of the Change
This adds a global cache for all WMS layers if the calling code sets the system property "worldwind.ImageRetriever.decodeUrlCacheDir". The cache stores WMS Capabilities as a .xml file as well as a .PNG tile for every URL processed through
gov.nasa.worldwind.render.ImageRetriever.Why Should This Be In Core?
I'm not 100% certain this should be in core, but there have been previous discussions on the worldwind forum which indicate this capability is desired:
https://forum.worldwindcentral.com/forum/worldwind-android-wwa/android-discussion/17902-android-offline-mode
This PR should open a discussion about what the most idiomatic way to add file caches to
LayerFactoryandImageRetrieversuch thatBenefits
Offline imagery is useful for a number of organizations (This change originated internally at https://devil-tech.com/, we are certainly interested in using offline data for an application we write).
Potential Drawbacks
This is a global cache which uses a system property to modify behavior. This is likely not idiomatic code for the WW community and I'd like to hear feedback on a more appropriate approach.
Applicable Issues
NASAWorldWind#3
NASAWorldWind#72