public class PlaceNameLayer extends AbstractLayer implements BulkRetrievable
Modifier and Type | Class and 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 |
Modifier and Type | Field and 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 and Description |
---|
PlaceNameLayer(PlaceNameServiceSet placeNameServiceSet) |
Modifier and Type | Method and 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,
BulkRetrievalListener listener)
Start a new
BulkRetrievalThread that downloads all placenames for a given sector and resolution to the
current WorldWind file cache. |
BulkRetrievalThread |
makeLocal(Sector sector,
double resolution,
FileStore fileStore,
BulkRetrievalListener listener)
Start a new
BulkRetrievalThread that downloads all placenames for a given sector and resolution to a
specified file store. |
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() |
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
onMessage, propertyChange
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
protected boolean cullNames
protected final java.lang.Object fileLock
public static final LatLon GRID_1152x2304
public static final LatLon GRID_144x288
public static final LatLon GRID_16x32
public static final LatLon GRID_1x1
public static final LatLon GRID_288x576
public static final LatLon GRID_36x72
public static final LatLon GRID_4x8
public static final LatLon GRID_576x1152
public static final LatLon GRID_72x144
public static final LatLon GRID_8x16
public static final double LEVEL_A
public static final double LEVEL_B
public static final double LEVEL_C
public static final double LEVEL_D
public static final double LEVEL_E
public static final double LEVEL_F
public static final double LEVEL_G
public static final double LEVEL_H
public static final double LEVEL_I
public static final double LEVEL_J
public static final double LEVEL_K
public static final double LEVEL_L
public static final double LEVEL_M
public static final double LEVEL_N
public static final double LEVEL_O
public static final double LEVEL_P
protected java.util.List<PlaceNameLayer.NavigationTile> navTiles
protected final PlaceNameServiceSet placeNameServiceSet
protected Vec4 referencePoint
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable> requestQ
public PlaceNameLayer(PlaceNameServiceSet placeNameServiceSet)
placeNameServiceSet
- the set of PlaceNameService objects that PlaceNameLayer will render.java.lang.IllegalArgumentException
- if PlaceNameServiceSet
is nullprotected PlaceNameLayer.Tile[] buildTiles(PlaceNameService placeNameService, PlaceNameLayer.NavigationTile navTile)
protected Vec4 computeReferencePoint(DrawContext dc)
protected void doRender(DrawContext dc)
doRender
in class AbstractLayer
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)
public long getEstimatedMissingDataSize(Sector sector, double resolution)
getEstimatedMissingDataSize
in interface BulkRetrievable
sector
- the sector to estimate.resolution
- the target resolution, provided in radians of latitude per texel.java.lang.IllegalArgumentException
- if the sector is null or the resolution is less than zero.public long getEstimatedMissingDataSize(Sector sector, double resolution, FileStore fileStore)
getEstimatedMissingDataSize
in interface BulkRetrievable
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.java.lang.IllegalArgumentException
- if the sector is null or the resolution is less than zero.public final 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)
public BulkRetrievalThread makeLocal(Sector sector, double resolution, BulkRetrievalListener listener)
BulkRetrievalThread
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.makeLocal
in interface BulkRetrievable
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.PlaceNameLayerBulkDownloader
that executes the retrieval.java.lang.IllegalArgumentException
- if the sector is null or the resolution is less than zero.PlaceNameLayerBulkDownloader
public BulkRetrievalThread makeLocal(Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)
BulkRetrievalThread
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.makeLocal
in interface BulkRetrievable
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.PlaceNameLayerBulkDownloader
that executes the retrieval.java.lang.IllegalArgumentException
- if the sector is null or the resolution is less than zero.PlaceNameLayerBulkDownloader
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) throws java.io.IOException
java.io.IOException
protected void sendRequests()