当前位置: 首页>>代码示例>>Java>>正文


Java WorldWind类代码示例

本文整理汇总了Java中gov.nasa.worldwind.WorldWind的典型用法代码示例。如果您正苦于以下问题:Java WorldWind类的具体用法?Java WorldWind怎么用?Java WorldWind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WorldWind类属于gov.nasa.worldwind包,在下文中一共展示了WorldWind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPath

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private Path createPath(final Color color) {
	final ShapeAttributes attrs = new BasicShapeAttributes();
	attrs.setEnableLighting(true);
	attrs.setOutlineMaterial(new Material(color));
	attrs.setInteriorMaterial(new Material(new Color(color.getRed(), color.getGreen(), color.getBlue(), 50), 50));
	attrs.setInteriorOpacity(0.3);
	attrs.setOutlineWidth(_mapLineThickness);
	attrs.setOutlineOpacity(0.7);
	final Path path = new Path();
	path.setExtrude(true);
	path.setAttributes(attrs);
	path.setVisible(true);
	path.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND);
	path.setPathType(AVKey.GREAT_CIRCLE);
	path.setFollowTerrain(true);
	return path;
}
 
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:18,代码来源:WWJPanel.java

示例2: doZoom

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public void doZoom(Point2D p, double factor) {
	LatLon dest = new LatLon(Angle.fromDegrees(p.getY()), Angle.fromDegrees(p.getX()));
	double wwzoom = 2785 * Math.pow(factor, -.8311) * 10000;

	final OrbitView view = (OrbitView) wwd.getView();

	FlyToOrbitViewAnimator fto = 
		FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(
			view,
			view.getCenterPosition(), new Position(dest, 0),
			view.getHeading(), Angle.fromDegrees(0),
			view.getPitch(), Angle.fromDegrees(0),
			view.getZoom(), wwzoom,
			5000, WorldWind.CONSTANT); //was true

	view.addAnimator(fto);

	SwingUtilities.invokeLater(new Runnable() {
		public void run() {
			((MapApp)getApp()).getFrame().toFront();
			view.firePropertyChange(AVKey.VIEW,  null, view);
		}
	});
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:25,代码来源:WWMap.java

示例3: GridTileLayer

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public GridTileLayer(GridRetriever retriever, ImageResampler ImageResampler) {
	super(makeLevels(retriever.getNumLevels()), new GridTiler(retriever, ImageResampler));
	tiler = (GridTiler) getTiler();
	tiler.renderTools.addChangeListener(this);
	
	if (!WorldWind.getMemoryCacheSet().containsCache(TextureTile.class.getName()))
	{
		long size = Configuration.getLongValue(AVKey.TEXTURE_IMAGE_CACHE_SIZE, 3000000L);
		MemoryCache cache = new BasicMemoryCache((long) (0.85 * size), size);
		cache.setName("Texture Tiles");
		WorldWind.getMemoryCacheSet().addCache(TextureTile.class.getName(), cache);
	}
	
	this.setUseTransparentTextures(true);
	this.setDrawTileBoundaries(true);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:17,代码来源:GridTileLayer.java

示例4: retrieveLocalImage

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected void retrieveLocalImage(TextureTile tile, String mimeType, int timeout) throws Exception
{
    if (!WorldWind.getLocalRetrievalService().isAvailable())
        return;

    RetrieverFactory retrieverFactory = (RetrieverFactory) this.getValue(AVKey.RETRIEVER_FACTORY_LOCAL);
    if (retrieverFactory == null)
        return;

    AVListImpl avList = new AVListImpl();
    avList.setValue(AVKey.SECTOR, tile.getSector());
    avList.setValue(AVKey.WIDTH, tile.getWidth());
    avList.setValue(AVKey.HEIGHT, tile.getHeight());
    avList.setValue(AVKey.FILE_NAME, tile.getPath());
    avList.setValue(AVKey.IMAGE_FORMAT, mimeType);

    Retriever retriever = retrieverFactory.createRetriever(avList, new CompositionRetrievalPostProcessor(tile));

    Logging.logger().log(java.util.logging.Level.FINE, "Locally retrieving " + tile.getPath());
    retriever.setReadTimeout(timeout);
    retriever.call();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:23,代码来源:ScalingTiledImageLayer.java

示例5: retrieveLocalTexture

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected void retrieveLocalTexture(TextureTile tile, DownloadPostProcessor postProcessor)
{
    if (!WorldWind.getLocalRetrievalService().isAvailable())
        return;

    RetrieverFactory retrieverFactory = (RetrieverFactory) this.getValue(AVKey.RETRIEVER_FACTORY_LOCAL);
    if (retrieverFactory == null)
        return;

    AVListImpl avList = new AVListImpl();
    avList.setValue(AVKey.SECTOR, tile.getSector());
    avList.setValue(AVKey.WIDTH, tile.getWidth());
    avList.setValue(AVKey.HEIGHT, tile.getHeight());
    avList.setValue(AVKey.FILE_NAME, tile.getPath());

    Retriever retriever = retrieverFactory.createRetriever(avList, postProcessor);

    WorldWind.getLocalRetrievalService().runRetriever(retriever, tile.getPriority());
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:20,代码来源:BasicScalingTiledImageLayer.java

示例6: createComponent

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected static Object createComponent(WMSCapabilities caps, AVList params)
{
    AVList configParams = params.copy(); // Copy to insulate changes from the caller.

    // Some wms servers are slow, so increase the timeouts and limits used by world wind's retrievers.
    configParams.setValue(AVKey.URL_CONNECT_TIMEOUT, 30000);
    configParams.setValue(AVKey.URL_READ_TIMEOUT, 30000);
    configParams.setValue(AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT, 60000);

    try
    {
        String factoryKey = getFactoryKeyForCapabilities(caps);
        Factory factory = (Factory) WorldWind.createConfigurationComponent(factoryKey);
        return factory.createFromConfigSource(caps, params);
    }
    catch (Exception e)
    {
        // Ignore the exception, and just return null.
    }

    return null;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:23,代码来源:WMSLayersPanel.java

示例7: main

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public static void main(String[] args)
{
    //List<File> cacheLocations = WorldWind.getDataFileStore().getCacheLocations();

    // Analyse and cleanup (if needed) the write cache location
    File writeCache = WorldWind.getDataFileStore().getWriteLocation();

    // Analyse location
    System.out.println("Analyzing: " + writeCache.getAbsolutePath());
    CacheLocationData cld = analyseCacheLocation(writeCache);
    System.out.println("Size: " + (int)(cld.sizeInBytes / Math.pow(2, 20)) + "Mb in " + cld.fileCount + " file(s) from " + cld.directories.size() + " dir(s)");
    //for (CacheDirectory dir : cld.directories)
    //    System.out.println(new Date(dir.file.lastModified()) + " " + dir.sizeInBytes / 1024 + "Kb " + dir.file.getAbsolutePath());

    // Any cleanup needed?
    if (cld.sizeInBytes >= HIGH_WATER_IN_BYTES)
    {
        System.out.println("Cleaning down to " + (int)(LOW_WATER_IN_BYTES / Math.pow(2, 20)) + "Mb");
        cleanupCacheLocation(cld, LOW_WATER_IN_BYTES);
        System.out.println("Size: " + (int)(cld.sizeInBytes / Math.pow(2, 20)) + "Mb in " + cld.fileCount + " file(s)");
    }
    else
        System.out.println("No cleanup needed until " + (int)(HIGH_WATER_IN_BYTES / Math.pow(2, 20)) + "Mb");
}
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:25,代码来源:CacheCleaner.java

示例8: createComponent

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private Object createComponent(WMSCapabilities caps, AVList params) {
    AVList configParams = params.copy(); // Copy to insulate changes from the caller.

    // Some wms servers are slow, so increase the timeouts and limits used by world wind's retrievers.
    configParams.setValue(AVKey.URL_CONNECT_TIMEOUT, 30000);
    configParams.setValue(AVKey.URL_READ_TIMEOUT, 30000);
    configParams.setValue(AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT, 60000);

    try {
        String factoryKey = getFactoryKeyForCapabilities(caps);
        Factory factory = (Factory) WorldWind.createConfigurationComponent(factoryKey);
        return factory.createFromConfigSource(caps, configParams);
    } catch (Exception e) {
        // Ignore the exception, and just return null.
    }

    return null;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:WmsHandler.java

示例9: addPoint

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private void addPoint( SimpleFeature pointFeature ) {
    Geometry geometry = (Geometry) pointFeature.getDefaultGeometry();
    if (geometry == null) {
        return;
    }
    int numGeometries = geometry.getNumGeometries();
    for( int i = 0; i < numGeometries; i++ ) {
        Geometry geometryN = geometry.getGeometryN(i);
        if (geometryN instanceof Point) {
            Point point = (Point) geometryN;
            FeaturePoint marker = new FeaturePoint(Position.fromDegrees(point.getY(), point.getX(), 0), featureStoreInfo);
            marker.setFeature(pointFeature);
            marker.setAltitudeMode(WorldWind.CLAMP_TO_GROUND);
            marker.setAttributes(basicMarkerAttributes);
            addRenderable(marker);
        }
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:FeatureCollectionPointsLayer.java

示例10: initWorldWindLayerModel

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private void initWorldWindLayerModel()
{
    Model model = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
    model.setShowWireframeExterior(false);
    model.setShowWireframeInterior(false);
    model.setShowTessellationBoundingVolumes(false);

    if (is3DGlobe) {
        model.setGlobe(new Earth());
    } else {
        model.setGlobe(new EarthFlat());
    }

    world = new WorldWindowGLCanvas();
    world.setModel(model);
}
 
开发者ID:vobject,项目名称:maru,代码行数:17,代码来源:WorldWindMap.java

示例11: makeVerts

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected void makeVerts(DrawContext dc, RectTile tile)
{
    // First see if the vertices have been previously computed and are in the cache. Since the elevation model
    // contents can change between frames, regenerate and re-cache vertices every second.
    // TODO: Go back to event-generated geometry re-computation.
    MemoryCache cache = WorldWind.getMemoryCache(CACHE_ID);
    CacheKey cacheKey = this.createCacheKey(dc, tile);
    tile.ri = (RenderInfo) cache.getObject(cacheKey);
    if (tile.ri != null && tile.ri.time >= System.currentTimeMillis() - this.getUpdateFrequency())
        return;

    if (this.buildVerts(dc, tile, this.makeTileSkirts))
        cache.add(cacheKey, tile.ri, tile.ri.getSizeInBytes());
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:MYEBSRectangularTessellator.java

示例12: dispose

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public void dispose() {
	rwl.writeLock().lock();
	isDisposed = true;
	
	frame.dispose();
	renderTools.setGrid(null);
	if (centerGrid != null)
		centerGrid.dispose();
	centerGrid = null;
	
	for (Grid2DOverlay grid : grids.values()) {
		grid.dispose();
	}
	
	grids.clear();
	
	for (TileKey tileKey : inMemory) {
		TextureTile tile = (TextureTile) 
			WorldWind.getMemoryCache(TextureTile.class.getName())
				.getObject(tileKey);
		
		if (tile != null) {
			WorldWind.getMemoryCache(TextureTile.class.getName())
				.remove(tileKey);
		}
	}
	
	invalid.addAll(valid);
	
	inMemory.clear();
	valid.clear();
	
	rwl.writeLock().unlock();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:35,代码来源:GridTileLayer.java

示例13: sendRequests

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private void sendRequests()
{
	Runnable task = this.requestQ.poll();
	while (task != null)
	{
		if (!WorldWind.getTaskService().isFull())
		{
			WorldWind.getTaskService().addTask(task);
		}
		task = this.requestQ.poll();
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:13,代码来源:ScalingTiledImageLayer.java

示例14: sendRequests

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected void sendRequests()
{
    Runnable task = this.requestQ.poll();
    while (task != null)
    {
        if (!WorldWind.getTaskService().isFull())
        {
            WorldWind.getTaskService().addTask(task);
        }
        task = this.requestQ.poll();
    }
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:13,代码来源:DynamicImageTileLayer.java

示例15: submitMissingTilesRequests

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected synchronized void submitMissingTilesRequests() throws InterruptedException
{
    RetrievalService rs = WorldWind.getRetrievalService();
    int i = 0;
    while (this.missingTiles.size() > i && rs.isAvailable())
    {
        Thread.sleep(1); // generates InterruptedException if thread has been interrupted

        TextureTile tile = this.missingTiles.get(i);

        if (this.layer.getLevels().isResourceAbsent(tile))
        {
            removeAbsentTile(tile);  // tile is absent, count it off.
            continue;
        }

        URL url = this.fileStore.findFile(tile.getPath(), false);
        if (url != null)
        {
            // tile has been retrieved and is local now, count it as retrieved.
            removeRetrievedTile(tile);
            continue;
        }

        this.layer.retrieveRemoteTexture(tile, createBulkDownloadPostProcessor(tile));
        i++;
    }
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:29,代码来源:BasicScalingTiledImageLayerBulkDownloader.java


注:本文中的gov.nasa.worldwind.WorldWind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。