Refine search
if ((query == Query.ALL) || query.equals(Query.ALL)) { return query; Filter filter = query.getFilter(); filter = makeDefinitionFilter(filter); Query defQuery = new Query(query); defQuery.setFilter(filter); defQuery.setPropertyNames(propNames); throw new DataSourceException( "Could not restrict the query to the definition criteria: " + ex.getMessage(), ex);
/** @see org.geotools.data.coverage.grid.AbstractGridFormat#getReader(Object, Hints) */ @Override public ArcGridReader getReader(Object source, Hints hints) { try { return new ArcGridReader(source, hints); } catch (DataSourceException e) { if (LOGGER.isLoggable(Level.SEVERE)) LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e); throw new RuntimeException(e); } }
private void inspectCoordinateReferenceSystems() throws DataSourceException { requestCRS = CRS.getHorizontalCRS(requestedBBox.getCoordinateReferenceSystem()); 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); new ReferencedEnvelope( CRS.transform( tempTransform, new GeneralEnvelope(requestedRasterArea))); throw new DataSourceException("Unable to inspect request CRS", e); } catch (TransformException e) { throw new DataSourceException("Unable to inspect request CRS", e);
.inverse(); } catch (NoninvertibleTransformException e) { throw new DataSourceException(e); destinationRasterArea = new GeneralGridEnvelope( CRS.transform( requestedWorldToGrid, new GeneralEnvelope(cropBBox)), PixelInCell.CELL_CORNER, false) .toRectangle(); } catch (IllegalStateException e) { throw new DataSourceException(e); } catch (TransformException e) { throw new DataSourceException(e); CRS.transform(cropBBox, requestedBBox.getCoordinateReferenceSystem()); cropBBOXInRequestCRS.setCoordinateReferenceSystem( requestedBBox.getCoordinateReferenceSystem()); destinationRasterArea, requestedRasterArea, destinationRasterArea); } catch (NoninvertibleTransformException e) { throw new DataSourceException(e); } catch (TransformException e) { throw new DataSourceException(e);
private Query reprojectFilter(Query query) throws IOException { SimpleFeatureType nativeFeatureType = source.getSchema(); final GeometryDescriptor geom = nativeFeatureType.getGeometryDescriptor(); Filter filter = query.getFilter() != null ? query.getFilter() : Filter.INCLUDE; Filter defaultedFilter = (Filter) filter.accept(defaultCRSVisitor, null); Filter reprojectedFilter = (Filter) defaultedFilter.accept(reprojectingVisitor, null); Query reprojectedQuery = new Query(query); reprojectedQuery.setFilter(reprojectedFilter); return reprojectedQuery; } catch (Exception e) { throw new DataSourceException("Had troubles handling filter reprojection...", e);
throws DataSourceException { if (CRS.equalsIgnoreMetadata( state.getRequestedEnvelope().getCoordinateReferenceSystem(), this.crs)) { state.setRequestEnvelopeTransformed(state.getRequestedEnvelope()); state.getRequestedEnvelope().getCoordinateReferenceSystem(), crs); state.setRequestEnvelopeTransformed(CRS.transform(op, state.getRequestedEnvelope())); state.getRequestEnvelopeTransformed().setCoordinateReferenceSystem(crs); state.getRequestEnvelopeTransformed().setCoordinateReferenceSystem(crs); } else if (indexX != indexRequestedX || indexY != indexRequestedY) { throw new DataSourceException("Unable to resolve the X Axis problem"); throw new DataSourceException("Unable to create a coverage for this source", e);
/** * Transforms the original feature type into a destination one according to the renaming rules. * For the moment, it's just a feature type name replacement * * @param original * @throws IOException */ protected SimpleFeatureType transformFeatureType(SimpleFeatureType original) throws IOException { String transfomedName = transformFeatureTypeName(original.getTypeName()); if (transfomedName.equals(original.getTypeName())) return original; try { SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); b.init(original); b.setName(transfomedName); return b.buildFeatureType(); } catch (Exception e) { throw new DataSourceException("Could not build the renamed feature type.", e); } }
if (fc.getSchema().getGeometryDescriptor() == null) { throw new DataSourceException( "Cannot write geometryless shapefiles, yet " + fc.getSchema() Class geomType = schema.getGeometryDescriptor().getType().getBinding(); LOGGER.log( Level.WARNING, "Error while writing featuretype '" + schema.getTypeName() + "' to shapefile.", ioe); throw new IOException(ioe);
public SimpleFeatureCollection getFeatures(Query query) throws IOException { String schemaName = wrapped.getSchema().getName().getLocalPart(); if (query.getTypeName() != null && !schemaName.equals(query.getTypeName())) { throw new DataSourceException( "Typename mismatch, query asks for '" + query.getTypeName() + " but this feature source provides '" + schemaName + "'"); } return getFeatureCollection(query, getEnvelope(query.getFilter())); }
SortBy[] sortBy = query.getSortBy(); Integer offset = null, maxFeatures = null; if (sortBy != null && sortBy != SortBy.UNSORTED) { if (!source.getQueryCapabilities().supportsSorting(sortBy)) { query.setSortBy(null); offset = query.getStartIndex(); maxFeatures = query.getMaxFeatures() == Integer.MAX_VALUE ? null : query.getMaxFeatures(); throw new DataSourceException(e);
} else { CoordinateReferenceSystem resultCRS = null; GeometryDescriptor gd = fs.getSchema().getGeometryDescriptor(); CoordinateReferenceSystem nativeCRS = gd != null ? gd.getCoordinateReferenceSystem() : null; if (!CRS.equalsIgnoreMetadata(resultCRS, schema.getCoordinateReferenceSystem())) schema = FeatureTypes.transform(schema, resultCRS); } catch (Exception e) { throw new DataSourceException("Problem forcing CRS onto feature type", e); info.getProjectionPolicy().getCode()); } catch (Exception e) { throw new DataSourceException("Creation of a versioning wrapper failed", e);
if (!envelope.equals(this.envelope, DELTA, true)) { if (!envelope.intersects(this.envelope, true)) { throw new IllegalArgumentException( "The coverage envelopes need to intersect each other"); if (!CRS.equalsIgnoreMetadata(crs, this.crs)) { try { destinationToSourceTransform = CRS.findMathTransform(crs, this.crs, true); } catch (FactoryException e) { throw new DataSourceException("Unable to inspect request CRS", e);
"Couldn't determine EPSG code for this raster." + " Using SDE's WKT-like coordSysDescription() instead."); crs = CRS.parseWKT(seCoordRef.getCoordSysDescription()); } else { crs = CRS.decode("EPSG:" + epsgCode); throw new DataSourceException(e);
coverageProperties.bbox); } catch (FactoryException e) { throw new DataSourceException(e); if (!CRS.equalsIgnoreMetadata(coverageProperties.geographicCRS, requestCRS)) { CRS.transform(requestedBBox, coverageProperties.geographicCRS); requestedBBOXInCoverageGeographicCRS.setCoordinateReferenceSystem( coverageProperties.geographicCRS); requestedBBOXInCoverageGeographicCRS = new GeneralEnvelope(requestCRS); if (!requestedBBOXInCoverageGeographicCRS.intersects( coverageProperties.geographicBBox, true)) { computedBBox = null; CRS.transform( requestedBBOXInCoverageGeographicCRS, coverageProperties.crs2D); approximateRequestedBBoInNativeCRS.setCoordinateReferenceSystem(
CRS.getHorizontalCRS(envelope.getCoordinateReferenceSystem()); if (envelopeCrs2D != null && !CRS.equalsIgnoreMetadata(crs, envelopeCrs2D)) { CoordinateOperationFactory operationFactory = CRS.getCoordinateOperationFactory(true); CoordinateOperation op = operationFactory.createOperation(envelopeCrs2D, crs); envelope = CRS.transform(op, envelope); envelope.setCoordinateReferenceSystem(crs); requestedRes[0] = envelope.getSpan(0) / dim.getWidth(); requestedRes[1] = envelope.getSpan(1) / dim.getHeight(); throw new DataSourceException("Unable to get resolution", e); } catch (FactoryException e) { throw new DataSourceException("Unable to get resolution", e);
final MosaicProducer dryRunVisitor = new MosaicProducer(true, collectors); final Utils.BBOXFilterExtractor bboxExtractor = new Utils.BBOXFilterExtractor(); query.getFilter().accept(bboxExtractor, null); query.setFilter( FeatureUtilities.DEFAULT_FILTER_FACTORY.bbox( FeatureUtilities.DEFAULT_FILTER_FACTORY.property( .getGranuleCatalog() .getType(rasterManager.getTypeName()) .getGeometryDescriptor() .getName()), bboxExtractor.getBBox())); query.setMaxFeatures(1); rasterManager.getGranuleDescriptors(query, dryRunVisitor); if (dryRunVisitor.granulesNumber > 0) { throw new DataSourceException("Unable to create this mosaic", e);
if (LOGGER.isLoggable(Level.SEVERE)) LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e); throw new DataSourceException(e); if (dest.getProtocol().equalsIgnoreCase("file")) { File destFile; destFile = URLs.urlToFile(dest); try { super.outStream = ImageIOExt.createImageOutputStream(null, destFile); if (LOGGER.isLoggable(Level.SEVERE)) LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e); throw new DataSourceException(e); if (LOGGER.isLoggable(Level.SEVERE)) LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e); throw new DataSourceException(e); else throw new DataSourceException("The provided destination cannot be used!");
throws SeException, IOException { final String[] typeNameParts = featureType.getTypeName().split("\\."); final String unqualifiedTypeName = typeNameParts[typeNameParts.length - 1]; rowIdType = SeRegistration.SE_REGISTRATION_ROW_ID_COLUMN_TYPE_SDE; } else { throw new DataSourceException( "createSchema hint 'rowid.column.type' must be one of 'NONE', 'USER' or 'SDE'"); featureType.getAttributeDescriptors(); AttributeDescriptor currAtt;
protected CoordinateReferenceSystem createFromAuthority( ResultSet result ) throws DataSourceException, FactoryException { try { int id = result.getInt(AUTH_SRID); return CRS.decode("EPSG" + ":" + id); } catch (SQLException sqle) { String message = sqle.getMessage(); throw new DataSourceException(message, sqle); } }
if ((query == Query.ALL) || query.equals(Query.ALL)) { return new DefaultQuery(constraintQuery); String[] propNames = extractAllowedAttributes(query); String typeName = query.getTypeName(); if (typeName == null) { typeName = constraintQuery.getTypeName(); return defaultQuery; } catch (Exception ex) { throw new DataSourceException( "Could not restrict the query to the definition criteria: " + ex.getMessage(), ex);