public class IlvAltitudeProviderProperty extends IlvNamedProperty
IlvManager
containing cartographic data.Using {@link #GetAltitudeProvider(IlvManager)} will return the altitude provider class attached to the manager.
If no specific provider has been set by the application, the above method will return a {@link ilog.views.maps.IlvDefaultAltitudeProvider} created and set the first time it is called for that manager.
For example, the code below displays the altitude at the point latLonRad
if the provider is able to compute it:
// Retrieve the provider for the manager
IlvAltitudeProvider elevationProvider = IlvAltitudeProviderProperty.GetAltitudeProvider(manager);
// retrieve the altitude for one point
double altitude = p.getAltitude(view.getManager(), latlonRad.x, latLonRad.y, 0);
if(!Double.IsNaN(altitude)) {
// use display preferences to format output altitude
IlvDisplayPreferences pref = IlvDisplayPreferencesProperty.GetDisplayPreferences(view.getManager());
System.out.println("Altitude is " + pref.formatAltitude(alt));
} else {
System.out.println("No altitude known");
}
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
NAME
The name of the property.
|
Constructor and Description |
---|
IlvAltitudeProviderProperty(IlvAltitudeProvider ap)
Creates a new
IlvAltitudeProviderProperty object with the
specified altitude provider. |
IlvAltitudeProviderProperty(IlvAltitudeProviderProperty source)
Creates a new
IlvAltitudeProviderProperty by copying an
existing one. |
IlvAltitudeProviderProperty(IlvInputStream stream)
Creates a new
IlvAltitudeProviderProperty from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
IlvNamedProperty |
copy()
Copies the property.
|
IlvAltitudeProvider |
getAltitudeProvider()
Returns the altitude provider of this property.
|
static IlvAltitudeProvider |
GetAltitudeProvider(IlvManager manager)
Returns the altitude provider of a manager.
|
boolean |
isPersistent()
Returns
true if the property can be saved. |
void |
write(IlvOutputStream stream)
Writes the property to an
IlvOutputStream . |
getName
public static final String NAME
public IlvAltitudeProviderProperty(IlvAltitudeProvider ap)
IlvAltitudeProviderProperty
object with the
specified altitude provider.ap
- The altitude provider.public IlvAltitudeProviderProperty(IlvAltitudeProviderProperty source)
IlvAltitudeProviderProperty
by copying an
existing one.source
- The source property to be copied.public IlvAltitudeProviderProperty(IlvInputStream stream) throws IlvReadFileException
IlvAltitudeProviderProperty
from an
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if an error occurs while reading.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvNamedProperty
stream
- The output stream.IOException
- if an I/O exception occurs.public IlvNamedProperty copy()
copy
in class IlvNamedProperty
IlvAltitudeProviderProperty
.public boolean isPersistent()
true
if the property can be saved.isPersistent
in class IlvNamedProperty
true
.public IlvAltitudeProvider getAltitudeProvider()
public static IlvAltitudeProvider GetAltitudeProvider(IlvManager manager)
IlvAltitudeProviderProperty
is attached to the
manager, the altitude provider of the property is returned. Otherwise,
a new IlvDefaultAltitudeProvider
is returned.manager
- The manager.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.