Package org.locationtech.udig.catalog

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


     */
    public void setLayer( Layer layer ) {
        this.layer = layer;
        IGeoResource resource = layer.getGeoResource();
        try {
            gridCoverage = resource.resolve(GridCoverage2D.class, new NullProgressMonitor());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

View Full Code Here


   
    public void op(final Display display, Object target, final IProgressMonitor monitor)
            throws Exception {
        final IGeoResource handle = (IGeoResource) target;
        final SimpleFeatureSource featureSource = handle.resolve( SimpleFeatureSource.class, null);
        SimpleFeature feature;
        final FeatureCollection<SimpleFeatureType, SimpleFeature> collection = featureSource
                .getFeatures();
        FeatureIterator<SimpleFeature> iterator = collection.features();
        try {
View Full Code Here

           
            final SimpleFeatureType featureType = output.getSchema();
           
            IGeoResource scratch = CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource( featureType );
            final SimpleFeatureStore store = scratch.resolve(SimpleFeatureStore.class, SubMonitor.convert(monitor,Messages.ReshapeOperation_createTempSpaceTask, 10));
           
            store.setTransaction( transaction );
           
            ProgressListener progessListener = GeoToolsAdapters.progress( SubMonitor.convert(monitor,"processing "+source.getName(), 90));         //$NON-NLS-1$
View Full Code Here

        final WizardDialog wizardDialog = (WizardDialog) getContainer();
        IGeoResource resource = data.getResource();

        try {
            SimpleFeatureSource fs = resource.resolve(SimpleFeatureSource.class, null);
            SimpleFeatureCollection fc = fs.getFeatures(data.getQuery());

            // TODO: remove from catalog/close layers if open?
            SimpleFeatureType schema = fs.getSchema();
            if (data.getName() != null) {
View Full Code Here

                 */
                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 {
                        throw new IOException(Messages.getString("KmlExportWizard.error.ResourceIsNotAFeatureLayer") + geoResource.getTitle()); //$NON-NLS-1$
                    }
View Full Code Here

                    IGeoResource resource = CatalogPlugin.getDefault().getLocalCatalog()
                            .createTemporaryResource(collection.getSchema());

                    @SuppressWarnings("unchecked")
                    FeatureStore<SimpleFeatureType, SimpleFeature> store = resource.resolve(FeatureStore.class, pm);
                    store.addFeatures(collection);

                    ApplicationGIS.addLayersToMap(ApplicationGIS.getActiveMap(), Collections.singletonList(resource), -1);
                } catch (Exception e) {
                    e.printStackTrace();
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( numFeatures == 0)
            toCreate=1;
        SimpleFeature[] features = UDIGTestUtil.createDefaultTestFeatures(featureTypeName, toCreate);
        IGeoResource resource = CatalogTests.createGeoResource(features, deleteExistingService);
        if( numFeatures == 0)
            resource.resolve(FeatureStore.class, new NullProgressMonitor()).removeFeatures(Filter.INCLUDE);
        return createNonDynamicMapAndRenderer(resource, displaySize, null, createRenderManager);
    }

    /**
     * @deprecated Moved to CatalogTests
View Full Code Here

    @SuppressWarnings("unchecked")
    @Ignore
    @Test
    public void testGetBounds() throws Exception {
        IGeoResource resource = CatalogTests.createGeoResource("resource", 0, false); //$NON-NLS-1$
        FeatureStore<SimpleFeatureType, SimpleFeature> fs = resource.resolve(FeatureStore.class, null);
        DefaultFeatureCollection collection = new DefaultFeatureCollection();
        collection.clear();
        GeometryFactory fac=new GeometryFactory();

        Object[] atts = new Object[]{
View Full Code Here

        IGeoResource resource = layer.findGeoResource(WMTSource.class);
       
        if (resource != null) {
            WMTSource wmtSource = null;
            try {           
                wmtSource = resource.resolve(WMTSource.class, null);
               
                return wmtSource;
            } catch (Exception e) {}
        }
       
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.