Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IGeoResource


     * </pre>
     *     
     */
    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


        setSize(new Point(500, 450));
    }

    public void createPageContent( Composite parent ) {
        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

        assertEquals(Resolution.IN_PROGRESS, list.get(0).getResolution());
       
        list.clear();
       
        SimpleFeature[] features = UDIGTestUtil.createDefaultTestFeatures("test", 4); //$NON-NLS-1$
        IGeoResource resource = MapTests.createGeoResource(features, false);
        final Map map = MapTests.createNonDynamicMapAndRenderer(resource, new Dimension(512,512));
        class FixIssue extends TestIssue{
            public IViewPart view;
            public IEditorPart editor;
            FixIssue(){
View Full Code Here

                    Layer layer = null;
   
                    if (o instanceof IGeoResource) {
                        // ensure that the service is part of the Catalog so that the find method in
                        // layer turn into layer
                        IGeoResource resource = (IGeoResource) o;
                        layer = layerFactory.createLayer(resource);
                    }
                    if (o instanceof Layer) {
                        // leave as is
                        layer = (Layer) o;
View Full Code Here

     */
    private void getSelectedResources( Collection<URL> resourceIDs, TreeItem treeItem ) {
        if (treeItem.getData() instanceof WMTWizardTreeItemData) {
            WMTWizardTreeItemData itemData = (WMTWizardTreeItemData) treeItem.getData();

            IGeoResource geoResource = itemData.getGeoResource();

            if (geoResource != null) {
                WMTPlugin.debug("[Wizard.getSelectedResources] adding " + //$NON-NLS-1$
                        geoResource.getIdentifier(), Trace.WIZARD);

                resourceIDs.add(geoResource.getIdentifier());
            }
        }

        for( int i = 0; i < treeItem.getItemCount(); i++ ) {
            TreeItem childItem = treeItem.getItem(i);
View Full Code Here

    private WMTSource getWMTSourceOfSelectedLayer() {
        ILayer layer = getSelectedLayer();
       
        if (layer == null) return null;
       
        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

    @Override
    protected Control createContents(Composite parent) {
        layer = (Layer) getElement();
       
        //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

   public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
      if (receiver == null || !(receiver instanceof ILayer))
         return false;
     
      ILayer layer = (Layer) receiver;     
      IGeoResource resource = layer.findGeoResource(WMTSource.class);
     
      return (resource != null);
   }
View Full Code Here

            object = object.getMap().getEditManager().getEditLayer();
        }
       
        try{
            if( ids.add( object.getID().toString() ) ){
                IGeoResource resource = object.findGeoResource(FeatureStore.class);
                if( resource!=null )
                    CatalogPlugin.getDefault().getLocalCatalog().addCatalogListener(new ObjectPropertyCatalogListener(object, resource, isEvaluating, this));
            }
        SimpleFeatureType schema = object.getSchema();
        if (schema == null || schema.getGeometryDescriptor() == null)
View Full Code Here

          ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();

            LayerFactory layerFactory = map.getLayerFactory();
            URL resourceID = new URL(null, "mapgraphic://localhost/mapgraphic#org.locationtech.udig.tutorial.mapgraphic.Whitebox", CorePlugin.RELAXED_HANDLER); //$NON-NLS-1$
            ID id = new ID(resourceID);
            IGeoResource resource = localCatalog.getById(IGeoResource.class, id, new NullProgressMonitor());
            Layer whiteboxLayer = layerFactory.createLayer(resource);
           
            whiteboxLayer.getStyleBlackboard().put(LocationStyleContent.ID, location);
            return whiteboxLayer;
      }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.IGeoResource

Copyright © 2018 www.massapicom. 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.