World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 10-30-2008, 04:01 PM   #1
KennyProle
Junior Member
 
Join Date: Apr 2008
Posts: 5
KennyProle is on a distinguished road
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.

Quote:
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-30-2008 at 11:27 PM.
KennyProle is offline   Reply With Quote
Old 10-30-2008, 05:31 PM   #2
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
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
patmurris is offline   Reply With Quote
Old 10-30-2008, 05:42 PM   #3
KennyProle
Junior Member
 
Join Date: Apr 2008
Posts: 5
KennyProle is on a distinguished road
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?
KennyProle is offline   Reply With Quote
Old 10-30-2008, 06:18 PM   #4
KennyProle
Junior Member
 
Join Date: Apr 2008
Posts: 5
KennyProle is on a distinguished road
Default

Actually, it looks like that format is correct. Hmm.. something else must be going wrong.
KennyProle is offline   Reply With Quote
Old 10-30-2008, 07:16 PM   #5
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
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
patmurris is offline   Reply With Quote
Old 10-30-2008, 08:05 PM   #6
KennyProle
Junior Member
 
Join Date: Apr 2008
Posts: 5
KennyProle is on a distinguished road
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.
KennyProle is offline   Reply With Quote
Reply

Tags
cache, cache pack, local data


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vertical resolution turman Development Help 22 10-12-2007 12:07 PM
I can't see WMS data with Worldwind 2.1 and Local Geoserver WMS vash Development Help 15 07-10-2007 06:25 PM
WW mentioned in article KoS WorldWind General 5 01-18-2006 04:23 PM
Using local higher res terrain data? vizda Image Serving & GIS 0 01-06-2006 02:13 AM
What to do with all my local data? muzietto WorldWind General 3 03-18-2005 12:49 AM


All times are GMT +1. The time now is 07:39 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.