L3DT users' community
Large 3D terrain generator

Wrong horizontal scale on imported VTP BT height map

Please report software faults here.

Wrong horizontal scale on imported VTP BT height map

Postby mip » Tue Jan 30, 2007 3:34 pm

I experienced that L3DT (Version: Std 2.5 build 6 Build date: 20-Jan-07 - Std, but waiting for my recently purchased Pro key... :D) doesn't set the horizontal scale of imported VTP BT height maps correctly.

I tried VTP BT height maps written by Wilbur and Landserf, both with and without projection info.

Image

Scale value looks correct in all of them, but actual scale is wrong in L3DT.
It doesn't matter if projection info is written in VTP BT.
In this example, the value which leads to the desired scale rather is 20 than 2*10^-4.

PS:
Design map workflow is quite strange and not intuitive. Why not organise it as layers or channels like known from any gfx software? When working on the design map, it's hard to know which scheme or features are being edited currently and a legend is missing completely.
The interface really, really needs some work.
mip
Member
 
Posts: 13
Joined: Tue Jan 30, 2007 2:42 pm

Postby Aaron » Tue Jan 30, 2007 9:03 pm

Hi Mip,

Looking at those dialogs, the resolution shown in Wilbur is the same as is shown in L3DT (2.45E-4m). The number shown on the scalebar in the main window is wrong, but that's just display eye-candy (I never tested it with a pixel resolution of 250 microns). The real resolution is shown in the 'enter horizontal scale of heightfield' number, and that's apparently correct.

I agree the design map is counter-intuitive. The interface, and indeed the whole design map structure, are due for revision later this year.

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby mip » Wed Jan 31, 2007 4:54 am

A correct scale actually makes a difference:
Image
(once with scale set as displayed by l3dt, once with scale corrected manually (by estimation), same default values for calculation queue and TM generation)

aaron wrote:Looking at those dialogs, the resolution shown in Wilbur is the same as is shown in L3DT (2.45E-4m). The number shown on the scalebar in the main window is wrong, but that's just display eye-candy (I never tested it with a pixel resolution of 250 microns). The real resolution is shown in the 'enter horizontal scale of heightfield' number, and that's apparently correct.
This value denotes the pixel width in arc degrees. L3DT incorrectly assumes this value being a dimension in meters.
VTP BT file format might contain projection info, but I think in most cases you can assume lat/lon projection with a WGS84 datum, so calculation isn't too complicated (maybe use an open source library like proj for this if license permits).

PS:
Is there a way to set or change the design map size when starting a project with an imported height field?
mip
Member
 
Posts: 13
Joined: Tue Jan 30, 2007 2:42 pm

Postby Aaron » Wed Jan 31, 2007 6:26 am

Hi Mip,

Can you send me a BT file for testing please? (aaron@bundysoft.com) Most of my testing of BT has been with UTM coordinate system (hence metres). I did have lat/lon working at some point in the past, but that was a long time ago and I'm not too surprised to hear it's broken. Apparently, not too many other users use lat/lon BT's, as this fault hasn't been reported previously.


Is there a way to set or change the design map size when starting a project with an imported height field?


Someone else asked for this yesterday, so I'm actually working on it now.

Regarding design map size, I should mention a few points that may not be obvious to new(ish) users:

The dimensions of the design map are always 1/64th that of the generated heightfield. This is a consequence of the particular terrain algorithm used, and which will be user-configurable in v2.6 but is not now. It can be changed by a suitably designed algorithm plugin in v2.5. If this is what you need, let me know and I'll write the plugin.

Also:

You can import the heightfield as a design map using the file->import->design map option, and this allows you to set the design map size. I'm not sure if this will help in your case, but I thought I'd mention it anyway.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby mip » Wed Jan 31, 2007 1:17 pm

When investigating the problem, I discovered that in my VTP BT height field file, horizontal units (at offset 22) were set to meters, and a geographic projection was used (at offset 24, UTM zone set to 0) with the extents of the raster given in degrees.
Maybe VTP BT specification and related sources (ElevationGridBT, Projections, ...) can give an authoritative answer about what to do in such cases where units of measurement of a projection don't match the horizontal units specified in the BT file (e.g. hor. unit set to deg, using epsg6326 which expects m, or hor. unit to m using epsg4326 which is in deg - maybe asking the user is an option).
So please excuse me for thinking L3DT was wrong concerning this problem. I assumed my VTP BT file was OK, as it could be diplayed correctly by other applications.

Having set horizontal units to degrees manually in my file using a hex editor, the scale in L3DT is now pretty OK, even if the ruler seems to defer by a factor of about 4 compared to measurements in a GIS application: L3DT applies a grid spacing of 85.64m/pixel, whileas the correct value should be at about 23m/pixel.
When using tiled map, horizontal scale doesn't fit at all.


For your reference:
The corrected (units set to degrees, no datum code) HF is at test.bt, the original (units set to m, but UTM zone 0 and EPSG4326 demanding map extents in degrees) is at test_orig.bt.

PS:
Thx for your responsive support and the hint to import an initial height field as a design map.
mip
Member
 
Posts: 13
Joined: Tue Jan 30, 2007 2:42 pm


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 25 guests

cron