Sign in to follow this  
Guest sgreenwood

Elevation BGL

Recommended Posts

Hi!Looking into Christian's tutorial I am trying to make some simple mesh in my coast and have problems. I have got charts from freely available atlas of Slovenia and using elevation lines I have made raw file of elevations (using PhotoShop). The highest hill has approx 250m so I made couple of layers: 0 with RGB 0 0 0 for sea, 2m with RGB 2 2 2, and so on for some more layers (60m, 100m, 120m, 200m, tops). Then I flattened these layers and made Indexed file. Then I saved this as RAW file and using this inf file

<Source>Type = ELEVS16LSBSourceDir = .SourceFile = "Elev.raw"Lat = 45.5491666667Lon = 13.5498333333NumOfCellsPerLine = 1913NumOfLines = 1519CellXdimensionDeg = 5.3521617887E-5CellYdimensionDeg = 3.6231884058E-5<Destination>DestDir = .DestBaseFileName = "Elev"NorthLat = 45.5491666667SouthLat = 45.4941666667WestLong = 13.5498333333EastLong = 13.6521666667LOD = Auto

old resample (using TMF compress and TMF2BGL) made a nice 93kB long BGL. But when I look at these coordinates in scenery, scenery is the same :-( Is there anything I have forgotten??P.S: Arno allready responded to me that Christian was talking about 16 bit divided to 2 layers. Ok, I have read that so that means I should have one RAW file for heights up to 256m, and another for higher elevations? Please help! Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Goran,I think the problem is that the DEM data needs to be 16 bit (as Christian explained in the tutorial, he talked about the two channels there). I think when you save it as RAW it will become 8 bit. So I guess that is the problem.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Arno!Thanks for Your answer and I was afraid of that. But how can I then make this small mesh? I am not quite certain how to use "Photoshop technique" in making mesh...Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

>Then I flattened these layers and made Indexed >file. Then I saved this as RAW file and using this inf file Just think about that step a bit more. Why do you flatten the image into one channel? My tutorial said you need 2 channels so your data is 16 bit. If you flatten it it'll be 8bits again! You have to save the 2 channels into the raw file.Christian

Share this post


Link to post
Share on other sites

See Christians answer :). And you name that your altitudes are below 255 meters, so I think with just an empty second channel it should work for you.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Christian!I am aware that what I got was 8bit RAW file. But the problem is if I change from RGB mode to Indexed color, Photoshop automatically flattens layers and I can't have 2 layers. Maybe there is a solution to make 2 RAW files, one for ELEVS16MSB and the other for ELEVS16LSB. Now I am wondering, if I am interested in heights up to 256m, that means, that MSB RAW file should have those needed elevations, the LSB RAW is full of gray with RGB 1 1 1? Should I then make two INF files, then make 2 TMF's and then merge them together, compress and make BGL? Or there is another way?Best regards and thanks in advance!Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

I don't think it will work with two RAW images and merging the TMF file later on.When you have an RGB images (or more RG probably, because you only need two channel). And you say save as RAW does it want to flatten then automatically (can't remember that)? If that is the case I think it is hard to make an elevation BGL with the PhotoShop method.Don't know if you have another program. I would try to make the file with MatLab or an hex editor.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Arno!Thank You for Your answer. Unfortunatelly it is true, that Photoshop automatically flattens layers :-( But if Christian says that Photoshop (or Paint Shop Pro, I don't mind) can be used this way, I would like to know. Getting elevation map from official institution for Slovenia is just too expensive (some hundreds of EUR, I think around 2000)...Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Same here in the Netherlands, it really expensive if you want to buy the stuff. We are talking with a company at the moment to get it for free. Sometimes that works, if you get them entousiastic for your project and explain you do it as freeware (non profit) etc. We have gotten some other data already in this way.But back to the question, are you sure flattening means it becomes index color (8 bit). When I have a RGB image with more then one layer I can also flatten it, but it stays RGB. So the layers are flattened, but not the channels. Maybe something similar happens when you want to save RAW? I'll test it tonight when I get home.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Goran,Sorry, my mistake. I of course meant 'channels' not 'layers'. You'll have to work with 2 CHANNELS and then it works. Sorry for the confusion.Also, make sure that you cover a whole LOD quadrant, which means a lot of work using this method...Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian!My apologizes, I overlooked through whole post that You talked about channels and I understood as layers. Sorry, my mistake. But I still haven't got my micro mesh in FS. Interestingly though, TMFViewer does show altitudes and values on correct place with correct elevations. I ask You or somebody else if You can look in PSD file found at http://slovenia.avsim.net/HIDDEN/elev.psd (122kb) what can be wrong. The most recent code for INF is here:

<Source>Type = ELEVS16LSBSourceDir = .SourceFile = "Elev.raw"Lat = 45.5491666667Lon = 13.5498333333NumOfCellsPerLine = 1913NumOfLines = 1519CellXdimensionDeg = 5.3521617887E-5CellYdimensionDeg = 3.6231884058E-5 <Destination>DestDir = .DestBaseFileName = "Elev"NorthLat = 45.5491666667SouthLat = 45.4941666667WestLong = 13.5498333333EastLong = 13.6521666667LOD = Auto

Thank You for help!Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

For my mesh I used Paint shop to make the grayscale raw file(picture).Then I used Grises50 to convert to DEM.And finally tmf2bgl to make the bgl.I used this bat file to automate the process:---grises50 Mesh10.raw mesh11gr.dem 8 0resample meshgr.inftmfcompress mesh11.tmf meshc11gr.tmftmf2bgl meshc11gr.tmf meshc10.bgldel mesh11gr.tmfdel meshc11gr.tmfpauseexit---And this inf file:---[Destination] LOD = 10 DestDir = "G:TestsceneryMesh_scenery" DestBaseFileName = "mesh11" UseSourceDimensions = 0 NorthLat = 62.40234375 SouthLat = 61.962890625 EastLong = 6.796875 WestLong = 5.859375[source] Type = ElevS16LSB SourceDir = "G:TestsceneryMesh_scenery" SourceFile = "mesh11gr.dem" CellType = S16LSB NullCellValue = -9999 SampleIsCentered=0 Lat = 62.40234375 Lon = 5.859375 NumOfCellsPerLine = 1340 NumOfLines = 1278 CellXdimensionDeg = 0.000699626865672 CellYdimensionDeg = 0.000343860035212 ScaleInMeters = 1.0---I also had some problems with finding the coordinates and the correct LOD-square.

Share this post


Link to post
Share on other sites

If TMFViewer shows your data then the bgl is fine...You must be doing something wrong when adding the bgl to FS2002. Are you sure it's loading in FS2002? Maybe your elevation changes are so small that they are hard to notice?Christian

Share this post


Link to post
Share on other sites

Bit late, but last evening I had a look at making a 16 bit RAW file in PhotoShop.When I start with a RGB image it has four channels listed, the R, G , B channels and the combined RGB channel. After I deleted the B channel the combined one also dissapeared and I had two channels left.When I exported them to RAW I got no message about flattening or so and the resulting file was 128 kB for a 256x256 RAW, so that seems correct :).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

I have done few tests with terrein bgl file compiling from image.raw file in different LOD value, in range from 9 to 13, with the same image 257 x 257 resolution. In every case I had good bgl generation, visible in tmfviewer. But in FS I have visible effect for LOD 9, 10 and 11 only.Markps. for calculation I use Excel and I have good results every time.

Share this post


Link to post
Share on other sites

Hi all!Thank You for Your help. Mark, I think You have said manything with Your answer. If I have LOD=Auto, BGL is good (for TMFViewer) but if I put there LOD 9, 10 or 11, then TMF2BGL says doesn't seem to contain DEM or Class data. Bounding rectangle set to the entire earthIt produces some bgl, which is 680 bytes long (instead of 49700 bytes).Arno, thank You for Your idea of making two channels. I haven't remember to try that.Knnygar, I have grises but I have never tried to use it. But now I think is ideal time :) I will try it in next 2 hours.Thanks again ta all of You. Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Hi Mark,>But in FS I have visible effect for LOD 9, 10 and 11 only.You may see the higher level LOD value mesh by changing to this setting in fs2002.cfg:&l;TERRAIN&r;TERRAIN_MAX_VERTEX_LEVEL=21Regards,Steve

Share this post


Link to post
Share on other sites

Hi again!It took me a lot more than 2 hours I would say :) Unfortunatelly I still have problems. I read again FS2000 SDK, Your answers, Grises documentation and came up that I will use whole LOD 11 quadrant. I made 2 channel Photoshop file:channel 1 has elevation up to 256m, channel 2 is full of black - 0 0 0.Finally I resized the image to size 257x257 pixels. Then I used this inf file:

<Source>Type = ELEVS16LSBSourceDir = .SourceFile = "LJPZElev.raw"Lat = 45.527344268Lon = 13.53515625NumOfCellsPerLine = 257NumOfLines = 257CellXdimensionDeg = 2.28881835938e-4CellYdimensionDeg = 1.71661378906e-4 <Destination>DestDir = .DestBaseFileName = "Elev"NorthLat = 45.527344268SouthLat = 45.483398955WestLong = 13.53515625EastLong = 13.59375LOD = 11

I triple checked values and they are correct. Resampler writes some values, then this tmf file is compressed but tmf2bgl gives again the error elfinal.tmf doesn't seem to contain DEM or Class data....Any ideas where I made a mistake? I have attached GIF elevation picture.Thanks again for all Your help. Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

The RAW-file does not have to be 256*256, mine was 5358*5113.I think the picture should maybe have the same proportions as the coordinates?I made the grayscale picture in Paint shop whith colour 255 the highest point.Then when I used Grises I set the correct altitude for my data.The calculations of CellXdimensionDeg and CellYdimensionDeg did allso make alot of problems for me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this