Class PlaceNameLayer
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.layers.AbstractLayer
-
- gov.nasa.worldwind.layers.placename.PlaceNameLayer
-
- All Implemented Interfaces:
AVList
,Disposable
,MessageListener
,Layer
,Restorable
,BulkRetrievable
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
NASAWFSPlaceNameLayer
public class PlaceNameLayer extends AbstractLayer implements BulkRetrievable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
PlaceNameLayer.DownloadPostProcessor
protected static class
PlaceNameLayer.GMLPlaceNameSAXHandler
protected class
PlaceNameLayer.NavigationTile
protected static class
PlaceNameLayer.PlaceNameChunk
protected static class
PlaceNameLayer.RequestTask
protected static class
PlaceNameLayer.Tile
-
Field Summary
Fields Modifier and Type Field Description protected boolean
cullNames
protected java.lang.Object
fileLock
static LatLon
GRID_1152x2304
static LatLon
GRID_144x288
static LatLon
GRID_16x32
static LatLon
GRID_1x1
static LatLon
GRID_288x576
static LatLon
GRID_36x72
static LatLon
GRID_4x8
static LatLon
GRID_576x1152
static LatLon
GRID_72x144
static LatLon
GRID_8x16
static double
LEVEL_A
static double
LEVEL_B
static double
LEVEL_C
static double
LEVEL_D
static double
LEVEL_E
static double
LEVEL_F
static double
LEVEL_G
static double
LEVEL_H
static double
LEVEL_I
static double
LEVEL_J
static double
LEVEL_K
static double
LEVEL_L
static double
LEVEL_M
static double
LEVEL_N
static double
LEVEL_O
static double
LEVEL_P
protected java.util.List<PlaceNameLayer.NavigationTile>
navTiles
protected PlaceNameServiceSet
placeNameServiceSet
protected Vec4
referencePoint
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable>
requestQ
-
Constructor Summary
Constructors Constructor Description PlaceNameLayer(PlaceNameServiceSet placeNameServiceSet)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PlaceNameLayer.Tile[]
buildTiles(PlaceNameService placeNameService, PlaceNameLayer.NavigationTile navTile)
protected static Angle
clampAngle(Angle a, Angle min, Angle max)
protected Vec4
computeReferencePoint(DrawContext dc)
protected void
doRender(DrawContext dc)
protected void
downloadTile(PlaceNameLayer.Tile tile)
protected void
downloadTile(PlaceNameLayer.Tile tile, PlaceNameLayer.DownloadPostProcessor postProcessor)
protected void
drawOrRequestTile(DrawContext dc, PlaceNameLayer.Tile tile, double minDisplayDistanceSquared, double maxDisplayDistanceSquared)
long
getEstimatedMissingDataSize(Sector sector, double resolution)
Get the estimated size in bytes of the placenames not in the WorldWind file cache for the given sector and resolution.long
getEstimatedMissingDataSize(Sector sector, double resolution, FileStore fileStore)
Get the estimated size in bytes of the placenames not in a specified file store for the given sector and resolution.PlaceNameServiceSet
getPlaceNameServiceSet()
protected Vec4
getReferencePoint()
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable>
getRequestQ()
protected static boolean
isNameVisible(DrawContext dc, PlaceNameService service, Position namePosition)
protected static boolean
isSectorVisible(DrawContext dc, Sector sector, double minDistanceSquared, double maxDistanceSquared)
protected static boolean
isServiceVisible(DrawContext dc, PlaceNameService placeNameService)
protected static boolean
isTileVisible(DrawContext dc, PlaceNameLayer.Tile tile, double minDistanceSquared, double maxDistanceSquared)
protected boolean
loadTile(PlaceNameLayer.Tile tile, java.net.URL url)
BulkRetrievalThread
makeLocal(Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)
Start a newBulkRetrievalThread
that downloads all placenames for a given sector and resolution to a specified file store.BulkRetrievalThread
makeLocal(Sector sector, double resolution, BulkRetrievalListener listener)
Start a newBulkRetrievalThread
that downloads all placenames for a given sector and resolution to the current WorldWind file cache.protected static java.nio.CharBuffer
newCharBuffer(int numElements)
protected static PlaceNameLayer.PlaceNameChunk
readTileData(PlaceNameLayer.Tile tile, java.net.URL url)
protected void
requestTile(DrawContext dc, PlaceNameLayer.Tile tile)
protected void
saveBuffer(java.nio.ByteBuffer buffer, java.io.File outFile)
protected void
sendRequests()
-
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
createLayerConfigElements, dispose, doPick, doPreRender, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getOpacity, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit, toString
-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from interface gov.nasa.worldwind.retrieve.BulkRetrievable
getName
-
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
-
-
-
-
Field Detail
-
placeNameServiceSet
protected final PlaceNameServiceSet placeNameServiceSet
-
requestQ
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable> requestQ
-
referencePoint
protected Vec4 referencePoint
-
fileLock
protected final java.lang.Object fileLock
-
cullNames
protected boolean cullNames
-
LEVEL_A
public static final double LEVEL_A
- See Also:
- Constant Field Values
-
LEVEL_B
public static final double LEVEL_B
- See Also:
- Constant Field Values
-
LEVEL_C
public static final double LEVEL_C
- See Also:
- Constant Field Values
-
LEVEL_D
public static final double LEVEL_D
- See Also:
- Constant Field Values
-
LEVEL_E
public static final double LEVEL_E
- See Also:
- Constant Field Values
-
LEVEL_F
public static final double LEVEL_F
- See Also:
- Constant Field Values
-
LEVEL_G
public static final double LEVEL_G
- See Also:
- Constant Field Values
-
LEVEL_H
public static final double LEVEL_H
- See Also:
- Constant Field Values
-
LEVEL_I
public static final double LEVEL_I
- See Also:
- Constant Field Values
-
LEVEL_J
public static final double LEVEL_J
- See Also:
- Constant Field Values
-
LEVEL_K
public static final double LEVEL_K
- See Also:
- Constant Field Values
-
LEVEL_L
public static final double LEVEL_L
- See Also:
- Constant Field Values
-
LEVEL_M
public static final double LEVEL_M
- See Also:
- Constant Field Values
-
LEVEL_N
public static final double LEVEL_N
- See Also:
- Constant Field Values
-
LEVEL_O
public static final double LEVEL_O
- See Also:
- Constant Field Values
-
LEVEL_P
public static final double LEVEL_P
- See Also:
- Constant Field Values
-
GRID_1x1
public static final LatLon GRID_1x1
-
GRID_4x8
public static final LatLon GRID_4x8
-
GRID_8x16
public static final LatLon GRID_8x16
-
GRID_16x32
public static final LatLon GRID_16x32
-
GRID_36x72
public static final LatLon GRID_36x72
-
GRID_72x144
public static final LatLon GRID_72x144
-
GRID_144x288
public static final LatLon GRID_144x288
-
GRID_288x576
public static final LatLon GRID_288x576
-
GRID_576x1152
public static final LatLon GRID_576x1152
-
GRID_1152x2304
public static final LatLon GRID_1152x2304
-
navTiles
protected java.util.List<PlaceNameLayer.NavigationTile> navTiles
-
-
Constructor Detail
-
PlaceNameLayer
public PlaceNameLayer(PlaceNameServiceSet placeNameServiceSet)
- Parameters:
placeNameServiceSet
- the set of PlaceNameService objects that PlaceNameLayer will render.- Throws:
java.lang.IllegalArgumentException
- ifPlaceNameServiceSet
is null
-
-
Method Detail
-
getPlaceNameServiceSet
public final PlaceNameServiceSet getPlaceNameServiceSet()
-
getRequestQ
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable> getRequestQ()
-
buildTiles
protected PlaceNameLayer.Tile[] buildTiles(PlaceNameService placeNameService, PlaceNameLayer.NavigationTile navTile)
-
doRender
protected void doRender(DrawContext dc)
- Specified by:
doRender
in classAbstractLayer
-
computeReferencePoint
protected Vec4 computeReferencePoint(DrawContext dc)
-
getReferencePoint
protected Vec4 getReferencePoint()
-
drawOrRequestTile
protected void drawOrRequestTile(DrawContext dc, PlaceNameLayer.Tile tile, double minDisplayDistanceSquared, double maxDisplayDistanceSquared)
-
isServiceVisible
protected static boolean isServiceVisible(DrawContext dc, PlaceNameService placeNameService)
-
isSectorVisible
protected static boolean isSectorVisible(DrawContext dc, Sector sector, double minDistanceSquared, double maxDistanceSquared)
-
isTileVisible
protected static boolean isTileVisible(DrawContext dc, PlaceNameLayer.Tile tile, double minDistanceSquared, double maxDistanceSquared)
-
isNameVisible
protected static boolean isNameVisible(DrawContext dc, PlaceNameService service, Position namePosition)
-
requestTile
protected void requestTile(DrawContext dc, PlaceNameLayer.Tile tile)
-
sendRequests
protected void sendRequests()
-
loadTile
protected boolean loadTile(PlaceNameLayer.Tile tile, java.net.URL url)
-
readTileData
protected static PlaceNameLayer.PlaceNameChunk readTileData(PlaceNameLayer.Tile tile, java.net.URL url)
-
newCharBuffer
protected static java.nio.CharBuffer newCharBuffer(int numElements)
-
downloadTile
protected void downloadTile(PlaceNameLayer.Tile tile)
-
downloadTile
protected void downloadTile(PlaceNameLayer.Tile tile, PlaceNameLayer.DownloadPostProcessor postProcessor)
-
saveBuffer
protected void saveBuffer(java.nio.ByteBuffer buffer, java.io.File outFile) throws java.io.IOException
- Throws:
java.io.IOException
-
makeLocal
public BulkRetrievalThread makeLocal(Sector sector, double resolution, BulkRetrievalListener listener)
Start a newBulkRetrievalThread
that downloads all placenames for a given sector and resolution to the current WorldWind file cache.This method creates and starts a thread to perform the download. A reference to the thread is returned. To create a downloader that has not been started, construct a
PlaceNameLayerBulkDownloader
.Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.
- Specified by:
makeLocal
in interfaceBulkRetrievable
- Parameters:
sector
- the sector to download data for.resolution
- the target resolution, provided in radians of latitude per texel.listener
- an optional retrieval listener. May be null.- Returns:
- the
PlaceNameLayerBulkDownloader
that executes the retrieval. - Throws:
java.lang.IllegalArgumentException
- if the sector is null or the resolution is less than zero.- See Also:
PlaceNameLayerBulkDownloader
-
makeLocal
public BulkRetrievalThread makeLocal(Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)
Start a newBulkRetrievalThread
that downloads all placenames for a given sector and resolution to a specified file store.This method creates and starts a thread to perform the download. A reference to the thread is returned. To create a downloader that has not been started, construct a
PlaceNameLayerBulkDownloader
.Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.
- Specified by:
makeLocal
in interfaceBulkRetrievable
- Parameters:
sector
- the sector to download data for.resolution
- the target resolution, provided in radians of latitude per texel.fileStore
- the file store in which to place the downloaded elevations. If null the current WorldWind file cache is used.listener
- an optional retrieval listener. May be null.- Returns:
- the
PlaceNameLayerBulkDownloader
that executes the retrieval. - Throws:
java.lang.IllegalArgumentException
- if the sector is null or the resolution is less than zero.- See Also:
PlaceNameLayerBulkDownloader
-
getEstimatedMissingDataSize
public long getEstimatedMissingDataSize(Sector sector, double resolution)
Get the estimated size in bytes of the placenames not in the WorldWind file cache for the given sector and resolution.Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.
- Specified by:
getEstimatedMissingDataSize
in interfaceBulkRetrievable
- Parameters:
sector
- the sector to estimate.resolution
- the target resolution, provided in radians of latitude per texel.- Returns:
- the estimated size in bytes of the missing placenames.
- Throws:
java.lang.IllegalArgumentException
- if the sector is null or the resolution is less than zero.
-
getEstimatedMissingDataSize
public long getEstimatedMissingDataSize(Sector sector, double resolution, FileStore fileStore)
Get the estimated size in bytes of the placenames not in a specified file store for the given sector and resolution.Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.
- Specified by:
getEstimatedMissingDataSize
in interfaceBulkRetrievable
- Parameters:
sector
- the sector to estimate.resolution
- the target resolution, provided in radians of latitude per texel.fileStore
- the file store to examine. If null the current WorldWind file cache is used.- Returns:
- the estimated size in byte of the missing placenames.
- Throws:
java.lang.IllegalArgumentException
- if the sector is null or the resolution is less than zero.
-
-