Cache read?

classic Classic list List threaded Threaded
7 messages Options
Johnson prem Johnson prem
Reply | Threaded
Open this post in threaded view
|

Cache read?

Hi


I seeded filesystem cache for the baselayer (world.tif) with the cache id "BaseLayer".
The cache path is D:\Cache. The cache was built under "D:\Cache\BaseLayer" without any issues.

I tried to use the cache with the following simple earth file,

<map type="geocentric" version="2">
  <options>
       <cache type="filesystem">
       <path>D:\Cache</path>
       <cache_policy usage="cache_only"/>
  </options>

  <image name="world" driver="gdal">
    <cacheid>BaseLayer</cacheid>
  </image>
 
</map>


The osgearth_viewer throws error messages saying error in building tilesource
and displays white sphere.
Is there any problem in earth file?





gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Cache read?

Yes; your image layer is missing the required "url" property.


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

Re: Cache read?

But when the cache is added through APIs, we need not to specify the URL. Isn't it?
Only cache cache-path, cache-id and cache-policy are suffice to be inputted.
I have done that way without any issue. But Is it necessary to specify URL in .earth file?
 


 
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Cache read?

How did you seed the cache? With another earth file? Can you show that one please?
Glenn Waldron / Pelican Mapping
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Cache read?

Oh -- The "path" property should be a child of the "cache" element, like so:

<cache type="filesystem">
    <path>D:/Cache</path>
</cache>

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

Re: Cache read?

Sorry for delay in responding.

Closing xml-tag was given properly like listed below,

<map type="geocentric" version="2">
  <options>
       <cache type="filesystem">
          <path>D:\Cache</path>
       </cache> 
       <cache_policy usage="cache_only"/>
  </options>

  <image name="world" driver="gdal">
    <cacheid>BaseLayer</cacheid>
  </image>
 
</map>

Actually, I did building cache by program (not by .earth file).
Yeah, when URL is given, it happens.
But in my case i have built cache of larger area(country level). Once cache is built, source data will be moved to some other storage area. Cache will be used as read-only to display (which must be the purpose of "cache-only" as well).

Thanks





gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Cache read?

Not really. The purpose of the cache is just that; to cache data locally in order to speed up a network data source.

If you want to generate a pre-tiled dataset, I would suggest either pre-processing your GeoTIFFs, or using using either osgearth_conv or osgearth_package to create a static tile set. Details are here:

http://docs.osgearth.org/en/latest/data.html#tips-for-preparing-your-own-data

Hope this helps.
Glenn Waldron / Pelican Mapping