Sign in to follow this  
Guest sgreenwood

Please help! Resample.exe and centimeter Z resolution?

Recommended Posts

I am very close to success with my first terrain meshes in fs9. Problem is, the 10meter dems I am using have a centimeter elevation resolution. I have had no luck changing my .inf file for this.The SDK says that resample.exe expects 1meter elevation points, and that somehow FractionBits and BaseValue may be used to change this, but it has not worked for me!Does anyone know how to make these centimeter elevation dems work? Or a program to convert to meter resolution. Microdem won't seem to do it.Thanks much,Chris Goodman

Share this post


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

Hi Chris,have you tried changingScaleinMeters = 1.0to 0.01 ?Cheers, Holger

Share this post


Link to post
Share on other sites

Hmmm! ScaleinMeters = 0.01 works for the elevation, but two strange things happen- the resolution of the entire mesh goes way down (x,y and z) and it is only resampling a small portion of the dem. I haven't changed any other parameters in the inf. Could this change affect LOD?Getting much closer now,Chris>Hi Chris,>>have you tried changing>>ScaleinMeters = 1.0>>to 0.01 ?>>Cheers, Holger

Share this post


Link to post
Share on other sites

Hi Chris,hmm... as far as I know ScaleinMeters affects only the z axis. Are you using a fixed LOD = setting or "auto"? Perhaps it's best to post your entire .inf file (use that Message format check box, above the subject line, to retain formatting).Ciao, Holger

Share this post


Link to post
Share on other sites

Hi Chris,Have you tried Microdem's In/Out -> Edit -> Multiply z values function?cm x .01 -> m should work.Steve

Share this post


Link to post
Share on other sites

Holger,Below is the .inf so far. As I said, the terrain looks pretty much right, exept for the loss in res (as judged from tmfviewer) but the biggest issue is the smaller dem sampling. Seems to be only a chunk out of the center of the dem!If you are curious, the dem can be found at http://duff.geology.washington.edu/data/ra...attle/q1122.zipThanks so much for looking into this!Chris[Destination] ; The [Destination] section defines the output of the resampler ; LOD = {Auto, 0..n}; LOD = Auto tells the resampler to pick the closest LOD to the ; source cell size. Specifying a number will force an LOD. ; This can be used for under sampling or over sampling. LOD = auto ; DestDir

Share this post


Link to post
Share on other sites

Steve,I will look into that as well- there's a lot to that program!Chris>Hi Chris,>>Have you tried Microdem's In/Out -> Edit -> Multiply z values>function?>>cm x .01 -> m should work.>>Steve

Share this post


Link to post
Share on other sites

Me again,the DEM loks good. However, if that's the only tile you have then the output .bgl will indeed be clipped, as only the portions completely within a LOD grid cell will be visible in FS. Steve's website provides a very good explanation of this and you can also find a LOD grid calculator tool, which allows you to determine the visible area up front. www.fs-traveler.comYou have some influence on this by setting your own LOD; the higher the LOD the finer the LOD grid and the more of your source data will be used. However, LOD11 is the maximum for FS9 and it has the downside of a very limited display radius, about 12 miles.If you only have one tile you could download 30m USGS source data of a larger spatial extent and merge the two in MicroDEM. Cheers, Holger

Share this post


Link to post
Share on other sites

I had to do a bit more to create the mesh using your data.The next step is to tell Microdem you've changed the scale. This involves editing the header:In/Out -> Edit -> HeaderChange the vertical scale to Meters.The data seems to be in UTM format. You can change it to lat/long and convert to the preferred WGS84 as follows:Load the dem and File -> Save DEM ->DTEDspecify a spacing of 0.33Then load the DT1 file and save it as 16-bit BSQ. This is a pretty small area once resample gets done with it. I've attached a text file I produce for each mesh file I create, and you can see how little is left, even when using an LOD of 12. (You will have to edit the fs9.cfg file to see this LOD; set the TERRAIN_MAXIMUM_VERTEX_LEVEL TO 21).I recomment setting the LOD in the inf manually. 11 is the smallest value that will produce any mesh at all from this small set of data.You may want to download a few more surrounding dems and merge them in Microdem. This is one of those situations where Bigger is Better!EDIT: I've just attached my inf file as well, since ours differ so much. I read the data in Microdem format and create my own BSQ file using just the data that will fill the LOD quadrants, so that explains some of the difference, but not the Cell dimensions!Stevewww.fs-traveler.com

Share this post


Link to post
Share on other sites

Holger,That makes perfect sense- my dems come in those very small packets. Thanks so much for your help- I'm seeing the terrain in the sim now, just not very much of it!Chris

Share this post


Link to post
Share on other sites

Steve,Great info too! I think I will see if LOD 12 is worth it!Thanks so much...Chris>I had to do a bit more to create the mesh using your data.>>The next step is to tell Microdem you've changed the scale.>This involves editing the header:>>In/Out -> Edit -> Header>>Change the vertical scale to Meters.>>The data seems to be in UTM format. You can change it to>lat/long and convert to the preferred WGS84 as follows:>>Load the dem and File -> Save DEM ->DTED>specify a spacing of 0.33>>Then load the DT1 file and save it as 16-bit BSQ. >>This is a pretty small area once resample gets done with it.>I've attached a text file I produce for each mesh file I>create, and you can see how little is left, even when using an>LOD of 12. (You will have to edit the fs9.cfg file to see this>LOD; set the TERRAIN_MAXIMUM_VERTEX_LEVEL TO 21).>>I recomment setting the LOD in the inf manually. 11 is the>smallest value that will produce any mesh at all from this>small set of data.>>You may want to download a few more surrounding dems and merge>them in Microdem. This is one of those situations where Bigger>is Better!>>Steve>www.fs-traveler.com>>

Share this post


Link to post
Share on other sites

>Steve,>>Great info too! I think I will see if LOD 12 is worth it!>>Thanks so much...>Chris>Absolutely great instructions. I was finally able to get new "bumps" where I wanted to with the DEM I was working with. However.... looking for additional advice. In your example .inf file, you had the CellY and CellXdimensionDeg set to the same (at 8.3e-05). The topo I'm working with is up around latitude 57, and there are differences. Is it materially important? In your instructions you specified a spacing of 0.33 for the DEM->DTED. Does that matter? Or should I estimate what the spacing should be? I have about 20,000 hectares (and hope to acquire more) of high-res topo data (10m grid, true 15 centimeter vertical accuracy - low level aerial survey + data the old fashioned way (i.e., ground survey). Breaklines were included/honoured in the grid generation. The source is in a local (planar) grid, but is easy to convert to UTM(NAD83). I also have a 1m pixel orthophoto to drape over the topo. I've got a reasonably hot computer (3GHzP4, 800FSB, 1 Gig memory, ATI9800Pro). How do I generate optimum results? (optimum being the most realistic terrain for the above data & computer). I'm confused about the LOD settings in FS9 (and don't appear to be the only one). The LOD tables appear to indicate a higher res than I've read FS9 is capable (willing?) to support. I'm a real newbie at this terrain thing... how do you merge real topo data into what FS9 thinks it should be (i.e., smooth transition). Thanks in advance. The information you have provided so far has been priceless. Bruce

Share this post


Link to post
Share on other sites

Hi Bruce,"Absolutely great instructions. I was finally able to get new "bumps" where I wanted to with the DEM I was working with."Glad we could help. And welcome to the Forums."In your example .inf file, you had the CellY and CellXdimensionDeg set to the same (at 8.3e-05). The topo I'm working with is up around latitude 57, and there are differences. Is it materially important? In your instructions you specified a spacing of 0.33 for the DEM->DTED. Does that matter? Or should I estimate what the spacing should be?"Good question. There are several issues involved here.We can't read the elevation data in the bgl produced by Resample, so we don't really know what it is doing. It may be possible to provide data to Resample that starts at the NW corner of an LOD quadrant and has the same spacing as the LOD used. We can only hope that Resample will simply convert this data into it's own format in the bgl, with no interpolation. In general, however, our data provides information Resample uses to construct its own version of the terrain; few, if any, of the original data points remain as is. We use the inf file to both describe the source data to Resample and to specify the final resolution to use when creating the new terrain (by specifying the LOD).Using Microdem to create a dataset in DTED format is essentially the same process. Our source data provides information to Microdem, which it uses to create the new "terrain model" in DTED format. In this case, the source data is self-describing, so no additional inf-like information is required. We tell Microdem the desired new resolution by providing X and Y resolutions in the Save As dialog box (0.33 arcsec in the above case).Several factors influence the value used here:* we can try to minimize the amount of interpolation required at this stage by specifying a new resolution that is approximately the same as the source data. In this example, I chose 0.33 arcsec because the source data is 10m, which is about 1/3 arcsec (although this varies with location, as you noted).* we can try to minimize the amount of interpolation required when Resample processes the data. In that situation, we should attempt to match the resolution with that of the target LOD resolution.Which of the above is preferred probably depends on which interpolation algorithm you believe is best. It probably does not matter whether you use the same or different X and Y spacing at this point, but eventually Resample will use a flat "projection" for the data, with no allowance for latitude, so it seems reasonable to create the data in that format. The critical point at this stage is insuring that you describe the data (CellX and CellY dimensions) correctly in the inf file.* if you wish to use Microdem to merge source data having different resolutions, you can convert the different sources to the same resolution by specifying the common resolution during conversion to DTED format, then merging the DTED files, creating a DEM with the desired final resolution. For example, 30arcsec GTOPO data can be converted to 3 arcsec DTED format (by oversampling) and 3 arcsec SRTM data can be converted to DTED format using the same 3arcsec spacing. These two sets can then be merged (specify the GTOPO30 data first in the merge process, so elevation points will be replaced by the higher resolution SRTM data, where available).In each case, we are specifying the TARGET resolution, not describing the source data. Microdem handles the conversion of fixed UTM spacing to the variable lat/lon spacing when it processes the data."How do I generate optimum results? (optimum being the most realistic terrain for the above data & computer)."Hmmm. That depends, at least in part, on your definition of "optimum". Aside from handling the mechanical issues above, the most critical decision for me is the selection of the LOD for the mesh. I generally try to match the LOD to the resolution of the source data, up to a point. As you note below, FS9 won't display the additional detail in mesh having an LOD greater than 11, and the radius of the displayed mesh drops off with increasing LOD, so I prefer going no higher than LOD 10 at this time. This provides my optimal combination of detail and radius where it is displayed."I'm confused about the LOD settings in FS9 (and don't appear to be the only one). The LOD tables appear to indicate a higher res than I've read FS9 is capable (willing?) to support."The sim will support those higher LOD values (at least up to LOD13, if you modify the fs9.cfg file), but will not display the additional detail. I feel the only valid reason for using a higher LOD is to force the use of your mesh in an area where the existing terrain LOD might otherwise prevent yours from being seen. In that case you can use a higher LOD to insure its use. (Although you can usually manage this precedence by carefully arranging the layers in the Scenery Library.) "I'm a real newbie at this terrain thing... how do you merge real topo data into what FS9 thinks it should be (i.e., smooth transition)."If you mean the transition along the boundaries between the high resolution mesh and the default, there is no practical way to do so. This would require determining the elevations of the default along the perimeter of your new mesh and then altering the elevation of your mesh to fit with the default. Neither is realistic. I just construct mesh for a large enough area so I rarely encounter those boundaries. (Continental coastlines help here!)There is another "transition" issue here as well. When we add mesh with a resolution much higher than the default, the sim does not always handle the transition correctly, leaving slivers of blue visible some distance from the aircraft. This is common where we add LOD9 SRTM mesh to areas with very low resolution default mesh. I have been able to eliminate this effect by adding another layer of my mesh constructed at an LOD level just one step above the default. This lower LOD mesh (relative to my own) seems to be rendered to a distance sufficient to either eliminate the problem or at least push it out so far that it is no longer visible. Steve

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