In article <3klgmi$noh@newsbf02.news.aol.com> arthurb733@aol.com (ArthurB733) writes:
> I'm new to IDL and to this group. Please forgive me if this subject has
> come up before. I was wondering if anyone knows of existing IDL
> procedures for reading USGS DEMs, or does someone have pointers to offer
> on the topic?
I wrote the attached short bit of code a while ago to do this. It's
not very fancy, but it should do the job for you.
Jeff Moersch
Astronomy and Space Sciences
Cornell University
moersch@astrosun.tn.cornell.edu
----cut here----
pro demread, filename, demarr
; Reads in a standard 1201x1201 USGS Digital Elevation Map.
hdr=''
linehdr=''
alt1=intarr(146)
alt2=intarr(170)
alt3=intarr(170)
alt4=intarr(170)
alt5=intarr(170)
alt6=intarr(170)
alt7=intarr(170)
alt8=intarr(35)
openr, 1, filename
readf,1,hdr
for i=0,1200 do begin
readf,1,linehdr,alt1,format='(a147,146i6)'
readf,1,alt2,format='(170i6)'
readf,1,alt3,format='(170i6)'
readf,1,alt4,format='(170i6)'
readf,1,alt5,format='(170i6)'
readf,1,alt6,format='(170i6)'
readf,1,alt7,format='(170i6)'
readf,1,alt8,format='(35i6)'
demarr(i,0:145)=alt1
demarr(i,146:315)=alt2
demarr(i,316:485)=alt3
demarr(i,486:655)=alt4
demarr(i,656:825)=alt5
demarr(i,826:995)=alt6
demarr(i,996:1165)=alt7
demarr(i,1166:1200)=alt8
endfor
close,1
end
----cut here----
--
|