Package org.geotools.data

Examples of org.geotools.data.DataSourceException


        connFact.setLogin(dbUser, dbPasswd);
        ConnectionPool pool = null;
        try {
            pool = connFact.getConnectionPool();
        } catch (SQLException e) {
            throw new DataSourceException("Could not create connection", e);
        }

        LineMergerPostgisDataStore dataStore = null;
        if (dbSchema == null && namespace == null) {
            dataStore = new LineMergerPostgisDataStore(pool, params);
View Full Code Here


            SimpleFeatureType schema = (SimpleFeatureType) getFeatureType(info);
            try {
                if (!CRS.equalsIgnoreMetadata(resultCRS, schema.getCoordinateReferenceSystem()))
                    schema = FeatureTypes.transform(schema, resultCRS);
            } catch (Exception e) {
                throw new DataSourceException(
                        "Problem forcing CRS onto feature type", e);
            }

            //
            // versioning
            //
            try {
                // only support versioning if on classpath
                if (VERSIONING_FS != null && GS_VERSIONING_FS != null && VERSIONING_FS.isAssignableFrom( fs.getClass() ) ) {
                    //class implements versioning, reflectively create the versioning wrapper
                    try {
                    Method m = GS_VERSIONING_FS.getMethod( "create", VERSIONING_FS,
                        SimpleFeatureType.class, Filter.class, CoordinateReferenceSystem.class, int.class );
                    return (FeatureSource) m.invoke(null, fs, schema, info.getFilter(),
                        resultCRS, info.getProjectionPolicy().getCode());
                    }
                    catch( Exception e ) {
                        throw new DataSourceException(
                                "Creation of a versioning wrapper failed", e);
                    }
                }
            } catch( ClassCastException e ) {
                //fall through
View Full Code Here

     */
    public int lockFeatures(Query query) throws IOException {
        if (source instanceof FeatureLocking) {
            return ((FeatureLocking<SimpleFeatureType, SimpleFeature>) source).lockFeatures(query);
        } else {
            throw new DataSourceException("FeatureTypeConfig does not supports locking");
        }
    }
View Full Code Here

                defQuery.setSortBy(query.getSortBy());
            }

            return defQuery;
        } catch (Exception ex) {
            throw new DataSourceException(
                "Could not restrict the query to the definition criteria: " + ex.getMessage(), ex);
        }
    }
View Full Code Here

        try {
            if (definitionQuery != Filter.INCLUDE) {
                newFilter = ff.and(definitionQuery, filter);
            }
        } catch (Exception ex) {
            throw new DataSourceException("Can't create the definition filter", ex);
        }

        return newFilter;
    }
View Full Code Here

        try {
            //this is the raw "unprojected" feature collection
            FeatureCollection<SimpleFeatureType, SimpleFeature> fc = source.getFeatures(newQuery);
            return applyProjectionPolicies(targetCRS, fc);
        } catch (Exception e) {
            throw new DataSourceException(e);
        }
    }
View Full Code Here

           
            DefaultQuery reprojectedQuery = new DefaultQuery(query);
            reprojectedQuery.setFilter(reprojectedFilter);
            return reprojectedQuery;
        } catch(Exception e) {
            throw new DataSourceException("Had troubles handling filter reprojection...", e);
        }
    }
View Full Code Here

                internalPyramidLevel++;
            }

        } catch (SeException se) {
            throw new DataSourceException(se);
        }
    }
View Full Code Here

                LOGGER.log(Level.SEVERE, dse.getLocalizedMessage(), dse);
                throw dse;
            } catch (RuntimeException ex) {
                this.hasNextAlreadyCalled = true;
                close();
                throw new DataSourceException("Fetching row:" + ex.getMessage(), ex);
            }
        }

        boolean hasNext = this.currentRow != null;
        if (!hasNext) {
View Full Code Here

     *
     * @throws IOException
     */
    public void next() throws IOException {
        if (this.currentRow == null) {
            throw new DataSourceException("There are no more rows");
        }

        this.hasNextAlreadyCalled = false;
    }
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.