L3DT users' community
Large 3D terrain generator

Cropping Heightfields

Any and all chit-chat regarding L3DT.

Cropping Heightfields

Postby BigYak » Thu Aug 06, 2009 2:09 pm

I searched the forums, but didn't find any suggestions..


If I want to crop a Heightfield, is there a preferred way to do so?

For example, if I want to import real-world terrain to Torque using this tutorial: http://www.bundysoft.com/wiki/doku.php? ... :l3dt:srtm

But, instead of a 6001x6001 pixel heightmap, I'd like to crop it to 2048x2048. Photoshop editing the GeoTIF doesn't keep all of the metadata, so I need another way to crop. I can make a selection within L3DT, but don't seem to be able to crop it to that selection.

Any suggestions on tool/processes to edit GeoTIFs?

Also, if we resize a GeoTIF (ie from 6001 to 2048), should it also resize the Horizontal Scale? (ie, from 92.69 to 31.63)?

Thanks always for great tools!
BigYak
New member
 
Posts: 9
Joined: Mon Oct 09, 2006 3:27 pm

Postby Aaron » Sun Aug 09, 2009 3:09 am

Hi BigYak,

If you have the latest developmental build of L3DT, there is a fairly straightforward way to crop the heightfield:
  • Use the select area mouse tool to select the desired area of the heightfield, or use the 'Edit->Select area...' to exactly specify the coordinates (remember: coordinate origin is at bottom-left of screen).
  • Select 'Edit->Copy'.
  • Select 'Edit->Paste as new layer'.
  • When prompted for the layer name, enter "HF" to overwrite the current heightfield.

If you are not using the latest version of L3DT, you can do a similar trick, except that instead of copying and pasting, you need to export the selected area as a heightfield file, then re-import it as the heightfield. This approach may loose some of the metadata (not sure about this).

Also, if we resize a GeoTIF (ie from 6001 to 2048), should it also resize the Horizontal Scale? (ie, from 92.69 to 31.63)?


If you resize a heightfield from 6001x6001 to 2048x2048, the horizontal scale must increase by a factor of 2.93 for it to cover the same geographic area. The 'Operations->Heightfield->Resize heightfield' menu option will calculate and apply the correct horizontal scale for you.

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

Postby BigYak » Sun Aug 09, 2009 4:01 pm

As always, Thanks Aaron!
BigYak
New member
 
Posts: 9
Joined: Mon Oct 09, 2006 3:27 pm


Return to General discussion

Who is online

Users browsing this forum: No registered users and 11 guests

cron