Page 1 of 1

Cropping Heightfields

PostPosted: Thu Aug 06, 2009 2:09 pm
by BigYak
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!

PostPosted: Sun Aug 09, 2009 3:09 am
by Aaron
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.

PostPosted: Sun Aug 09, 2009 4:01 pm
by BigYak
As always, Thanks Aaron!