Sign in to follow this  
Holger

LOD5 landclass borders in Ground2K4

Recommended Posts

Hi all,here's an image of my problem:http://forums.avsim.net/user_files/44913.jpgI have redefined the landclass of the entire image area but it crosses a LOD5 boundary which remains visible as an edge. If I understand correctly, the problem is that landclass files are actually 257x257 files and that (in my example) column 257 of the left area has to be identical with column 1 in the right area. I actually have the same landclass values on both sides but it seems that Ground2K doesn't show column 257 but rather 256, which results in the FS default landclass values for that column showing through. Correct?Is there an easy fix for this (in Ground2K)? I have looked at Russel's EZ-landclass and believe I could use it to fix the problem but perhaps there's an easier way???Thanks for sharing ideas.Cheers, Holger

Share this post


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

Hi Holger.You should be able to look at the two landclass BGLS in TMFViewer to see if the butt each other, and what values are present.Landclass is assigned to the verticies, not the spans ( not the cells or not the groundtiles, if you prefer ). The LOD13 groundtile is created at runtime by the blending of the four corners to the center. The exceptions to this are water landclass values and CUSTOM values... they hog the whole groundtile... and that's why the minimum size is 4 ( all the tiles touching that assigned vertex will be CUSTOM or water ).256 x 256 groundtiles are enclosed by 257 x 257 vertices. That's where we came up with the number 257.But what a mistake! Unless the edge verticies are value 254 ( transparent ) we get a hard edge at the borders of the LOD5. That's because we have all been conditioned to think in terms of 257x257 and a singular LOD5 area.All our landclass programs seem to be restricted by this idea.How is it avoided? Multisourcing.{Source}Type = MultiSourceNumberOfSources = 2{Source1}Type = ClassU8SourceDir ="."SourceFile = "722x308.raw"Lon = -90.466Lat = 45.845NumOfCellsPerLine = 722NumOfLines = 308CellXdimensionDeg = 0.010540802213001383125864453665284CellYdimensionDeg = 0.010181229773462783171521035598706; CellXdimensionDeg = (7.621 / ( 722 + 1 )); CellYdimensionDeg = (3.146 / ( 308 + 1 )){Source2}Type = ClassU8SourceDir ="."SourceFile = "transparent.raw"Lon = -180.0000Lat = 90.0000NumOfCellsPerLine = 100NumOfLines = 100CellXdimensionDeg = 3.636363636363636363636363636CellYdimensionDeg = 1.818181818181818181818181818{Destination}DestDir = "."DestBaseFileName = "722x308"UseSourceDimensions = 0NorthLat = 48.00SouthLat = 42.00EastLong = -86.00WestLong = -92.00transparent.raw is a 100x100 8-bit RAW file that is filled as value 254 ( 0FEh ). It is the size of the world, and makes a transparent background for any landclass. Your other source(s) could be any size, especially a raw file 257x257, such as Ground2K saves. As long as the size and dimensions are right, then the final extent of the landclass is controlled by your destination bounds ( in decimal degrees ). If you make these bounds greater than the multisources ( excepting the world background ), then resample will do it's thing and make you a combined BGL greater than the singular LOD5, surrounded by transparent, which will blend perfectly at the edges.The above source is rectangular, but oddly shaped, and NOT an LOD5. But you could use G2K raw files just as well... and as many sources as you need.So you can intercept the Ground2K raw landclass sources and write your own INF to encompass all those sources. That sould give you a perfectly blended landclass.I haven't done this with G2k raw sources, but it should be quite easily done. If you have trouble with it, attach a zip with the G2k raw files, and their bounds, and I could probably make the INF and produce the BGL.This could be avoided if Christian were to free his code of the LOD5 restriction, but I'm not sure if that would be easily programmed. It certainly is not easily communicated. ;)Dick

Share this post


Link to post
Share on other sites

Hi Holger,I wrote to Christian about this problem. As Dicks points out we need to generate a 257 x 257 array of vertices if we are to generate an isolated LOD5. However Ground2k only allows the specification of 256 x 256 indexes, although it generates a 257 x 257 raw file. Unfortunately the 257th row and the 257th column are empty (=254). In your picture the vertical LOD13 stripe to the left of the discontinuity (column 256 of the left LOD5) is the result of blending vertexes on the 256th column with default landclasses indexes (since there are no "257th vertices" on the raw file). The vertical LOD13 stripe to the right of the discontinuity (column 1 of the right LOD5) is the result of blending the 1st and the 2nd columns of vertexes in your raw file.If the LOD5 border was in the ocean (say that you wanted to make an artificial island) as explained in the final part of this post:http://forums.avsim.net/dcboard.php?az=sho...id=14937&page=4then the stripe to the left of the discontinuity would be water as the combination of whatever index I use for column 256 with default water index (at 257) will result in water.Regards, Luis

Share this post


Link to post
Share on other sites

Hi Holger>I have redefined the landclass of the entire image area but it>crosses a LOD5 boundary which remains visible as an edge. If I>understand correctly, the problem is that landclass files are>actually 257x257 files and that (in my example) column 257 of>the left area has to be identical with column 1 in the right>area. Correct.>I actually have the same landclass values on both sides>but it seems that Ground2K doesn't show column 257 but rather>256, which results in the FS default landclass values for that>column showing through. Correct?Never used Ground2K, but I think I read somewhere that a new version will fix this.Cheers, Christian

Share this post


Link to post
Share on other sites

>area. I actually have the same landclass values on both sidesHi Holger, again,As far as I understand the Ground2k interface, you do not need to repeat values across a LOD5 when working on a single project. If you make 2 LWM projects, one for each LOD5 (and yes - in this case you should repeat the border values in both sides!) you still get the error.One thing that may be misleading is the shifting of the LOD grids (red lines) by 1/2 of a LOD13, when you switch to the LandClass tool.Regards, Luis

Share this post


Link to post
Share on other sites

Hi everyone:thanks for the prompt and detailed responses!!!Ahh - sweet success:http://forums.avsim.net/user_files/45090.jpgIt is indeed the case that FS requires the 257th column/row of vertexes and that Ground2K doesn't show it; well, it is identical to column 1 of the next LOD5 area to the right but it remains at value 254 in the .raw file produced by Ground2K4. If Christian could change the code so that column 1 of the right LOD5 area automatically gets duplicated in column 257 of the left area we'd be happy, I believe."You should be able to look at the two landclass BGLS in TMFViewer to see if they butt each other, and what values are present."Interestingly, TMFViewer was of no help here. I loaded the compiled LC files and they show exactly as in Ground2K with no 254 seam in between. I tested different variations of loading, including loading Worldlc.bgl first, but it always looked the same and suggested no problem.Being a spreadsheet junkie, I ended up using EZ-Landclass for the corrections:1. Make two new projects in EZ-landclass, importing the two .raw files.2. Open the right LOD5 area and take a screenshot of the landclass values along the left edge (it doesn't look like you can have two projects open at the same time, and copy/paste doesn't work acrosss projects either, so that's why I used this approach).3. Open the left LOD5 area and display (tile) the screenshot to the right of it.4. As described in Russel's read-me file, add the 257th column data in the 156th column with the help of a comma separator. To avoid the seam, the additional data needs to be exactly the same as the corresponding 1st-column value in the right LOD5 area.5. Save and compile as landclass .bglRhumba's idea about multisourcing should work too and is probably more elegant but I had only about 40 overlapping rows of data.This was the last kink in my first 'integrated' mesh/Ground2K project - Banff National Park and the southern Canadian Rocky Mountains. I used my satellite images as base maps to make lakes, stream and transportation networks, and land-/waterclass files; it's amazing how well the Ground2K data fits the LOD9 SRTM mesh. Just need to finish up the docs and packaging - yeah! This is Lake Louisehttp://forums.avsim.net/user_files/45101.jpgAnd here's Canmore at dawnhttp://forums.avsim.net/user_files/45104.jpgThe last kink? Well, there's always one more... Here are some extraneous road signs and lampposts that litter the National Park despite successful exclusion of the road itself.http://forums.avsim.net/user_files/45102.jpgCheers, Holger

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