Package org.geotools.arcsde

Examples of org.geotools.arcsde.ArcSdeException


                    if (!this.schemaGeometryClass.isAssignableFrom(actualGeomtryClass)) {
                        value = adaptGeometry((Geometry) value, schemaGeometryClass);
                    }
                }
            } catch (SeException e) {
                throw new ArcSdeException(e);
            }
        } else if (value instanceof Geometry) {
            if (!this.schemaGeometryClass.isAssignableFrom(value.getClass())) {
                value = adaptGeometry((Geometry) value, schemaGeometryClass);
            }
View Full Code Here


                assertEquals(10D, x, 1E-5);
                assertEquals(10D, y, 1E-5);
            }

        } catch (SeException e) {
            throw new ArcSdeException(e);
        }
    }
View Full Code Here

        // from
        String mainTable;
        try {
            mainTable = queryInfo.getConstruct().getTables()[0];
        } catch (SeException e) {
            throw new ArcSdeException(e);
        }

        SeLayer layer = null;
        try {
            layer = session.getLayer(mainTable);
        } catch (NoSuchElementException e) {
            LOGGER.info(mainTable + " is not an SeLayer, so no CRS info will be parsed");
        }
        LOGGER.fine("testing query");

        final Command<SeColumnDefinition[]> testQueryCmd = new Command<SeColumnDefinition[]>() {
            @Override
            public SeColumnDefinition[] execute(ISession session, SeConnection connection)
                    throws SeException, IOException {
                final SeQuery testQuery = new SeQuery(connection);

                try {
                    testQuery.prepareQueryInfo(queryInfo);
                    testQuery.execute();
                    LOGGER.fine("definition query executed successfully");

                    LOGGER.fine("fetching row to obtain view's types");

                    SeRow testRow = testQuery.fetch();
                    SeColumnDefinition[] colDefs = testRow.getColumns();
                    return colDefs;
                } finally {
                    try {
                        testQuery.close();
                    } catch (SeException e) {
                        throw new ArcSdeException(e);
                    }
                }
            }
        };
View Full Code Here

                    rasterColumn = new SeRasterColumn(connection, ratt.getRasterColumnId());
                    rasterColumnId = rasterColumn.getID().longValue();
                    sampleBand = ratt.getBands()[0];
                    bitsPerSample = RasterCellType.valueOf(ratt.getPixelType()).getBitsPerSample();
                } catch (SeException e) {
                    throw new ArcSdeException(e);
                }
                final SeCoordinateReference seCoordRef = rasterColumn.getCoordRef();
                if (seCoordRef == null) {
                    throw new IllegalArgumentException(rasterTableName
                            + " has no coordinate reference system set");
                }
                LOGGER.finer("Looking CRS for raster column " + rasterTableName);
                coverageCrs = ArcSDEUtils.findCompatibleCRS(seCoordRef);
                if (DefaultEngineeringCRS.CARTESIAN_2D == coverageCrs) {
                    LOGGER.warning("Raster " + rasterTableName
                            + " has not CRS set, using DefaultEngineeringCRS.CARTESIAN_2D");
                }
                if (sampleBand.hasColorMap()) {
                    rastersColorMaps = loadColorMaps(rasterColumnId, bitsPerSample, connection);
                } else {
                    rastersColorMaps = Collections.emptyMap();
                }

            }
            try {
                for (SeRasterAttr rAtt : rasterAttributes) {
                    LOGGER.fine("Gathering raster metadata for " + rasterTableName + " raster "
                            + rAtt.getRasterId().longValue());
                   
                    if (rAtt.getMaxLevel() == 0) {
                        throw new IllegalArgumentException(
                                "Raster cotains no pyramid levels, we don't support non pyramid rasters");
                    }
                    if (rAtt.getNumBands() == 0) {
                        throw new IllegalArgumentException("Raster "
                                + rAtt.getRasterId().longValue() + " in " + rasterTableName
                                + " contains no raster attribtues");
                    }
                    if (this.statisticsMandatory && !rAtt.getBandInfo(1).hasStats()) {
                        throw new IllegalArgumentException(rasterTableName
                                + " has no statistics generated (or not all it's rasters have). "
                                + "Please use sderaster -o stats to create them before use");
                    }

                    RasterInfo rasterInfo = new RasterInfo(rAtt, coverageCrs);
                    rastersLayoutInfo.add(rasterInfo);

                    final GeneralEnvelope originalEnvelope;
                    originalEnvelope = calculateOriginalEnvelope(rAtt, coverageCrs);
                    rasterInfo.setOriginalEnvelope(originalEnvelope);
                    final List<RasterBandInfo> bands;
                    bands = setUpBandInfo(connection, rAtt, rastersColorMaps);
                    rasterInfo.setBands(bands);
                    if (LOGGER.isLoggable(Level.FINER)) {
                        LOGGER.finer("Gathered metadata for " + rasterTableName + "#"
                                + rAtt.getRasterId().longValue() + ":\n" + rasterInfo.toString());
                    }
                   
                    System.out.println(rasterInfo);
                }
            } catch (SeException e) {
                throw new ArcSdeException("Gathering raster dataset information", e);
            }
        }

        RasterDatasetInfo rasterInfo = new RasterDatasetInfo();
        rasterInfo.setRasterTable(rasterTableName);
View Full Code Here

        SeTable sTable = new SeTable(scon, rasterTable);
        SeColumnDefinition[] cols;
        try {
            cols = sTable.describe();
        } catch (SeException e) {
            throw new ArcSdeException("Exception fetching the list of columns for table "
                    + rasterTable, e);
        }
        List<String> fetchColumns = new ArrayList<String>(cols.length / 2);
        for (int i = 0; i < cols.length; i++) {
            if (cols[i].getType() == SeColumnDefinition.TYPE_RASTER)
View Full Code Here

            CoordinateReferenceSystem coverageCrs) throws IOException {
        SeExtent sdeExtent;
        try {
            sdeExtent = rasterAttributes.getExtent();
        } catch (SeException e) {
            throw new ArcSdeException("Exception getting the raster extent", e);
        }
        GeneralEnvelope originalEnvelope = new GeneralEnvelope(coverageCrs);
        originalEnvelope.setRange(0, sdeExtent.getMinX(), sdeExtent.getMaxX());
        originalEnvelope.setRange(1, sdeExtent.getMinY(), sdeExtent.getMaxY());
        return originalEnvelope;
View Full Code Here

                rasterAttributes = row.getRaster(0);
                rasterAttList.addFirst(rasterAttributes);
                row = query.fetch();
            }
        } catch (SeException se) {
            throw new ArcSdeException("Error fetching raster attributes for " + rasterTable, se);
        } finally {
            if (query != null) {
                try {
                    query.close();
                } catch (SeException e) {
                    throw new ArcSdeException(e);
                }
            }
        }
        LOGGER.fine("Found " + rasterAttList.size() + " raster attributes for " + rasterTable);
        return rasterAttList;
View Full Code Here

                colorMaps.put(Long.valueOf(bandId), colorModel);

                row = query.fetch();
            }
        } catch (SeException e) {
            throw new ArcSdeException("Error fetching colormap data for column " + rasterColumnId
                    + " from table " + auxTableName, e);
        } finally {
            if (query != null) {
                try {
                    query.close();
View Full Code Here

                        + rasterColumnId);
            }
            owner = row.getString(0);
            query.close();
        } catch (SeException e) {
            throw new ArcSdeException("Error getting auxiliary table for raster column "
                    + rasterColumnId, e);
        } finally {
            if (query != null) {
                try {
                    query.close();
View Full Code Here

        try {
            numBands = rasterAttributes.getNumBands();
            seBands = rasterAttributes.getBands();
            cellType = RasterCellType.valueOf(rasterAttributes.getPixelType());
        } catch (SeException e) {
            throw new ArcSdeException(e);
        }

        List<RasterBandInfo> detachedBandInfo = new ArrayList<RasterBandInfo>(numBands);

        RasterBandInfo bandInfo;
View Full Code Here

TOP

Related Classes of org.geotools.arcsde.ArcSdeException

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.