Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IGeoResource.resolve()


                return;

            ReferencedEnvelope bounds = getRenderBounds();
            monitor.subTask("connecting");

            CSV csv = resource.resolve(CSV.class, new SubProgressMonitor(monitor, 10));
            reader = csv.reader();
           
            monitor.subTask("drawing");
            int nameIndex = csv.getHeader("name");
            Coordinate worldLocation = new Coordinate();
View Full Code Here


                if (layer instanceof IGeoResource) {
                    IGeoResource geoResource = (IGeoResource) layer;
                    try {
                        GridGeometry2D gridGeometry = null;
                        if (geoResource.canResolve(GridGeometry2D.class)) {
                            gridGeometry = geoResource.resolve(GridGeometry2D.class, new NullProgressMonitor());
                        } else if (geoResource.canResolve(GridCoverage.class)) {
                            GridCoverage2D gridCoverage = (GridCoverage2D) geoResource.resolve(GridCoverage.class,
                                    new NullProgressMonitor());
                            gridGeometry = gridCoverage.getGridGeometry();
                        }
View Full Code Here

                    try {
                        GridGeometry2D gridGeometry = null;
                        if (geoResource.canResolve(GridGeometry2D.class)) {
                            gridGeometry = geoResource.resolve(GridGeometry2D.class, new NullProgressMonitor());
                        } else if (geoResource.canResolve(GridCoverage.class)) {
                            GridCoverage2D gridCoverage = (GridCoverage2D) geoResource.resolve(GridCoverage.class,
                                    new NullProgressMonitor());
                            gridGeometry = gridCoverage.getGridGeometry();
                        }
                        if (gridGeometry != null)
                            setWidgetsToWindow(OmsBoxUtils.gridGeometry2ProcessingRegion(gridGeometry));
View Full Code Here

        // try to go for the reader first
        boolean isOnGrid = false;
        boolean hasProblem = false;
        Point2D p = null;
        if (geoResource.canResolve(AbstractGridCoverage2DReader.class)) {
            AbstractGridCoverage2DReader reader = geoResource.resolve(AbstractGridCoverage2DReader.class, monitor);
            GeneralEnvelope originalEnvelope = reader.getOriginalEnvelope();
            CoordinateReferenceSystem targetCrs = reader.getCrs();

            if (targetCrs != null) {
                evaluateCoord = transform(sourceCRS, targetCrs, envelopeCenterOrig);
View Full Code Here

                isOnGrid = true;
            }
        }
        // else try with coverage
        else if (geoResource.canResolve(GridCoverage.class)) {
            coverage = (GridCoverage2D) geoResource.resolve(GridCoverage.class, monitor);
            CoordinateReferenceSystem targetCrs = coverage.getCoordinateReferenceSystem();
            gridGeometry = coverage.getGridGeometry();
            evaluateCoord = transform(sourceCRS, targetCrs, envelopeCenterOrig);
            p = new Point2D.Double(evaluateCoord.x, evaluateCoord.y);
            Envelope2D envelope2d = coverage.getEnvelope2D();
View Full Code Here

        Layer layer = getSelectedLayer();
        IGeoResource resource = layer.getGeoResource();

        if (resource.canResolve(JGrassMapGeoResource.class)) {
            try {
                JGrassMapGeoResource grassMapGeoResource = resource.resolve(
                        JGrassMapGeoResource.class, null);
                if (grassMapGeoResource.getType().equals(JGrassConstants.GRASSBINARYRASTERMAP)) {
                    editorSupported = true;
                } else {
                    editorSupported = false;
View Full Code Here

                                pm.done();

                                IGeoResource resource = CatalogPlugin.getDefault().getLocalCatalog()
                                        .createTemporaryResource(type);

                                resource.resolve(FeatureStore.class, pm).addFeatures(newCollection);
                                ApplicationGIS.addLayersToMap(ApplicationGIS.getActiveMap(), Collections.singletonList(resource),
                                        -1);
                            } catch (Exception e) {
                                e.printStackTrace();
                                String message = "An error occurred while loading the places to map";
View Full Code Here

                    // }
                    // }
                    //
                    // } else
                    if (geoResource.canResolve(GridCoverage.class)) {
                        GridCoverage2D coverage2D = (GridCoverage2D) geoResource.resolve(GridCoverage.class, pm);
                        dumpMap(coverage2D, fileCrs, newCrs, newPath, isAscii, isTiff);
                    } else {
                        throw new IOException("The selected resource doesn't seem to be a coverage layer: " + geoResource.getTitle());
                    }
View Full Code Here

    Iterator<ILayer> iterator = mapLayers.iterator();
    while (iterator.hasNext()) {
      ILayer layer = iterator.next();
      IGeoResource geoResource = layer.findGeoResource(MapMarksGraphics.class);
      if (geoResource != null) {
        MapMarksGraphics mapGraphic = geoResource.resolve(MapMarksGraphics.class, null);
        this.mapMarkGraphic = mapGraphic;
        this.mapGraphicLayer = layer;
        break;
      }
    }
View Full Code Here

                    SimpleFeatureType featureType = csvFileFeatureCollection.getSchema();
                    JGrassCatalogUtilities.removeMemoryServiceByTypeName(featureType.getTypeName());
                    IGeoResource resource = CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(featureType);

                    SimpleFeatureStore resolve = (SimpleFeatureStore) resource.resolve(FeatureStore.class, pm);
                    resolve.addFeatures(csvFileFeatureCollection);
                    ApplicationGIS.addLayersToMap(ApplicationGIS.getActiveMap(), Collections.singletonList(resource), -1);

                } catch (Exception e) {
                    e.printStackTrace();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.