Package org.locationtech.udig.catalog

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


                    // dumpMap(coverage2D, fileCrs, newCrs, mapPath, isAscii, isTiff);
                    // }
                    // }
                    //
                    // } 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


            }
           
//TODO codereview: This resolves http://jira.codehaus.org/browse/UDIG-1686
//            final FeatureStore<?,?> store  = object.getResource(FeatureStore.class, ProgressManager.instance().get());
//            return store != null;
            boolean canResolve = resource.canResolve(FeatureStore.class);
            return canResolve;
        } catch (Exception e) {
            return false;
        } finally {
            isEvaluating.set(false);
View Full Code Here

            final IGeoResource resource = object.findGeoResource(FeatureSource.class);
            if (resource != null && ids.add(resource.getIdentifier())) {
                CatalogPlugin.getDefault().getLocalCatalog().addCatalogListener(
                        new ObjectPropertyCatalogListener(object, resource, isEvaluating, this));
            }
            boolean canResolve = resource.canResolve(FeatureSource.class);
            return canResolve;
        } catch (Exception e) {
            return false;
        } finally {
            isEvaluating.set(false);
View Full Code Here

                /*
                 * finally do some processing
                 */
                pm.beginTask(Messages.getString("KmlExportWizard.taskExportingMap"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
                try {
                    if (geoResource.canResolve(SimpleFeatureSource.class)) {

                        SimpleFeatureSource featureStore = (SimpleFeatureSource) geoResource.resolve(SimpleFeatureSource.class,
                                pm);
                        KmlUtils.writeKml(new File(filePath), featureStore.getFeatures());
                    } else {
View Full Code Here

    /**
     * @see org.locationtech.udig.project.render.IRenderMetricsFactory#canRender(org.locationtech.udig.project.render.IRenderContext)
     */
    public boolean canRender( IRenderContext context ) {
        IGeoResource geoResource = context.getGeoResource();
        if (geoResource.canResolve(AbstractGridCoverage2DReader.class)) {
            return false; // give image moasic priority over shapefile
        }
        return context.getGeoResource().canResolve(FeatureSource.class);
    }

View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public boolean canRender(IRenderContext context) {
        try {
            IGeoResource geoResource = context.getGeoResource();
            if( geoResource.canResolve(ShapefileDataStore.class)){
                FeatureSource featureSource=geoResource.resolve(FeatureSource.class, null);
               
                boolean notAView = !(featureSource instanceof DefaultView);
                boolean isAShapefile = (featureSource.getDataStore() instanceof ShapefileDataStore);
                return notAView && featureSource!=null && isAShapefile;
View Full Code Here

                    if (!isAlreadyLoaded) {
                        List< ? extends ILayer> addedLayersToMap = ApplicationGIS.addLayersToMap(activeMap,
                                Collections.singletonList(resolve.resolve(IGeoResource.class, null)), layers.size());
                        for( ILayer l : addedLayersToMap ) {
                            IGeoResource geoResource = l.getGeoResource();
                            if (geoResource.canResolve(ProcessingRegionMapGraphic.class)) {
                                processingRegionLayer = l;
                            }
                        }
                    }
                    break;
View Full Code Here

   */
  private static boolean canResolveFeautreStore(final ILayer layer) {

    IGeoResource resource = layer.getGeoResource();

    boolean retValue = resource.canResolve(FeatureStore.class);

    return retValue;
  }

  /**
 
View Full Code Here

        if (info != null) {
            ImageDescriptor infoIcon = info.getImageDescriptor();
            if (infoIcon != null)
                return infoIcon;
        }
        if (resource.canResolve(GridCoverageReader.class)) {
            ImageDescriptor icon = Glyph.grid(null, null, null, null);
            if (icon != null)
                return icon;
        }
        if (resource.canResolve(FeatureSource.class)) {
View Full Code Here

        if (resource.canResolve(GridCoverageReader.class)) {
            ImageDescriptor icon = Glyph.grid(null, null, null, null);
            if (icon != null)
                return icon;
        }
        if (resource.canResolve(FeatureSource.class)) {
            ImageDescriptor icon = Glyph.geometry(rule);
            if (icon != null)
                return icon;
        }
        return null;
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.