Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- nav4kml

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
nav4kml
Synopsis
/infobank/programs/kml/nav4kml/nav4kml.for
Description
  Program to convert a DAPS navigation file to x,y,z format for KML.

       
COMMENTS
  This program is driven by a script that creates 

  a temporary collection of IDs.
  This program relies on .best_nav_file files for data.
    
RELATED_PROGRAMS
  seis4kml.for     times4kml.for

    
AUTHOR
  Clint Steele    4/12/2006

  Joan Paz        12/30/2008
                  Modified to plot just points as noted from a file
  Sumy Tom        jan/26/2010
                  Modified coordinates so that it all have same sign
  Clint Steele    8/17/2010   Added recognition of DAPX format
  Carolyn Degnan, 8/2/2012, Added sp format specification to output positive lat/lons with plus signs.
  Carolyn Degnan, 2/7/2013, Added separate sp output format for Lat less than 10.0 and greater than -10.0.


    
Reads
      read (BestListFile, '(q,a)', end=199) 
     *    NavFilenameLength, NavFilename
      read (IDsFile, '(t10,a20)') AkaID
      read (EventsFile, '(a)') TimeLine
      read (TimeLine, '(t8,i3,i2,i2,i2,i1)')
     *    Day, Hour, Minute, Second, Tenth
      read (TimeLine, '(t24,i3,i2,i2,i2,i1)')
     *    Day, Hour, Minute, Second, Tenth
      read (NavFile, '(q,a)', end = 99) 
     *    ALineLength, ALine(1:ALineLength)
          read (NavFile, '(q,a)', end = 99) 
     *        ALineLength, ALine(1:ALineLength)
              read (ALine, '(t16,f9.5,t26,f10.5)') Lat, Long
              read (ALine, '(t17,f10.6,t28,f11.6)') Lat, Long
          read (ALine, '(t5,i3,i2,i2,i2,i1)')
     *        Day, Hour, Minute, Second, Tenth
              read (EventsFile, '(a)', end = 63) TimeLine
              read (TimeLine, '(t8,i3,i2,i2,i2,i1)')
     *            Day, Hour, Minute, Second, Tenth
              read (TimeLine, '(t24,i3,i2,i2,i2,i1)')
     *            Day, Hour, Minute, Second, Tenth
      read (Navfile, '(q,a)', end = 198)
     *        ALineLength, ALine(1:ALineLength)
      read (Navfile, '(q,a)', end = 198)
     *        ALineLength, ALine(1:ALineLength)
          read (ALine, '(i4, i3)') Year, Day
          read (ALine, '(t5,i3,i2,i2,i2,i1)')
     *        Day, Hour, Minute, Second, Tenth
              read (ALine, '(t16,f9.5,t26,f10.5)') Lat, Long
              read (ALine, '(t17,f10.6,t28,f11.6)') Lat, Long
      read (NavFile, '(q,a)', end = 99) 
     *    ALineLength, ALine(1:ALineLength)
              read (ALine, '(t16,f9.5,t26,f10.5)') Lat, Long
              read (ALine, '(t17,f10.6,t28,f11.6)') Lat, Long
          read (ALine, '(i4, i3)') Year, Day
          read (ALine, '(t5,i3,i2,i2,i2,i1)')
     *        Day, Hour, Minute, Second, Tenth
Writes
      write (KmlFileName, '(1024x)')
      write (AkaID, '(20x)')
          write (KmlFile, '(a)') '<Folde
          write (KmlFile, '(a)')
     *        '<name>'//AkaID(1:AkaIDLength)//' nav&l
          write (KmlFile, '(/,2x,a)')  
     *        '<Placemar
          write (KmlFile, '(4x,a)')      
     *        '<styleUrl>#Circle</s
          write (KmlFile, '(4x,a)')  
     *        '<visibility>1</vis
          write (KmlFile, '(4x,a)')  
     *        '<name>'//AkaID(1:AkaIDLength)//'&l
          write (KmlFile, '(4x,a)')  
     *        '<Poin
          write (KmlFile, '(6x,a)')  
     *        '<coordinate
              write (KmlFile, '(sp,8x,f11.6,a,f10.6,a)')
     *            Long,',',Lat,',0'
              write (KmlFile, '(sp,8x,f11.6,a,f9.6,a)')
     *            Long,',',Lat,',0'
          write (KmlFile, '(6x,a)')    
     *        '</coordinate
          write (KmlFile, '(4x,a)')  
     *        '</Poin
          write (KmlFile, '(2x,a)')  
     *        '</Placemar
          write (KmlFile, '(a)') '</Folde
       write (KmlFile, '(a)') '</Documen
       write (KmlFile, '(a)') '</km
      write (KmlFile, '(a)') '<Placemar
      write (KmlFile, '(4x,a)') '<styleUrl>#Circle</s
          write (KmlFile, '(2x,a)')
     *        '<name>'//AkaID(1:AkaIDLength)//' nav&l
          write (KmlFile, '(2x,a)')
     *        '<name>'//AkaID(1:AkaIDLength)/
     *        NavFilename(Lastdot+1:Underscore-1)//
     *        ' nav</nam
      write (KmlFile, '(2x,a)') '<visibility>1</vis
      write (KmlFile, '(2x,a)') '<open>0&l
      write (KmlFile, '(2x,a)') '<Styl
      write (KmlFile, '(4x,a)')   '<LineStyl
      write (KmlFile, '(6x,a)')     '<color>ffffffff<
      write (KmlFile, '(4x,a)')   '</LineStyl
      write (KmlFile, '(4x,a)')   '<PolyStyl
      write (KmlFile, '(6x,a)')     '<color>7f00ff00<
      write (KmlFile, '(4x,a)')   '</PolyStyl
      write (KmlFile, '(2x,a)') '</Styl
      write (KmlFile, '(2x,a)') '<MultiGeometr
              write (KmlFile, '(6x,a)')   '</coordinate
              write (KmlFile, '(4x,a)') '</LineStrin
              write (KmlFile, '(4x,a)') '<LineStrin
              write (KmlFile, '(6x,a)')   '<extrude>1</
              write (KmlFile, '(6x,a)')   '<tessellate>1</tes
              write (KmlFile, '(6x,a)')   '<coordinate
              write (KmlFile, '(6x,a)')   '</coordinate
              write (KmlFile, '(4x,a)') '</LineStrin
              write (KmlFile, '(4x,a)') '<LineStrin
              write (KmlFile, '(6x,a)')   '<extrude>1</
              write (KmlFile, '(6x,a)')   '<tessellate>1</tes
              write (KmlFile, '(6x,a)')   '<coordinate
              write (KmlFile, '(sp,8x,f11.6,a,f10.6,a)')
     *            Long,',',Lat,',0'
              write (KmlFile, '(sp,8x,f11.6,a,f9.6,a)')
     *            Long,',',Lat,',0'
      write (KmlFile, '(6x,a)') '</coordinate
      write (KmlFile, '(4x,a)') '</LineStrin
      write (KmlFile, '(2x,a)') '</MultiGeometr
      write (KmlFile, '(a)') '</Placemar
      write (KmlFile, '(a)') '<Placemar
      write (KmlFile, '(a)') '<styleUrl>#Circle</s
      write (KmlFile, '(a)') '<visibility>0</vis
          write (KmlFile, '(a)')
     *        '<name>'//AkaID(1:AkaIDLength)//' nav&l
          write (KmlFile, '(a)')
     *        '<name>'//AkaID(1:AkaIDLength)/
     *        NavFilename(LastDot+1:Underscore-1)//
     *        ' nav</nam
      write (KmlFile, '(2x,a)') '<Poin
      write (KmlFile, '(4x,a)') '<coordinate
              write (KmlFile, '(sp,6x,f11.6,a,f10.6,a)')
     *            FirstLong,',',FirstLat,',0'
              write (KmlFile, '(sp,6x,f11.6,a,f9.6,a)')
     *            FirstLong,',',FirstLat,',0'
      write (KmlFile, '(4x,a)') '</coordinate
      write (KmlFile, '(2x,a)') '</Poin
      write (KmlFile, '(a)') '</Placemar
      write (KmlFile, '(a)') '<Folde
      write (KmlFile, '(2x,a)') '<name>Navigation Path by Hour&l
      write (KmlFile, '(a)') '<visibility>0</vis
          write (KmlFile, '(4x,a)') '<Placemar
          write (KmlFile, '(4x,a)') '<TimeStam
          write (KmlFile, 
     *      '(6x,a,i4,a,i2.2,a,i2.2,a,i2.2,a,i2.2,a,i2.2,a)')
     *      '<when>', Year, '-', Month, '-', DayofMonth
     *       Hour, ':', Minute, ':', Second, 'Z</whe
          write (KmlFile, '(4x,a)') '</TimeStam
          write (KmlFile, '(4x,a)') 
     *                   '<styleUrl>#Circle</s
          write (KmlFile, '(4x,a)')
     *                   '<LabelStyl
          write (KmlFile, '(6xa)')
     *                   '<scale>0<
          write (KmlFile, '(4x,a)')
     *                    '</LabelStyl
          write (KmlFile, '(4x,a)') '<visibility>0</vis
          write (KmlFile, 
     *       '(4x,a,i4,a,i2.2,a,i2.2,a,i2.2,a,i2.2,a,i2.2,a)')
     *       '<name>', Year, '-', Month, '-', DayofMonth
     *       Hour, ':', Minute, ':', Second, '</nam
          write (KmlFile, '(6x,a)') '<Poin
          write (KmlFile, '(8x,a)') '<coordinate
              write (KmlFile, '(sp,8x,f11.6,a,f10.6,a)')
     *            Long,',',Lat,',0'
              write (KmlFile, '(sp,8x,f11.6,a,f9.6,a)')
     *            Long,',',Lat,',0'
          write (KmlFile, '(8x,a)') '</coordinate
          write (KmlFile, '(6x,a)') '</Poin
          write (KmlFile, '(4x,a)') '</Placemar
      write (KmlFile, '(a)') '</Folde
      write (KmlFile, '(a)') '</Documen
      write (KmlFile, '(a)') '</km
      write (LcaseID, '(20x)')
      write (DashID,  '(20x)')
      write (KmlFile, '(2x,a)') '<descriptio
      write (KmlFile, '(4x,a)') '<![CDAT
      write (KmlFile, '(4x,a)')
     *    '<li>Activity ID: <a
     *    '"http://walrus.wr.usgs.gov/infobank/'//
     *     ID(1:1)//
     *     '/'//ID(1:IDLength)//'/html/'//
     *     DashID(1:DashIDLength)//
     *     '.meta.html">
     *     AkaID(1:AkaIDLength)//
     *     '</a>
      write (KmlFile, '(10x,a)') '<li><a
     *    '"http://www.google.com/custom?q='//
     *    'usgs+'//ID(1:IDLength)//
     *    '+'//AkaID(1:AkaIDLength)//
     *    '&sa=Google+Search&cof=LW%3A600%3BL%3Ahttp%3A%2F%2F'//
     *    'walrus.wr.usgs.gov'//
     *    '%2Finfobank%2Fprograms%2Fhtml%2Ftools%2FBanr600x72SF.jpg'//
     *    '%3BLH%3A72%3BAH%3Aleft%3BS%3Ahttp%3A%2F%2F'//
     *    'walrus.wr.usgs.gov'//
     *    '%2Finfobank%3BAWFID%3A6c345480ae9708%3B'//
     *    '&domains=walrus.wr.usgs.gov'//
     *    '&sitesearch=walrus.wr.usgs.gov'//
     *    '">Search InfoBank&l
      write (KmlFile, '(4x,a)') 
     *    '<!-- Source: http://walrus.wr.usgs.gov/infobank/ --
      write (KmlFile, '(4x,a)') ']]&g
      write (KmlFile, '(2x,a)') '</descriptio
           write (CharYear, '(i4)') Year
           write (TimeString,
     *            '(i2, 1a, i2.2, 1a, a2,
     *              1x, i2.2, 1a, i2.2)' )
     *          Month, '/',
     *          DayofMonth, '/',
     *          CharYear(3:4),
     *          Hour, ':', Minute
           write (KmlFile, '(a)')  
     *         '<Placemar
                write (KmlFile, '(4x, a,
     *                 a14,
     *                 1x, a)')  
     *          '<name&
     *          TimeString,
     *          ' </nam
           write (KmlFile, '(2x,a)')  
     *         '<styleUrl>#MagentaBubble</s
           write (KmlFile, '(2x,a)')  
     *         '<visibility>1</vis
          write (KmlFile, '(4x,a)')  
     *        '<Poin
          write (KmlFile, '(6x,a)')  
     *        '<coordinate
              write (KmlFile, '(sp,8x,f11.6,a,f10.6,a)')
     *            Long,',',Lat,',0'
              write (KmlFile, '(sp,8x,f11.6,a,f9.6,a)')
     *            Long,',',Lat,',0'
          write (KmlFile, '(6x,a)')    
     *        '</coordinate
          write (KmlFile, '(4x,a)')  
     *        '</Poin
           write (KmlFile, '(a)')  
     *         '</Placemar
      write (DashedCruiseId, '(20x)')
Opens
      open (unit = ControlFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/nav4kml.control.temp')
      open (unit = BestListFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = '/infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/nav/'//LongID(1:IDLength+3)//'.best_nav_file')
      open (unit = NavFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = NavFilename(1:NavFilenameLength))
      open (unit = KmlFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = KmlFileName(1:KmlFileNameLength))
      open (unit = IDsFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/meta/'//LongID(1:IDLength+3)//'.ids')
          open (unit = EventsFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = NavFilename(1:NavFilenameLength)//'_events')
Calls
      call kmlanalyzeid (ControlFile, IDLength, LongID, ID, Status)
      call stringlen (KmlFileName, KmlFileNameLength)
          call system ('/bin/rm '//
     *                   KmlFileName(1:KmlFileNameLength))
          call system ('/infobank/programs/time/events/events')
      call stringlen (AkaID, AkaIDLength)
      call kmllookat (KmlFile, AkaID, 'nav',
     *    IDLength, ID, LongID)
      call describenav 
     *   (KmlFile, ID, IDLength, AkaID, AkaIDLength,
     *    TimeString)
          call justpoints
     *       (KmlFile, NavFile,ID, IDLength, AkaID, AkaIDLength,
     *        First, Lat, Long)
           call justpoints
     *       (KmlFile,NavFile, ID, IDLength, AkaID, AkaIDLength,
     *        First, Lat, Long)
       call kmlzip (KmlFileName(1:KmlFileNameLength))
      call describenav 
     *      (KmlFile, ID, IDLength, AkaID, AkaIDLength,
     *          TimeString)
      call converttime ('COMPRESS', Day, Hour, Minute, Second, Tenth,
     *    OnTime, TimeError)
      call converttime ('COMPRESS', Day, Hour, Minute, Second, Tenth,
     *    OffTime, TimeError)
          call converttime ('COMPRESS', 
     *        Day, Hour, Minute, Second, Tenth,
     *        ThisTime, TimeError)
              call converttime ('COMPRESS', 
     *            Day, Hour, Minute, Second, Tenth,
     *            OnTime, TimeError)
              call converttime ('COMPRESS', 
     *            Day, Hour, Minute, Second, Tenth,
     *            OffTime, TimeError)
          call julianday ('YMD', Day, Year, Month, DayofMonth)
      call kmlzip (KmlFileName(1:KmlFileNameLength))
      call changecase ('SMALL', LcaseID)
      call dashcruiseid (LcaseID,DashID,DashIDLength)
          call julianday ('YMD', Day, Year, Month, DayofMonth)
          call converttime ('COMPRESS', 
     *        Day, Hour, Minute, Second, Tenth,
     *        ThisTime, TimeError)
      call describenav 
     *    (KmlFile, ID, IDLength, AkaID, AkaIDLength,
     *    TimeString)
      call stringlen (CruiseId, LenCruiseId)
      call stringlen (DashedCruiseId, LenDashedCruiseId)

Skip footer navigational links

Coastal and Marine Science Centers:  Pacific   St. Petersburg   Woods Hole  
InfoBank   Coastal and Marine Geology Program   Geologic Information   Ask-A-Geologist   USGS Disclaimer  


Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
URL: http://walrus.wr.usgs.gov/infobank/programs/kml/nav4kml/nav4kml.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Thu Dec 12 03:07:40 PST 2013  (chd)