Results 1 to 6 of 6

Thread: [Solved] How to display local data?

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Posts
    5

    Default [Solved] How to display local data?

    I have my own local data in Mr. SID format that I’m trying to display in WorldWind (locally; just for a single PC). I’ve read a bunch of threads on this, but I’m still stuck. Here’s what I’ve done.

    Used GlobalMapper to export the Mr. SID files into WWJ cache (it has that option). All files and folders do not have the leading zeros that I’ve been reading about, so I think I’m good with that. It did create an xml configuration file, but I think that’s not supported by WWJ. Ideally, I’d like my application to just be able to add new custom layer dynamically, but I don’t think that’s built in to WWJ.

    I took the resulting folder, called “MyLocalData” and placed it in C:\ProgramData\WorldWindData\MyLocalData . I’m on Vista and I know this is the correct place because that’s where data goes when fetching items from built-in online sources.

    Now, how to get this to display in WWJ. It appears I need to add a new layer in my code. So, I did that and extended from BasicTileImageLayer. My makeLevels method looks like this:

    Code:
    private static LevelSet makeLevels()
    {
        AVList params = new AVListImpl();
    
        params.setValue(AVKey.TILE_WIDTH, 512); 
        params.setValue(AVKey.TILE_HEIGHT, 512);
        params.setValue(AVKey.DATA_CACHE_NAME, "MyLocalData"); // also tired MyLocalData/
        params.setValue(AVKey.OFFLINE_MODE, true);
        params.setValue(AVKey.SERVICE, "http://locahost");
        params.setValue(AVKey.DATASET_NAME, "*");
        params.setValue(AVKey.FORMAT_SUFFIX, ".jpg");
        params.setValue(AVKey.NUM_LEVELS, 5); // this value was taken from xml file generated by GlobalMapper
        params.setValue(AVKey.NUM_EMPTY_LEVELS, 0); // not sure what this should be?
    
        // Not sure if I'm setting this up right?
        params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36d), Angle.fromDegrees(36d)));
        params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
    
        return new LevelSet(params);
    }
    I read in previous posts (below) that you need to set AVKey.SERVICE, so I used http://localhost as recommended. This will fail, since I’m not running a web server locally. I shouldn’t need to, right? I read about the php server, but didn’t want to go down that road, unless that’s the only way.

    From http://forum.worldwindcentral.com/sh...pack%22&page=2: Just make sure the layer points to the right cache folder. SERVICE and DATASET_NAME should never be needed if WW finds the images at the expected place in the cache, but you need to provide these parameter so use something like "http://locahost" for the service and "*" for the dataset name for instance. That should work. You'd better set the bounding sector of your layer properly to avoid WW looking for tiles outside the layer extent too.
    Any guidance is much appreciated!

    - Ken
    Last edited by patmurris; 10-31-2008 at 12:27 AM.

  2. #2
    WWJ Consultant patmurris's Avatar
    Join Date
    Jun 2005
    Location
    Saint-Paul de Vence, Alpes Maritimes, France
    Posts
    3,382

    Default

    You setting for the layer looks good, however you should certainly check the LEVEL_ZERO_TILE_DELTA value and make sure you use the right one. Is you dataset global (full sphere/globe) and jpg format?
    My World Wind Java Blog & WW.net Plugins page

  3. #3
    Junior Member
    Join Date
    Apr 2008
    Posts
    5

    Default

    No, it's not a global dataset; I will have to look into setting that. Yes, it's jpg format.

    I took a closer look at the files generated by GlobalMapper and I think the folder structure is wrong. It creates a structure like MyLocalData/1/12124/12124_38079.jpg. It seems like WWJ is requesting things like MyLocalData/1/3/3_2.jpg.

    Hmm... not sure what GlobalMapper is doing. Maybe I'll need to use the dstile tool?

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

    Default

    Actually, it looks like that format is correct. Hmm.. something else must be going wrong.

  5. #5
    WWJ Consultant patmurris's Avatar
    Join Date
    Jun 2005
    Location
    Saint-Paul de Vence, Alpes Maritimes, France
    Posts
    3,382

    Default

    MyLocalData/1/12124/12124_38079.jpg is OK except the numbers are for much smaller tiles then with a LZTD of 36 degrees.

    What seems to be wrong in your settings is the LZTD and the dataset sector.

    Did you see this:
    http://issues.worldwind.arc.nasa.gov...le+systemt.gif
    My World Wind Java Blog & WW.net Plugins page

  6. #6
    Junior Member
    Join Date
    Apr 2008
    Posts
    5

    Default

    Sweet.... that's what was wrong. Needed to change to:

    Code:
    params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(45d), Angle.fromDegrees(45d)));
    Which was defined in the XML file generated from GlobalMapper.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Vertical resolution
    By turman in forum Development Help
    Replies: 22
    Last Post: 10-12-2007, 01:07 PM
  2. Replies: 15
    Last Post: 07-10-2007, 07:25 PM
  3. WW mentioned in article
    By KoS in forum WorldWind General
    Replies: 5
    Last Post: 01-18-2006, 05:23 PM
  4. Using local higher res terrain data?
    By vizda in forum Image Serving & GIS
    Replies: 0
    Last Post: 01-06-2006, 03:13 AM
  5. What to do with all my local data?
    By muzietto in forum WorldWind General
    Replies: 3
    Last Post: 03-18-2005, 01:49 AM

Tags for this Thread

Posting Permissions

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