Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IGeoResource


            String prov = (String)selectedFarmFeature.getAttribute(0);
            String id = (String)selectedFarmFeature.getAttribute(1);
           
            //put layer info on the mapgraphic's style blackboard
            URL detailsResId = new URL(null, "mapgraphic://localhost/mapgraphic#org.locationtech.udig.tutorial.mapgraphic.TitleArea", CorePlugin.RELAXED_HANDLER);
            IGeoResource detailsRes = localCatalog.getById(IGeoResource.class, new ID(detailsResId), new NullProgressMonitor());
            
            Layer titleAreaLayer = layerFactory.createLayer(detailsRes);
            titleAreaLayer.getStyleBlackboard().put(LocationStyleContent.ID, location);
            XMLMemento selectedFeatureMemento = XMLMemento.createWriteRoot("style");
            selectedFeatureMemento.putString(FEATURE_ID_KEY, id);
View Full Code Here


                break;
            }
        }
        if( graphLayer == null ){           
            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
            IGeoResource resource = catalog.getById(IGeoResource.class, GRAPH_ID, new NullProgressMonitor() );
            if( resource == null ){
                return; // not available?
            }
            List<IGeoResource> resourceList = Collections.singletonList( resource );           
            List< ? extends ILayer> added = ApplicationGIS.addLayersToMap(map, resourceList, 0 );
            if( added.isEmpty() ){
                return; // not available?
            }
            graphLayer = (ILayer) added.get(0);           
        }
        if( !graphLayer.isVisible() ){
            map.sendCommandASync( new SetLayerVisibilityCommand(graphLayer, true) );
        }
       
        for( ILayer look : map.getMapLayers() ){
            URL id = look.getGeoResource().getIdentifier();
            if(PATH_ID.equals(id) ){
                pathLayer = look;
                break;
            }
        }
        if( pathLayer == null ){           
            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
            IGeoResource resource = catalog.getById(IGeoResource.class, PATH_ID, new NullProgressMonitor() );
            if( resource == null ){
                return; // not available?
            }
            List<IGeoResource> resourceList = Collections.singletonList( resource );           
            List< ? extends ILayer> added = ApplicationGIS.addLayersToMap(map, resourceList, 0 );
View Full Code Here

        for (Iterator<Object> iter = selection.iterator(); iter.hasNext();) {
            Object obj = iter.next();
            if (obj instanceof IService) {
                layers.addAll(getLayers((IService) obj));
            } else if (obj instanceof IGeoResource) {
                IGeoResource entry = (IGeoResource) obj;
                Layer ref = createLayer(entry);

                if (ref != null)
                    layers.add(ref);
            }
View Full Code Here

        Layer ref = null;
        List<Layer> layers = new LinkedList<Layer>();

        Iterator<? extends IGeoResource> rentryIter = service.resources(null).iterator();
        while (rentryIter.hasNext()) {
            IGeoResource entry = rentryIter.next();

            ref = createLayer(entry);

            if (ref != null)
                layers.add(ref);
View Full Code Here

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

    public void createPageContent( Composite parent ) {
        Layer layer = getSelectedLayer();
        IGeoResource resource = layer.getGeoResource();

        if (resource.canResolve(GridCoverage.class)) {
            editorSupported = true;
        } else {
            editorSupported = false;
        }
View Full Code Here

     
      if (layer == null) return;
      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

        noFeatureLabel = new Label(mainComposite, SWT.NONE);
        noFeatureLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        noFeatureLabel.setText(Messages.SimplePointEditorPage_0);

        StyleLayer layer = getSelectedLayer();
        IGeoResource resource = layer.getGeoResource();
        if (resource.canResolve(FeatureSource.class)) {
            StyleBlackboard styleBlackboard = layer.getStyleBlackboard();
            oldStyle = (Style) styleBlackboard.get(SLDContent.ID);
            if (oldStyle == null) {
                oldStyle = Utilities.createDefaultPointStyle();
            }
View Full Code Here

        return true;
    }

    public void refresh() {
        Layer layer = getSelectedLayer();
        IGeoResource resource = layer.getGeoResource();
        if (!resource.canResolve(FeatureSource.class)) {
            return;
        }

        StyleBlackboard styleBlackboard = layer.getStyleBlackboard();
        oldStyle = (Style) styleBlackboard.get(SLDContent.ID);
View Full Code Here

        noFeatureLabel = new Label(mainComposite, SWT.NONE);
        noFeatureLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        noFeatureLabel.setText(Messages.SimplePolygonEditorPage_0);

        StyleLayer layer = getSelectedLayer();
        IGeoResource resource = layer.getGeoResource();
        if (resource.canResolve(FeatureSource.class)) {
            StyleBlackboard styleBlackboard = layer.getStyleBlackboard();
            style = (Style) styleBlackboard.get(SLDContent.ID);
            if (style == null) {
                style = Utilities.createDefaultPolygonStyle();
            }
View Full Code Here

*/
public class SetStyleInterceptor implements LayerInterceptor {

    public void run( Layer layer ) {
        if( layer.getStyleBlackboard().getContent().isEmpty()){
            IGeoResource geoResource = layer.getGeoResource();
            if( geoResource == null ){
                throw new NullPointerException("Layer requires GeoResource to determine default style");
            }
            SetDefaultStyleProcessor defaultStyleProcessor = createDefaultStyles(geoResource, layer);
            defaultStyleProcessor.run();
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.