Class AbstractElevationModel

    • Field Detail

      • dataFileStore

        protected FileStore dataFileStore
      • missingDataFlag

        protected double missingDataFlag
      • missingDataValue

        protected double missingDataValue
      • networkRetrievalEnabled

        protected boolean networkRetrievalEnabled
      • expiryTime

        protected long expiryTime
      • enabled

        protected boolean enabled
    • Constructor Detail

      • AbstractElevationModel

        public AbstractElevationModel()
    • Method Detail

      • dispose

        public void dispose()
        Description copied from interface: Disposable
        Disposes of any internal resources allocated by the object.
        Specified by:
        dispose in interface Disposable
      • setName

        public void setName​(java.lang.String name)
        Description copied from interface: ElevationModel
        Set the elevation model's name. The name is a convenience attribute typically used to identify the elevation model in user interfaces. By default, an elevation model has no name.
        Specified by:
        setName in interface ElevationModel
        Parameters:
        name - the name to give the elevation model.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isNetworkRetrievalEnabled

        public boolean isNetworkRetrievalEnabled()
        Description copied from interface: ElevationModel
        Indicates whether the elevation model is allowed to retrieve data from the network. Some elevation models have no need to retrieve data from the network. This flag is meaningless for such elevation models.
        Specified by:
        isNetworkRetrievalEnabled in interface ElevationModel
        Returns:
        true if the elevation model is enabled to retrieve network data, else false.
      • setNetworkRetrievalEnabled

        public void setNetworkRetrievalEnabled​(boolean enabled)
        Description copied from interface: ElevationModel
        Controls whether the elevation model is allowed to retrieve data from the network. Some elevation models have no need for data from the network. This flag may be set but is meaningless for such elevation models.
        Specified by:
        setNetworkRetrievalEnabled in interface ElevationModel
        Parameters:
        enabled - true if network retrieval is allowed, else false.
      • setExpiryTime

        public void setExpiryTime​(long expiryTime)
        Description copied from interface: ElevationModel
        Specifies the time of the elevation model's most recent dataset update. If greater than zero, the model ignores and eliminates any previously cached data older than the time specified, and requests new information from the data source. If zero, the model uses any expiry times intrinsic to the model, typically initialized at model construction. The default expiry time is 0, thereby enabling a model's intrinsic expiration criteria.
        Specified by:
        setExpiryTime in interface ElevationModel
        Parameters:
        expiryTime - the expiry time of any cached data, expressed as a number of milliseconds beyond the epoch.
        See Also:
        for a description of milliseconds beyond the epoch.
      • setEnabled

        public void setEnabled​(boolean enabled)
        Description copied from interface: ElevationModel
        Indicates whether this elevation model is used or ignored.
        Specified by:
        setEnabled in interface ElevationModel
        Parameters:
        enabled - true if this elevation model is used, otherwise false.
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: ElevationModel
        Indicates whether this elevation model is used or ignored.
        Specified by:
        isEnabled in interface ElevationModel
        Returns:
        true if this elevation model is used, otherwise false.
      • getDetailHint

        public double getDetailHint​(Sector sector)
        Description copied from interface: ElevationModel
        Returns the detail hint associated with the specified sector. If the elevation model does not have any detail hint for the sector, this method returns zero.
        Specified by:
        getDetailHint in interface ElevationModel
        Parameters:
        sector - the sector in question.
        Returns:
        The detail hint corresponding to the specified sector.
      • getDataFileStore

        public FileStore getDataFileStore()
      • setDataFileStore

        public void setDataFileStore​(FileStore dataFileStore)
      • getElevation

        public double getElevation​(Angle latitude,
                                   Angle longitude)
        Description copied from interface: ElevationModel
        Returns the elevation at a specified location. If the elevation at the specified location is the elevation model's missing data signal, or if the location specified is outside the elevation model's coverage area, the elevation model's missing data replacement value is returned.

        The elevation returned from this method is the best available in memory. If no elevation is in memory, the elevation model's minimum extreme elevation at the location is returned. Local disk caches are not consulted.

        Specified by:
        getElevation in interface ElevationModel
        Parameters:
        latitude - the latitude of the location in question.
        longitude - the longitude of the location in question.
        Returns:
        The elevation corresponding to the specified location, or the elevation model's missing-data replacement value if there is no elevation for the given location.
        See Also:
        ElevationModel.setMissingDataSignal(double), ElevationModel.getUnmappedElevation(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle)
      • getElevations

        public double[] getElevations​(Sector sector,
                                      java.util.List<? extends LatLon> latLons,
                                      double[] targetResolutions,
                                      double[] elevations)
        Description copied from interface: ElevationModel
        Returns the elevations of a collection of locations. Replaces any elevation values corresponding to the missing data signal with the elevation model's missing data replacement value. If a location within the elevation model's coverage area cannot currently be determined, the elevation model's minimum extreme elevation for that location is returned in the output buffer. If a location is outside the elevation model's coverage area, the output buffer for that location is not modified; it retains the buffer's original value.
        Specified by:
        getElevations in interface ElevationModel
        Parameters:
        sector - the sector in question.
        latLons - the locations to return elevations for. If a location is null, the output buffer for that location is not modified.
        targetResolutions - the desired horizontal resolution, in radians, of the raster or other elevation sample from which elevations are drawn. (To compute radians from a distance, divide the distance by the radius of the globe, ensuring that both the distance and the radius are in the same units.) This is an array to enable specification of a target resolution per elevation model for CompoundElevationModel. The entries must be in the same order as the elevations in CompoundElevationModel.
        elevations - an array in which to place the returned elevations. The array must be pre-allocated and contain at least as many elements as the list of locations.
        Returns:
        the resolutions achieved, in radians, which will be Double.MAX_VALUE if individual elevations cannot be determined for all of the locations. The entries are in the same order as the elevations in CompoundElevationModel.
        See Also:
        ElevationModel.setMissingDataSignal(double)
      • getUnmappedElevations

        public double[] getUnmappedElevations​(Sector sector,
                                              java.util.List<? extends LatLon> latLons,
                                              double[] targetResolutions,
                                              double[] elevations)
        Description copied from interface: ElevationModel
        Returns the elevations of a collection of locations. Does not replace any elevation values corresponding to the missing data signal with the elevation model's missing data replacement value. If a location within the elevation model's coverage area cannot currently be determined, the elevation model's minimum extreme elevation for that location is returned in the output buffer. If a location is outside the elevation model's coverage area, the output buffer for that location is not modified; it retains the buffer's original value.
        Specified by:
        getUnmappedElevations in interface ElevationModel
        Parameters:
        sector - the sector in question.
        latLons - the locations to return elevations for. If a location is null, the output buffer for that location is not modified.
        targetResolutions - the desired horizontal resolution, in radians, of the raster or other elevation sample from which elevations are drawn. (To compute radians from a distance, divide the distance by the radius of the globe, ensuring that both the distance and the radius are in the same units.) This is an array to enable specification of a target resolution per elevation model for CompoundElevationModel. The entries must be in the same order as the elevations in CompoundElevationModel.
        elevations - an array in which to place the returned elevations. The array must be pre-allocated and contain at least as many elements as the list of locations.
        Returns:
        the resolutions achieved, in radians, which will be Double.MAX_VALUE if individual elevations cannot be determined for all of the locations. The entries are in the same order as the elevations in CompoundElevationModel.
        See Also:
        ElevationModel.setMissingDataSignal(double)
      • getRestorableState

        public java.lang.String getRestorableState()
        Description copied from interface: Restorable
        Returns an XML document string describing the object's state. This state can be restored later by calling restoreState and passing the XML document.
        Specified by:
        getRestorableState in interface Restorable
        Returns:
        an XML document string describing the object's state.
      • restoreState

        public void restoreState​(java.lang.String stateInXml)
        Description copied from interface: Restorable
        Restores the object's state to what is described in the specified XML document string.
        Specified by:
        restoreState in interface Restorable
        Parameters:
        stateInXml - an XML document string describing an object's state.
      • composeElevations

        public void composeElevations​(Sector sector,
                                      java.util.List<? extends LatLon> latlons,
                                      int tileWidth,
                                      double[] buffer)
                               throws java.lang.Exception
        Description copied from interface: ElevationModel
        Determines the elevations at specified locations within a specified Sector.
        Specified by:
        composeElevations in interface ElevationModel
        Parameters:
        sector - the sector containing the locations.
        latlons - the locations for which to return elevations.
        tileWidth - the number of locations that comprise one row in the latlons argument.
        buffer - a buffer in which to put the elevations. The buffer must have at least as many elements as the number of specified locations.
        Throws:
        java.lang.Exception - if the method fails. Different elevation models may fail for different reasons.
        java.lang.IllegalArgumentException - if either the sector, list of locations or buffer is null, if the buffer size is not at least as large as the location list, or the tile width is greater than the locations list length or less than 1.
      • isTransparentValue

        protected boolean isTransparentValue​(java.lang.Double value)
      • isElevationModelConfigDocument

        public static boolean isElevationModelConfigDocument​(org.w3c.dom.Element domElement)
        Returns true if a specified DOM document is an ElevationModel configuration document, and false otherwise.
        Parameters:
        domElement - the DOM document in question.
        Returns:
        true if the document is an ElevationModel configuration document; false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if document is null.
      • createElevationModelConfigElements

        public static org.w3c.dom.Element createElevationModelConfigElements​(AVList params,
                                                                             org.w3c.dom.Element context)
        Appends elevation model configuration parameters as elements to the specified context. This appends elements for the following parameters:
        Parameters
        ParameterElement PathType
        AVKey.DISPLAY_NAMEDisplayNameString
        AVKey.NETWORK_RETRIEVAL_ENABLEDNetworkRetrievalEnabledBoolean
        AVKey.MISSING_DATA_SIGNALMissingData/@signalDouble
        AVKey.MISSING_DATA_REPLACEMENTMissingData/@replacementDouble
        AVKey.DETAIL_HINTDataDetailHintDouble
        Parameters:
        params - the key-value pairs which define the elevation model configuration parameters.
        context - the XML document root on which to append elevation model configuration elements.
        Returns:
        a reference to context.
        Throws:
        java.lang.IllegalArgumentException - if either the parameters or the context are null.
      • getElevationModelConfigParams

        public static AVList getElevationModelConfigParams​(org.w3c.dom.Element domElement,
                                                           AVList params)
        Parses elevation model configuration parameters from the specified DOM document. This writes output as key-value pairs to params. If a parameter from the XML document already exists in params, that parameter is ignored. Supported parameters are:
        Parameters
        ParameterElement PathType
        AVKey.DISPLAY_NAMEDisplayNameString
        AVKey.NETWORK_RETRIEVAL_ENABLEDNetworkRetrievalEnabledBoolean
        AVKey.MISSING_DATA_SIGNALMissingData/@signalDouble
        AVKey.MISSING_DATA_REPLACEMENTMissingData/@replacementDouble
        AVKey.DETAIL_HINTDataDetailHintDouble
        Parameters:
        domElement - the XML document root to parse for elevation model configuration elements.
        params - the output key-value pairs which recieve the elevation model configuration parameters. A null reference is permitted.
        Returns:
        a reference to params, or a new AVList if params is null.
        Throws:
        java.lang.IllegalArgumentException - if the document is null.
      • getLocalDataAvailability

        public double getLocalDataAvailability​(Sector sector,
                                               java.lang.Double targetResolution)
        Description copied from interface: ElevationModel
        Returns the proportion of this elevation model's data that is local -- in the computer's data cache or installed data filestore -- for a specified sector and target resolution.
        Specified by:
        getLocalDataAvailability in interface ElevationModel
        Parameters:
        sector - the sector of interest.
        targetResolution - the desired horizontal resolution, in radians, of the raster or other elevation sample from which elevations are drawn. (To compute radians from a distance, divide the distance by the radius of the globe, ensuring that both the distance and the radius are in the same units.) Specify null to use this elevation model's best resolution.
        Returns:
        the fraction of the data that is local. A value of 1.0 indicates that all the data is available.
      • getUnmappedLocalSourceElevation

        public double getUnmappedLocalSourceElevation​(Angle latitude,
                                                      Angle longitude)
        Description copied from interface: ElevationModel
        Returns the elevation for this elevation model's highest level of detail if the source file for that level and the specified location exists in the local elevation cache on disk. This method is useful only when an elevation dataset has been pre-cached.
        Specified by:
        getUnmappedLocalSourceElevation in interface ElevationModel
        Parameters:
        latitude - The latitude of the location whose elevation is desired.
        longitude - The longitude of the location whose elevation is desired.
        Returns:
        The elevation at the specified location, if that location is contained in this elevation model and the source file for the highest-resolution elevation at that location exists in the current disk cache. Otherwise this elevation model's missing data signal is returned (see ElevationModel.getMissingDataSignal()).