protected FeatureReader<SimpleFeatureType, SimpleFeature> applyReprojectionDecorator( FeatureReader<SimpleFeatureType, SimpleFeature> reader, Query query, GetFeatureRequest request) { FeatureReader<SimpleFeatureType, SimpleFeature> tmp = reader; if (query.getCoordinateSystem() != null && !query.getCoordinateSystem() .equals(reader.getFeatureType().getCoordinateReferenceSystem())) { if (request.getSrsName() != null) { try { reader = new ForceCoordinateSystemFeatureReader( reader, query.getCoordinateSystem()); } catch (SchemaException e) { LOGGER.warning(e.toString()); reader = tmp; } } else { try { reader = new ReprojectFeatureReader(reader, query.getCoordinateSystem()); } catch (Exception e) { LOGGER.warning(e.toString()); reader = tmp; } } } return reader; }
int featuresCount = 0; try (ReprojectFeatureReader reprojected = new ReprojectFeatureReader(reader, sphericalMercator)) { SimpleFeature reprojectedFeature = reprojected.next(); assertThat(reprojectedFeature, notNullValue()); Point geometry = (Point) reprojectedFeature.getDefaultGeometry();
/** * Retrieve a FeatureReader<SimpleFeatureType, SimpleFeature> for this Query * * @return FeatureReader<SimpleFeatureType, SimpleFeature> for this Query * @throws IOException If results could not be obtained */ public FeatureReader<SimpleFeatureType, SimpleFeature> reader() throws IOException { FeatureReader<SimpleFeatureType, SimpleFeature> reader; reader = ((DataStore) featureSource.getDataStore()) .getFeatureReader(query, getTransaction()); int maxFeatures = query.getMaxFeatures(); if (maxFeatures != Integer.MAX_VALUE) { reader = new MaxFeatureReader<SimpleFeatureType, SimpleFeature>(reader, maxFeatures); } if (transform != null) { reader = new ReprojectFeatureReader(reader, getSchema(), transform); } return reader; }
} else if (!sourceCRS.equals(targetCRS)) { try { reader = new ReprojectFeatureReader(reader, targetCRS); } catch (Exception e) { if (e instanceof IOException) throw (IOException) e;
protected FeatureReader<SimpleFeatureType, SimpleFeature> applyReprojectionDecorator( FeatureReader<SimpleFeatureType, SimpleFeature> reader, Query query, GetFeatureRequest request) { FeatureReader<SimpleFeatureType, SimpleFeature> tmp = reader; if (query.getCoordinateSystem() != null && !query.getCoordinateSystem() .equals(reader.getFeatureType().getCoordinateReferenceSystem())) { if (request.getSrsName() != null) { try { reader = new ForceCoordinateSystemFeatureReader( reader, query.getCoordinateSystem()); } catch (SchemaException e) { LOGGER.warning(e.toString()); reader = tmp; } } else { try { reader = new ReprojectFeatureReader(reader, query.getCoordinateSystem()); } catch (Exception e) { LOGGER.warning(e.toString()); reader = tmp; } } } return reader; }
/** * Retrieve a FeatureReader for this Query * * @return FeatureReader for this Query * * @throws IOException If results could not be obtained */ public FeatureReader reader() throws IOException { FeatureReader reader = featureSource.getDataStore().getFeatureReader(query, getTransaction()); int maxFeatures = query.getMaxFeatures(); if (maxFeatures != Integer.MAX_VALUE) { reader = new MaxFeatureReader(reader, maxFeatures); } if( transform != null ){ reader = new ReprojectFeatureReader( reader, schema, transform ); } return reader; }
/** * JDBCDataStore has a more direct query method * * @return DOCUMENT ME! * * @throws IOException DOCUMENT ME! */ public FeatureReader reader() throws IOException { FeatureReader reader = getDataStore().getFeatureReader(query, getTransaction()); int maxFeatures = query.getMaxFeatures(); if (maxFeatures != Integer.MAX_VALUE) { reader = new MaxFeatureReader(reader, maxFeatures); } if( transform != null ){ reader = new ReprojectFeatureReader( reader, schema, transform ); } return reader; }
/** * Retrieve a FeatureReader<SimpleFeatureType, SimpleFeature> for this Query * * @return FeatureReader<SimpleFeatureType, SimpleFeature> for this Query * * @throws IOException If results could not be obtained */ public FeatureReader<SimpleFeatureType, SimpleFeature> reader() throws IOException { FeatureReader<SimpleFeatureType, SimpleFeature> reader; reader = ((DataStore) featureSource.getDataStore()).getFeatureReader(query, getTransaction()); int maxFeatures = query.getMaxFeatures(); if (maxFeatures != Integer.MAX_VALUE) { reader = new MaxFeatureReader<SimpleFeatureType, SimpleFeature>(reader, maxFeatures); } if( transform != null ){ reader = new ReprojectFeatureReader( reader, getSchema(), transform ); } return reader; }
&& !queryCrs.equals(readerCrs)) { try { reader = new ReprojectFeatureReader(reader, queryCrs); } catch (Exception e) { throw new DataSourceException(e);
if (query.getCoordinateSystemReproject() != null) { try { reader = new ReprojectFeatureReader(reader, query.getCoordinateSystemReproject()); } catch (Exception e) { if(e instanceof IOException)