comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Projection
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Projection [message #67266] Fri, 17 July 2009 04:09
woods is currently offline  woods
Messages: 4
Registered: July 2009
Junior Member
Hi,
i want to project the map on an image.My file is not a shapefile
I have a Problem.My Image is so big(ns = 36800, nl = 56700) .
this is the beginning of my program:

filename = envi_pickfile(title = 'title')
if(filename eq '')then return

envi_open_file, filename, r_fid=De_fid


envi_file_query, De_fid, ns=ns, nl=nl, nb=nb, pos=pos,$
dims=dims, data_type=type, sname=sname

dims = [-1L, 0, ns-1, 0, nl-1]
map_info = envi_get_map_info(fid = De_fid)
proj_dd = envi_proj_create(/geographic)
proj_aa = envi_proj_create(/utm, zone= 37, /south, datum=8,
units=meters )

xf = [0, ns-1]
yf = [0, nl-1]
fwest_p=0
fnorth_p=0
feast_p=fwest_p+ns
fsouth_p=fnorth_p+nl
fxcent_p=map_info.mc[0]; UTM coordinates defined from center
fycent_p=map_info.mc[1]; UTM coordinates def. from center
fxcent_u=map_info.mc[2]
fycent_u=map_info.mc[3]
xpxsz_u=map_info.ps[0]
ypxsz_u=map_info.ps[1]
fwest_u=fxcent_u+(long(fwest_p-fxcent_p)*xpxsz_u)
feast_u=fxcent_u+(long(feast_p-fxcent_p)*xpxsz_u)
fnorth_u=fycent_u+(long(fycent_p-fnorth_p)*ypxsz_u)
fsouth_u=fycent_u+(long(fycent_p-fsouth_p)*ypxsz_u)

envi_convert_projection_coordinates,[fwest_u,feast_u,fxcent_ u,
fxcent_u], $

[fycent_u,fycent_u,fnorth_u,fsouth_u],proj_u,fcornerx_dd,fco rnery_dd,proj_dd
envi_convert_file_coordinates, De_fid, xf, yf, xmap, ymap, /
to_map
print, 'UL corner:',xmap[0], ymap[0]
print, 'LR corner:',xmap[1], ymap[1]
print, 'UR corner:',xmap[0], ymap[1]
print, 'LL corner:',xmap[1], ymap[0]

utmMap = map_proj_init('UTM', DATUM=8, ZONE=37)
help, utmMap, /struct
xcenter = (xmap[1]-xmap[0])/2.0 +xmap[0]
ycenter = (ymap[1]-ymap[0])/2.0 +ymap[0]
lonlat = map_proj_inverse([xmap[0],xmap[0],xmap[1],xmap[1],
xcenter], $
[ymap[0],ymap[1], ymap[1],ymap
[0],ycenter], $
MAP_STRUCTURE=utmMap)
print, 'Latitude: ', reform(lonlat[1,0:3])
print, 'Longitude: ', reform(lonlat[0,0:3])
minLat = Min(lonlat[1,*], Max = maxlat)
minLon = Min(lonlat[0,*], Max = maxLon)
limit = [minLat, minLon, maxLat, maxLon]

utmMap = MAP_PROJ_INIT('UTM', DATUM = 8, ZONE = 37,
LIMIT=limit )
help, utmMap

A = 6370997.0d
eccsq = 0.00669439d
k0 = 0.9996d

map_set, 0, 39.0,0, /trans, position=[0.0 , 0.0, 1.0,
1.0],LIMIT=limit, $
ellipsoid = [A, eccsq, k0]


map_continents,/coast, /usa, /hires, thick = 1
map_grid, /box_axes, /clip_text, charsize=1.5, charthick=1
roi_id = envi_create_roi(name=name, ns=ns, nl=nl)

envi_define_roi, roi_id,/point, xpts=reform(xmap), $
ypts=reform(ymap)

xpts=reform(xmap)
ypts=reform(ymap)


roi_addr = envi_get_roi(roi_id)
roi_data = envi_get_roi_data(roi_id, fid=De_fid, pos =
[0])
envi_get_roi_information, roi_id, ns=ns, nl=nl
min_x=min(xpts)
max_x=max(xpts)
min_y=min(ypts)
max_y=max(ypts)

imgdata=bytarr(ns,nl)

imgdata[roi_addr] = 1




envi_enter_data, roi_data, map_info=map_info
window, 0, /free, xsize=ns, ysize=nl
tv, imgdata

end

my problem is with imgdata=bytarr(ns,nl), and i want to create a mask,
but i don't how i am doing.

can somebody help me
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: discover SDS of HDF with GUI
Next Topic: Re: discover SDS of HDF with GUI

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:51:34 PDT 2025

Total time taken to generate the page: 0.00545 seconds