Package org.locationtech.udig.catalog.jgrass.core

Examples of org.locationtech.udig.catalog.jgrass.core.JGrassMapGeoResource.parent()


                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(),
                    envelope.getMaxY(), fileWindow.getRows(), fileWindow.getCols());

            // to intersect with the data window, we transform the screen window
View Full Code Here


            for( Object layer : layers ) {
                if (layer instanceof JGrassMapGeoResource) {
                    JGrassMapGeoResource rasterMapResource = (JGrassMapGeoResource) layer;
                    try {
                        mapName = rasterMapResource.getInfo(null).getTitle();
                        mapsetPath = ((JGrassMapsetGeoResource) rasterMapResource.parent(null)).getFile().getAbsolutePath();
                        if (mapName != null && mapsetPath != null) {
                            String colrPath = mapsetPath + File.separator + JGrassConstants.COLR + File.separator + mapName;
                            makeSomeColor(colrPath);
                        }
                    } catch (IOException e) {
View Full Code Here

            for( Object layer : layers ) {
                if (layer instanceof JGrassMapGeoResource) {
                    JGrassMapGeoResource rasterMapResource = (JGrassMapGeoResource) layer;
                    try {
                        mapName = rasterMapResource.getInfo(null).getTitle();
                        mapsetPath = ((JGrassMapsetGeoResource) rasterMapResource.parent(null)).getFile().getAbsolutePath();
                        if (mapName != null && mapsetPath != null) {
                            String catsPath = mapsetPath + File.separator + JGrassConstants.CATS + File.separator + mapName;
                            makeSomeCategories(catsPath);
                        }
                    } catch (IOException e) {
View Full Code Here

            return null;
        }

        JGrassMapsetGeoResource mapsetResource = null;
        try {
            mapsetResource = (JGrassMapsetGeoResource) mapResource.parent(null);
            mapsetPathAndMapName[0] = mapsetResource.getFile().getAbsolutePath();
            mapsetPathAndMapName[1] = mapResource.getTitle();
        } catch (IOException e) {
            JGrassPlugin
                    .log("JGrassPlugin problem: eu.hydrologis.udig.catalog.utils#JGrassCatalogUtilities#getMapsetpathAndMapnameFromJGrassMapGeoResource", e); //$NON-NLS-1$
View Full Code Here

                                    JGrassMapGeoResource.class, null)).getType().equals(JGrassConstants.ESRIRASTERMAP)))

                    {
                        JGrassMapGeoResource mapResolve = layer.getGeoResource().resolve(JGrassMapGeoResource.class,
                                new NullProgressMonitor());
                        IResolve mapsetResolve = mapResolve.parent(new NullProgressMonitor());
                        // check for the limiting mapset
                        if (mapsetPath != null && mapsetResolve instanceof JGrassMapsetGeoResource) {
                            JGrassMapsetGeoResource map = (JGrassMapsetGeoResource) mapsetResolve;
                            File refFile = map.getFile();
                            File mapsetFile = new File(mapsetPath);
View Full Code Here

                                                        .toArray(new ILayer[toRemove.size()])));

                                            // rename the map
                                            renameGrassRasterMap(mapsetName, oldMapName, newMapName);
                                            // remove old map
                                            ((JGrassMapsetGeoResource) mr.parent(new NullProgressMonitor())).removeMap(
                                                    oldMapName, JGrassConstants.GRASSBINARYRASTERMAP);
                                            // add new name map
                                            ((JGrassMapsetGeoResource) mr.parent(new NullProgressMonitor())).addMap(newMapName,
                                                    JGrassConstants.GRASSBINARYRASTERMAP);
                                        }
View Full Code Here

                                            renameGrassRasterMap(mapsetName, oldMapName, newMapName);
                                            // remove old map
                                            ((JGrassMapsetGeoResource) mr.parent(new NullProgressMonitor())).removeMap(
                                                    oldMapName, JGrassConstants.GRASSBINARYRASTERMAP);
                                            // add new name map
                                            ((JGrassMapsetGeoResource) mr.parent(new NullProgressMonitor())).addMap(newMapName,
                                                    JGrassConstants.GRASSBINARYRASTERMAP);
                                        }

                                    } catch (Exception e) {
                                        MessageDialog.openInformation(shell, "Information",
View Full Code Here

                                        if (type.equals(JGrassConstants.GRASSBINARYRASTERMAP)) {
                                            String[] mapsetpathAndMapname = JGrassCatalogUtilities
                                                    .getMapsetpathAndMapnameFromJGrassMapGeoResource(mr);
                                            try {
                                                removeGrassRasterMap(mapsetpathAndMapname[0], mapsetpathAndMapname[1]);
                                                ((JGrassMapsetGeoResource) mr.parent(new NullProgressMonitor())).removeMap(
                                                        mapsetpathAndMapname[1], JGrassConstants.GRASSBINARYRASTERMAP);

                                                IMap activeMap = ApplicationGIS.getActiveMap();
                                                List<ILayer> mapLayers = activeMap.getMapLayers();
                                                String mapName = mr.getTitle();
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.