Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- spphotos4kml

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
spphotos4kml
Synopsis
/infobank/programs/kml/spphotos4kml/spphotos4kml.for
Description
  Program to convert a St. Pete XSTORMS photo file to KML.

       
AUTHOR
  Clint Steele    4/3/2007 

  based on photos4kml

    
Reads
      read (84, '(t10,a20)') AkaID
      read (80, '(q,a)', end=199) ControlFilenameLength, ControlFilename
      read (ControlFile, '(q,a)', end = 99) 
     *    ALineLength, ALine(1:ALineLength)
          read (ControlFile, '(q,a)', end = 99) 
     *        ALineLength, ALine(1:ALineLength)
      read ( ALine(Tab(9)+1:Tab(10)-1), '(i2)') intDay
      read ( ALine(Tab(7)+1:Tab(8)-1), '(i4)') intYear
      read ( ALine(Tab(2)+1:Tab(3)-1), '(i2,t1,i2,t1,i2)')
     *           intHour, intMin, intSec
      read (ALine(1:Tab(1)-1), '(f9.5)', err=1) Lat
      read (ALine(Tab(1)+1:Tab(2)-1), '(f10.5)', err=1) Long
Writes
      write (KmlFileName, '(1024x)')
      write (AkaID, '(20x)')
      write (KmlFile, '(2x,a)') '<Folde
      write (KmlFile, '(4x,a)') 
     *    '<name&
     *    ControlFilename(LastDot+1:ControlFilenameLength)//
     *    '</nam
      write (KmlFile, '(2x,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>', intYear, '-', intMonth, '-', intDay
     *       intHour, ':', intMin, ':', intSec, 'Z</whe
      write (KmlFile, '(4x,a)') '</TimeStam
      write (KmlFile, '(4x,a)') 
     *    '<name>'//PhotoID(1:PhotoLength)//'&l
      write (KmlFile, '(4x,a)') '<styleUrl>#Circle</s
      write (KmlFile, '(4x,a)') '<visibility>1</vis
      write (KmlFile, '(4x,a)') '<open>0&l
      write (KmlFile, '(4x,a)') 
     *    '<name>'//PhotoID(1:PhotoLength)//'&l
      write (KmlFile, '(4x,a)') '<Poin
      write (KmlFile, '(6x,a)') '<coordinate
      write (KmlFile, '(8x,f10.5,a,f9.5,a)') Long,',',Lat,',0'
      write (KmlFile, '(6x,a)') '</coordinate
      write (KmlFile, '(4x,a)') '</Poin
      write (KmlFile, '(2x,a)') '</Placemar
      write (KmlFile, '(2x,a)') '</Folde
      write (KmlFile, '(a)') '</Documen
      write (KmlFile, '(a)') '</km
      write (KmlFile, '(4x,a)') '<descriptio
      write (KmlFile, '(6x,a)') '<![CDAT
      write (KmlFile, '(8x,a)') '<u
      write (KmlFile, '(10x,a)')
     *    '<li>Activity ID: <a href="http://walrus.wr.us
     *    '/infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *    '/html/'//LongID(1:IDLength+3)//'.meta.html'//
     *    '">'//AkaID(1:AkaIDLength)//'&l
      write (KmlFile, '(10x,a)')
     *    '<li>Equipment descriptio
     *    '<a href="http://walrus.wr.usgs.gov
     *    '/imag1/'//ID(1:1)//'/'//ID(1:IDLength)//
     *    '/imag/'//LongID(1:IDLength+3)//
     *    '.equipment_description.keep'//
     *    '">image&l
      write (KmlFile, '(10x,a)')
     *    '<li>Geographic Are
     *    ALine(Tab(12)+1:ALineLength)//' ('//
     *    ALine(Tab(10)+1:Tab(11)-1)//' '//
     *    ALine(Tab(11)+1:Tab(12)-1)//')'
      write (PhotoID, '(80x)')
      write (KmlFile, '(10x,a)') 
     *    '<li>Photo ID: '//PhotoID(1:PhotoL
      write (KmlFile, '(10x,a)') '<li>Lat/Lon
     *    ALine(1:Tab(1)-1)//'/'//ALine(Tab(1)+1:Tab(2)-1)
      write (KmlFile, '(10x,a)') '<li>Date/Tim
     *    ALine(Tab(8)+1:Tab(9)-1)//' '//
     *    ALine(Tab(9)+1:Tab(10)-1)//', '//
     *    ALine(Tab(7)+1:Tab(8)-1)//' '//
     *    ALine(Tab(2)+1:Tab(3)-1)
          write (KmlFile, '(10x,a)')
     *        '<li>Digital Photograph: <img borde
     *        'src="http://walrus.wr.usgs.gov'//
     *        '/imag1/'//ID(1:1)//'/'//
     *        ID(1:IDLength)//'/imag/photo'//
     *        ALine(Slash2:Tab(5)-1)//'" '//
     *        'alt="Digital Photograph" width="500"&g
              write (KmlFile, '(10x,a)') '<li&
     *            '<a href="http://walrus.wr.usgs.gov
     *            '/imag1/'//ID(1:1)//'/'//
     *            ID(1:IDLength)//'/imag/photohi/'//
     *            ALine(Slash2:Tab(5)-1)//'" '//
     *            'alt="Full Resolution Digital Photograph" '//
     *            'window="new">
     *            'View Full Resolution Digital Photograph</
          write (KmlFile, '(10x,a)') 
     *            '<li>Digital Photograph: <img borde
     *            'src="http://walrus.wr.usgs.gov'//
     *            '/imag1/'//ID(1:1)//'/'//
     *            ID(1:IDLength)//'/imag/photohi/'//
     *            ALine(Slash2:Tab(5)-1)//'" '//
     *            'alt="Full Resolution Digital Photograph" '//
     *            'width="500"&g
          write (KmlFile, '(10x,a)')
     *        '<li>35mm Slide Film: <img borde
     *        'src="http://walrus.wr.usgs.gov'//
     *        '/imag1/'//ID(1:1)//'/'//
     *        ID(1:IDLength)//'/imag/slide'//
     *        ALine(Slash2:Tab(5)-1)//'" '//
     *        'alt="35mm Slide Film" width="500"&g
              write (KmlFile, '(10x,a)') '<li&
     *            '<a href="http://walrus.wr.usgs.gov
     *            '/imag1/'//ID(1:1)//'/'//
     *            ID(1:IDLength)//'/imag/slidehi/'//
     *            ALine(Slash2:Tab(5)-1)//'" '//
     *            'alt="Full Resolution 35mm Slide Film" '//
     *            'window="new">
     *            'View Full Resolution 35mm Slide Film</
          write (KmlFile, '(10x,a)')
     *            '<li>35mm Slide Film: <img borde
     *            'src="http://walrus.wr.usgs.gov'//
     *            '/imag1/'//ID(1:1)//'/'//
     *            ID(1:IDLength)//'/imag/slidehi/'//
     *            ALine(Slash2:Tab(5)-1)//'" '//
     *            'alt="Full Resolution 35mm Slide Film" width="500"&g
      write (KmlFile, '(10x,a)') '<li><a
     *    '"http://www.google.com/custom?q='//
     *    'usgs+'//ID(1:IDLength)//'+'//PhotoID(1:PhotoLength)//
     *    '+'//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 (KmlFile, '(8x,a)') '</u
      write (KmlFile, '(8x,a)')
     *    '<!-- Source: http://walrus.wr.usgs.gov/infobank/ --
      write (KmlFile, '(6x,a)') ']]&g
      write (KmlFile, '(4x,a)') '</descriptio
Opens
      open (unit = 70,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/spphotos4kml.control.temp')
      open (unit = 80,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = '/infobank/tmp/spphotos4kml.'//
     *      ID(1:IDLength)//'.temp')
      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 = ControlFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = ControlFilename(1:ControlFilenameLength))
Calls
      call kmlanalyzeid (70, IDLength, LongID, ID, Status)
      call stringlen (KmlFileName, KmlFileNameLength)
              call system ('/bin/rm '//KmlFileName(1:KmlFileNameLength))
      call system ('/bin/ls -1 '//
     *             '/imag1/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/imag/'//LongID(1:IDLength+3)//'.control.* '//
     *             ' | grep -v events > 
     *             '/infobank/tmp/spphotos4kml.'//
     *             ID(1:IDLength)//'.temp')
      call stringlen (AkaID, AkaIDLength)
      call kmllookat (KmlFile, AkaID, 'photo',
     *    IDLength, ID, LongID)
      call describephotos
     *    (ID, IDLength, LongID, ControlFilename, ControlFilenameLength,
     *     LastDot, ALine, ALineLength, PhotoID, PhotoLength,
     *     AkaID, AkaIDLength, CapID, Tab, TabCount)
      call kmlzip (KmlFileName(1:KmlFileNameLength))
      call stringlen (PhotoID, PhotoLength)

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