<HTML dir=ltr><HEAD><TITLE>Re: [Proj] lla file format</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16608" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText36664 dir=ltr>
<DIV dir=ltr><FONT face="Times New Roman" color=#000000 size=2>Is this what you need?</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>Cliff Mugnier</FONT></DIV>
<DIV dir=ltr><FONT size=2>LOUISIANA STATE UNIVERSITY</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr>c program convert.ftn -- cpfs csm golden,co<BR>c<BR>c this routine converts ascii files of x,y,z1,z2,...zn <BR>c data to the center format for binary file storage<BR>c the interactive nature allows for creation of the<BR>c appropriate headers and file formats<BR>c<BR>c----------------------------------------------------------------<BR> program convdam<BR> parameter(nfile=50,nx=6000,ny=10)<BR> character rident*56,pgm*8,filin(nfile)*30,<BR> 1 filout*30,formin*56<BR> character gname(nfile)*8<BR> dimension data(ny,nx),zero(ny) <BR> common /inout/ iit,iot<BR> common /input/ nv,nr,formin,rident,pgm,filout<BR>c data iit,iot/5,6/,in,iout/30,31/,nc/-1/<BR>c data pgm/'convertd'/<BR> data x0,dx,y0,dy,angle/5*0.0/,zero/ny*0.0/</DIV>
<DIV dir=ltr> iit = 5<BR> iot = 6<BR> in = 30<BR> iout = 31<BR> nc = -1<BR> pgm = 'convertd'<BR>c<BR>c......................................................................<BR>1000 format(///,5x,'this program converts a formatted data file to',/,<BR> & 5x,'an unformatted binary file conforming to the ',/,<BR> & 5x,'center format',//,' ** warning - the input files',<BR> & ' are assumed to have a uniform format;',<BR> & /,' all the groups are to have the same number',<BR> & ' and type of variables',//,<BR> & 5x,'each group will come from one input file.',//,<BR> & 5x,'program is dimensioned to read',i3,' files of',/,<BR> & 8x,i6,' variables per sample',/,<BR> & 8x,i6,' samples per group',//)<BR>1005 format(' enter number of input-files/output-groups',<BR> & ' (eg. flightlines):')<BR>1010 format(' enter filename for input file ',i3,' :')<BR>1020 format(/,' enter filename for output file:')<BR>1030 format(a30) <BR>1040 format(///,5x,'enter header information,up to 56 characters',/,<BR> & 5x,'this should include data identifier',/,<BR> & 5x,'and coordinate system used !!')<BR>1050 format(a56)<BR>1070 format(/,5x,'enter the number of variables at each location',/,<BR> & 5x,'this includes the x and y locations') <BR>1080 format(/,5x,'enter the format of the input file records',/,<BR> & 5x,'e.g. (3f20.4) ')<BR>1100 format(' enter an groupname (8 char) for input file ',a30,)<BR>1110 format(a8) <BR>1120 format('there will be',i3,' sample sets on each binary record')<BR>1130 format(' there are ',i6,' samples in group: ',a8)<BR>1300 format(' cannot open file ',a30,/,' reenter correct name:')<BR>1400 format(' error in read; current format: ',a56,//,<BR> & ' fix file and/or reenter correct format:')<BR>c......................................................................<BR>c<BR>c...write intro to screen</DIV>
<DIV dir=ltr> write(iot,1000)nfile,ny,nx</DIV>
<DIV dir=ltr>c...get in and out filenames <BR> <BR> write(iot,1005)<BR> read(iit,*)nr<BR> do 50 i = 1,nr<BR> write(iot,1010)i<BR> read(iit,1030)filin(i)<BR>50 continue<BR> write(iot,1020)<BR> read(iit,1030)filout<BR>c<BR>c...get input information from user and set pgm for header<BR>c<BR> write(iot,1040)<BR> read(iit,1050)rident<BR> write(iot,1070)<BR> read(iit,*)nv<BR> write(iot,1080)<BR> read(iit,1050)formin<BR> do 60 i = 1,nr<BR> write(iot,1100)filin(i)<BR> read(iit,1110)gname(i)<BR>60 continue<BR>c<BR>c...check input information and allow for changes<BR>c<BR> call go(nfile,filin,gname)<BR>c<BR>c...now figure number of samples that will fit in 256 bytes<BR>c<BR> nrec=64/nv<BR> write(iot,1120)nrec<BR>c<BR>c...open output file<BR>c<BR> open(iout,file=filout,access='direct',<BR> * form='unformatted',status='unknown',recl=256)<BR>c rewind(iout)<BR>c<BR>c...write header to output file<BR>c<BR> nrd = 1<BR> write(iout,rec=nrd)rident,pgm,nc,nr,nv,x0,dx,y0,dy,angle <BR> nrd = nrd + 1<BR>c<BR>c...proceed to open input data files<BR>c <BR> do 70 if=1,nr<BR>1 open(in,file=filin(if),status='old',err=2000)<BR> rewind(in)</DIV>
<DIV dir=ltr>c...read in file/group data and recover the number of samples (nsamp)<BR> <BR> j = 1<BR>80 read(in,fmt=formin,end=100,err=3000) (data(k,j),k=1,nv)<BR> j = j + 1<BR> goto 80</DIV>
<DIV dir=ltr>100 nsamp = j - 1</DIV>
<DIV dir=ltr>c...write group header to binary file</DIV>
<DIV dir=ltr> write(iout,rec=nrd)gname(if),nsamp<BR> nrd = nrd + 1 <BR> write(iot,1130)nsamp,gname(if)</DIV>
<DIV dir=ltr>c...check to see if last binary record is filled<BR>c (use integer division)<BR> <BR> numrec = nsamp / nrec<BR> nsleft = nsamp - (nrec*numrec)<BR> if(nsleft.eq.0)then<BR> numwri = numrec<BR> else<BR> numwri = numrec + 1<BR> endif</DIV>
<DIV dir=ltr>c...see how many zeros are in remainder part of record</DIV>
<DIV dir=ltr> nremain = 64 - nv * nrec<BR> <BR>c...write this data to records (extra space in records are zeros)<BR> <BR> do 110 k=1,numwri<BR> write(iout,rec=nrd)((data(j,i),j=1,nv),i=(k-1)*nrec+1,k*nrec),<BR> 1 (zero(ir),ir=1,nremain)<BR> nrd = nrd + 1 <BR>110 continue</DIV>
<DIV dir=ltr>c...zero data array for next file read<BR>c<BR> do 120 kk=1,nx<BR> do 130 kkk=1,ny<BR> data(kkk,kk) = 0.0<BR>130 continue<BR>120 continue<BR> <BR>c...loop back up and write next file<BR> close(in)<BR> go to 70<BR>2000 write(iot,1300)filin(if)<BR> read(iit,1030)filin(if)<BR> goto 1<BR>3000 write(iot,1400)formin<BR> read(iit,1050)formin<BR> goto 80<BR>70 continue<BR>c<BR> close(iout)<BR> stop <BR> end<BR>c-------------------------------------------------------------------<BR> subroutine go(nfile,filin,gname)<BR>c<BR>c purpose: allows alteration of input parameters<BR>c<BR> character rident*56,pgm*8,filin(nfile)*30,ac*1,<BR> 1 filout*30,formin*56,gname(nfile)*8,<BR> 1 buffer*200<BR> common /inout/ iit,iot<BR> common /input/ nv,nr,formin,rident,pgm,filout<BR>c....................................................................<BR>100 format(/,' there are ',i3,' input data files:',/)<BR>102 format(' file ',i3,' is :',a30)<BR>103 format(/,' enter filename number to change: ',/,<BR> 1 ' (enter 0 if no changes desired)')<BR>104 format(/,' file ',i3,' is presently :',a30,/,<BR> 1 ' please enter correct filename :')<BR>105 format(a30)<BR>110 format(/,' there are ',i3,' group names:',/)<BR>111 format(' group ',i3,' is :',a8)<BR>112 format(/,' enter groupname number to change: ',/,<BR> 1 ' (enter 0 if no changes desired)')<BR>113 format(/,' group ',i3,' is presently :',a8,/,<BR> 1 ' please enter correct groupname (8 char):')<BR>114 format(a8)<BR>300 format(/,' okay, enter changes ... (c/r twice when finished)',/)<BR>301 format(a1)<BR>c....................................................................<BR>200 write(iot,400)nr,nr,formin,filout,rident,pgm,nr,nv<BR>400 format(/////,<BR> 1 ' the following are the control parameters:',//,<BR> 1 ' 1. enter 1 to change any of the ',i3,' input files',/,<BR> 1 ' 2. enter 2 to change any of the ',i3,' group names',/,<BR> 1 ' 3. input files format (assumed the same): ',/,4x,a56,/,<BR> 1 ' 4. output filename: ',/,4x,a30,/,<BR> 1 ' 5. output file header comment:',/,4x,a56,/,<BR> 1 ' 6. program title (8 CHARACTERS): ...................',A8,/,<BR> 1 ' 7. NUMBER OF DATA Groups in output file: ...........',i3,/,<BR> 1 ' 8. number of variables per sample: .................',i3,//)<BR> write(iot,*)' do you wish to change anything ? (y/n) :'<BR> read(iit,301)ac <BR> if(ac.eq.'n'.or.ac.eq.'n')return<BR> write(iot,300)<BR>c an 80 character buffer is used to input the changed parameters<BR>c from the crt screen. the number identifying the parameter is<BR>c read first then the parameter is read. changes are accordingly<BR>c made. <BR>c<BR>201 read(iit,fmt='(a)',end=200)buffer<BR> read(buffer(1:2),403)chng <BR>403 format(f2.0) <BR>410 format(f2.0,1x,a8)<BR>420 format(f2.0,1x,a30)<BR>430 format(f2.0,1x,a56)<BR>440 format(f2.0,1x,i3)<BR> if(chng.eq.1.0)goto 500<BR> if(chng.eq.2.0)goto 600<BR> if(chng.eq.3.0)read(buffer,430)chng,formin<BR> if(chng.eq.4.0)read(buffer,420)chng,filout<BR> if(chng.eq.5.0)read(buffer,430)chng,rident<BR> if(chng.eq.6.0)read(buffer,410)chng,pgm<BR> if(chng.eq.7.0)read(buffer,440)chng,nr<BR> if(chng.eq.8.0)read(buffer,440)chng,nv<BR> if(chng.eq.0.0)goto 200<BR> goto 201<BR>c<BR>500 write(iot,100)nr<BR> do 501 i=1,nr<BR> write(iot,102)filin(i)<BR>501 continue<BR> write(iot,103)<BR> read(iit,*)ichng<BR> if(ichng.eq.0)goto 200<BR> write(iot,104)ichng,filin(ichng)<BR> read(iit,105)filin(ichng)<BR> goto 500</DIV>
<DIV dir=ltr>600 write(iot,110)nr<BR> do 601 i=1,nr<BR> write(iot,111)gname(i)<BR>601 continue<BR> write(iot,112)<BR> read(iit,*)ichng<BR> if(ichng.eq.0)goto 200<BR> write(iot,113)ichng,gname(ichng)<BR> read(iit,114)gname(ichng)<BR> goto 600<BR>c<BR> end</DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> proj-bounces@lists.maptools.org on behalf of Eric Miller<BR><B>Sent:</B> Tue 26-Feb-08 12:00<BR><B>To:</B> PROJ.4 and general Projections Discussions<BR><B>Subject:</B> Re: [Proj] lla file format<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>As far as I can tell, it is only documented in the Fortran source code for nadgrd. Get the sources and read "readme.grd" for some help...<BR><BR>"""<BR>The program NADCON reads binary grids that contain NAD 27 to NAD 83<BR>latitude and longitude shifts. The first record in a grid file consists of<BR>header information. All the other records consist of FORTRAN REAL*4<BR>numbers. The grid files are unformatted and direct access.<BR><BR>...<BR>""" <BR><BR>>>> On 2/16/2008 at 5:30 PM, "Richard Greenwood" <richard.greenwood@gmail.com><BR>wrote:<BR>> Can anyone point me to documentation of the *.lla file format?<BR><BR><BR>_______________________________________________<BR>Proj mailing list<BR>Proj@lists.maptools.org<BR><A href="http://lists.maptools.org/mailman/listinfo/proj">http://lists.maptools.org/mailman/listinfo/proj</A><BR></FONT></P></DIV></BODY></HTML>