Map data cache question

classic Classic list List threaded Threaded
6 messages Options
jeladi jeladi
Reply | Threaded
Open this post in threaded view
|

Map data cache question

I have a simple earth file that is almost identical to tests/readymap.earth.  The only difference is that I left out the extensions portion of the XML.  As long as I am connected to the web when using my osgEarth-based application everything is fine.

A problem occurs if I add a cache_policy block, set the usage to 'cache_only', and unplug my laptop from the web. Once I do that I get frequent crashes until I remove the cache_policy block from the earth file and reconnect the laptop to the network.

We need to be able to demo our application offline.  Obviously for a production system the idea is that the user would have internet access enabled or have their own map server.  For demo purposes we can't assume that though.  Is offline usage of readymap.org cache data both possible and permitted under the terms of service?  

Sometimes even when connected to the internet we are seeing failed write messages.  I am not sure why this is happening since the directories it attempts to write to do exist.  It writes some map data but not all.  I don't know if this is related but thought I would mention it.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Map data cache question

I tested it locally and it worked as expected (master branch). Make sure your cache policy is inside the options block like so

<map>
   <options>
      <cache_policy usage="cache_only"/>

I tested this by setting the environment variable OSGEARTH_HTTP_DEBUG=1 and seeing whether osgEarth made any HTTP requests.
Glenn Waldron / Pelican Mapping
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Map data cache question

In reply to this post by jeladi
To answer your second question: yes, you can use the cached data for demo or development purposes.
Glenn Waldron / Pelican Mapping
jeladi jeladi
Reply | Threaded
Open this post in threaded view
|

Re: Map data cache question

Ok we will do some more digging to see what is causing the issue.  

I am seeing a lot of these when I look at the output with HTTP debug enabled:

[osgEarth]  [HTTPClient] GET(200, image/jpeg) : "http://readymap.org/readymap/tiles/1.0.0/7/6/117/46.jpeg" (Tue, 04 May 2010 00:16:44 GMT) t=0.1225s
[osgEarth]  [HTTPClient] Error in HTTPClient for http://readymap.org/readymap/tiles/1.0.0/7/6/117/46.jpeg but it's recoverable

Is this a problem?  
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Map data cache question

No, it likely just means that the request was canceled (by osgEarth) before it completed. No harm done.

BUT, if you are seeing any HTTP requests at all, that means you are not in cache-only mode.


Glenn Waldron / Pelican Mapping
jeladi jeladi
Reply | Threaded
Open this post in threaded view
|

Re: Map data cache question

I just wanted to make sure that it was successfully writing the imagery to the cache while connected and using a 'read-write' cache policy.  I thought maybe there were some partial output files so it is good to hear it is not an issue.

I finally managed to get a call stack and it looks like it is crashing in the DatabasePager.  I posted a message on the OSG forum about it here but would be interested to know if any osgEarth users have encountered DatabasePager issues.