HiRISE

HiRISE.HiPlan.Shapes
Class USGS_Gazetteer

java.lang.Object
  extended by HiRISE.HiPlan.Shapes.USGS_Gazetteer
All Implemented Interfaces:
edu.asu.jmars.layer.util.features.FeatureProvider

public class USGS_Gazetteer
extends Object
implements edu.asu.jmars.layer.util.features.FeatureProvider

A JMARS shape layer feature provider for Mars feature names as defined by the USGS Gazetteer of Planetary Nomenclature.

When the load(java.lang.String) method is invoked, the operator is presented with a dialog to choose from a variety of feature types. A checkbox allows the operator to include the features' bounding boxes in the resulting shapes; the bounding boxes are more useful for small, regular features, such as impact craters, and less useful for large, irregular features such as planitia.

The functionality of the feature provider relies on the gazetteer's URL and back-end service. If these change, the provider will fail to return useful shape date. (It changed in July of 2010, requiring a non-trivial modification of the URL and field names.)

Coordinates: The gazetteer of planetary nomenclature is able to supply coordinates in a variety of systems: latitude may be planetographic or planetocentric; and longitude may be east- or west leading and may be 0 to 360 or -180 to 180. The shape layer takes planetocentric, west-leading data, but to keep parity with the JMARS coordinate display, east-leading longitude is requested (for display in the shape table) and then converted to west-leading coordinates; planetocentric latitudes are requested.

Version:
1.15
Author:
Christian Schaller - UA/PIRL
See Also:
USGS Gazetteer of Planetary Nomenclature

Field Summary
static String ID
          Class identification name with source code version and date.
static String SERVICE_DESCRIPTION
          The name of this feature provider.
 
Constructor Summary
USGS_Gazetteer()
          Creates a new feature provider.
 
Method Summary
 String getDescription()
          Gets a description of this feature provider.
 File[] getExistingSaveToFiles(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection, String baseName)
          Gets the names of the files output by a save with the given base name and feature collection.
 String getExtension()
          Gets the file extension.
 boolean isFileBased()
          Tests whether this provider pulls data from a file.
 boolean isRepresentable(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection)
          Tests whether the given collection can be completely represented in the source format of this provider.
 edu.asu.jmars.layer.util.features.FeatureCollection load(String filename)
          Gets a new feature collection containing data from the USGS Gazetteer of Planetary Nomenclature web service.
 int save(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection, String filename)
          Writes the specified features to the source from which the feature provider was constructed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

SERVICE_DESCRIPTION

public static final String SERVICE_DESCRIPTION
The name of this feature provider. It is the value returned by the getDescription() method.

See Also:
Constant Field Values
Constructor Detail

USGS_Gazetteer

public USGS_Gazetteer()
Creates a new feature provider. The JMARS shape layer is responsible for creating the provider.

Method Detail

getDescription

public String getDescription()
Gets a description of this feature provider. This value appears in the shape layer's menu.

Specified by:
getDescription in interface edu.asu.jmars.layer.util.features.FeatureProvider
Returns:
"USGS Online Gazetteer"

getExistingSaveToFiles

public File[] getExistingSaveToFiles(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection,
                                     String baseName)
Gets the names of the files output by a save with the given base name and feature collection.

Specified by:
getExistingSaveToFiles in interface edu.asu.jmars.layer.util.features.FeatureProvider
Parameters:
featureCollection - the feature collection in question.
baseName - the base name in question.
Returns:
the names of the output files.

getExtension

public String getExtension()
Gets the file extension. Since this provider pulls data from a web service rather than from a file, there is no file extension.

Specified by:
getExtension in interface edu.asu.jmars.layer.util.features.FeatureProvider
Returns:
null.

isFileBased

public boolean isFileBased()
Tests whether this provider pulls data from a file. This provider does not.

Specified by:
isFileBased in interface edu.asu.jmars.layer.util.features.FeatureProvider
Returns:
false.

isRepresentable

public boolean isRepresentable(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection)
Tests whether the given collection can be completely represented in the source format of this provider. It cannot.

Specified by:
isRepresentable in interface edu.asu.jmars.layer.util.features.FeatureProvider
Parameters:
featureCollection - the collection to be tested.
Returns:
false.

load

public edu.asu.jmars.layer.util.features.FeatureCollection load(String filename)
Gets a new feature collection containing data from the USGS Gazetteer of Planetary Nomenclature web service. A dialog is presented to the operator to select from a set of feature types and to include feature bounding boxes or not.

Specified by:
load in interface edu.asu.jmars.layer.util.features.FeatureProvider
Parameters:
filename - unused, but required by the interface.
Returns:
a new single feature collection, which may be empty.

save

public int save(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection,
                String filename)
Writes the specified features to the source from which the feature provider was constructed. This method is unsupported, so an UnsupportedOperationException is thrown if this method is called.

Specified by:
save in interface edu.asu.jmars.layer.util.features.FeatureProvider
Parameters:
featureCollection - the collection of features in question.
filename - a filename.
Returns:
the number of features saved.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona