Package org.geotools.data

Examples of org.geotools.data.DataSourceException


            ogr.DriverRelease(driver);
            if (!driverName.equalsIgnoreCase("georss") &&
                !driverName.equalsIgnoreCase("gpx") &&
                !driverName.equalsIgnoreCase("sosi") &&
                !ogr.LayerCanCreateField(layer)) {
                throw new DataSourceException(
                        "OGR reports it's not possible to create fields on this layer");
            }

            // create fields
            Map<String, String> nameMap = new HashMap<String, String>();
View Full Code Here


                .getCoordinateReferenceSystem());

        // create the layer
        layer = ogr.DataSourceCreateLayer(dataSource, schema.getTypeName(), spatialReference, ogrGeomType, options);
        if (layer == null) {
            throw new DataSourceException("Could not create the OGR layer: "+ogr.GetLastErrorMsg());
        }
        return layer;
    }
View Full Code Here

                ogr.DriverRelease(driver);
                if (dataSource == null)
                    throw new IOException("Could not create OGR data source with driver "
                            + ogrDriver + " and options " + options);
            } else {
                throw new DataSourceException("Driver not provided, and could not "
                        + "open data source neither");
            }
        }
        return dataSource;
    }
View Full Code Here

    try {
      reader = new BufferedReader(new FileReader(header));
      initMap();
      parseHeaderFile(reader);
      if (!fullPropertySet(this.propertyMap)) {
        throw new DataSourceException(
            "Needed properties missing in GTOPO30 header file");
      }
    } finally {
      if (reader != null)
        try {
View Full Code Here

                    crs,
                    envelope,
                    gridToWorld,
                    originalRasterRange);
        } catch (TransformException e) {
            throw new DataSourceException(e);
        } catch (FactoryException e) {
            throw new DataSourceException(e);
        }
        // rasterDescriptor creation
        rasterDescriptor = new RasterDescriptor(this);
       
    }
View Full Code Here

                expectedInstanceOf = typeRegistry.getAttributeType(expectedNodeTypeName, null, crs);
                if (expectedInstanceOf == null) {
                    String msg = "mapping expects and instance of " + expectedNodeTypeName
                            + " for attribute " + targetXPath
                            + " but the attribute descriptor was not found";
                    throw new DataSourceException(msg);
                }
            } else {
                expectedInstanceOf = null;
            }
            AttributeMapping attMapping;
View Full Code Here

            try {
                expression = CQL.toExpression(sourceExpr, ff);
            } catch (CQLException e) {
                String formattedErrorMessage = e.getMessage();
                AppSchemaDataAccessConfigurator.LOGGER.log(Level.SEVERE, formattedErrorMessage, e);
                throw new DataSourceException("Error parsing CQL expression " + sourceExpr + ":\n"
                        + formattedErrorMessage);
            } catch (Exception e) {
                e.printStackTrace();
                String msg = "parsing expression " + sourceExpr;
                AppSchemaDataAccessConfigurator.LOGGER.log(Level.SEVERE, msg, e);
                throw new DataSourceException(msg + ": " + e.getMessage(), e);
            }
        }
        return expression;
    }
View Full Code Here

        String dsId = dto.getSourceDataStore();
        String typeName = dto.getSourceTypeName();

        DataAccess<FeatureType, Feature> sourceDataStore = sourceDataStores.get(dsId);
        if (sourceDataStore == null) {
            throw new DataSourceException("datastore " + dsId + " not found for type mapping "
                    + dto);
        }

        AppSchemaDataAccessConfigurator.LOGGER.fine("asking datastore " + sourceDataStore
                + " for source type " + typeName);
View Full Code Here

            DataAccess<FeatureType, Feature> dataStore = DataAccessFinder.getDataStore(datastoreParams);

            if (dataStore == null) {
                AppSchemaDataAccessConfigurator.LOGGER.log(Level.SEVERE,
                        "Cannot find a DataAccess for parameters " + datastoreParams);
                throw new DataSourceException("Cannot find a DataAccess for parameters "
                        + "(some not shown) "
                        + filterDatastoreParams(datastoreParams));
            }

            AppSchemaDataAccessConfigurator.LOGGER.fine("got datastore " + dataStore);
View Full Code Here

        if (!CRS.equalsIgnoreMetadata(requestCRS, rasterManager.spatialDomainManager.coverageCRS2D))
            try {
                destinationToSourceTransform = CRS.findMathTransform(requestCRS,
                        rasterManager.spatialDomainManager.coverageCRS2D, true);
            } catch (FactoryException e) {
                throw new DataSourceException("Unable to inspect request CRS", e);
            }
        // now transform the requested envelope to sourceFile crs
        if (destinationToSourceTransform != null && destinationToSourceTransform.isIdentity()) {
            destinationToSourceTransform = null;// the CRS is basically the same
        } else if (destinationToSourceTransform instanceof AffineTransform) {
            needsReprojection = true;
            //
            // k, the transformation between the various CRS is not null or the
            // Identity, let's see if it is an affine transform, which case we
            // can incorporate it into the requested grid to world
            //
            // we should not have any problems with regards to BBOX reprojection

            // update the requested grid to world transformation by pre concatenating the destination to sourceFile transform
            AffineTransform mutableTransform = (AffineTransform) requestedGridToWorld.clone();
            mutableTransform.preConcatenate((AffineTransform) destinationToSourceTransform);

            // update the requested envelope
            try {
                final MathTransform tempTransform = PixelTranslation.translate(
                        ProjectiveTransform.create(mutableTransform), PixelInCell.CELL_CENTER,
                        PixelInCell.CELL_CORNER);
                requestedBBox = new ReferencedEnvelope(CRS.transform(tempTransform,
                        new GeneralEnvelope(requestedRasterArea)));

            } catch (MismatchedDimensionException e) {
                throw new DataSourceException("Unable to inspect request CRS", e);
            } catch (TransformException e) {
                throw new DataSourceException("Unable to inspect request CRS", e);
            }

            // now clean up all the traces of the transformations
            destinationToSourceTransform = null;
        }
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.