Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IGeoResource


        return true;
    }

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

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


            Point upperLeft = currentContext.worldToPixel(new Coordinate(envelope.getMinX(), envelope.getMinY()));
            Point bottomRight = currentContext.worldToPixel(new Coordinate(envelope.getMaxX(), envelope.getMaxY()));
            Rectangle screenSize = new Rectangle(upperLeft);
            screenSize.add(bottomRight);

            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

    public RasterRenderMetricsFactory() {
    }

    public boolean canRender( IRenderContext context ) throws IOException {
        // check if it is a Property resource
        IGeoResource resource = context.getGeoResource();
        boolean isRightResource = resource.canResolve(JGrassMapGeoResource.class);
        boolean isRightType = false;

        if (resource.getInfo(null).getDescription() == null) {
            isRightType = false;
        } else {

            String descString = resource.getInfo(null).getDescription();

            if (descString.equals(JGrassConstants.GRASSBINARYRASTERMAP)
                    || descString.equals(JGrassConstants.GRASSASCIIRASTERMAP)
                    || descString.equals(JGrassConstants.ESRIRASTERMAP)
                    || descString.equals(JGrassConstants.FTRASTERMAP)) {
View Full Code Here

        ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
        catalog.add(service); // we can now find this service!

        ID id = new ID(new ID(url), "tasmania");

        IGeoResource resource = (IGeoResource) catalog.getById(IGeoResource.class, id, null);

        /*
         * setup the properties so this adapter is enabled
         */
        resource.getPersistentProperties().put(PreferenceConstants.P_TILESET_ON_OFF, true);
        resource.getPersistentProperties().put(PreferenceConstants.P_TILESET_WIDTH, PreferenceConstants.DEFAULT_TILE_SIZE+"");
        resource.getPersistentProperties().put(PreferenceConstants.P_TILESET_HEIGHT,PreferenceConstants.DEFAULT_TILE_SIZE+"");
        resource.getPersistentProperties().put(PreferenceConstants.P_TILESET_IMAGE_TYPE,PreferenceConstants.DEFAULT_IMAGE_TYPE);
        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

        IRepository local = CatalogPlugin.getDefault().getLocal();
        local.acquire(MapGraphicService.SERVICE_URL, null);
       
        // Test ScaleBar
        final ID SCALE_BAR = new ID("mapgraphic:/localhost/mapgraphic#scalebar", null); //$NON-NLS-1$
        IGeoResource scalebarResource = local.getById(IGeoResource.class, SCALE_BAR,
                new NullProgressMonitor());
        assertNotNull(scalebarResource);
       
        // Test Graticule
        final ID GRATICULE = new ID("mapgraphic:/localhost/mapgraphic#graticule", null); //$NON-NLS-1$
        IGeoResource graticuleResource = local.getById(IGeoResource.class, GRATICULE,
                new NullProgressMonitor());
        assertNotNull(graticuleResource);
       
    }
View Full Code Here

         */
        public void openInJob(final Runnable okayRunnable) {
            Job job = new Job("Prompt Hotlink Descriptor") { //$NON-NLS-1$
                @Override
                protected IStatus run(IProgressMonitor monitor) {
                    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;
                        try {
                            featureSource = resource.resolve(SimpleFeatureSource.class, monitor);
                            schema = featureSource != null ? featureSource.getSchema() : null;
                        } catch (IOException e) {
                        }
                    }
                    setSchema(schema);
View Full Code Here

        exportButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
        exportButton.setImage(exportImg);
        exportButton.setToolTipText(Messages.PolygonPropertiesEditor_23);
        exportButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                IGeoResource geoResource = layer.getGeoResource();
                ID id = geoResource.getID();
                if (id.isFile()) {
                    try {
                        File file = id.toFile();
                        polygonStyleManager.exportStyle(styleWrapper, file);
                    } catch (Exception e1) {
View Full Code Here

        exportButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
        exportButton.setImage(exportImg);
        exportButton.setToolTipText(Messages.PointPropertiesEditor_24);
        exportButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                IGeoResource geoResource = layer.getGeoResource();
                ID id = geoResource.getID();
                if (id.isFile()) {
                    try {
                        File file = id.toFile();
                        pointStyleManager.exportStyle(styleWrapper, file);
                    } catch (Exception e1) {
View Full Code Here

     *
     * @return grid map graphic, returns null if service is not up or service does not hold the resource
     */
    public static IGeoResource getGridMapGraphic() {
        final IRepository local = CatalogPlugin.getDefault().getLocal();
        final IGeoResource gridResource = local.getById(IGeoResource.class, GRID_ID, new NullProgressMonitor());
        if (gridResource == null) {
            System.out.println("[LegendViewUtils] Grid resource not found. Either service is not up or it does not hold the resource."); //$NON-NLS-1$
        }
        return gridResource;
    }
View Full Code Here

        noFeatureLabel = new Label(mainComposite, SWT.NONE);
        noFeatureLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        noFeatureLabel.setText(Messages.SimpleLineEditorPage_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.createDefaultLineStyle();
            }
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.