Pre-Seeding a cache without using a .earth file

classic Classic list List threaded Threaded
3 messages Options
Blanky Blanky
Reply | Threaded
Open this post in threaded view
|

Pre-Seeding a cache without using a .earth file

Hello,

I know previously there was no good pre-seeding capabilities a couple of years ago, but according to the 2.10 docs, it seems that the feature was finally fleshed out as a stand-alone application bundled in the /bin of each release now. I'm really glad that this was done, but I had a question about replicating what the seeder does from the context in source code, rather than using a .earth file as input from the command line with the osgearth_cache script. Our application has deprecated the usage of .earth files as we opted to do everything from source which includes:

    1. Creating the Map
    2. Creating the MapNode
    3. Creating the Image layers and Elevation layers and adding them to the Map

What I want to do is have the ability for GeoTiff, DTED, CADRG, and ECRG layers to be pre-seeded at all levels of detail so when a new user uses the application for the first time they don't have to wait for their cache to initialize naturally, since it can take a decent amount of time for so many differing layers. If this still isn't possible from a source code perspective, is there any plans to implement doing so from code using a MapNode as the input and have all of the same options available as the command line osgearth_cache script has?

Thanks.

- Blanky
Blanky Blanky
Reply | Threaded
Open this post in threaded view
|

Re: Pre-Seeding a cache without using a .earth file

After a bit of digging I found the solution to my own question by looking for the osgearth_cache application source.

Essentially this file describes exactly what I want to do on the map node and even has a super convenient callback mechanism for tracking the progress on a front-end widget if I wanted through polling.

https://updraft.github.io/osgearth-doc/html/osgearth__seed_8cpp_source.html
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Pre-Seeding a cache without using a .earth file

As you can see, that code is based on the CacheSeed class which still exists in osgEarth master. So you can definitely use this as a template for doing seeding from your application.
Glenn Waldron / Pelican Mapping