Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- sites4kml

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
sites4kml
Synopsis
/infobank/programs/kml/sites4kml/sites4kml.for
Description
  Program to convert a site control tab-delimited file

  with an associated lookup control tab-delimited file
  to KML.
       
AUTHOR
  Clint Steele    8/7/2007 

  based on spphotos4kml
  Set disk "imag1" for activities A-M and "imag2" for N-Z and
  added variables IDA2M and ImageDisk. CDegnan, 9/6/2013

    
Reads
          read (LookUpFile, '(q,a)', end = 299)
     *        LookUpLineLength, LookUpLine(1:LookUpLineLength)
      read (84, '(t10,a20)') AkaID
      read (SiteFile, '(q,a)', end = 99)
     *    HeadLineLength, HeadLine(1:HeadLineLength)
          read (SiteFile, '(q,a)', end = 99) 
     *        ALineLength, ALine(1:ALineLength)
      read (ALine(Tab(7)+1:Tab(8)-1), '(f9.5)', err=1000) Lat
      read (ALine(Tab(8)+1:Tab(9)-1), '(f10.5)', err=1000) Long
          read (ALine(Tab(7)+1:Tab(8)-1), '(f)', err=1000) Lat
          read (ALine(Tab(8)+1:Tab(9)-1), '(f)', err=1000) Long
              read (NotedFile, '(q,a)', end = 759) 
     *            TempSiteIDLength, TempSiteID(1:TempSiteIDLength)
Writes
      write (Blank, '(80x)')
      write (KmlFileName, '(4096x)')
          write (LookUpLine, '(4096x)')
      write (AkaID, '(20x)')
      write (KmlFile, '(a)') Blank(1:Level)//'<Folde
      write (KmlFile, '(a)') Blank(1:Level)//
     *    '<open>1&l
      write (KmlFile, '(a)') Blank(1:Level)//
     *    '<name&
     *    CapLongID(1:IDLength+3)//' sites'//
     *    '</nam
          write (ALine, '(4096x)')
                  write (NotedFile, '(a)') ALine(1:Tab(1)-1)
      write (TempFile, '(2x,a)') '<Placemar
      write (TempFile, '(4x,a)') 
     *    '<name>'//SiteID(1:SiteLength)//'&l
      write (TempFile, '(4x,a)') '<styleUrl>#Circle</s
      write (TempFile, '(4x,a)') '<visibility>1</vis
      write (TempFile, '(4x,a)') '<open>0&l
      write (TempFile, '(4x,a)') 
     *    '<name>'//ALine(1:Tab(1)-1)//'&l
      write (TempFile, '(4x,a)') '<Poin
      write (TempFile, '(6x,a)') '<coordinate
      write (TempFile, '(8x,f10.5,a,f9.5,a)') Long,',',Lat,',0'
      write (TempFile, '(6x,a)') '</coordinate
      write (TempFile, '(4x,a)') '</Poin
      write (TempFile, '(2x,a)') '</Placemar
          write (TempFile, '(2x,a)') '<Placemar
          write (TempFile, '(4x,a)')
     *        '<name>'//SiteID(1:SiteLength)//'&l
          write (TempFile, '(4x,a)') '<visibility>1</vis
          write (TempFile, '(4x,a)') '<open>0&l
          write (TempFile, '(4x,a)')
     *        '<name>'//ALine(1:Tab(1)-1)//'&l
          write (TempFile, '(4x,a)') '<Poin
          write (TempFile, '(6x,a)') '<coordinate
          write (TempFile, '(8x,f10.5,a,f9.5,a)') Long,',',Lat,',0'
          write (TempFile, '(6x,a)') '</coordinate
          write (TempFile, '(4x,a)') '</Poin
          write (TempFile, '(2x,a)') '</Placemar
          write (KmlFile, '(a)') Blank(1:Level)//'<Folde
          write (KmlFile, '(a)') Blank(1:Level)//'<name>sites&l
          write (KmlFile, '(a)') Blank(1:Level)//'<Styl
          write (KmlFile, '(a)') Blank(1:Level)//'<ListStyl
          write (KmlFile, '(a)') Blank(1:Level)//
     *       '<listItemType>radioFolder</listIte
          write (KmlFile, '(a)') Blank(1:Level)//'</ListStyl
          write (KmlFile, '(a)') Blank(1:Level)//'</Styl
          write (KmlFile, '(a)') Blank(1:Level)//'<Folde
              write (KmlFile, '(a)') Blank(1:Level)//'<name&
     *            'Landslide locations</nam
              write (KmlFile, '(a)') Blank(1:Level)//'<name&
     *            HeadLine(HeadTab(Loop)+1:HeadTab(Loop+1)-1)//
     *            ' sites</nam
          write (KmlFile, '(a)') Blank(1:Level)//'</Folde
          write (KmlFile, '(a)') Blank(1:Level)//'<Folde
          write (KmlFile, '(a)') Blank(1:Level)//
     *        '<name>all sites&l
          write (KmlFile, '(a)') Blank(1:Level)//'</Folde
          write (KmlFile, '(a)') Blank(1:Level)//'</Folde
          write (KmlFile, '(a)') Blank(1:Level)//'</Folde
      write (KmlFile, '(a)') Blank(1:Level)//'</Documen
      write (KmlFile, '(a)') Blank(1:Level)//'</km
      write (TempFile, '(4x,a)') '<descriptio
      write (TempFile, '(6x,a)') '<![CDAT
      write (TempFile, '(8x,a)') '<u
      write (TempFile, '(10x,a)')
     *    '<li>'//HeadLine(1:HeadTab(1
     *    ' -- '//
     *    ALine(1:Tab(1)-1)
      write (TempFile, '(10x,a)')
     *    '<li>'//HeadLine(HeadTab(9)+1:HeadTab(10
     *    ' -- '//
     *    ALine(Tab(9)+1:Tab(10)-1)
                  write (TempFile, '(10x,a)')
     *            '<li>'//'No
     *            ' -- '//
     *            HeadLine(HeadTab(Loop)+1:HeadTab(Loop+1)-1)
                  write (TempFile, '(10x,a)')
     *            '<li>'//HeadLine(HeadTab(Loop)+1:HeadTab(Loop+1
     *            ' -- '//
     *            ALine(Tab(Loop)+1:Tab(Loop+1)-1)
              write (TempFile, '(10x,a)')
     *            '<li>Click site photo for full resolution v
     *            '<b
            write (TempFile, '(10x,a)')
     *        '<a href="http://walrus.wr.usgs.gov
     *        HiPath(PathLoop)(1:HiPathLength)//'" '//
     *        'alt="Full resolution Hi at site '//
     *        ALine(1:Tab(1)-1)//'" target="new">
     *        '<img border="0" 
     *        'src="http://walrus.wr.usgs.gov'//
     *        LoPath(PathLoop)(1:LoPathLength)//'" '//
     *        'alt="Lo Hi at site '//
     *        ALine(1:Tab(1)-1)//'" width="100"><
     *        ' '
            write (TempFile, '(10x,a)')
     *        '<a href="http:/
     *        HiPath(PathLoop)(1:HiPathLength)//'" '//
     *        'alt="Full resolution Hi at site '//
     *        ALine(1:Tab(1)-1)//'" target="new">
     *        '<img border="0" 
     *        'src="http:/'//
     *        LoPath(PathLoop)(1:LoPathLength)//'" '//
     *        'alt="Lo Hi at site '//
     *        ALine(1:Tab(1)-1)//'" width="100"><
     *        ' '
            write (TempFile, '(10x,a)')
     *        '<a href="http://walrus.wr.usgs.gov
     *        HiPath(PathLoop)(1:HiPathLength)//'" '//
     *        'alt="Full resolution Hi at site '//
     *        ALine(1:Tab(1)-1)//'" target="new">
     *        '<img border="0" 
     *        'src="http://walrus.wr.usgs.gov'//
     *        HiPath(PathLoop)(1:HiPathLength)//'" '//
     *        'alt="Lo Hi at site '//
     *        ALine(1:Tab(1)-1)//'" width="100"><
     *        ' '
            write (TempFile, '(10x,a)')
     *        '<a href="http:/
     *        HiPath(PathLoop)(1:HiPathLength)//'" '//
     *        'alt="Full resolution Hi at site '//
     *        ALine(1:Tab(1)-1)//'" target="new">
     *        '<img border="0" 
     *        'src="http:/'//
     *        HiPath(PathLoop)(1:HiPathLength)//'" '//
     *        'alt="Lo Hi at site '//
     *        ALine(1:Tab(1)-1)//'" width="100"><
     *        ' '
      write (TempFile, '(10x,a)') '<li><a
     *    '"http://www.google.com/custom?q='//
     *    'usgs+'//ID(1:IDLength)//'+'//SiteID(1:SiteLength)//
     *    '+'//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%3A6c82345480ae9708%3B'//
     *    '&domains=walrus.wr.usgs.gov'//
     *    '&sitesearch=walrus.wr.usgs.gov'//
     *    '">Search InfoBank&l
      write (TempFile, '(8x,a)') '</u
      write (TempFile, '(8x,a)')
     *    '<!-- Source: http://walrus.wr.usgs.gov/infobank/ --
      write (TempFile, '(6x,a)') ']]&g
      write (TempFile, '(4x,a)') '</descriptio
Opens
      open (unit = 70,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/sites4kml.control.temp')
      open (unit = LookUpFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = '/'//ImageDisk//'/'//
     *             ID(1:1)//'/'//ID(1:IDLength)//'/imag/'//
     *             LongID(1:IDLength+3)//'.lookup.keep')
      open (unit = KmlFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = KmlFileName(1:KmlFileNameLength))
      open (unit = 84,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/meta/'//LongID(1:IDLength+3)//'.ids')
      open (unit = SiteFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = '/'//ImageDisk//'/'//
     *             ID(1:1)//'/'//ID(1:IDLength)//'/imag/'//
     *             LongID(1:IDLength+3)//'.sites.keep')
                  open (unit = NotedFile,
     *                  access = 'append',
     *                  status = 'unknown',
     *                  form = 'formatted',
     *                  name = '/infobank/tmp/sites4kml.noted.'//
     *                   HeadLine(HeadTab(Loop)+1:HeadTab(Loop+1)-1)//
     *                         '.temp')
      open (unit = TempFile,
     *      access = 'sequential',
     *      status = 'unknown',
     *      form = 'formatted',
     *      name = '/infobank/tmp/sites4kml.site.'//
     *             SiteID(1:SiteLength)//'.temp')
          open (unit = TempFile,
     *      access = 'sequential',
     *      status = 'unknown',
     *      form = 'formatted',
     *      name = '/infobank/tmp/sites4kml.arrow.'//
     *             SiteID(1:SiteLength)//'.temp')
          open (unit = NotedFile,
     *          access = 'sequential',
     *          status = 'unknown',
     *          form = 'formatted',
     *          name = '/infobank/tmp/sites4kml.noted.'//
     *                 HeadLine(HeadTab(Loop)+1:HeadTab(Loop+1)-1)//
     *                 '.temp')
Calls
      call kmlanalyzeid (70, IDLength, LongID, ID, Status)
      call stringlen (KmlFileName, KmlFileNameLength)
              call system ('/bin/rm '//KmlFileName(1:KmlFileNameLength))
      call stringlen (AkaID, AkaIDLength)
      call kmllookat (KmlFile, AkaID, 'sites',
     *    IDLength, ID, LongID)
      call changecase ('CAPITALS', CapLongID)
          call includeit (KmlFile, 
     *        '/'//ImageDisk//'/'//
     *        ID(1:1)//'/'//ID(1:IDLength)//'/imag/'//
     *        LongID(1:IDLength+3)//'.includekml.keep')
      call describesites
     *    (TempFile, 
     *     ID, IDLength, LongID, SiteFilename, SiteFilenameLength,
     *     LastDot, ALine, 
     *     ALineLength, SiteID, SiteLength,
     *     AkaID, AkaIDLength, CapID, Tab, TabCount,
     *     HeadLine, 
     *     HeadLineLength, HeadTab, HeadTabCount,
     *     PathCount, SiteName, HiPath, LoPath)
          call describesites
     *    (TempFile,
     *     ID, IDLength, LongID, SiteFilename, SiteFilenameLength,
     *     LastDot, ALine,
     *     ALineLength, SiteID, SiteLength,
     *     AkaID, AkaIDLength, CapID, Tab, TabCount,
     *     HeadLine,
     *     HeadLineLength, HeadTab, HeadTabCount,
     *     PathCount, SiteName, HiPath, LoPath)
              call includeit (KmlFile, 
     *            '/infobank/tmp/sites4kml.site.'//
     *            TempSiteID(1:TempSiteIDLength)//'.temp')
          call system ('/bin/cat /infobank/tmp/sites4kml.site.*.temp >
     *        //
     *        '/infobank/tmp/sites4kml.allsites.temp')
          call includeit (KmlFile,
     *       '/infobank/tmp/sites4kml.allsites.temp')
      call system ('/bin/rm /infobank/tmp/sites4kml*.temp')
      call kmlzip (KmlFileName(1:KmlFileNameLength))
          call stringlen (SiteName(PathLoop), PathSiteLength)
          call stringlen (LoPath(PathLoop), LoPathLength)
          call stringlen (HiPath(PathLoop), HiPathLength)

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/sites4kml/sites4kml.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:38:59 PDT 2013  (chd)