2013-07-09 93 views
0

我试图导入一些(Matlab生成的)GeoTIFF文件到WorldWind中,但似乎没有任何运气。任何有用的提示将非常感激。该文件的GeoTIFF做在ArcGIS显示效果细腻(让我当我出口营造一个.TFW文件),但世界风使我有以下消息:geoTIFF在worldwind中导入:::无法读取栅格:无法解密图像组织

SEVERE: Cannot read raster: C:\Users\Matthias\Desktop\geotiff\fldextent_02- 
Jan-1977(1)renderedno0.tif : gov.nasa.worldwind.formats.tiff.GeotiffImageReader.read(): unable 
to decipher image organization 
Jul 09, 2013 6:54:33 PM gov.nasa.worldwind.data.CachedDataRaster drawOnTo 
SEVERE: C:\Users\Matthias\Desktop\geotiff\fldextent_02-Jan-1977(1)renderedno0.tif : Cannot read 
raster: C:\Users\Matthias\Desktop\geotiff\fldextent_02-Jan-1977(1)renderedno0.tif : 
gov.nasa.worldwind.formats.tiff.GeotiffImageReader.read(): unable to decipher image organization 
gov.nasa.worldwind.exception.WWRuntimeException: Cannot read raster: C:\Users\Matthias\Desktop 
\geotiff\fldextent_02-Jan-1977(1)renderedno0.tif : 
gov.nasa.worldwind.formats.tiff.GeotiffImageReader.read(): unable to decipher image organization 
    at gov.nasa.worldwind.data.CachedDataRaster.getDataRasters(CachedDataRaster.java:255) 
    at gov.nasa.worldwind.data.CachedDataRaster.drawOnTo(CachedDataRaster.java:290) 
    at gov.nasa.worldwind.data.TiledRasterProducer.drawDataSources(TiledRasterProducer.java:576) 
[...] 

我也看了的GeoTIFF文件的FWTools属性这给了我:

C:\Users\Matthias\Desktop\geotiff>gdalinfo fldextent_02-Jan-1977(1)renderedno0.tif 
Driver: GTiff/GeoTIFF 
Files: fldextent_02-Jan-1977(1)renderedno0.tif 
    fldextent_02-Jan-1977(1)renderedno0.tfw 
Size is 7200, 7200 
Coordinate System is: 
GEOGCS["WGS 84", 
    DATUM["WGS_1984", 
     SPHEROID["WGS 84",6378137,298.257223563, 
      AUTHORITY["EPSG","7030"]], 
     AUTHORITY["EPSG","6326"]], 
    PRIMEM["Greenwich",0], 
    UNIT["degree",0.0174532925199433], 
    AUTHORITY["EPSG","4326"]] 
Origin = (99.000000000000000,7.000000000000000) 
Pixel Size = (0.000833333333333,-0.000833333333333) 
Metadata: 
    AREA_OR_POINT=Area 
Image Structure Metadata: 
    INTERLEAVE=BAND 
Corner Coordinates: 
Upper Left ( 99.0000000, 7.0000000) (99d 0'0.00"E, 7d 0'0.00"N) 
Lower Left ( 99.0000000, 1.0000000) (99d 0'0.00"E, 1d 0'0.00"N) 
Upper Right (105.0000000, 7.0000000) (105d 0'0.00"E, 7d 0'0.00"N) 
Lower Right (105.0000000, 1.0000000) (105d 0'0.00"E, 1d 0'0.00"N) 
Center  (102.0000000, 4.0000000) (102d 0'0.00"E, 4d 0'0.00"N) 
Band 1 Block=128x128 Type=Byte, ColorInterp=Gray 
    NoData Value=0   

的.TFW文件读取:

0.0008333333 
0.0000000000 
0.0000000000 
-0.0008333333 
99.0004166667 
6.9995833333 

回答

0

我发现最后的问题:

重要的是在Matlab中创建一个CLEAN GeoTIFF文件(用于透明度的RGB和alpha层)。这里有一些Matlab的指导,生成的GeoTIFF可以直接导入到WorldWind中:

%%% read intensity values Z (2D matrix) - with values of 0 and above 
%%% (we want 0 to be completely transparent in the final geotiff) - 
%%% together with spatialref.GeoRasterReference ss 
[Z, ss] = geotiffread('./flddph_1976-01-01.tif'); 
info_3 = geotiffinfo('./flddph_1976-01-01.tif'); 

%%% generate indexed image with 0 to 255 (255 equals max. intensity) 
indexedimage = gray2ind(Z); 
indexedimage = double(indexedimage); 

%%% normalize so that everything between 0 and 1 
normalizedimg = (indexedimage)/255; 

%%% scaling data and applying colormap 
imgscaled = uint8(256*normalizedimg); % scale data 

cmp = makeColorMap([1 1 0],[1 0.75 0],[1 0 0],256); 
% 256 element colormap yellow - orange - red 
% (download appropriate function MAKECOLORMAP) 
imgrgb = ind2rgb(imgscaled,cmp); 

%%% check plot 
% subplot(2,1,1) 
% imagesc(indexedimage) 
% title('indexed image') 
% subplot(2,1,2) 
% image(img) 
% title('rgb image') 

%%% generating alpha layer for transparency 
%%% (255 for non-transparent, 0 for transparent) 

alpha3 = Z; 
alpha3(alpha3>0)=255; 
alpha3 = uint8(alpha3); 

out2 = cat(3,imgrgb,alpha3); 

geotiffwrite('test_rgbhope_flddph.tif',out2,ss);