Producer.offerDataSource(imageSource, null) Configure the TiledImageProducer with the parameter list and the image source. TiledImageProducer producer = new TiledImageProducer() Create a TiledImageProducer to install the imagery. tValue(AVKey.DATA_CACHE_NAME, cacheName) tValue(AVKey.FILE_STORE_LOCATION, fileStoreLocation.getAbsolutePath()) Create a parameter list specifying the install location information. String cacheName = BASE_CACHE_PATH + WWIO.replaceIllegalFileNameCharacters(displayName) Create a unique cache name that specifies the installed data's location within the FileStore. ![]() location is the FileStore's area for permanent storage.įile fileStoreLocation = DataInstallUtil.getDefaultInstallLocation(fileStore) Use the FileStore's install location as the destination for the installed imagery. Protected Layer installSurfaceImage(String displayName, Object imageSource, FileStore fileStore) Sector sector = (Sector) params.getValue(AVKey.SECTOR) Get the location from the layer's constructionĪVList params = (AVList) layer.getValue(AVKey.CONSTRUCTION_PARAMETERS) Set the view to look at the installed image. Add the layer created by the install method to the layer list. SwingUtilities.invokeLater(new Runnable() Install the imagery into the FileStore.įinal Layer layer = installSurfaceImage("Crater Lake Imagery 30m", sourceFile, fileStore) Get a reference to the FileStore into which we'll install the imagery.įileStore fileStore = WorldWind.getDataFileStore() Install the imagery on a thread other than the event-dispatch thread to avoid freezing the UI.įile sourceFile = ExampleUtil.saveResourceToTempFile(IMAGE_PATH, ".tif") Show the WAIT cursor because the installation may take a while. Logging.logger().log(.SEVERE, e.getMessage(), e) SwingUtilities.invokeLater(new void void exception(Exception e) Add the layer to the World Window's layer list on the Event Dispatch Thread. tName(WWIO.getFilename(layer.getName())) Define the completion callback.įactory.createFromShapefileSource("testData/shapefiles/TM_WORLD_BORDERS-0.3.shp",įinal Layer layer = (Layer) result // the result is the layer the factory created tAttributes(randomAttrs.nextAttributes().asShapeAttributes()) ShapefileRenderable.Record renderableRecord) Specify an attribute delegate to assign random attributes to each shape file record.įinal RandomShapeAttributes randomAttrs = new RandomShapeAttributes() įtAttributeDelegate(new void assignAttributes(ShapefileRecord shapefileRecord, ![]() ShapefileLayerFactory factory = new ShapefileLayerFactory() Private static final long serialVersionUID = -7733929990972508866L Public static class AppFrame extends ApplicationTemplate.AppFrame Protected static final String IMAGE_PATH = "gov/nasa/worldwindx/examples/data/craterlake-imagery-30m.tif" This example's imagery is loaded from the following class-path resource. Protected static final String BASE_CACHE_PATH = "Examples/" // Define a subdirectory in the installed-data area Public class ShapeRaster extends ApplicationTemplate * parse a Shapefile's contents and convert the shapefile into an equivalent World Wind shape. * Illustrates how to import ESRI Shapefiles into World Wind. * National Aeronautics and Space Administration. * Copyright (C) 2012 United States Government as represented by the Administrator of the ![]() The problem is when i change the order of layers with layermanager panel, only the order of objects that have the same type of layer changes and shapes are always displayed on top of images no matter which order they have. One of them is RenderableLayer which contain shapes and the other is BasicTiledImageLayer containing raster images. I have two layers added to the layerlist of WorldWindowGLJPanel.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |