21
Reading Data Reading Data Analysis and applications of remote sensing imagery Instructor: Dr. Cheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last updated: 28 February 2005 Chapter 1 Chapter 1

Reading Data Analysis and applications of remote sensing imagery Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng

  • View
    225

  • Download
    1

Embed Size (px)

Citation preview

Reading DataReading Data

Analysis and applications of remote sensing imagery

Instructor: Dr. Cheng-Chien Liu

Department of Earth Sciences

National Cheng Kung University

Last updated: 28 February 2005

Chapter 1Chapter 1

Outline Outline

Digital image formatDigital image format Header fileHeader file Map informationMap information Vector dataVector data

Digital image formatDigital image format

Sequential and interleaveSequential and interleave• Band sequential (BSQ)• Band interleaved by Pixel (BIP)• Band interleaved by Line (BIL)

Raster vs. vectorRaster vs. vector ENVI image formatENVI image format

• Flat binary fileA binary stream of bytes without embedded non-image data or

structural elements of any type

• Header file

Exercise 1Exercise 1

Reading known image formatsReading known image formats• Open external file• Read Flkeys.tif• Load standard false color bands• Explain why changing the view of main image slows

down the display Finding the cursor’s location and data valueFinding the cursor’s location and data value

• Understand the widget of cursor location/value• Pixel locator• Determine the pixel size by watching the map

coordinates update• Enter a lat/lon coordinate

Header fileHeader file

ENVI header fileENVI header file• A small ascii text file that contains the basic

information that ENVI must know in order to read the image data

• Extension Generation of header fileGeneration of header file

• Importing file• Reading a generic format• Reading a native format (e.g. GeoTiff)

No change save in memoryChange save in disk

View and edit header file in ENVIView and edit header file in ENVI

Exercise 2Exercise 2

Generic import: defining an ENVI headerGeneric import: defining an ENVI header• Open image file: envidata/boulder/bldr_tm.dat

Input: 702 samples, 863 lines, 6 bands, 0 bytes offset, floating point data type, Host byte order, ENVI standard file type, BIP interleave, Band name = Band 1, 2, 3, 4, 5, 7

Check cursor location/value not georeferenced

• Add map informationReference pixel: (526, 645) (480168.67E, 4427572.69N)Projection: UTM, zone 13, North American 1927Pixel size = 30m x 30mWavelength: import ascii file twave6.asc (two columns)

Managing filesManaging files• Open image files: envidata/cup95av/cup95at.int• Wavelength locator• Available file list

Self testSelf test

Repeat exercise 2Repeat exercise 2• Open image file: envidata/boulder/bldr_tm.dat

Input: 702 samples, 863 lines, 6 bands, 0 bytes offset, floating point data type, Host byte order, ENVI standard file type, BIP interleave, Band name = Band 1, 2, 3, 4, 5, 7

Check cursor location/value not georeferenced

• Add map informationReference pixel: (526, 645) (480168.67E, 4427572.69N)Projection: UTM, zone 13, North American 1927Pixel size = 30m x 30mWavelength: import ascii file twave6.asc (two columns)

Map informationMap information

Why and what is mappingWhy and what is mapping• USGS map projections

Two named structureTwo named structure• ENVI_PROJ_STRUCT

Define a map projection

• ENVI_MAP_STRUCTDefine the georeferencing for an ENVI file

Viewing current structure of projectionViewing current structure of projection• proj = ENVI_PROJ_CREATE()• help, proj, /structures

Name: any name except for UTM- or utm- filesProjection type: 38 types (see User guide, appendix D)Projection params: (see User guide, appendix D)Projection units: (e.g. deg = 6, feet = 2, meters = 0)Projection datum: (see C:\RSI\IDL60\products\envi40\map_proj)

Map information (cont.)Map information (cont.)

Viewing current structure of mapViewing current structure of map• map_proj = ENVI_MAP_INFO_CREATE()• help, map_proj , /struct

proj: the ENVI_PROJ_STRUCT variablemc: a 4-element double array, [position in the image in file coordinates,

corresponding map coordinates]ps: a 2-element double array, the pixel size in the sample and line directionsrotationpseudo: a flag used to indicate that the image has not been projected

ENVI files related to map projectionsENVI files related to map projections• map_proj.txt: required parameters up to 15 values• ellipse.txt: ellipse name, semi-major a, semi-minor b• datum.txt:datum name, ellipse name, delta X, delta Y, delta Z

Exercise 3Exercise 3

Getting map informationGetting map information• ENVI_OPEN_FILE, 'C:\RSI\envidata\enviprog\avhrr\

fl_avhrr.img‘• map_infor = ENVI_GET_MAP_INFO(fid=fl_fid)• help, map_infor, /struct• help, map_infor.proj, /struct• print,

ENVI_TRANSLATE_PROJECTION_NAME(map_infor.proj.type)

• Ref to User’s guide, appendix D• print, map_infor.proj.params[2:3]• print, 'pixel sizes = ', map_infor.ps• print, 'Units = ',

ENVI_TRANSLATE_PROJECTION_UNITS(map_infor.proj.units)

Exercise 4Exercise 4

Converting coordinates between map projectionsConverting coordinates between map projections• lat_lon = dblarr(2,50)• fname = ENVI_PICKFILE(filter='*.txt')• OpenR, unit, fname, /Get_LUN• ReadF, unit, lat_lon• Free_LUN, unit• print, lat_lon[*, 0:4]• geo_proj = ENVI_PROJ_CREATE(/geographic)• sanfran_params = dblarr(6)• sanfran_params[0:5] = [a, b, lat0, lon0, x0, y0]

The North America 1983 datum (see map_proj.txt)Projection origin: 37 North Latithde and 122 West LongitudeFalse easting and northing will both be 500,000 meters

Exercise 4 (cont.)Exercise 4 (cont.)

Converting coordinates between map projectionsConverting coordinates between map projections• print,

ENVI_TRANSLATE_PROJECTION_NAME('Polyconic')• sanfran_proj = ENVI_PROJ_CREATE(type=10,

params=sanfran_params, name='WCoast Polyconic', datum='North America 1983')

• help, /struct, geo_proj• help, /struct, sanfran_proj• ENVI_CONVERT_PROJECTION_COORDINATES,

lat_lon[1,*], lat_lon[0,*], geo_proj, mapX, mapY, sanfran_proj• for i=0,49 do print, lat_lon[*,i], mapX[i], mapY[i],

format='(4(F20.5))‘• ENVI_ADD_PROJECTION, sanfran_proj, /write• Check the file: map_proj.txt

Map information (cont.)Map information (cont.)

TWD 67TWD 67

Map information (cont.)Map information (cont.)

TWD 97TWD 97

Exercise 5Exercise 5

Write an IDL program to convert Write an IDL program to convert coordinates between TWD67 and coordinates between TWD67 and TWD97 map projectionsTWD97 map projections• Check file: C:\RSI\IDL60\products\envi40\

map_proj\map_proj.txt• Specify the required parameters for

TWD67: 6378160.0, 6356774.5, 0.000000, 121.000000, 250000.0, 0.0, 0.999900, Hu-Tzu-Shan, TWD67

TWD97: 6378137.0, 6356752.3, 0.000000, 121.000000, 250000.0, 0.0, 0.999900, WGS-84, TWD97

Vector dataVector data

Vector dataVector data• Utilize a coordinate-based system to represent

and locate physical elements such as points, lines, and areas

• Vertices, arcs, polygons

• Compact

• Format supported by ENVI

• Available vectors list

• Vector parameters window

Exercise 6Exercise 6

Vector layer overlay and editingVector layer overlay and editing• File: envidata/vectors/washdc_x.bil• Display: 321 RGB• Georeference image data• Open vector file: cities.shp, roads.shp, counties.shp

Geographic Lat/Lon projection with WGS-84 datumIt doesn’t specify a projection into which the imported vector data will be

converted!

• Display vector• Editing vector displays

Edit layer properties: Associate attribute name

• Display vector attributesVector parameter, option, vector information, scroll, select one to displayVector parameter, edit, view/edit/query

Change column width Sorting

Change highlight color

Exercise 6 (cont.)Exercise 6 (cont.)

Vector layer overlay and editing (cont.)Vector layer overlay and editing (cont.)• Editing vector layers

Select road.shp Model, edit existing vectors Tool, pixel locator, (690, 860) Add node Accept change Model, add new vector Node handles on Accept new polyline

• Add attribute information Vector parameter, edit, view/edit/query

Querying vector attributesQuerying vector attributes• Vector parameters, Edit, query attributes, STATE_NAME == Virginia

Vector to raster conversionVector to raster conversion• Export active layer to ROIs• Overlay• Options, report area of ROIs, Miles2

Exercise 7Exercise 7

Generating image contour lines and Generating image contour lines and overlaying vector layersoverlaying vector layers• Read USGS DEM file

• Mosaic and display

• Contouring a DEM image

• Overlay vectors on a 3-Dsurface view

Self testSelf test

Repeat exercise 6 to generate the figureRepeat exercise 6 to generate the figure