Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
Guilhem Bonnefille writes: > IMHO, the current cache in viking serves two distinct roles: > - a cache like any web browser has (in order to keep files locally for > the session); > - a local tilecache to allow cross session caching but also *offline* reading. Agreed; these are the two standard uses of caches. From this discussion I still don't see why we want this cache to be anything but per-user. > > As many other project uses a local *tilecache* (tangogps, > nerongps...), perhaps can we imagine a future project, offering such > services in a DBus manner. > I would go the other way, and say that the right answer is an actual tilecache that can be set up with zero hassle and then viking would point to it and skip all this caching stuff. But maybe there should be a way to do an rpc to it "do you have tile x, and what's the pathname" to avoid turning it into/outof a web fetch. pgpA0Vg5s6GTa.pgp Description: PGP signature -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
2010/10/8 Greg Troxel : > I know you said "other" opinions, but here's a perhaps provocative > statement: :-) > so really all the cache behavior in viking is doing is being a poor > man's substitute for a caching web/tile proxy IMHO, the current cache in viking serves two distinct roles: - a cache like any web browser has (in order to keep files locally for the session); - a local tilecache to allow cross session caching but also *offline* reading. As many other project uses a local *tilecache* (tangogps, nerongps...), perhaps can we imagine a future project, offering such services in a DBus manner. -- Guilhem BONNEFILLE -=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com -=- mailto:guilhem.bonnefi...@gmail.com -=- http://nathguil.free.fr/ -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
Guilhem Bonnefille writes: > It's an interesting point of vue. Currently, the map cache is > associated to the *instance* of a map layer, not the map layer itself > (as far as i know). For example, you can embed two Mapnik layers with > different caches. > > As you spotted it, I think this is probably unecessary. A single cache > per map type or a global path for map cache would be certainly enough. > Other opinions? I know you said "other" opinions, but here's a perhaps provocative statement: the only reason we have tile caching in viking is to speed up performance with slow servers, to handle some degree of offline use, and to be polite to upsteram tile servers. if we had a tilecache instance between viking and the web, then we could just let it work, and cache tiles according to normal rules, and not have to have any caching in viking. so really all the cache behavior in viking is doing is being a poor man's substitute for a caching web/tile proxy pgp4q2iVYi0w3.pgp Description: PGP signature -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
2010/10/6 Greg Troxel : > user preference file (NOT a .vik) sets path to cached maps > > each map layer just uses a standard place in the path, and there's no > config allowed. It's an interesting point of vue. Currently, the map cache is associated to the *instance* of a map layer, not the map layer itself (as far as i know). For example, you can embed two Mapnik layers with different caches. As you spotted it, I think this is probably unecessary. A single cache per map type or a global path for map cache would be certainly enough. Other opinions? -- Guilhem BONNEFILLE -=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com -=- mailto:guilhem.bonnefi...@gmail.com -=- http://nathguil.free.fr/ -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
> From: g...@ir.bbn.com > To: guilhem.bonnefi...@gmail.com > CC: rw_nor...@hotmail.com; viking-de...@lists.sf.net > Subject: Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't > save the map cache directory if it's the map cache default directory. > Date: Wed, 6 Oct 2010 09:22:14 -0400 > > > how about: > > user preference file (NOT a .vik) sets path to cached maps > > each map layer just uses a standard place in the path, and there's no > config allowed. I'm fine with that. I suppose there must be some advantage of potentially having differing maps save to different areas. But given the cheapness of any storage device (inc USB/flash efforts), one might as well dump everything in one area and just use that for simplicity. Personally I never change the map default. And for about 3 years of my use - my .viking-maps is 2.8G -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
how about: user preference file (NOT a .vik) sets path to cached maps each map layer just uses a standard place in the path, and there's no config allowed. pgpZByDysOHT3.pgp Description: PGP signature -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
2010/10/1 Robert Norris : > > >> Date: Fri, 1 Oct 2010 21:29:15 +0200 >> Subject: Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't >> save the map cache directory if it's the map cache default directory. >> From: guilhem.bonnefi...@gmail.com >> To: rw_nor...@hotmail.com >> CC: viking-de...@lists.sf.net >> >> Patch applied. >> >> Nevertheless, such solution creates .vik file that does not support a >> change of the preference. >> Here is a scenario: I save a file, change the preference, and reopen >> the saved file... > > > Ah yes you're right, I didn't think about that. What should we do? Revert? > I was hoping to try to make the .vik file a bit portable, but perhaps that > can not be done in a such a simple way as I was hoping. > > Normally I think other software that deals with references to other files are > often relative references. > Obviously absolute filename references are not cross platform. I can imagine some solutions. First one: remove absolute path when it use *default* directories, but not *prefered* directory. Another one: replace home directory part (as returned by g_get_home_dir()) with a marker (for exemple '~'). I also imagine much more complex solution: 1) replace map's numerical id by real identifiers (like "osm-mapnik" or "osmarender"...) 2) do not use absolute path, but a lookup in different directories: For exemple, current map uses "osmarender" id, so look for "osmarender" directory in /home/user/.viking-maps, then in /var/viking/maps then in /usr/share/viking/maps... But it is much more complex and really different from current solution. Perhaps for viking 2.0 ;-) -- Guilhem BONNEFILLE -=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com -=- mailto:guilhem.bonnefi...@gmail.com -=- http://nathguil.free.fr/ -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
> Date: Fri, 1 Oct 2010 21:29:15 +0200 > Subject: Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't > save the map cache directory if it's the map cache default directory. > From: guilhem.bonnefi...@gmail.com > To: rw_nor...@hotmail.com > CC: viking-de...@lists.sf.net > > Patch applied. > > Nevertheless, such solution creates .vik file that does not support a > change of the preference. > Here is a scenario: I save a file, change the preference, and reopen > the saved file... Ah yes you're right, I didn't think about that. I was hoping to try to make the .vik file a bit portable, but perhaps that can not be done in a such a simple way as I was hoping. Normally I think other software that deals with references to other files are often relative references. Obviously absolute filename references are not cross platform. There is an open SF#2998555 about this (albeit more for waypoint image references). I have a partial working solution for SF#2998555, but that ATM only addresses the waypoint images. Other places that use file references: .DEMs .GeoRefs .Map Cache (as this patch was about) Further I was then thinking of adding an advanced preference to say 'save in either relative or absolute mode', which only affects the saving. Reading files in is simple, as it can tell been '/absolute/file' and 'relative/file' (in fact I think the OS's open function does that automatically for you) This is very much a 1.0+ change. -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
Re: [Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
Patch applied. Nevertheless, such solution creates .vik file that does not support a change of the preference. Here is a scenario: I save a file, change the preference, and reopen the saved file... -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/
[Viking-devel] [PATCH] Make more portable .vik file, as don't save the map cache directory if it's the map cache default directory.
The map cache default directory is dependent on the user and OS, however on reading in when it's blank it automatically puts in the map cache default directory. --- src/vikmapslayer.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/src/vikmapslayer.c b/src/vikmapslayer.c index 40b3e67..6468637 100644 --- a/src/vikmapslayer.c +++ b/src/vikmapslayer.c @@ -466,7 +466,15 @@ static VikLayerParamData maps_layer_get_param ( VikMapsLayer *vml, guint16 id, g VikLayerParamData rv; switch ( id ) { -case PARAM_CACHE_DIR: rv.s = vml->cache_dir ? vml->cache_dir : ""; break; +case PARAM_CACHE_DIR: + /* Only save a blank when the map cache location equals the default +On reading in, when it is blank then the default is reconstructed +Since the default changes dependent on the user and OS, it means the resultant file is more portable */ + if ( is_file_operation && vml->cache_dir && strcmp ( vml->cache_dir, a_preferences_get(VIKING_PREFERENCES_NAMESPACE "maplayer_default_dir")->s ) == 0 ) + rv.s = ""; + else + rv.s = vml->cache_dir ? vml->cache_dir : ""; + break; case PARAM_MAPTYPE: rv.u = map_index_to_uniq_id ( vml->maptype ); break; case PARAM_ALPHA: rv.u = vml->alpha; break; case PARAM_AUTODOWNLOAD: rv.u = vml->autodownload; break; -- 1.7.1 -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/