Package org.locationtech.udig.catalog

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


     */
    public void example( SimpleFeatureType featureType, IProgressMonitor progressMonitor,
            FeatureCollection collection, int addPosition, IMap map ) throws IOException {
        IGeoResource resource = CatalogPlugin.getDefault().getLocalCatalog()
                .createTemporaryResource(featureType);
        resource.resolve(FeatureStore.class, progressMonitor).addFeatures(collection);

        ApplicationGIS.addLayersToMap(map, Collections.singletonList(resource), addPosition);

    }
}
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

       
        IGeoResource resource = layer.findGeoResource(WMTSource.class);
        if (resource == null) return null;
       
        try {
            WMTSource wmtSource = resource.resolve(WMTSource.class, null);
           
            return wmtSource;
        } catch (IOException e) {
            return null;
        }
View Full Code Here

        //region Get GeoResource/Source/WMTSource for this layer
        IGeoResource resource = layer.findGeoResource(WMTSource.class);
        if (resource == null) return createErrorMessage(parent);
       
        try {
            wmtSource = resource.resolve(WMTSource.class, null);
        } catch(IOException exc) {
            wmtSource = null;
           
            return createErrorMessage(parent);
        }
View Full Code Here

      if (style == null) return;
       
      if (layer.hasResource(FeatureSource.class)) {
        IGeoResource resource = layer.findGeoResource(FeatureSource.class);
        SimpleFeatureSource featureSource
          = resource.resolve(SimpleFeatureSource.class, m);
       
        if (featureSource != null) {
          //match up the feature type style name and the feature type name
          SimpleFeatureType type = featureSource.getSchema();
          FeatureTypeStyle fstyle = SLDs.featureTypeStyle(style,type);
View Full Code Here

            final IGeoResource resource = getContext().getGeoResource();
            if (resource == null || !resource.canResolve(JGrassMapGeoResource.class)) {
                return;
            }
            JGrassMapGeoResource grassMapGeoResource = resource.resolve(JGrassMapGeoResource.class, monitor);

            JGrassRegion fileWindow = new JGrassRegion(grassMapGeoResource.getFileWindow());
            JGrassMapsetGeoResource parent = (JGrassMapsetGeoResource) grassMapGeoResource.parent(new NullProgressMonitor());
            CoordinateReferenceSystem grassCrs = parent.getLocationCrs();
            JGrassRegion screenDrawWindow = new JGrassRegion(envelope.getMinX(), envelope.getMaxX(), envelope.getMinY(),
View Full Code Here

        resource.getPersistentProperties().put(PreferenceConstants.P_TILESET_SCALES,
                "1000000.0 100000.0 50000.0 20000.0 10000.0 5000.0 2500.0 1000.0");
       
        assertNotNull(resource);

        TileSet ts = resource.resolve(TileSet.class, null);
        assertNotNull(ts);
    }
}
View Full Code Here

                    IGeoResource resource = (IGeoResource) getElement().getAdapter(
                            IGeoResource.class);
                    SimpleFeatureType schema = null;
                    if (resource.canResolve(SimpleFeatureType.class)) {
                        try {
                            schema = resource.resolve(SimpleFeatureType.class, monitor);
                        } catch (IOException e) {
                        }
                    }
                    if (resource.canResolve(SimpleFeatureSource.class)) {
                        SimpleFeatureSource featureSource;
View Full Code Here

                        }
                    }
                    if (resource.canResolve(SimpleFeatureSource.class)) {
                        SimpleFeatureSource featureSource;
                        try {
                            featureSource = resource.resolve(SimpleFeatureSource.class, monitor);
                            schema = featureSource != null ? featureSource.getSchema() : null;
                        } catch (IOException e) {
                        }
                    }
                    setSchema(schema);
View Full Code Here

            MathTransform dataToWorld = CRS.findMathTransform(dataCRS, worldCRS, false);

            ReferencedEnvelope bounds = getRenderBounds();
            monitor.subTask("connecting");
           
            CSV csv = resource.resolve(CSV.class, new SubProgressMonitor(monitor, 10) );
            reader = csv.reader();
           
            int nameIndex = csv.getHeader("name");

            IProgressMonitor drawMonitor = new SubProgressMonitor(monitor, 90);
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.