Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IGeoResourceInfo


        assertNotNull(resources);
        assertEquals(resources.size(),1);
       
        CSV csv = null;
        for (IGeoResource resource : resources) {
            IGeoResourceInfo info = resource.getInfo(null);
           
            String description = info.getDescription();
            assertNotNull( description );
            System.out.println("Description:"+description);
           
            ReferencedEnvelope bounds = info.getBounds();
            assertTrue( !bounds.isNull() );
            System.out.println("Bounds:"+bounds);
           
           if( resource.canResolve(CSV.class)){
               csv = resource.resolve(CSV.class, null );
View Full Code Here


*/
public class SetLayerNameInterceptor implements LayerInterceptor {

    public void run( Layer layer ) {
        try {
            IGeoResourceInfo info = layer.getGeoResource().getInfo(ProgressManager.instance().get());
            nameLayer(info, layer);
        } catch (IOException e) {
            //shouldn't happen
            throw (RuntimeException) new RuntimeException( ).initCause( e );
        }
View Full Code Here

        List<? extends IGeoResource> m = service.resources(new NullProgressMonitor());
        for(IGeoResource resource: m) {
            ID id = resource.getID();
            assertNotNull(id);
            //IGeoResourceInfo grinfo = resource.getInfo(new NullProgressMonitor());
            IGeoResourceInfo grinfo = getInfo(resource, new NullProgressMonitor());
            assertNotNull(grinfo);
            assertEquals("GeoResource title matches filename", "sample data", grinfo.getTitle());
        }
       
    }
View Full Code Here

           
        };
        FutureTask<IGeoResourceInfo> task = new FutureTask<IGeoResourceInfo>(job);
        Thread t = new Thread(task);
        t.start();
        IGeoResourceInfo info = null;
       
        try {
            info = task.get();
        } catch (InterruptedException e) {
        } catch (ExecutionException e) {
View Full Code Here

    }

    @Override
  protected IGeoResourceInfo createInfo( IProgressMonitor monitor ) {
        // TODO Auto-generated method stub
        return new IGeoResourceInfo(){
            @Override
            public ReferencedEnvelope getBounds() {
                // TODO Auto-generated method stub
                return new ReferencedEnvelope(new Envelope(), null);
            }
View Full Code Here

    private ReferencedEnvelope obtainBoundsFromResources(IProgressMonitor monitor) {
        ReferencedEnvelope result = null;
        for (IGeoResource resource : getGeoResources()) {
            //IGeoResourceInfo info = resource.getInfo(monitor);
            IGeoResourceInfo info = getInfo(resource, monitor);
            Envelope tmp = null;
            if (info != null)
                tmp = info.getBounds();

            if (tmp instanceof ReferencedEnvelope
                    && ((ReferencedEnvelope) tmp).getCoordinateReferenceSystem() != null) {
                result = (ReferencedEnvelope) tmp;
            } else {
View Full Code Here

        };
        FutureTask<IGeoResourceInfo> task = new FutureTask<IGeoResourceInfo>(job);
        Thread t = new Thread(task);
        t.start();
        IGeoResourceInfo info = null;

        try {
            info = task.get();
        } catch (InterruptedException e) {
        } catch (ExecutionException e) {
View Full Code Here

            }
            if (version == null || "".equals(version)) { //$NON-NLS-1$
                WmsPlugin.log("GetCapabilities VERSION is required", new ServiceNotFoundException()); //$NON-NLS-1$
                return null;
            }
            IGeoResourceInfo info = resource.getInfo( new SubProgressMonitor(monitor, 50));
   
            String srs = CRS.toSRS(info.getCRS());
            TileSet tileset = new WMSTileSet();
   
            ReferencedEnvelope bounds = info.getBounds();
            if (bounds == null ) { //$NON-NLS-1$
                WmsPlugin.log("Bounds required for TileSet definition", new NullPointerException("Bounds required for tileset definitio")); //$NON-NLS-1$
                return null;
            }
            double minX = bounds.getMinimum(0);
            double maxX = bounds.getMaximum(0);
            double minY = bounds.getMinimum(1);
            double maxY = bounds.getMaximum(1);
   
            CRSEnvelope bbox = new CRSEnvelope(srs, minX, minY, maxX, maxY);
            tileset.setBoundingBox(bbox);
            tileset.setCoorindateReferenceSystem(srs);
   
            Map<String, Serializable> properties = resource.getPersistentProperties();
            Integer width = Integer.parseInt((String) properties.get(PreferenceConstants.P_TILESET_WIDTH));
            Integer height = Integer.parseInt((String) properties.get(PreferenceConstants.P_TILESET_HEIGHT));
   
            if (width == null) {
                width = PreferenceConstants.DEFAULT_TILE_SIZE;
            }
   
            if (height == null) {
                height = PreferenceConstants.DEFAULT_TILE_SIZE;
            }
   
            tileset.setWidth(width);
            tileset.setHeight(height);
   
            String imageType = (String) properties.get(PreferenceConstants.P_TILESET_IMAGE_TYPE);
   
            if (imageType == null || "".equals(imageType)) { //$NON-NLS-1$
                imageType = PreferenceConstants.DEFAULT_IMAGE_TYPE;
            }
   
            tileset.setFormat(imageType);
   
            /*
             * The layer ID
             */
            tileset.setLayers(info.getName());
   
            String scales = (String) properties.get(PreferenceConstants.P_TILESET_SCALES);
   
            String resolutions = workoutResolutions(scales, new ReferencedEnvelope(bbox), width);
   
View Full Code Here

    @Override
    protected Control createContents( Composite parent ) {
        final Layer layer = (Layer) getElement();
        IGeoResource resource = layer.getGeoResource();
        IGeoResourceInfo info = null;
        try {
            info = resource.getInfo(null);
        } catch (IOException e) {
            ProjectUIPlugin.trace( TileSetPropertyPage.class, "Unable to obtain info:"+e, e );
        }
View Full Code Here

     * @param resource
     * @throws IOException
     */
    private void op( final Display display, IProgressMonitor monitor, IGeoResource resource )
            throws IOException {
        IGeoResourceInfo info = resource.getInfo(monitor);
        Envelope bounds = info.getBounds();
        final List<SummaryData> data=new ArrayList<SummaryData>();
        String crs;
        if (info.getCRS() != null)
            crs = info.getCRS().getName().toString();
        else
            crs = Messages.MultiTargetOp_unknown;
        crs=crs.replace('\n', ' ');
       
        try {
            data.add(new SummaryData(Messages.MultiTargetOp_name, info.getName()));
            data.add(new SummaryData( Messages.MultiTargetOp_title, info.getTitle()));
            data.add(new SummaryData( Messages.MultiTargetOp_bounds, LayerSummary.parseBounds(bounds) ));
            data.add(new SummaryData( Messages.MultiTargetOp_crs, crs));
            data.add(new SummaryData( Messages.MultiTargetOp_featuresource, resource.canResolve(FeatureSource.class)));
            data.add(new SummaryData( Messages.MultiTargetOp_featurestore, resource.canResolve(FeatureStore.class)));
            data.add(new SummaryData( Messages.MultiTargetOp_wms, resource.canResolve(WebMapServer.class)));
            boolean first=false;
            for( String word : info.getKeywords() ) {
                if( first )
                    data.add(new SummaryData( Messages.MultiTargetOp_keywords, word));
                else
                    data.add(new SummaryData( null , word ));
            }
View Full Code Here

TOP

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

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.