Package org.geotools.data

Examples of org.geotools.data.DataSourceException


                        featureType);

                try {
                    geometryEncoder.encode(getGeometryFilter());
                } catch (GeometryEncoderException e) {
                    throw new DataSourceException("Error parsing geometry filters: "
                            + e.getMessage(), e);
                }

                this.sdeSpatialFilters = geometryEncoder.getSpatialFilters();
            }
View Full Code Here


        for (int i = 0; i < cols.length; i++) {
            if (cols[i].getType() == SeColumnDefinition.TYPE_RASTER)
                fetchColumns.add(cols[i].getName());
        }
        if (fetchColumns.size() == 0) {
            throw new DataSourceException("Couldn't find any TYPE_RASTER columns in ArcSDE table "
                    + rasterTable);
        }

        rasterColumns = fetchColumns.toArray(new String[fetchColumns.size()]);
        return rasterColumns;
View Full Code Here

        // Check if this is a known featureType
        cacheLock.readLock().lock();
        try {
            if (!availableLayerNames.contains(typeName)) {
                throw new DataSourceException(typeName + " does not exist");
            }
            typeInfo = featureTypeInfos.get(typeName);
        } finally {
            cacheLock.readLock().unlock();
        }
View Full Code Here

            try {
                featureType = DataUtilities.createSubType(featureType, propertyNames,
                        query.getCoordinateSystem());
            } catch (SchemaException e) {
                LOGGER.log(Level.FINEST, e.getMessage(), e);
                throw new DataSourceException("Could not create Feature Type for query", e);
            }
        }
        return featureType;
    }
View Full Code Here

        final ISession session = getSession(transaction);

        try {
            final FeatureTypeInfo typeInfo = typeInfoCache.getFeatureTypeInfo(typeName, session);
            if (!typeInfo.isWritable()) {
                throw new DataSourceException(typeName + " is not writable");
            }
            final SimpleFeatureType featureType = typeInfo.getFeatureType();

            final FeatureReader<SimpleFeatureType, SimpleFeature> reader;
            if (Filter.EXCLUDE.equals(filter)) {
View Full Code Here

     */
    public void createSchema(final SimpleFeatureType featureType, final Map<String, String> hints)
            throws IOException, IllegalArgumentException {

        if (featureType.getGeometryDescriptor() == null && !typeInfoCache.isAllowNonSpatialTables()) {
            throw new DataSourceException("This DataStore does not allow FeatureTypes with no "
                    + "geometry attributes");
        }

        final ISession session = getSession(Transaction.AUTO_COMMIT);
        try {
View Full Code Here

            for (int i = 0; i < numPolys; i++) {
                try {
                    polys[i] = buildPolygon(coords[i], geometryFactory);
                } catch (Exception ex) {
                    throw new DataSourceException(ex.getMessage(), ex);
                }
            }

            MultiPolygon multiPoly = geometryFactory.createMultiPolygon(polys);
View Full Code Here

                    try {
                        session.rollbackTransaction();
                    } finally {
                        session.dispose();
                    }
                    throw new DataSourceException("Exception initiating transaction on " + session,
                            e);
                }
                state = new SessionTransactionState(session);
                transaction.putState(pool, state);
            }
View Full Code Here

        Reader reader = new StringReader(selectStatement);
        Statement statement;
        try {
            statement = pm.parse(reader);
        } catch (Exception e) {
            throw new DataSourceException("parsing select statement: " + e.getCause().getMessage(),
                    e);
        }
        if (!(statement instanceof Select)) { // either PlainSelect or Union
            throw new IllegalArgumentException("expected select or union statement: " + statement);
        }
View Full Code Here

    final StringBuffer buff = new StringBuffer(baseFile);
//     looking for another extension
    final Set ext=WorldImageFormat.getWorldExtension(extension);
    final Iterator it=ext.iterator();
    if(!it.hasNext())
      throw new DataSourceException("Unable to parse extension "+extension);
    buff.append((String)it.next());
    final File worldFile = new File(buff.toString());
    final PrintWriter out = new PrintWriter(new FileOutputStream(worldFile));
    out.println(xPixelSize);
    out.println(rotation1);
View Full Code Here

TOP

Related Classes of org.geotools.data.DataSourceException

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.