Package org.geotools.arcsde

Examples of org.geotools.arcsde.ArcSdeException


                bandInfo.statsMin = band.getStatsMin();
                bandInfo.statsMax = band.getStatsMax();
                bandInfo.statsMean = band.getStatsMean();
                bandInfo.statsStdDev = band.getStatsStdDev();
            } catch (SeException e) {
                throw new ArcSdeException(e);
            }
            // double noDataValue = 0;
            // bandInfo.noDataValue = noDataValue;
        } else {
            bandInfo.statsMin = java.lang.Double.NaN;
            bandInfo.statsMax = java.lang.Double.NaN;
            bandInfo.statsMean = java.lang.Double.NaN;
            bandInfo.statsStdDev = java.lang.Double.NaN;
        }
        if (bandInfo.getColorMap() != null) {
            bandInfo.noDataValue = RasterUtils.determineNoDataValue(bandInfo.getColorMap());
        } else {
            double statsMin = bandInfo.getStatsMin();
            double statsMax = bandInfo.getStatsMax();
            RasterCellType nativeCellType = bandInfo.getCellType();
            bandInfo.noDataValue = RasterUtils.determineNoDataValue(numBands, statsMin, statsMax,
                    nativeCellType);
        }
        SDEPoint tOrigin;
        try {
            tOrigin = band.getTileOrigin();
        } catch (SeException e) {
            throw new ArcSdeException(e);
        }
        bandInfo.tileOrigin = new Point((int)tOrigin.getX(), (int)tOrigin.getY());
    }
View Full Code Here


            final SeQueryInfo queryInfo;
            try {
                LOGGER.fine("creating definition query info");
                queryInfo = QueryInfoParser.parse(session, qualifiedSelect);
            } catch (SeException e) {
                throw new ArcSdeException("Error Parsing select: " + qualifiedSelect, e);
            }
            FeatureTypeInfo typeInfo = ArcSDEAdapter.createInprocessViewSchema(session, typeName,
                    typeInfoCache.getNamesapceURI(), qualifiedSelect, queryInfo);

            typeInfoCache.addInprocessViewInfo(typeInfo);
View Full Code Here

        SeShape shape = null;

        try {
            shape = new SeShape(seSrs);
        } catch (SeException ex) {
            ArcSdeException e = new ArcSdeException("Can't create SeShape with SeCrs " + seSrs, ex);
            LOGGER.log(Level.WARNING, e.getMessage(), e);
            throw e;
        }

        if (geometry.isEmpty()) {
            return shape;
        }

        // REVISIT: this may be worth considering. If not, at least shape.generateFromWKB
        // final String wkt = geometry.toText();
        // try {
        // shape.generateFromText(wkt);
        // } catch (SeException e) {
        // ArcSdeException sdeEx = new ArcSdeException("Can't generate SeShape from " + geometry
        // + "\n", e);
        // LOGGER.log(Level.WARNING, sdeEx.getMessage());
        // throw sdeEx;
        // }

        int numParts;
        GeometryCollection gcol = null;

        if (geometry instanceof GeometryCollection) {
            gcol = (GeometryCollection) geometry;
        } else {
            Geometry[] geoms = { geometry };
            gcol = new GeometryFactory().createGeometryCollection(geoms);
        }

        List<SDEPoint> allPoints = new ArrayList<SDEPoint>();
        numParts = gcol.getNumGeometries();

        int[] partOffsets = new int[numParts];
        Geometry geom;
        Coordinate[] coords;
        Coordinate c;

        for (int currGeom = 0; currGeom < numParts; currGeom++) {
            partOffsets[currGeom] = allPoints.size();
            geom = gcol.getGeometryN(currGeom);

            coords = geom.getCoordinates();

            for (int i = 0; i < coords.length; i++) {
                c = coords[i];
                allPoints.add(new SDEPoint(c.x, c.y));
            }
        }

        SDEPoint[] points = new SDEPoint[allPoints.size()];
        allPoints.toArray(points);

        try {
            if (geometry instanceof Point || gcol instanceof MultiPoint) {
                shape.generatePoint(points.length, points);
            } else if (geometry instanceof LineString || geometry instanceof MultiLineString) {
                shape.generateLine(points.length, numParts, partOffsets, points);
            } else {
                shape.generatePolygon(points.length, numParts, partOffsets, points);
            }
        } catch (SeException e) {
            ArcSdeException sdeEx = new ArcSdeException("Can't generate SeShape from " + geometry
                    + "\n", e);
            LOGGER.log(Level.WARNING, sdeEx.getMessage());
            throw sdeEx;
        }

        return shape;
    }
View Full Code Here

                        LOGGER.finer("Locking the transaction state");
                        transactionState.lock();
                        LOGGER.finer("Transaction state locked");
                    } catch (SeException e) {
                        throw new ArcSdeException(e);
                    }
                }
                final SeObjectId differencesId = new SeObjectId(SeState.SE_NULL_STATE_ID);
                final SeObjectId currentStateId = transactionState.getId();
                streamOperation.setState(currentStateId, differencesId,
View Full Code Here

                return command.execute(this, null);
            } else {
                return command.execute(this, connection);
            }
        } catch (SeException e) {
            throw new ArcSdeException(e);
        }
    }
View Full Code Here

                                + sessionId);
                        cause = nase;
                    }
                }
            } catch (SeException e) {
                throw new ArcSdeException("Can't create connection to " + serverName
                        + " for Session #" + sessionId, e);
            } catch (RuntimeException e) {
                throw (IOException) new IOException("Can't create connection to " + serverName
                        + " for Session #" + sessionId).initCause(e);
            }
View Full Code Here

        } catch (NoSuchElementException e) {
            LOGGER.log(Level.WARNING, "Out of connections: " + e.getMessage() + ". Config: "
                    + this.config);
            throw new UnavailableConnectionException(config.getMaxConnections(), this.config);
        } catch (SeException se) {
            ArcSdeException sdee = new ArcSdeException(se);
            LOGGER.log(Level.WARNING, "ArcSDE error getting connection for " + config, sdee);
            throw sdee;
        } catch (Exception e) {
            LOGGER.log(Level.WARNING, "Unknown problem getting connection: " + e.getMessage(), e);
            throw (IOException) new IOException(
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

            SeShapeFilter bboxFilter = new SeShapeFilter(typeName, layer.getSpatialColumn(),
                    filterShape, SeFilter.METHOD_ENVP, true);
            spatFilters = new SeFilter[] { bboxFilter };
        } catch (SeException eek) {
            throw new ArcSdeException(eek);
        }
        SeSqlConstruct sqlCons = new SeSqlConstruct(typeName);
        // sqlCons.setWhere(where);

        final SeQueryInfo seQueryInfo = new SeQueryInfo();
View Full Code Here

            SeShapeFilter bboxFilter = new SeShapeFilter(typeName, layer.getSpatialColumn(),
                    filterShape, SeFilter.METHOD_ENVP, true);
            spatFilters = new SeFilter[] { bboxFilter };
        } catch (SeException eek) {
            throw new ArcSdeException(eek);
        }
        SeSqlConstruct sqlCons = new SeSqlConstruct(typeName);
        sqlCons.setWhere(where);

        final SeQueryInfo seQueryInfo = new SeQueryInfo();
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.