|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.collab.SharableImpl
ucar.unidata.data.DataSourceImpl
ucar.unidata.data.FilesDataSource
ucar.unidata.data.gis.KmlDataSource
public class KmlDataSource
DataSource for Web Map Servers
| Field Summary | |
|---|---|
static String |
ATTR_NAME
xml attribute |
static String |
ATTR_PARENT
xml attribute |
protected List |
cachedData
A local cache |
protected List |
cachedUrls
The urls |
static String |
EXT_KML
For ximg files |
static PatternFileFilter |
FILTER_KML
For ximg files |
static String |
SUFFIX_KML
For ximg files |
static String |
TAG_DOCUMENT
kml tag id |
static String |
TAG_FOLDER
kml tag id |
static String |
TAG_GROUNDOVERLAY
kml tag id |
static String |
TAG_HREF
xml tag |
static String |
TAG_KML
xml tag |
static String |
TAG_LINESTRING
|
static String |
TAG_LINK
xml tag |
static String |
TAG_MULTIGEOMETRY
kml tag id |
static String |
TAG_NAME
kml tag id |
static String |
TAG_NETWORKLINK
kml tag id |
static String |
TAG_PHOTOOVERLAY
kml tag |
static String |
TAG_PLACEMARK
kml tag id |
static String |
TAG_SCHEMA
xml tag |
static String |
TAG_URL
xml tag |
| Fields inherited from class ucar.unidata.data.FilesDataSource |
|---|
adapters, oldSourceFromBundles, sources |
| Fields inherited from class ucar.unidata.data.DataSourceImpl |
|---|
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES |
| Fields inherited from interface ucar.unidata.data.DataSource |
|---|
DATAPATH_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_TITLE |
| Constructor Summary | |
|---|---|
KmlDataSource()
Dummy constructor so this object can get unpersisted. |
|
KmlDataSource(DataSourceDescriptor descriptor,
String kmlUrl,
Hashtable properties)
Create a KmlDataSource from the specification given. |
|
| Method Summary | |
|---|---|
static String |
createKml(GeoLocationInfo bounds,
String imageFileName)
Create some kml from the given bounds and image file |
static void |
createLatLonBox(GeoLocationInfo bounds,
StringBuffer sb)
Utility to create a latlonbox kml |
protected void |
doMakeDataChoices()
Create the data choices associated with this source. |
protected List |
doMakeDateTimes()
Create a list of times for this data source. |
void |
expandIfNeeded(CompositeDataChoice parent)
Expand the data choice if its a networklink |
protected Data |
getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection dataSelection,
Hashtable requestProperties)
Actually get the data identified by the given DataChoce. |
protected InputStream |
getInputStream(String path)
Create the input stream. |
void |
initAfterUnpersistence()
Initialize after we have been unpersisted |
static boolean |
isKmlFile(String filename)
Is this a kml or kmz file |
static void |
main(String[] args)
test main |
protected byte[] |
readBytes(String path)
Utility to read the bytes from the file or url |
protected Image |
readImage(String url,
String baseUrl)
Read the image |
void |
reloadData()
reload |
void |
setKmlUrl(String value)
Set the KmlUrl property. |
protected boolean |
shouldCache(Data data)
See if this DataSource should cache or not |
static void |
writeToFile(String kmlFilename,
GeoLocationInfo bounds,
String imageFileName)
write image as a kml to file |
| Methods inherited from class ucar.unidata.data.FilesDataSource |
|---|
doRemove, equals, getDataFileExtension, getDataPaths, getFilePath, getFullDescription, getInputStreams, getLocationsForPolling, getPartialDescription, getSource, getSources, haveSources, initAfterCreation, initWithPollingInfo, isFileBased, newFilesFromPolling, processDataFilename, propertiesChanged, reloadData, saveDataToLocalDisk, setNewFiles, setSource, setSources, sourcesChanged, updateState |
| Methods inherited from class ucar.unidata.collab.SharableImpl |
|---|
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ucar.unidata.data.DataSource |
|---|
getUniqueId |
| Field Detail |
|---|
public static final PatternFileFilter FILTER_KML
public static final String EXT_KML
public static final String SUFFIX_KML
public static final String ATTR_PARENT
public static final String ATTR_NAME
public static final String TAG_GROUNDOVERLAY
public static final String TAG_PHOTOOVERLAY
public static final String TAG_URL
public static final String TAG_HREF
public static final String TAG_LINK
public static final String TAG_LINESTRING
public static final String TAG_SCHEMA
public static final String TAG_NETWORKLINK
public static final String TAG_MULTIGEOMETRY
public static final String TAG_DOCUMENT
public static final String TAG_FOLDER
public static final String TAG_KML
public static final String TAG_PLACEMARK
public static final String TAG_NAME
protected List cachedData
protected List cachedUrls
| Constructor Detail |
|---|
public KmlDataSource()
public KmlDataSource(DataSourceDescriptor descriptor,
String kmlUrl,
Hashtable properties)
throws VisADException
descriptor - descriptor for the data sourcekmlUrl - Where the kml came fromproperties - extra properties
VisADException - some problem occurred creating data| Method Detail |
|---|
public void reloadData()
reloadData in interface DataSourcereloadData in class FilesDataSourcepublic void initAfterUnpersistence()
initAfterUnpersistence in interface DataSourceinitAfterUnpersistence in class FilesDataSource
protected Image readImage(String url,
String baseUrl)
url - image urlbaseUrl - Where the kml came from_
protected byte[] readBytes(String path)
throws Exception
path - file or url
Exception - On badness
protected InputStream getInputStream(String path)
throws Exception
path - file or url
Exception - On badnessprotected void doMakeDataChoices()
doMakeDataChoices in class DataSourceImplpublic void expandIfNeeded(CompositeDataChoice parent)
expandIfNeeded in interface DataSourceexpandIfNeeded in class DataSourceImplparent - data choice
protected Data getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection dataSelection,
Hashtable requestProperties)
throws VisADException,
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.
RemoteException - Java RMI problem
VisADException - VisAD problemprotected boolean shouldCache(Data data)
shouldCache in class DataSourceImpldata - Data to cache
protected List doMakeDateTimes()
doMakeDateTimes in class DataSourceImplpublic void setKmlUrl(String value)
value - The new value for KmlUrlpublic static boolean isKmlFile(String filename)
filename - file
public static void writeToFile(String kmlFilename,
GeoLocationInfo bounds,
String imageFileName)
throws FileNotFoundException,
IOException
kmlFilename - kml filenamebounds - _image boundsimageFileName - image filename
FileNotFoundException - On badness
IOException - On badness
public static String createKml(GeoLocationInfo bounds,
String imageFileName)
throws FileNotFoundException,
IOException
bounds - boundsimageFileName - image
FileNotFoundException - On badness
IOException - On badness
public static void createLatLonBox(GeoLocationInfo bounds,
StringBuffer sb)
bounds - boundssb - buffer to add topublic static void main(String[] args)
args - cmd line args
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||