Please login or register.

Login with username, password and session length

News:

Registration is only required if you want to post, and is not needed to read any posts. To avoid excess 'spam' accounts, all accounts where no posts have been made will be deleted after two weeks. Please register again if you wish to post.

Author Topic: World Model Creation  (Read 29101 times)

October 27, 2011, 10:24:04 AM
  • Member
  • **
  • Posts: 2
    • View Profile
Hi, I have just found Bridge Command and I am eager to create a world model.

I understand the requirements from the docs, but I need to know what software to use to create the world files.
I am presuming that SRTM data will be used. Can someone enlighten me about the actual proceedure of the creation of the variose BMP files needed.

Thanks,

Marvin.

October 28, 2011, 09:34:18 PM
Reply #1
  • Administrator
  • Member
  • *****
  • Posts: 130
    • View Profile
Hi Marvin,

Yes, one of the main sources of data for elevation maps is SRTM data, which can be downloaded from http://earthexplorer.usgs.gov/. In addition, for the USA, the NGDC Coastal Relief Model (http://ngdc.noaa.gov/mgg/coastal/startcrm.htm) is a very good data set which combines land elevation with sub-sea bathymetry for the US continental shelf.

Since I have last worked with these data sets, the data formats available have changed, so I need to investigate further what tools are available to convert the data into BMP format, suitable to load into Bridge Command. I will look into this over the weekend and post an update here.

In the UK, the Ordnance Survey have recently released a reasonably high resolution digital elevation map (Land-Form PANORAMA on https://www.ordnancesurvey.co.uk/opendatadownload/products.html) under their OpenData licence. However, this is referenced to the UK National Grid, so I am currently looking at how to re-process this into a latitude/longitude format using WGS84, the standard datum used by modern charts and gps.

Once you have your heightmap in an image format, you can also generate a texture image to display on the terrain when it is loaded in the program, which should be the same image size as the heightmap. For this I currently use L3DT (http://www.bundysoft.com/L3DT/).

The radar image file is now only used as a map in the scenario editor and map controller, as the radar image is simulated directly from the terrain. Therefore I normally use the same image as the land texture.

I will report back on tools to convert the available datasets into a bitmap image,

James Packer

October 29, 2011, 10:30:59 PM
Reply #2
  • Administrator
  • Member
  • *****
  • Posts: 130
    • View Profile
To follow up:

The best data source for importing STRM data for terrain models appears to be CGIAR, who maintain an SRTM dataset with voids filled in (http://srtm.csi.cgiar.org).

I have also put together a tool to convert this data from ArcInfo ASCII format into an image format suitable to generate a heightmap for Bridge Command. This creates a 'pgm' file, which can be read in a good image editor, such as the free GIMP (http://www.gimp.org/downloads/), and saved as a .bmp or jpeg file.

To use this data to generate a height map image:
>Go to: http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp and select the area you want.
>Select 'ArcInfo ASCII' as the file format
>Search and download the data you want

>Download the conversion tool from http://www.bridgecommand.co.uk/file/import.exe
>Save import.exe somewhere
>Drag and drop the .asc file you have downloaded with your data onto the import.exe program file
>Set the sea depth when requested (SRTM has no sub-sea data)
>The program will process the file, which will take a number of minutes, and may appear to freeze while writing the output file
>When done, the output file will be saved in the same location as the input, with .pgm appended to the filename. Note the TerrainMaxHeight and SeaMaxDepth values to use.
>Open the .pgm file in your image editor, and follow the documentation to save this in the correct size as a .bmp or .jpg file.

Please note the terms of use of the CGIAR data at http://srtm.csi.cgiar.org/SELECTION/SRT_disclaimer.htm.

Please let me know if this is helpful, or if you come across any issues,

James Packer

October 30, 2011, 10:30:52 AM
Reply #3
  • Member
  • **
  • Posts: 2
    • View Profile
Meny thanks, James.
That is a great help!!

I will let you know how I get on.


Marvin.

May 28, 2014, 11:32:38 PM
Reply #4
  • Member
  • **
  • Posts: 10
    • View Profile


"Once you have your heightmap in an image format, you can also generate a texture image to display on the terrain when it is loaded in the program, which should be the same image size as the heightmap. For this I currently use L3DT (http://www.bundysoft.com/L3DT/). "

Hello Might you explain how the program L3TD is used to generate the field, I fail to understand how to use it from the map image. i have a image in BMP or JPG downloaded and i have the importe.exe image.

Thanks

June 18, 2014, 02:51:12 PM
Reply #5
  • Administrator
  • Member
  • *****
  • Posts: 130
    • View Profile

April 19, 2015, 06:13:25 PM
Reply #6
  • Member
  • **
  • Posts: 4
    • View Profile
Ok, am doing Kingston Ontario Harbour, almost got it done but the world is too big. I am having trouble with the Lat Long extent. What exactly is this supposed to be? I am about 40 minutes either side of my bottem left corner. Cheers
Mark

November 06, 2017, 11:21:56 PM
Reply #7
  • Member
  • **
  • Posts: 49
  • Officer of the Watch Deck
    • View Profile
where can the tool for converting .asc to .pgm be downloaded from ?

November 14, 2017, 08:15:36 AM
Reply #8
  • Administrator
  • Member
  • *****
  • Posts: 130
    • View Profile
Hi, I use the script in post https://www.bridgecommand.co.uk/forum/index.php/topic,1729.msg2033.html#msg2033, and run this with GNU Octave, an open source numerical processing program, available from https://www.gnu.org/software/octave/#install

July 13, 2022, 08:37:38 AM
Reply #9
  • Member
  • **
  • Posts: 49
  • Officer of the Watch Deck
    • View Profile
import.exe

is there some way of passing the file to import.exe other than dropping the input file onto it ?

the reason is, im using linux exclusively and the windows emulator does not support the drag and drop onto .exe

either that, is there another way of converting .asc to a .bmp

July 14, 2022, 06:23:54 PM
Reply #10
  • Administrator
  • Member
  • *****
  • Posts: 130
    • View Profile
Hi, if you are able to run it on the command line (are you using Wine?) you can just give the asc file as the only command line argument (import.exe nameOfFile.asc).
Its a pretty simple program so I may be able rewrite it as a simple cross platform command line program.

July 18, 2022, 11:57:58 AM
Reply #11
  • Member
  • **
  • Posts: 49
  • Officer of the Watch Deck
    • View Profile
hmm asks for some .dlls when running through wine, which I dont have

My problem is that I am getting high spikes near the "beach"

so either the .asc data has this (which I discount as improbable) or
the conversion from asc to .f32 is introducing the problem or
the internal conversion from .f32 to a 1+2^n square matric is introducing the problem

What I am in the process of doing is taking a 2049 square directly out of the asc data using GNU Octave which should give me a clean smaller set of data of the same size as irrlicht uses

and converting that to a 2049 square f32 again using octave as you have posted earlier.

If I can picture that .f32 as an image (without the irrlicht interpretation) then I can rule out the process of asc>.f32 creating the spikes,

July 18, 2022, 02:05:18 PM
Reply #12
  • Member
  • **
  • Posts: 49
  • Officer of the Watch Deck
    • View Profile
So using Octave I extracted a 2049 x 2049 element matrix from the .asc file

# big.asc is an asc file with the headers stripped
>> load big.asc; # which puts into an array big
>> smaller = big(1820:3868,1:2049);
>> save smaller.asc smaller;

# as a check

>> rows(smaller)
>> columns(smaller)

# both of which returned 2049 which is correct

>> flipped=flupud(smaller);
>> flipped(flipped<=0)=-10;
>> fileID-=open('smaller2049.f32','w');
>> fwrite(fileID, flipped, 'single');
>> fclose(fileID);

It seemed to get rid of the mountains on the beach problem, although are the elevations shown in feet and not metres, they seem quite a bit bigger from real life ?
« Last Edit: July 22, 2022, 09:59:23 AM by elir71 »

July 19, 2022, 11:12:19 PM
Reply #13
  • Administrator
  • Member
  • *****
  • Posts: 130
    • View Profile
Bridge Command uses metres internally, and assumes that binary heightmaps are defined in metres, so as long as the original data is in metres, they should be correct. Please double check the source, but let me know if it still doesn't look right.

For information, from the latest release (5.7.12), there are a few improvements to terrain loading, including directly supporting 3dem 16 bit integer and 32 bit floating point terrain matrix (the 3dem format uses a separate binary map and ascii header file). Additionally, if the heightmap isn't (2^n + 1) square, instead of resizing it, Bridge Command now uses the data directly (it still internally using a 2^n+1 square worldmap, but just picking the next size up, and only using the amount required.)