Newbie: How to load geotiff files?

Started by atzibala, November 15, 2009, 04:15:12 PM

Previous topic - Next topic

atzibala

Hello:

I am a newbie at terragen and just yesterday I tried Ben McDuff's tutorial, which helped me to overcome some fears and become acquainted with the interface (result attached).

In this year I have been working with terrains for virtual reality applications. My usual tools are GDAL, QGIS, OpenScenegraph, and Virtual Planet Builder. Now I'd like to use terragen2 to get some realistic and good looking over flights of those terrains. All my terrains are created from real data, from USGS SRTM or other similar sources. I use georeferenced file formats, mainly GeoTiff.

I have read in this forum about people using georeferenced images, but I can't find  a way to import them without converting them previously to terragen's own file format. Which is the way? Which are the requirements?

Sorry if this is a stupid question. I will appreciate any help.

Alex



Kadri

There are many topics . But in this one    Ryan Archer  says  " When choosing Load Heightfield, it would be nice if there was an option to filter by .tif files similar to the options to filter by .ter, .bmp, .tga.  As it is now, it is necessary to first select "all files" and then search through all you files to find the .tif file. "
I don't know if it is the same now.

http://forums.planetside.co.uk/index.php?topic=6025.msg70976#msg70976

There are other things too there.

Cheers.

Kadri

Oshyan

That's correct, the format is not listed on the format dropdown in load file dialogs, but it *is* supported.

- Oshyan

atzibala

Quote from: Oshyan on November 15, 2009, 09:51:16 PM
That's correct, the format is not listed on the format dropdown in load file dialogs, but it *is* supported.

But which are the conditions for this support? I tried with a small terrain and it complains with the following error message:

    ReadImage: Please convert image to SGI for non-standard bit depths

Does it means that it doesn't support tifs with bit depths > 8 ?!!   The conversion to SGI format also only works with 8bit depths. I understand that terragen uses meter units. My tif images are in meters for the height. How can I use 8bit depths for real mountains?

Atzibala


Oshyan

It should support 16 bit GeoTIFF at the least. What is the source of your data? Can you provide a sample?

- Oshyan

atzibala

Sure. This one is the Popocatepetl mountain. The archive contains the original bil and hdr data, my converted tif file and a PNG image (which by the way works but it's just 8 bit depth and non georeferenced).

The output from gdalinfo popo.tif is

Driver: GTiff/GeoTIFF
Files: popo.tif
Size is 300, 300
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.2572235630016,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (-98.666666666666671,19.066666666666666)
Pixel Size = (0.000277777777778,-0.000277777777778)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( -98.6666667,  19.0666667) ( 98d40'0.00"W, 19d 4'0.00"N)
Lower Left  ( -98.6666667,  18.9833333) ( 98d40'0.00"W, 18d59'0.00"N)
Upper Right ( -98.5833333,  19.0666667) ( 98d35'0.00"W, 19d 4'0.00"N)
Lower Right ( -98.5833333,  18.9833333) ( 98d35'0.00"W, 18d59'0.00"N)
Center      ( -98.6250000,  19.0250000) ( 98d37'30.00"W, 19d 1'30.00"N)
Band 1 Block=300x13 Type=UInt16, ColorInterp=Gray
  NoData Value=0



Oshyan

Strange, I do get the same error message, I can make it go away by re-saving from Photoshop into Mac byte order (odd), but then it just doesn't show anything. I think it's a format issue of some kind though. The TIFF "standard" is unfortunately not very standard. What software did you use to do the conversion?

- Oshyan

atzibala

Quote from: Oshyan on November 17, 2009, 02:31:10 AM
The TIFF "standard" is unfortunately not very standard. What software did you use to do the conversion?

GDAL, http://www.gdal.org/


RArcher

Sorry, I don't know anything about the GDAL software, but I took the .bil file you uploaded in your zip file, loaded it into GlobalMapper and resaved it out as a 32bit .tif.  Works fine in TG2.

You can also easily use the geotiff's that you can download directly from seamless.usgs.gov without doing any sort of converting.  You can most likely also do any conversions via 3DEM as well.

I've attached the 32bit tiff file.

himalofa

I use 3Dem to convert hgt files direct to terragen, you can then georeference the corner. However the heights seem to get messed up and I have just been adjusting the heights to approximate real photos. Proper importation of DEM's and hgt files with the georeference data would be good.

Oshyan

TG2 does import the reference format of GeoTIFF, which is a common DEM data format. I'd recommend using that in all cases where DEM data is necessary, rather than converting to TER which yes, is likely to lose absolute height info, along with actual georeferencing. GeoTIFFs are properly georeferenced.

- Oshyan

atzibala

Quote from: Oshyan on November 23, 2009, 02:36:57 AM
TG2 does import the reference format of GeoTIFF, which is a common DEM data format. I'd recommend using that in all cases where DEM data is necessary, rather than converting to TER which yes, is likely to lose absolute height info, along with actual georeferencing. GeoTIFFs are properly georeferenced.

As you said above, GeoTIFF apparently is not quite standard. We need to know exactly which features of GeoTiff are supported. Since I posted this, I have tried some tiff files from USGS as suggested, without success.

atzibala

Quote from: RArcher on November 17, 2009, 11:32:03 AM
Sorry, I don't know anything about the GDAL software, but I took the .bil file you uploaded in your zip file, loaded it into GlobalMapper and resaved it out as a 32bit .tif.  Works fine in TG2.

Thanks Ryan. Can you please show us an image of your results?

As I said above, I have had no success with other geotiff files. I will keep trying.


RArcher

All the geotiff files from seamless.usgs.gov should work fine as well as any other DEM data.  One thing to remember though after you have loaded the file into TG2 is to adjust the Lat/Long at Apex value in the planet node to be somewhere around the area you are working with.

Here are a couple images I've done with GIS Data:

http://forums.planetside.co.uk/index.php?topic=8095.0
http://forums.planetside.co.uk/index.php?topic=7219.0

Also here is a simple tutorial working with various forms of GIS data that may be of some use to you simply to get some of the concepts down:

http://www.archer-designs.com/tutorials/terragen2/working-with-gis-data/index.html

Oshyan

Do you get errors with the USGS GeoTIFFs are just no terrain when loaded?

- Oshyan