public class KmlDataSource extends FilesDataSource
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_NAME
xml attribute
|
static java.lang.String |
ATTR_PARENT
xml attribute
|
protected java.util.List |
cachedData
A local cache
|
protected java.util.List |
cachedUrls
The urls
|
static java.lang.String |
EXT_KML
For ximg files
|
static PatternFileFilter |
FILTER_KML
For ximg files
|
static java.lang.String |
SUFFIX_KML
For ximg files
|
static java.lang.String |
TAG_DOCUMENT
kml tag id
|
static java.lang.String |
TAG_FOLDER
kml tag id
|
static java.lang.String |
TAG_GROUNDOVERLAY
kml tag id
|
static java.lang.String |
TAG_HREF
xml tag
|
static java.lang.String |
TAG_KML
xml tag
|
static java.lang.String |
TAG_LINESTRING |
static java.lang.String |
TAG_LINK
xml tag
|
static java.lang.String |
TAG_MULTIGEOMETRY
kml tag id
|
static java.lang.String |
TAG_NAME
kml tag id
|
static java.lang.String |
TAG_NETWORKLINK
kml tag id
|
static java.lang.String |
TAG_PHOTOOVERLAY
kml tag
|
static java.lang.String |
TAG_PLACEMARK
kml tag id
|
static java.lang.String |
TAG_SCHEMA
xml tag
|
static java.lang.String |
TAG_STYLEURL
kml tag id
|
static java.lang.String |
TAG_URL
xml tag
|
adapters, oldSourceFromBundles, sourceschangeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YESDATAPATH_DATE_FORMAT, DATAPATH_DATE_PATTERN, MOST_RECENT, ordinalNames, PROP_AUTOCREATEDISPLAY, PROP_BASEDIRECTORY, PROP_CACHEABLE, PROP_DATACHOICENAME, PROP_DISPLAYPROPERTIES, PROP_DOCUMENTLINKS, PROP_FILEPATTERN, PROP_GEOLOCATION, PROP_ICON, PROP_NAME, PROP_POLLINFO, PROP_RESOLVERURL, PROP_SERVICE_HTTP, PROP_SUBPROPERTIES, PROP_TIMELABELS, PROP_TIMESTRIDE, PROP_TITLE| Constructor and Description |
|---|
KmlDataSource()
Dummy constructor so this object can get unpersisted.
|
KmlDataSource(DataSourceDescriptor descriptor,
java.lang.String kmlUrl,
java.util.Hashtable properties)
Create a KmlDataSource from the specification given.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
createKml(GeoLocationInfo bounds,
java.lang.String imageFileName)
Create some kml from the given bounds and image file
|
static void |
createLatLonBox(GeoLocationInfo bounds,
java.lang.StringBuffer sb)
Utility to create a latlonbox kml
|
protected void |
doMakeDataChoices()
Create the data choices associated with this source.
|
protected java.util.List |
doMakeDateTimes()
Create a list of times for this data source.
|
void |
expandIfNeeded(CompositeDataChoice parent)
Expand the data choice if its a networklink
|
protected visad.Data |
getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection dataSelection,
java.util.Hashtable requestProperties)
Actually get the data identified by the given DataChoce.
|
protected java.io.InputStream |
getInputStream(java.lang.String path)
Create the input stream.
|
void |
initAfterUnpersistence()
Initialize after we have been unpersisted
|
static boolean |
isKmlFile(java.lang.String filename)
Is this a kml or kmz file
|
static void |
main(java.lang.String[] args)
test main
|
protected byte[] |
readBytes(java.lang.String path)
Utility to read the bytes from the file or url
|
protected java.awt.Image |
readImage(java.lang.String url,
java.lang.String baseUrl)
Read the image
|
void |
reloadData()
reload
|
void |
setKmlUrl(java.lang.String value)
Set the KmlUrl property.
|
protected boolean |
shouldCache(visad.Data data)
See if this DataSource should cache or not
|
static void |
writeToFile(java.lang.String kmlFilename,
GeoLocationInfo bounds,
java.lang.String imageFileName)
write image as a kml to file
|
doRemove, equals, getDataFileExtension, getDataPaths, getFilePath, getFullDescription, getInputStreams, getLocationsForPolling, getPartialDescription, getSource, getSources, haveSources, initAfterCreation, initWithPollingInfo, isFileBased, newFilesFromPolling, processDataFilename, propertiesChanged, reloadData, saveDataToLocalDisk, setNewFiles, setSource, setSources, sourcesChanged, updateStateaddActions, addDataChangeListener, addDataChoice, addPropertiesTabs, addReloadTab, applyFieldMask, applyProperties, beginWritingDataToLocalDisk, canAddCurrentName, canCacheDataToDisk, canChangeData, canDoAllLevels, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canSaveDataToLocalDisk, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, endWritingDataToLocalDisk, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, getAllLevels, getAllTimesForTimeDriver, getCache, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDefaultSave, getDescription, getDescriptor, getErrorMessage, getEverChangedName, getExtraGeoSelectionComponent, getExtraTimesComponent, getFileFilterForPolling, getid, getIdv, getInError, getLocalDirectory, getLocationForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesComponents, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSampleDataProjection, getSaveDataFileLabel, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initDataChoice, initDataSelectionComponents, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFileFromPolling, notifyDataChange, putCache, putCache, reloadProperties, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, selectTimesFromList, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDefaultSave, setDescription, setDescriptor, setDirectory, setEverChangedName, setInError, setInError, setInError, setName, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setTmpPaths, setUserName, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, writeFieldMaskFile, writeFieldMaskFileapplySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialogclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetUniqueIdpublic static final PatternFileFilter FILTER_KML
public static final java.lang.String EXT_KML
public static final java.lang.String SUFFIX_KML
public static final java.lang.String ATTR_PARENT
public static final java.lang.String ATTR_NAME
public static final java.lang.String TAG_GROUNDOVERLAY
public static final java.lang.String TAG_PHOTOOVERLAY
public static final java.lang.String TAG_URL
public static final java.lang.String TAG_HREF
public static final java.lang.String TAG_LINK
public static final java.lang.String TAG_LINESTRING
public static final java.lang.String TAG_SCHEMA
public static final java.lang.String TAG_NETWORKLINK
public static final java.lang.String TAG_MULTIGEOMETRY
public static final java.lang.String TAG_DOCUMENT
public static final java.lang.String TAG_FOLDER
public static final java.lang.String TAG_KML
public static final java.lang.String TAG_PLACEMARK
public static final java.lang.String TAG_NAME
public static final java.lang.String TAG_STYLEURL
protected java.util.List cachedData
protected java.util.List cachedUrls
public KmlDataSource()
public KmlDataSource(DataSourceDescriptor descriptor, java.lang.String kmlUrl, java.util.Hashtable properties) throws visad.VisADException
descriptor - descriptor for the data sourcekmlUrl - Where the kml came fromproperties - extra propertiesvisad.VisADException - some problem occurred creating datapublic void reloadData()
reloadData in interface DataSourcereloadData in class FilesDataSourcepublic void initAfterUnpersistence()
initAfterUnpersistence in interface DataSourceinitAfterUnpersistence in class FilesDataSourceprotected java.awt.Image readImage(java.lang.String url,
java.lang.String baseUrl)
url - image urlbaseUrl - Where the kml came from_protected byte[] readBytes(java.lang.String path)
throws java.lang.Exception
path - file or urljava.lang.Exception - On badnessprotected java.io.InputStream getInputStream(java.lang.String path)
throws java.lang.Exception
path - file or urljava.lang.Exception - On badnessprotected void doMakeDataChoices()
doMakeDataChoices in class DataSourceImplpublic void expandIfNeeded(CompositeDataChoice parent)
expandIfNeeded in interface DataSourceexpandIfNeeded in class DataSourceImplparent - data choiceprotected visad.Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, java.util.Hashtable requestProperties) throws visad.VisADException, java.rmi.RemoteException
getDataInner in class DataSourceImpldataChoice - The data choice that identifies the requested
data.category - The data category of the request.dataSelection - Identifies any subsetting of the data.requestProperties - Hashtable that holds any detailed request
properties.java.rmi.RemoteException - Java RMI problemvisad.VisADException - VisAD problemprotected boolean shouldCache(visad.Data data)
shouldCache in class DataSourceImpldata - Data to cacheprotected java.util.List doMakeDateTimes()
doMakeDateTimes in class DataSourceImplpublic void setKmlUrl(java.lang.String value)
value - The new value for KmlUrlpublic static boolean isKmlFile(java.lang.String filename)
filename - filepublic static void writeToFile(java.lang.String kmlFilename,
GeoLocationInfo bounds,
java.lang.String imageFileName)
throws java.io.FileNotFoundException,
java.io.IOException
kmlFilename - kml filenamebounds - _image boundsimageFileName - image filenamejava.io.FileNotFoundException - On badnessjava.io.IOException - On badnesspublic static java.lang.String createKml(GeoLocationInfo bounds, java.lang.String imageFileName) throws java.io.FileNotFoundException, java.io.IOException
bounds - boundsimageFileName - imagejava.io.FileNotFoundException - On badnessjava.io.IOException - On badnesspublic static void createLatLonBox(GeoLocationInfo bounds, java.lang.StringBuffer sb)
bounds - boundssb - buffer to add topublic static void main(java.lang.String[] args)
args - cmd line args