Problem about open multiband raster image

Mar 14, 2013 at 8:25 AM
Hi all

I don't know how to load a multiband raster image with 4 bands(.tif). The function Grid.Open( ) can only load 1 band. Now I need to load multiband image in the way of RGB composite and get pixel value of all bands. Is there some methods besides using GDAL?
Coordinator
Mar 14, 2013 at 4:14 PM
JuSong,

MapWinGIS is not capable of opening multiband rasters. Sorry about that.

- Dan

----------------------------------
Daniel P. Ames, Ph.D., P.E.
Associate Professor, Civil & Environmental Engineering
Brigham Young University, Provo, Utah


On Thu, Mar 14, 2013 at 2:25 AM, JuSong <notifications@codeplex.com> wrote:

From: JuSong

Hi all

I don't know how to load a multiband raster image with 4 bands(.tif). The function Grid.Open( ) can only load 1 band. Now I need to load multiband image in the way of RGB composite and get pixel value of all bands. Is there some methods besides using GDAL?

Read the full discussion online.

To add a post to this discussion, reply to this email (mapwingis@discussions.codeplex.com)

To start a new discussion for this project, email mapwingis@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Mar 15, 2013 at 2:36 AM
Dan,

Thank you for your reply. But I'm a little confused. I can open multiband rasters by the function Image.Open and display on the screen by axMap.AddLayer. But I don't konw whether the display conbine 3 bands or only one band.

Now I can get the position of pixel in mapcontrol and using GDAL to get values of different bands. But the key point is how to pick 3 bands and display them correctly.
Coordinator
Mar 15, 2013 at 1:21 PM
Is your tiff an RGB file? If so you can open it as an image.
The 3 bands will be combined to create a color: 255;255;255 is black. Each band has the value 255.

If you have the latest version of MapWindow (http://tinyurl.com/mwMonthly) you'll have in the toolbox a tool called 'Gdal Info'.
With this tool you can see the info of your image.
If it says RGB your file will be opened in color using all 3 bands.
Mar 18, 2013 at 2:15 AM
The tiff is an remote sensing image and it has 4 bands. I need to pick 3 bands to display. And the image display is different from ENVI or Arcgis. Here is the result of 'Gdal Info'. Is there any way to display tif file like ENVI?

Driver: GTiff/GeoTIFF
Files: E:\rootPathSimu\ZY3\ZY31210101699.tif
   E:\rootPathSimu\ZY3\ZY31210101699.tif.ovr
   E:\rootPathSimu\ZY3\ZY31210101699.tif.aux.xml
Size is 8856, 8476
Coordinate System is `'
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 8476.0)
Upper Right ( 8856.0, 0.0)
Lower Right ( 8856.0, 8476.0)
Center ( 4428.0, 4238.0)
Band 1 Block=8856x1 Type=UInt16, ColorInterp=Gray
Min=148.000 Max=1433.000
Minimum=148.000, Maximum=1433.000, Mean=246.226, StdDev=103.760
NoData Value=-3.4028234663852901e+038
Overviews: 2214x2119, 1107x1060, 554x530, 277x265, 139x133
Metadata:
STATISTICS_MAXIMUM=1433
STATISTICS_MEAN=246.22623683887
STATISTICS_MINIMUM=148
STATISTICS_STDDEV=103.75989436924
Band 2 Block=8856x1 Type=UInt16, ColorInterp=Undefined
Min=100.000 Max=1792.000
Minimum=100.000, Maximum=1792.000, Mean=263.200, StdDev=141.751
NoData Value=-3.4028234663852901e+038
Overviews: 2214x2119, 1107x1060, 554x530, 277x265, 139x133
Metadata:
STATISTICS_MAXIMUM=1792
STATISTICS_MEAN=263.20044155707
STATISTICS_MINIMUM=100
STATISTICS_STDDEV=141.75074998538
Band 3 Block=8856x1 Type=UInt16, ColorInterp=Undefined
Min=0.000 Max=1431.000
Minimum=0.000, Maximum=1431.000, Mean=215.292, StdDev=134.438
NoData Value=-3.4028234663852901e+038
Overviews: 2214x2119, 1107x1060, 554x530, 277x265, 139x133
Metadata:
STATISTICS_MAXIMUM=1431
STATISTICS_MEAN=215.29206853998
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=134.43767799053
Band 4 Block=8856x1 Type=UInt16, ColorInterp=Undefined
NoData Value=-3.4028234663852901e+038
Overviews: 2214x2119, 1107x1060, 554x530, 277x265, 139x133
Coordinator
Mar 18, 2013 at 7:53 AM
You probably need to gdal_translate your tiff to a 3 band RGB tiff to display it properly in MapWindow.
I'm not sure how to achieve that. You can have a look here http://www.gdal.org/gdal_translate.html
You can use the tool from MapWindows toolbox calles Translate image to use the same parameters.

Perhaps you need gdal_warp http://www.gdal.org/gdalwarp.html. We have implemented this in the ocx as well, but have not created a tool for the toolbox yet.

Paul
Coordinator
Mar 18, 2013 at 3:03 PM
We've also implemented multiband tiff's in the MapWindow sister project DotSpatial (dotspatial.codeplex.com).

----------------------------------
Daniel P. Ames, Ph.D., P.E.
Associate Professor, Civil & Environmental Engineering
Brigham Young University, Provo, Utah


On Sun, Mar 17, 2013 at 8:15 PM, JuSong <notifications@codeplex.com> wrote:

From: JuSong

The tiff is an remote sensing image and it has 4 bands. I need to pick 3 bands to display. And the image display is different from ENVI or Arcgis. Here is the result of 'Gdal Info'. Is there any way to display tif file like ENVI?

Driver: GTiff/GeoTIFF
Files: E:\rootPathSimu\ZY3\ZY31210101699.tif
   E:\rootPathSimu\ZY3\ZY31210101699.tif.ovr
   E:\rootPathSimu\ZY3\ZY31210101699.tif.aux.xml
Size is 8856, 8476
Coordinate System is `'
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 8476.0)
Upper Right ( 8856.0, 0.0)
Lower Right ( 8856.0, 8476.0)
Center ( 4428.0, 4238.0)
Band 1 Block=8856x1 Type=UInt16, ColorInterp=Gray
Min=148.000 Max=1433.000
Minimum=148.000, Maximum=1433.000, Mean=246.226, StdDev=103.760
NoData Value=-3.4028234663852901e+038
Overviews: 2214x2119, 1107x1060, 554x530, 277x265, 139x133
Metadata:
STATISTICS_MAXIMUM=1433
STATISTICS_MEAN=246.22623683887
STATISTICS_MINIMUM=148
STATISTICS_STDDEV=103.75989436924
Band 2 Block=8856x1 Type=UInt16, ColorInterp=Undefined
Min=100.000 Max=1792.000
Minimum=100.000, Maximum=1792.000, Mean=263.200, StdDev=141.751
NoData Value=-3.4028234663852901e+038
Overviews: 2214x2119, 1107x1060, 554x530, 277x265, 139x133
Metadata:
STATISTICS_MAXIMUM=1792
STATISTICS_MEAN=263.20044155707
STATISTICS_MINIMUM=100
STATISTICS_STDDEV=141.75074998538
Band 3 Block=8856x1 Type=UInt16, ColorInterp=Undefined
Min=0.000 Max=1431.000
Minimum=0.000, Maximum=1431.000, Mean=215.292, StdDev=134.438
NoData Value=-3.4028234663852901e+038
Overviews: 2214x2119, 1107x1060, 554x530, 277x265, 139x133
Metadata:
STATISTICS_MAXIMUM=1431
STATISTICS_MEAN=215.29206853998
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=134.43767799053
Band 4 Block=8856x1 Type=UInt16, ColorInterp=Undefined
NoData Value=-3.4028234663852901e+038
Overviews: 2214x2119, 1107x1060, 554x530, 277x265, 139x133

Read the full discussion online.

To add a post to this discussion, reply to this email (mapwingis@discussions.codeplex.com)

To start a new discussion for this project, email mapwingis@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Mar 23, 2013 at 6:20 AM
Would you give me some sample code, or which function can do this work?