Planetside Software Forums

General => Terragen Discussion => Topic started by: bigben on June 30, 2012, 07:32:50 PM

Title: Geotiff and georeferencing
Post by: bigben on June 30, 2012, 07:32:50 PM
Did a few searches but didn't quite find the info to get me through. With the appeal of georeferencing I thought I'd try creating a tiled terrain set of geotiffs but first things first I've got to get a single terrain working. What I'm getting so far:
* geotiff, no extra files: Terrain with correct altitude range but 1m per pixel
* geotiff with tfw: seemingly georeferenced bounding box but no visible terrain
* manually adjusting size of terrain has no effect (unselected georeference)

I suspect it's more with what I'm doing, so what are the recommended settings for creating georeferenced terrains of earth data?  Happy to test things out if it's still under development. Working on TER versions as well anyway
Title: Re: Geotiff and georeferencing
Post by: Oshyan on June 30, 2012, 08:32:28 PM
What is the source of your data? Have you tried with an "off-the-shelf" GeoTIFF generated by/downloaded from e.g. seamless.usgs.gov? I'm fairly sure those have worked for me in the past, so they might - if nothing else - serve as a reference. I'm also not sure what projections are supported. Certainly the georeferencing support is fairly basic at this point...

- Oshyan
Title: Re: Geotiff and georeferencing
Post by: bigben on June 30, 2012, 08:55:29 PM
The data is exported from GlobalMapper (ASTER GDEM 1.5sec and USGS 10m NED) and so it's essentially rewriting geotiff headers and tfw files. I'm using a database to record coordinates as I need them for creating masks and sourcing other image data so in theory I could write a tfw with whatever would work (that would be homework).  I'll try a downloaded dataset and see what happens.
Title: Re: Geotiff and georeferencing
Post by: jo on June 30, 2012, 09:56:11 PM
Hi Ben,

When the GeoTIFF has a tfw file it will be georeferenced but normally to see it you need to shift the planet origin. What I do is copy the SW corner georeferencing coordinates (you can use the clipboard button to copy the coords) and then paste those into the origin parameter of the planet. This shifts the planet origin to the SW corner of the GeoTIFF. You could also navigate to the place on the planet where the terrain is located but typically it's best to work around the planet origin due to precision issues.

If you uncheck the Georeference checkbox and the GeoTIFF was georeferenced you should get a reasonably sized terrain. TG2 can use the georeferencing coordinates to make a reasonable calculation of the heightfield's size in metres. It's quite approximate though and only works for an Earth sized planet.

EDIT: This gives a reasonably sized terrain which is located at the Heightfield shader position.

How are you manually adjusting the size of the terrain? If you were trying to do that with the XY size parameter of the Heightfield load node that won't work because that is technically a read only parameter (properly read only in v2.5) that's only for information and convenience in copying and pasting. It doesn't effect anything. You can resize the heightfield with a Heightfield resize operator though.

Welcome back BTW :-).

Regards,

Jo
Title: Re: Geotiff and georeferencing
Post by: bigben on July 01, 2012, 01:34:21 AM
Hi Jo

Thanks for the info.  I guessed the size parameter I was editing was read only  ::)  I can get a reasonable terrain from an SRTM file without georeferencing but when I try to georeference it using the method you described I still get a flat terrain.  I'll stick to TERs for now as I still have to read my own posts for using my blending masks  ;)  ... and it is ultimately easier to work on top of the globe for most stuff
Title: Re: Geotiff and georeferencing
Post by: RArcher on July 03, 2012, 01:58:30 PM
Hi Ben,

I find when exporting from GlobalMapper, that if I select the Elevation (32 bit Floating Point Samples) option combined "Generate a .tfw" and "Generate a .prj" options that things load into TG pretty easily.

Most of this information is way below your level of expertise, but you can take a quick read through the following for info about the lat/long at apex bit.  http://www.archer-designs.com/tutorials/terragen2/usgs-data-terragen-2/index.html (http://www.archer-designs.com/tutorials/terragen2/usgs-data-terragen-2/index.html)
Title: Re: Geotiff and georeferencing
Post by: bigben on July 03, 2012, 10:25:32 PM
Hi Ryan

Nice tutorial.  It all boiled down to me forgetting to change the projection to geographic  :-[ doh! ... and on that note, it may be worth mentioning that texture maps for larger areas may need spherical projection rather than plan Y to match the terrain. The differences will be negligible for small terrains and plan Y is easier to set up but eventually it will be noticeable as the size increases