Class DEMReader

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    SRTM2Reader, SRTM3Reader

    public abstract class DEMReader
    extends java.beans.PropertyChangeSupport
    DEMReader - an abstract base class for readers of various forms of Digital Elevation Model data sets
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  DEMReader.CacheEntry
      CacheEntry -- A class used to store a row of values
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected DEMReader​(javax.swing.JComponent item)  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String[] copyright()  
      abstract java.lang.String datasetName()  
      abstract boolean downloadable()  
      protected void downloadFile​(java.lang.String filename)
      Download a specific file and sand save it in scratch space on the local machine
      abstract java.lang.String extn()  
      abstract java.lang.String formatstring()  
      double frac​(int tile)
      Calculate the proportion of a degree represented by a particular element in the buffer
      protected java.lang.String getDownloadSiteName()  
      double getHeight​(LatLong place)  
      protected java.lang.String getProperty​(TerrainProperties propertyName)  
      java.beans.PropertyChangeListener[] getPropertyChangeListeners()  
      protected DEMReader.CacheEntry getRow​(java.lang.String name, int ytile)  
      long hits()  
      static double lagrangian​(double x, java.awt.geom.Point2D.Double... points)
      Fit an exact polynomial to a set of points and return its value at a specified point
      abstract boolean littleendian()  
      protected java.lang.String makename​(java.lang.String ns, double lat, java.lang.String ew, double lon)  
      long missing()  
      abstract int missingValue()  
      java.lang.String numEntryName​(java.lang.String name)  
      byte[] readByteRecord()
      Read the next byte record from the current ZipInputStream
      int[] readRecord()
      Read the next record from the current ZipInputStream
      abstract int recordlength()  
      void resetCounts()  
      long resultcount()  
      void setDownload​(boolean flag)  
      protected void setMessage​(java.lang.String msg)  
      protected void setProgress​(int val)  
      double tile​(double x)
      Calculate the number of the element in the buffer that refers to a particular lat or lon value
      long tries()  
      java.lang.String zipEntryName​(java.lang.String name)  
      • Methods inherited from class java.beans.PropertyChangeSupport

        addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • in

        protected static java.util.zip.ZipInputStream in
      • DIRECTORY

        protected java.lang.String DIRECTORY
      • cycle

        protected long cycle
      • cacheEnable

        protected boolean cacheEnable
      • hits

        protected long hits
      • tries

        protected long tries
      • missing

        protected long missing
      • resultcount

        protected long resultcount
      • lastMessage

        protected java.lang.String lastMessage
      • download

        protected boolean download
      • lastValue

        protected int lastValue
      • LOCALE

        protected static final java.util.Locale LOCALE
      • useLegacy

        protected boolean useLegacy
      • copyright

        protected java.lang.String[] copyright
    • Method Detail

      • makename

        protected java.lang.String makename​(java.lang.String ns,
                                            double lat,
                                            java.lang.String ew,
                                            double lon)
      • readRecord

        public int[] readRecord()
                         throws java.io.IOException
        Read the next record from the current ZipInputStream
        Returns:
        int[] buffer of length recordlength() containing the decoded next record;
        Throws:
        java.io.IOException
      • readByteRecord

        public byte[] readByteRecord()
                              throws java.io.IOException
        Read the next byte record from the current ZipInputStream
        Returns:
        byte[] buffer of length recordlength() containing the decoded next record;
        Throws:
        java.io.IOException
      • tile

        public double tile​(double x)
        Calculate the number of the element in the buffer that refers to a particular lat or lon value
        Parameters:
        x - the double lat/lon value
        Returns:
        A double value representing the buffer element index
      • getDownloadSiteName

        protected java.lang.String getDownloadSiteName()
      • frac

        public double frac​(int tile)
        Calculate the proportion of a degree represented by a particular element in the buffer
        Parameters:
        tile - the integer number of the element
        Returns:
        double number representing a fraction of a degree
      • downloadFile

        protected void downloadFile​(java.lang.String filename)
                             throws java.security.KeyManagementException,
                                    java.security.NoSuchAlgorithmException,
                                    java.io.IOException,
                                    MissingDataFileException
        Download a specific file and sand save it in scratch space on the local machine
        Parameters:
        filename - the name of the file to download
        Throws:
        java.security.KeyManagementException
        java.security.NoSuchAlgorithmException
        java.io.IOException
        MissingDataFileException
      • lagrangian

        public static double lagrangian​(double x,
                                        java.awt.geom.Point2D.Double... points)
        Fit an exact polynomial to a set of points and return its value at a specified point
        Parameters:
        x - double the value at which to evaluate the calculated polynomial
        points - a set of java.awt.geom.Point2D.Double values
        Returns:
        double value of the polynomial
      • hits

        public long hits()
      • resultcount

        public long resultcount()
      • tries

        public long tries()
      • missing

        public long missing()
      • resetCounts

        public void resetCounts()
      • setMessage

        protected void setMessage​(java.lang.String msg)
      • setProgress

        protected void setProgress​(int val)
      • getProperty

        protected java.lang.String getProperty​(TerrainProperties propertyName)
      • setDownload

        public void setDownload​(boolean flag)
      • getPropertyChangeListeners

        public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
        Overrides:
        getPropertyChangeListeners in class java.beans.PropertyChangeSupport
      • datasetName

        public abstract java.lang.String datasetName()
      • downloadable

        public abstract boolean downloadable()
      • recordlength

        public abstract int recordlength()
      • formatstring

        public abstract java.lang.String formatstring()
      • extn

        public abstract java.lang.String extn()
      • littleendian

        public abstract boolean littleendian()
      • missingValue

        public abstract int missingValue()
      • copyright

        public abstract java.lang.String[] copyright()
      • zipEntryName

        public java.lang.String zipEntryName​(java.lang.String name)
      • numEntryName

        public java.lang.String numEntryName​(java.lang.String name)