Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Cache Pack and Offline Server Help

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    4

    Default Cache Pack and Offline Server Help

    Hi all, I can't seem to figure this offline stuff out. I have the 1.4 release of World Wind and I'm trying to run it on a closed lan.

    First, I've downloaded the cache packs for BMNG and extracted them to apache directory --I'd like to serve this imagery out.

    Then, I found the local_cache.php script (on the wiki).. but I'm not sure where to put it or do with it. I tried putting it in my local WW1.4 directory but then WW wouldn't start up. Where does it go...?

    Basically, how do I get WW pulling map titles from another server? Is there some wiki? If someone can help me, I wouldn't mind writing the wiki for this... It seems very useful.

    Is this possible with the regular WW App, or do I need WWJ?

  2. #2
    Junior Member
    Join Date
    Mar 2008
    Posts
    4

    Default

    Hmm.. Still haven't been able to figure this out.

    If I had two machines, A and B, how could I make Server A only pull tile images from Server B?

  3. #3
    Super Member James_In_Utah's Avatar
    Join Date
    Jan 2006
    Location
    Eden, Utah
    Posts
    1,786

    Default

    Set up a web server on B. Put the cache pack in a directory on B. Install the php scripts under the web server, we converted them to .ASPX. Edit your @Images.xml in config\earth to point to B instead of NASA. Edit your Earth.xml in the \config directory to point to B instead of NASA for elevation data. Your done. At least that's the theory. We don't have it working yet, but should in the next day or two.

    The other way that does work is to share the directory on B with the cache pack in it, and point your cache on A to look at the directory on B. You do that in the worldwind.xml file under your profile name\Applicatiion Data\NASA\WorldWind\1.4.0.1 or something like that. It's slow, but it does work.
    James

  4. #4
    Junior Member
    Join Date
    Mar 2008
    Posts
    4

    Default

    Thanks James, I was giving something like that a shot. One thing I noticed so far is that it still seems to be trying to go to worldwind25 for the tiles...

    So right now I'm going test this out:
    - mod hosts file, <server B ip> worldwind25.arc.nasa.gov

    And on Server B, in my apache folder I have a 'tile' directory. Now I just need to figure out how to convert that php file to aspx.

    In a browser, worldwind25.arc.nasa.gov/tile/tile.apsx points to the correct file :-)

    * btw, this is without changing any of the worldwind config files.

  5. #5
    Junior Member
    Join Date
    Mar 2008
    Posts
    4

    Default

    Okay, I figured it out.

    I'll try to write up a good explanation, but here's a quick one on how to set up a Stand Alone tile server for use with the Regular WorldWind App (non JDK).

    On your MAP SERVER
    - Install Apache (I'm using a Mapserver build, "MS4W")
    - Ensure that apache is running, try viewing it in your browser "http://localhost"
    - This will show you an html directory structure of the c:/ms4w/Apache path
    - Next create a directory 'MapPacks' under c:/ms4w/Apache
    - Download the mappacks, I used all of the BMNG packs
    - Install the mappacks to c:/ms4w/Apache/MapPacks/
    - The image path will should look like "c:/ms4w/Apache/MapPacks/"

    - Now create a directory 'tile' under c:/ms4w/Apache
    - Add a file called tile.php to c:/ms4w/Apache/tile

    PHP Code:
    <?
    // This scipt is for serving out your own WW Cached tiles to World Wind, useful for own imagery and for working "off line"
    // This script can be named what ever you want, it is controlled via a World Wind XML
    //
    // thanks to MaurizoZA and Nowak for the script

    $X $_GET['X'];
    $Y $_GET['Y'];
    $L $_GET['L'];
    $T $_GET['T'];

    function 
    addzeros($string){
           
    //echo $string;
           
    if(strlen($string) >= 4){
                   return 
    $string;
           }

           
    $string "0" "$string";

           if(
    strlen($string) < 4){
                   
    $string addzeros($string);
           }
           return 
    $string;
    }


    $ext ".jpg";

    // Change the following to the location of your local root cache folder
    $url 'c:/ms4w/Apache/MapServer/BMNG (Shaded + Bathymetry) Tiled - 12.2004';
    $doneurl $url .  "/" $L "/" addzeros($Y) . "/" addzeros($Y) .
    "_" addzeros($X) . $ext;

    // Debug tools
    //header("Location: $doneurl");
    //exit;
    // print ($doneurl);
    //exit;

         
    $tileData file_exists($doneurl) ? file_get_contents($doneurl) :
    false;
         if (
    $tileData === false) die();

         @
    header('Content-type: image/jpeg');
         print(
    $tileData);

    ?>
    - finally, in the c:/ms4w/Apache/conf file, edit httpd.conf
    Code:
    # Find the line # 
    AddType application/x-httpd-php .php5 .php4 .php3 .phtml .ph
    
    # and Add .apsx, ie run any aspx request as a php file #
    AddType application/x-httpd-php .php5 .php4 .php3 .phtml .ph .aspx
    - rename tile.php to tile.aspx
    - in services.msc (Windows Services), restart Apache

    On your CLIENT BOX
    - In c:/%windows%/System32/drivers/etc/hosts add the line
    Code:
    %ip_to_mapserver%     worldwind25.arc.nasa.gov
    
    # below is an example
    127.0.168.12     worldwind25.arc.nasa.gov
    - make sure you can ping your server, in cmd type "ping worldwind25.arc.nasa.gov
    - make sure you can reach your apache server, in IE go to "http://worldwind25.arc.nasa.gov"
    - Now try accessing the tile dir, and the tile.aspx file, ie:
    "http://worldwind25.arc.nasa.gov/tile/tile.aspx?T=105&L=0&X=85&Y=44"
    - This should display a jpg image in your browser
    - Install WorldWind and you're done


    Notes:
    - One issue I do see is I had to hardcode the image path in the php file. I wasn't sure what the different "Tiled - XX.2004" meant. Please let me know if you have any questions or have anything to add.
    - This way is nice because now anyone else on the private lan (large or small) just needs to edit their host entry to get your tiles.
    Last edited by donnie; 03-27-2008 at 09:01 PM.

  6. #6
    Bored Explorer m_k's Avatar
    Join Date
    Nov 2004
    Location
    Warsaw, Poland
    Posts
    1,797

    Default

    Quote Originally Posted by donnie View Post
    One thing I noticed so far is that it still seems to be trying to go to worldwind25 for the tiles...
    Probably it's Blue Marble plugin...
    Other image layers (Landsat, USGS) can be configured via Images.xml file, but for Blue Marble it's all hardcoded in the plugin.
    You should be able to disable the plugin and create your own xml for BM. Then you don't have to use hosts file.

    I wasn't sure what the different "Tiled - XX.2004"
    XX = month number
    There are 12 versions of BM imagery - one for each month.
    Last edited by m_k; 03-27-2008 at 09:12 PM.

  7. #7
    Super Member James_In_Utah's Avatar
    Join Date
    Jan 2006
    Location
    Eden, Utah
    Posts
    1,786

    Default

    The only problem we are having right now is, without using the BMNGLoader plugin, the tile server does not server up imagery that wraps the whole earth. If you zoom in, you see the imagery, but when you zoom back out portions of the earth are black. I'm not sure why that's the case. Maybe we will use the Host file trick above to make use of the BMNGLoader plugin.
    Thanks,
    James

  8. #8
    Super Member James_In_Utah's Avatar
    Join Date
    Jan 2006
    Location
    Eden, Utah
    Posts
    1,786

    Default

    OK,
    I created a local_images.xml. It has the layer info for BMNG(bath) and Landsat 7 and pointed it at our file server which as as script called WorldMaps.aspx. It is configured to serve BMNG, Landsat, or SRTM data. From the Download Monitor, I can see that it is downloading SRTM data, but I don't see any 3D on the screen. The BMNG seems to be working fine. I left the pluging loaded to give me the initial globe of BM, but then when I zoom in, the layer in my local_images takes over and I see better resolution tiles. The Landsat is the mystery. A few of the tiles download, but not many. It looks as it lots of tiles are missing from the Cache directory, and maybe have been converted to .dds files. I've been treating this cache directory on the file server as a cache directory for several clients. Does it make since that a good number of the files would now be gone, or have been converted to .dds? Is that an option somewhere in the WW interface? Also, any clue on why the terrain would download, but I wouldn't see elevations relief on the screen? Any help on this would be appreciated!
    Thanks,
    James

  9. #9
    God. Root. What is difference? TomServo's Avatar
    Join Date
    Sep 2004
    Location
    Eastern Pennsylvania
    Posts
    2,823

    Default

    Elevation is the only dataset I am still working out. I have it serving locally.. but I am not sure if it works or not. And if you try to remove the existing data, no elevation seems to download.


    Earth is Square blog

    PUBLIC NOTICE AS REQUIRED BY LAW: Any use of this forum post, in any manner whatsoever, will increase the amount of disorder in the universe. Although no liability is implied herein, the consumer is warned that this process will ultimately lead to the heat death of the universe.

  10. #10
    Super Member James_In_Utah's Avatar
    Join Date
    Jan 2006
    Location
    Eden, Utah
    Posts
    1,786

    Default

    I'll have to look again, but it appeared that there was a .tmp being added to the end of the .bil file names as they were downloading. I'll have to double check that in my .aspx file. On the Landsat data, I'm using all of the cache packs on WorldWIndData. Does it make since that a large number of these level 0 and level 1 files would be missing? Also, is there something that converts .jpgs to .dds in WorldWind? Does it delete the .jpgs? Is there some way to control this? I still have all of the cache packs. I think I will have to refresh my images from those packs.
    Thanks,
    James

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. USGS Ortho imagery for offline
    By Unregistered in forum WorldWind General
    Replies: 1
    Last Post: 03-10-2008, 04:09 AM
  2. How Can I make a cache pack?
    By jskim326 in forum WorldWind General
    Replies: 2
    Last Post: 12-06-2007, 10:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •