World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 02-24-2011, 03:16 PM   #1
BrunoSpy
Senior Member
 
Join Date: Aug 2009
Location: Paris
Posts: 233
BrunoSpy is on a distinguished road
Default Error importing Geotiff

Hi !

I just tried to import Geotiff; I wanted to see GDALraster in action but I have the following error :

GRAVE: Exception while reading E:\SIA_2010-1_001001.TIF: Region for E:\SIA_2010-1_001001.TIF not found in world files
BrunoSpy is offline   Reply With Quote
Old 02-24-2011, 06:29 PM   #2
nlneilson
Super Moderator
 
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,624
nlneilson is on a distinguished road
Default

.tif files usually have a .tfw with it, the w indicates it is the world file.
It is a small file that looks like this:

63.508293000000009

0.0

0.0

-63.508293000000009

-348337.85969737754

276906.82253528311

Find the .tfw and place it with the .tif file.
nlneilson is offline   Reply With Quote
Old 02-25-2011, 08:53 PM   #3
tag
WWJ Technical Manager
 
Join Date: May 2007
Location: Seattle
Posts: 1,041
tag is on a distinguished road
Default

Are you sure it's a GeoTIFF? If it is it will have all the necessary projection and location info within it. If it's just a TIFF then you do indeed need an accompanying world (.tfw) file, and a projection file if it's not in EPSG:4326 (lat/lon WGS84).

If it is truly a GeoTIFF, if you could post it or get it to us privately we can debug the problem.
tag is offline   Reply With Quote
Old 02-25-2011, 10:21 PM   #4
nlneilson
Super Moderator
 
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,624
nlneilson is on a distinguished road
Default

http://www.remotesensing.org/geotiff...20from%20TIFF?
FWTools
gdalinfo SIA_2010-1_001001.TIF
would show what is in the .tif file
I followed an example on how to make a world .tfw file.

If the "geographic (or cartographic) data" is not in the file you would probably
need to place, orient and scale it to use it.

I tried importing a GeoTiff in WWJ, AFAIR without the the .tfw and it worked OK.

Last edited by nlneilson; 02-25-2011 at 10:27 PM.
nlneilson is offline   Reply With Quote
Old 02-28-2011, 01:52 PM   #5
BrunoSpy
Senior Member
 
Join Date: Aug 2009
Location: Paris
Posts: 233
BrunoSpy is on a distinguished road
Default

(sorry for the delay)

Yes, it's a Geotiff with its tfw file.

sampl.zip
BrunoSpy is offline   Reply With Quote
Old 02-28-2011, 08:55 PM   #6
garakl
Administrator
 
Join Date: May 2006
Location: Seattle
Posts: 250
garakl is on a distinguished road
Default

To BrunoSpy

I just tried to load the file, and the first problem with the file is that it has the extension TIF, while the matching world file is .tfw. This may not be a problem on windows machines, but on mac or linux - it is a problem.

Once I renamed to the lower case .tif I was able to run a gdalinfo command, which showed a next problem - unknown projection.

Code:
SIA_2010-1_001001.tif 
Driver: GTiff/GeoTIFF
Files: SIA_2010-1_001001.tif
       SIA_2010-1_001001.tfw
Size is 3000, 3000
Coordinate System is `'
Yes, it looks like it is an UTM projection, but unfortunately, world files do not provide projection information, and without knowing UTM zone it is not possible to "guess" coordinates.

Projection and zone info is provided by a file with the same name as the original raster, but has the .prj extension.

In case you know the correct UTM zone, you can fix it with one of the GDAL command line tools : gdal_translate or gdalwarp :

Let's say your UTM zone is 11:

Code:
gdalwarp -rc -t_srs '+proj=utm +zone=11 +datum=WGS84' SIA_2010-1_001001.tif utm11.tif
I prefer gdalwarp, because you can select what kind of interpolation to use (-rc in my example above, "cubic" interpolation),
while gdal_transalte is limited to the fastest but worst interpolation "nearest neighbor" resampling algorithm.

In this case, your destination file will contain both georeference and projection information embeddd in the "tif" file itself, so you will not need tfw and prj files anymore.
garakl is offline   Reply With Quote
Old 02-28-2011, 09:01 PM   #7
BrunoSpy
Senior Member
 
Join Date: Aug 2009
Location: Paris
Posts: 233
BrunoSpy is on a distinguished road
Default

It's not an UTM projection but a Lambert.

I use gdalwarp to translate my tiffs, but I hoped that it will not be necessary with the integration of gdal into WWJ.

Here is the command I use to convert this file :

gdalwarp -s_srs '+proj=lcc +lat_1=44 +lat_2=49 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000' -t_srs '+proj=longlat +datum=WGS84' -dstnodata 255 -dstalpha

Some informations about the projection we use : http://www.remotesensing.org/geotiff...ormal_2sp.html

Last edited by BrunoSpy; 02-28-2011 at 09:07 PM.
BrunoSpy is offline   Reply With Quote
Old 02-28-2011, 09:51 PM   #8
garakl
Administrator
 
Join Date: May 2006
Location: Seattle
Posts: 250
garakl is on a distinguished road
Default

Did you export the file into WWJ after the reprojection?

Last edited by garakl; 02-28-2011 at 09:56 PM.
garakl is offline   Reply With Quote
Old 02-28-2011, 10:00 PM   #9
garakl
Administrator
 
Join Date: May 2006
Location: Seattle
Posts: 250
garakl is on a distinguished road
Default

To use GDAL version, you should have a GDAL dynamic library in the PATH or in the current folder. Do you have the gdalalljni.dll in the current folder or in one of the subfolders?
Just to have GDAL binaries somewhere on your machine does not enable GDAL functionality.

Even if you have the correct GDAL dynamic library in place, we still will not be able to load a raster
IF GDAL cannot figure out coordinates AND projection of the raster file.
This happens when the raster file does not embed projection and coordinate information OR the matching world and projection files are missing.

Last edited by garakl; 02-28-2011 at 10:30 PM.
garakl is offline   Reply With Quote
Old 02-28-2011, 10:24 PM   #10
nlneilson
Super Moderator
 
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,624
nlneilson is on a distinguished road
Default

libgdalalljni.dll ??
did you mean gdalalljni.dll or libgdalalljni.jnilib for Mac
nlneilson is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Geotiff File error tbrooks Development Help 3 04-06-2011 05:22 PM
problem with ImportingElevations and custom geotiff xnfinite Development Help 1 10-22-2010 07:24 AM
GeoTiff Support jas511 Development Help 4 02-02-2010 12:30 PM
Where to get the GEOTIFF Lat Lon values herehere Development Help 15 07-22-2009 11:48 PM
converting dds format to geotiff SDNewman WorldWind General 0 12-04-2006 03:27 PM


All times are GMT +1. The time now is 07:59 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.