PDA

View Full Version : Custom Terrain


Guest_StudentGeologist_*
04-11-2006, 05:57 PM
I am trying to make a custom layer but I am not sure how to add custom terrain. I want to add a TIN, DEM or raster image with terrain capabilities. Does anyone know how?
I can add shapefiles, and images, I know how to make my own plant but not this.
Anyone able to help?
Thanks

withak
04-11-2006, 06:36 PM
Adding your own terrain is a closely-held secret.

Guest
04-11-2006, 09:33 PM
Quoted postAdding your own terrain is a closely-held secret.
I am trying to create a program with my professor to view certain aspects of the earths interior in 3-D.
Anyone willing to tell me the secret?

withak
04-11-2006, 09:42 PM
That sounds really cool. Post your question in the Add-on & Script Development forum or the Developers forum and hopefully someone who knows the secret will help you. There are probably others interested in hearing the secret too. style_emoticons/<#EMO_DIR#>/smile.gif

Beansprout
04-11-2006, 11:24 PM
Boo!

http://forum.worldwind.arc.nasa.gov/index....wtopic=6471&hl= (http://forum.worldwind.arc.nasa.gov/index.php?showtopic=6471&hl=)

:)

Guest Fsim Nut
04-13-2006, 12:59 PM
Quoted post
I am trying to make a custom layer but I am not sure how to add custom terrain. I want to add a TIN, DEM or raster image with terrain capabilities. Does anyone know how?
I can add shapefiles, and images, I know how to make my own plant but not this.
Anyone able to help?
Thanks


It should be fairly easy if you take a shortcut and populate one of the datasets you don't use much. You get the dataset info from the earth or images config files, use a spreadsheet to calculate the coordinates and tile filename reference and then assign these to the image/terrain data you want to display. I do the opposite and use a macro to write a config file from the spreadsheet to resample image or terrain data into Fsim processing hundreds of images at a time.

Andy

StudentGeologist
04-13-2006, 08:54 PM
Quoted post
<Quoted post
I am trying to make a custom layer but I am not sure how to add custom terrain. I want to add a TIN, DEM or raster image with terrain capabilities. Does anyone know how?
I can add shapefiles, and images, I know how to make my own plant but not this.
Anyone able to help?
Thanks


It should be fairly easy if you take a shortcut and populate one of the datasets you don't use much. You get the dataset info from the earth or images config files, use a spreadsheet to calculate the coordinates and tile filename reference and then assign these to the image/terrain data you want to display. I do the opposite and use a macro to write a config file from the spreadsheet to resample image or terrain data into Fsim processing hundreds of images at a time.

Andy


I didn't understand everything you said (I'm a geologist not a programmer) but it is a really good start and I'm sure I can figure most of it out. Thanks a million!

Guest
04-14-2006, 03:50 AM
I'm not either but have been on the fringe since the 80's. Your DEM/images will need to be in the same file formats as WW or it won't know how to handle them (I expect). BIL for the DEM data, Int16 LSB 150x150. JPG or DDS 512 x 512 for the images. They also need to be in WGS84 or spherical? projection

You will probably find for the images that you can replace an existing WW tile(or where it would be) with your own image data. If the base level of the tile (level 0) covers 2 x 2 deg and is 512 x 512, then an image 8192 x 8192 covering that area would be equal to level 4 but located in level 0. If it works like Celestia it should display the image. Not sure you could do the same with the DEM data.

I assume you have image data that is georeferenced so you can cut images for placement withinin WW, or clone a config to suit your dataset tilesize. You don't need to cover the whole earth and should be able to locate your data at the location it should appear.

Should be fun.

Guest Andy

StudentGeologist
04-14-2006, 07:10 PM
Quoted post
I'm not either but have been on the fringe since the 80's. Your DEM/images will need to be in the same file formats as WW or it won't know how to handle them (I expect). BIL for the DEM data, Int16 LSB 150x150. JPG or DDS 512 x 512 for the images. They also need to be in WGS84 or spherical? projection

You will probably find for the images that you can replace an existing WW tile(or where it would be) with your own image data. If the base level of the tile (level 0) covers 2 x 2 deg and is 512 x 512, then an image 8192 x 8192 covering that area would be equal to level 4 but located in level 0. If it works like Celestia it should display the image. Not sure you could do the same with the DEM data.

I assume you have image data that is georeferenced so you can cut images for placement withinin WW, or clone a config to suit your dataset tilesize. You don't need to cover the whole earth and should be able to locate your data at the location it should appear.

Should be fun.

Guest Andy

A couple of quick questions. What does Int16 LSB 150X150 mean and is it important? Does 512X512 mean pixel size? What is the level a reference to? What programs export .bil? Thanks alot this has been a big help.

5of0
04-15-2006, 04:59 AM
Quoted post
A couple of quick questions. What does Int16 LSB 150X150 mean and is it important? Does 512X512 mean pixel size? What is the level a reference to? What programs export .bil? Thanks alot this has been a big help.

Int16 LSB 150x150 probably means:
16-bit Integer format
Least Significant Byte
150x150 elevation points

And 512x512 is the image size. Level is what resolution you're at. World Wind works with levels - a level 0 tile is the closest zoomed in. 4 level 0 tiles make a level 1 tile, four level 1s make a level 2, etc.

StudentGeologist
04-15-2006, 05:06 AM
Quoted post
Quoted post
A couple of quick questions. What does Int16 LSB 150X150 mean and is it important? Does 512X512 mean pixel size? What is the level a reference to? What programs export .bil? Thanks alot this has been a big help.

Int16 LSB 150x150 probably means:
16-bit Integer format
Least Significant Byte
150x150 elevation points

And 512x512 is the image size. Level is what resolution you're at. World Wind works with levels - a level 0 tile is the closest zoomed in. 4 level 0 tiles make a level 1 tile, four level 1s make a level 2, etc.

This is all excellent info - thanks!
I was finally able to convert my raster image into a .bil file. I am having trouble importing it in. I think I am messin' up with the .xml file format. Not sure how to do it. I am trying to put it into a world I created so the equatorial radius is a little smaller. I am not sure if I need to put the file in a special directory and not sure what command to use in the .xml file so the program will call on it. Hmmm? Thanks for the help.

Guest
04-15-2006, 05:23 AM
Ok, I assumed(based on what you wanted to do) you were a bit more advanced than it seems since you are studying in a field that would be right into this stuff. No problem, you need to start somewhere.

Microdem and 3Dem would be good applications to get hold of.

http://www.usna.edu/Users/oceano/pguth/microdem/win32/

This should pretty well set you up for info on all formats and tools
http://www.grime.net/gistools/
http://www.digitalgrove.net/Links.htm

You'll have to google for 3dem

There's a thread somwhere in the forums on the BIL format

What happened to the math.... Int 16 = 16 bit integer, LSB/MSB least/most significant byte order

I guess you have a bit of a task ahead of you if you can't get away with a simple DEM format conversion and hack it into WW as I outlined previously. Imagery is fairly straight forward.

Keep at it.

Andy

Guest
04-15-2006, 06:12 AM
Op's I didn't see there were a couple of other posts. It looks like you are underway with the format conversion.

You are going to have to get into the way WW displays the tiles to figure out how you can relate them to WW's world, then produce your tiles to match and name them so they fit correctly. That's where a spreadsheet comes in handy.

This is for landsat imagery with 2deg level 0 tiles(calculating for level 5) but it should give you a rough idea if it displays ok.

deg. Km Lat Long Res Km Res m

0 2 222
1 1 111
2 0.5 55.5
3 0.25 27.75
4 0.125 13.875
5 0.0625 6.9375 2880 5760 0.0135498 13.549805
6 0.03125 3.46875 5760 11520 0.0067749 6.7749023




High Wide Tiles
16 16 256

UL 943 4720 -31 115 -32 116


LR 928 4735



eg Upper Left of tile 0943_4720

943+1 * 0.0625 - 90 = -31 4720 * 0.0625 -180 = 115

= S31 E115

Guest
04-15-2006, 06:37 AM
Quoted post
Op's I didn't see there were a couple of other posts. It looks like you are underway with the format conversion.

You are going to have to get into the way WW displays the tiles to figure out how you can relate them to WW's world, then produce your tiles to match and name them so they fit correctly. That's where a spreadsheet comes in handy.

This is for landsat imagery with 2deg level 0 tiles(calculating for level 5) but it should give you a rough idea if it displays ok.

deg. Km Lat Long Res Km Res m

0 2 222
1 1 111
2 0.5 55.5
3 0.25 27.75
4 0.125 13.875
5 0.0625 6.9375 2880 5760 0.0135498 13.549805
6 0.03125 3.46875 5760 11520 0.0067749 6.7749023




High Wide Tiles
16 16 256

UL 943 4720 -31 115 -32 116


LR 928 4735



eg Upper Left of tile 0943_4720

943+1 * 0.0625 - 90 = -31 4720 * 0.0625 -180 = 115

= S31 E115

Thanks again,
Do I need to create a speadsheet in this format and then convert it to an .xml file? How do I reference it back to my original .xml file that calls for the terrain? It has a space for serverURL- do I put the name and location of the directory with these files in it? What format does the name have to be in because you said I have to name it correctly?
Thanks with all of this info I'm making loads of progress.

StudentGeologist
04-16-2006, 02:57 AM
I did some more research and I think I'm starting to understand the naming, tile size and format. I am still really fuzzy and can't find any information about how to format the .xml and the spreadsheet your talking about. Any clues or templates??
Thanks,
John

Guest
04-17-2006, 01:05 PM
Quoted post
Thanks again,
Do I need to create a speadsheet in this format and then convert it to an .xml file? How do I reference it back to my original .xml file that calls for the terrain? It has a space for serverURL- do I put the name and location of the directory with these files in it? What format does the name have to be in because you said I have to name it correctly?
Thanks with all of this info I'm making loads of progress.


Is it only Dem data you want to work with. I'm not sure creating another dataset for the terrain will work like it would for imagery where you select which dataset you want to appear from the menubar across the top.

I don't think there is provision for this with the terrain data unless like when you zoom within the USA you go to the higher resolution data in that exterded 30m dataset. In this case you might just need to copy the code for it, expand the levels, add the path to the directory like you mentioned(they did that in an earlier version of WW or one of the datasets for something or other). So for the xml part it would just be cut and paste with a bit of editing. It's really just going to be give it a try and see where you finish up.

The spreadsheet for me was just to calculate the the corner coords for a tile, column, row or block given the tile numbers. You should get hold of the Tile Downloader because with it you can enter the coords and get the tile number(s). You can create a config for it so may also be able to use it some way to crunch numbers for your data.

http://forum.worldwind.arc.nasa.gov/index....wtopic=3004&hl= (http://forum.worldwind.arc.nasa.gov/index.php?showtopic=3004&hl=)

The macro I used in the spreadsheet was to create a config for the Fsim utility to resample the tiles into Fsim format. Not much use to you in that at this point.

Like I said earlier, you are going to have to figure out if you can relate the data you want to use with how they are doing it in WW and how you can slot it in. It sounds like you are making headway to me.

Regards

Andy

StudentGeologist
04-17-2006, 03:24 PM
Thanks for the info. I think my biggest hold up will be-How do I reference my data? Should I replace my cache files in that section of the world? I did a trial run of that and it came up with an error. I pulled an example off of one of the forums <permanant directory>cache directory<permanant directory>. Is it supposed to be misspelled or should it be permanent? Can I use this same technique for a world i created and have it reference that worlds cache or can I only use the earth format that world wind used? Anyway, I have a long way before that I am just wondering what I'm in for. Thanks again for all of the help,
John

barnacle9
04-18-2006, 02:04 PM
I pulled an example off of one of the forums <permanant directory>cache directory<permanant directory>. Is it supposed to be misspelled or should it be permanent?

<PermanantDirectory> I believe is/was the proper tag. It is misspelled. style_emoticons/<#EMO_DIR#>/blink.gif

However, I am not entirely sure that reference still works- I used it a few versions ago with no problems, but not sure as to current status of that tag.
As you mentioned, it might make more sense to just create your own 'world'. Use the various examples in Config directory (each planet is a 'world') - each will have a top level xml file (which generally defines/references your terrain data) and a directory containing additional xml files referencing the data sources. You could probably locate some instructions posted a while back here in the forums . . .

Good Luck
:confused:

5of0
04-19-2006, 01:06 AM
Quoted post
I pulled an example off of one of the forums <permanant directory>cache directory<permanant directory>. Is it supposed to be misspelled or should it be permanent?

<ExtendedInformation> was like that for a while, it used to be <ExtendedInfomation>. It'll probably be fixed eventually, for now, putting both a misspelled and correctly spelled version in *shouldn't* hurt anything (it didn't with the other case.)

StudentGeologist
04-27-2006, 03:28 AM
Thanks for all of the info, it has been a big help (a little slow due to finals week :confused:). I have been able to create a .bil file and I think I have a lot of the concepts down. My current issue is how do I make all of the conections between size, position, naming and such to tile down the .bil file. My file is a square file as it sits on the face of the earth but it isn't lined up along lat/long lines because the longitude lines converge in the north. Is there a concept or a short cut I'm missing?
Basicly, does anyone have any advice for me as to the easiest way to turn my file into tiles and implement them into worldwind?
Thanks,
John

mdsumner
04-27-2006, 09:26 AM
Hi, I've been trying to do this too - I gave up on it a while ago but 1.3.4 has spurred me on since we can now see the bottom in relief style_emoticons/<#EMO_DIR#>/wink.gif

I've been writing tile sets of images with Manifold, pretty messy but it works OK - part of the problem is that the easiest way to create subsets of the topography data end up changing the value type to floating point . . . a brute force approach would fix this, but

I've also been trying using R - this won't be too bad to tile with since some recent new capabilities (spatial classes and GDAL libraries), and I can just explicitly write it to binary, so . . .

when I finally get it right is this XML going to work, other than guessing from the metadata between images and topo I think this will work (at least I've had a cache master folder automatically created by WW, but I've been making other mistakes that prevent caching),

Is this XML kind of right, for a one-level (it would be equivalent to SRTM level 11 by my reckoning) dataset, placed in the Config/Earth.xml - or have I got it all wrong and is the accessor/permanent stuff to be expressed differently?


<TerrainAccessor Name="A test">
<TerrainTileService>

<LevelZeroTileSizeDegrees>10</LevelZeroTileSizeDegrees>
<NumberLevels>1</NumberLevels>
<SamplesPerTile>150</SamplesPerTile>
<DataFormat>Int16</DataFormat>
<FileExtension>bil</FileExtension>
<PermanentDirectory>Data\Earth\Manifold\TopoData</PermanentDirectory>
</TerrainTileService>
<LatLonBoundingBox>
<North>
<Value>-47.9746605</Value>
</North>
<South>
<Value>-56.041512</Value>
</South>
<West>
<Value>67.9788</Value>
</West>
<East>
<Value>80.02617</Value>
</East>
</LatLonBoundingBox>
</TerrainAccessor>

mdsumner
04-27-2006, 01:24 PM
And, I've been pretty scatty with this but I will clean up some examples and post what I've learnt. style_emoticons/<#EMO_DIR#>/tongue.gif

SG: what sorts of (programming) environments are you using? Do you think you have access to all the tools you need?

Basically you need to get some functions that automatically produce the tile file and directory names for you from your extents, level0 tile size and number of levels. I have examples in manifold GIS but that probably won't help you, if I can get the R thing going it will be more accessible to all.

StudentGeologist
05-06-2006, 01:10 AM
mdsumner
- I'm using ArcGIS as my main form of manipulation. I couldn't create a .bil file in it though so I took my data and created a ASCII file then converted it inside DIVA-GIS (do I need all of the information that came with it i.e. header). I dont understand how to create the proper size tiles. I am told they need to be formated square but what projection is that under. Is it square on a cylindrical projection bounded by the lat long lines or is there another method? Any advice and IO would really appreciate it. I have hit a stone wall.
John
One more thing, how do I look at the .bil files in my cache?:confused:

mdsumner
05-06-2006, 05:13 AM
Oh. A bil file is literally just a binary format - the metadata of this consists of the data type (e.g. Integer), its storage size (2 bytes = 16bit), its machine type (small-endian = PC, big-endian = Sun - for example), the missing value, and even different layers and/or interleaving in some cases - and you can write this with many generic tools, but I can appreciate the confusion if you are not familiar with this stuff.

The binary .bil file will often be accompanied by auxiliary text files with the appropriate metadata for the data type(s), and the projection paramaters - but in this case these are assumed constant (as specified in the terrain accessor .xml), so you will find no text files in the WW directories.

Square tiles means that each tile file has the same number of columns as rows - whether this means the same height and width in a geographic context is not relevant, and certainly not true for the lon/lat setup used by WW. AFAIK, WW is always lon/lat on the Sphere.

I've not managed to read the cache .bil files by using the GIS BIL import (I use Manifold) - I think because there is no accompanying metadata files. I can read them using Raw Binary import (as you'd expect), by specifying explicitly the number and type of bytes to read and knowing the number of columns and rows.

I'll see if I can put together some examples, but for now I hope that helps. I use R for general programming and data-munging, but whether that is for you . . .

what_nick
05-10-2006, 12:42 PM
Here is the magic bullet, if u add terrain please share it on a server for the benefit of the community.I would really like to see the Canada DEM.
http://www.urbanrobots.com/Blogs/WW/

geodan
05-10-2006, 06:11 PM
If someone is able to add their own terrain, in a somewhat automated way...can you please post a simple tutorial to get others started?

thanks,
Dan

StudentGeologist
05-11-2006, 09:17 PM
I spoke with my professor and he is willing to purchase the software (currently the manifold software package) I need to create the terrain .bil tiles. Can anyone tell me if this software will be sufficient and if so do you have a basic procedure for going about the tile creation? If not, does anyone have a better software package and a basic tile creating procedure specific for that software? I have hit a wall and all I really need is a way to create the terrain tiles then I can get back on track.
Thanks
John

StudentGeologist
05-12-2006, 03:01 PM
I ran into another hiccup. I can't get a definative answer on how to name the .bil files. As far as I can figure the image and .bil files are named differently. I found a few different things on the forums to detirmine this but they conflict with each other. Does anyone have the answer? Has anyone added their own terrain before? Could they tell me which way is correct? It is a whole lot of hassle to be wrong.
Thanks
John

tchezi
05-14-2006, 02:13 PM
Hi,
i'd like to add a .bil file at a given place. So i thought i could for example create a subset for 1 layer in earth.xml just like SRTM30US:

<HigherResolutionSubsets Name="test">
<TerrainTileService>
<LevelZeroTileSizeDegrees>10</LevelZeroTileSizeDegrees>
<NumberLevels>1</NumberLevels>
<SamplesPerTile>150</SamplesPerTile>
<DataFormat>Int16</DataFormat>
<FileExtension>bil</FileExtension>
<CompressonType>7z</CompressonType>
</TerrainTileService>

<LatLonBoundingBox>
<North>
<Value>50</Value>
</North>
<South>
<Value>40</Value>
</South>
<West>
<Value>0</Value>
</West>
<East>
<Value>10</Value>
</East>
</LatLonBoundingBox>
</HigherResolutionSubsets>

In the same time,in the cache, i create a directory named "test" with a folder 0 and the name of my bil file within it.
Doing that, WW gives me 0 as terrain elevation. could someone tell me why?
Is a server needed ?
thks

withak
05-14-2006, 02:41 PM
Your tile needs to be in the correct folder and named correctly. Tiles are numbered in a grid from the lower left corner. Turn on the RenderFileNames options to see how they should be named and organized into folders. The terrain tiles use the same organization as the image tiles do. The first number in the filename is the row number and the second is the column number. They are divided into folders by level (0, if you only have one level), then by row. If the tile is ten degrees square, then you will need 18 rows (0000-0017) and 36 columns (0000-0035). I think your tile would go in "/0/0000/0000_0013.bil", but you might want to check my math. :)

mdsumner
05-15-2006, 12:55 AM
I've not been able to create the tiles using Manifold, there is a problem with a linked surface being converted to floating point when updating the query, so the export to BIL harder to do . . .

I will try to do this in R/GDAL, but I don't really have time. Hopefully you can follow the PHP "bullet" above . . .

what_nick
05-15-2006, 02:35 AM
Hi all,
I am willing to set up a DEM tiling service using the little PHP scripties if someone is willing ti give me some space on a server and some DEM tiles they want me to serve out.
I will look into adding a DEM serving tutorial on the wiki.

JamesCanada
05-26-2006, 03:35 AM
Hi WhatNick, I have a dedicated Windows 2003 Server that is not too busy and has about 40 gigs of space availible. The Canadian 1:50,000 DEMs are availible here:

http://www.geobase.ca/geobase/en/data/cded1.html;jsessionid=B78BF72782F9B47B47 4F8583D1D1014B

I have made some high resolution images for -117W to -113W and 52N to 49N and would like to see how they look over high res DEM.

My IT guy went to another project, so I don't have anyone to set up the server. So I will need detailed instructions on helping to set it up.

Cheers James