/** @see org.geotools.data.FeatureReader#next() */ public SimpleFeature next() throws IOException, IllegalAttributeException, NoSuchElementException { if (reader == null) { throw new IllegalStateException("Reader has already been closed"); } SimpleFeature next = reader.next(); if (builder == null) return next; return SimpleFeatureBuilder.retype(next, builder); }
/** @see org.geotools.data.FeatureReader#next() */ public SimpleFeature next() throws NoSuchElementException { if (reader == null) { throw new IllegalStateException("Reader has already been closed"); } SimpleFeature next = reader.next(); if (builder == null) return next; try { return SimpleFeatureBuilder.retype(next, builder); } catch (IllegalAttributeException eep) { throw (IllegalStateException) new IllegalStateException(eep.getMessage()).initCause(eep); } }
addedFeatureIds.add(addedFid); SimpleFeature remoteFeature = SimpleFeatureBuilder.retype(localFeature, builder);
new CoverageSlice( postRetypeRequired ? SimpleFeatureBuilder.retype(sf, target) : sf); coverageSliceDescriptorsCache.put(granuleIndex, slice);
protected void setUp() throws Exception { super.setUp(); data = new MemoryDataStore(); data.addFeatures(roadFeatures); // Override river to use CRS riverType = SimpleFeatureTypeBuilder.retype(super.riverType, CRS.decode("EPSG:4326")); riverBounds = new ReferencedEnvelope(super.riverBounds, CRS.decode("EPSG:4326")); riverFeatures = new SimpleFeature[super.riverFeatures.length]; for (int i = 0; i < riverFeatures.length; i++) { riverFeatures[i] = SimpleFeatureBuilder.retype(super.riverFeatures[i], riverType); } data.addFeatures(riverFeatures); }
protected void setUp() throws Exception { super.setUp(); data = new MemoryDataStore(); data.addFeatures(roadFeatures); // Override river to use CRS riverType = SimpleFeatureTypeBuilder.retype(super.riverType, CRS.decode("EPSG:4326")); riverBounds = new ReferencedEnvelope(super.riverBounds, CRS.decode("EPSG:4326")); riverFeatures = new SimpleFeature[super.riverFeatures.length]; for (int i = 0; i < riverFeatures.length; i++) { riverFeatures[i] = SimpleFeatureBuilder.retype(super.riverFeatures[i], riverType); } data.addFeatures(riverFeatures); decorator = new MyDecoratingDataStore(data); }
protected void setUp() throws Exception { super.setUp(); data = new MemoryDataStore(); data.addFeatures(roadFeatures); SimpleFeatureType riverTypeWithCrs = SimpleFeatureTypeBuilder.retype(riverType, CRS.decode("EPSG:4326")); data.addFeature(SimpleFeatureBuilder.retype(riverFeatures[0], riverTypeWithCrs)); riverBounds = new ReferencedEnvelope(riverFeatures[0].getBounds()); }
/** * @see org.geotools.data.FeatureReader#next() */ public SimpleFeature next() throws IOException, IllegalAttributeException, NoSuchElementException { if (reader == null) { throw new IllegalStateException("Reader has already been closed"); } SimpleFeature next = reader.next(); if( builder == null ) return next; return SimpleFeatureBuilder.retype(next, builder); }
@Override public boolean hasNext() throws IOException { if (next != null) { return true; } try { SimpleFeature raw = (SimpleFeature) parser.parse(); if (raw != null) { next = SimpleFeatureBuilder.retype(raw, featureType); } } catch (Exception e) { throw new IOException(e); } return next != null; }
/** * @see org.geotools.data.FeatureReader#next() */ public SimpleFeature next() throws NoSuchElementException { if (reader == null) { throw new IllegalStateException("Reader has already been closed"); } SimpleFeature next = reader.next(); if( builder == null ) return next; try { return SimpleFeatureBuilder.retype(next, builder); } catch( IllegalAttributeException eep){ throw (IllegalStateException) new IllegalStateException(eep.getMessage()).initCause(eep ); } }
private SimpleFeature retype(SimpleFeature feature) { if (propertyNames == null) { return feature; } else { if (retypeBuilder == null) { SimpleFeatureType targetType = SimpleFeatureTypeBuilder.retype( feature.getFeatureType(), propertyNames); retypeBuilder = new SimpleFeatureBuilder(targetType); } return SimpleFeatureBuilder.retype(feature, retypeBuilder); } }
public static SimpleFeature crsTransform( final SimpleFeature entry, final SimpleFeatureType reprojectedType, final MathTransform transform) { SimpleFeature crsEntry = entry; if (transform != null) { // we can use the transform we have already calculated for this // feature try { // this will clone the feature and retype it to Index CRS crsEntry = SimpleFeatureBuilder.retype(entry, reprojectedType); // this will transform the geometry crsEntry.setDefaultGeometry( JTS.transform((Geometry) entry.getDefaultGeometry(), transform)); } catch (MismatchedDimensionException | TransformException e) { LOGGER.warn( "Unable to perform transform to specified CRS of the index, the feature geometry will remain in its original CRS", e); } } return crsEntry; } }
addedFeatureIds.add(addedFid); SimpleFeature remoteFeature = SimpleFeatureBuilder.retype(localFeature, builder);
private static SimpleFeature createTargetFeature(Geometry sourceGeometry, SimpleFeatureType targetSchema, SimpleFeature sourceFeature, GeometryCoordinateSequenceTransformer source2TargetTransformer) { SimpleFeature targetFeature; if (source2TargetTransformer != null) { Geometry targetGeometry; try { targetGeometry = source2TargetTransformer.transform(sourceGeometry); } catch (Exception e) { Debug.trace(e); return null; } targetFeature = SimpleFeatureBuilder.retype(sourceFeature, targetSchema); targetFeature.setDefaultGeometry(targetGeometry); } else { targetFeature = SimpleFeatureBuilder.copy(sourceFeature); targetFeature.setDefaultGeometry(sourceGeometry); } return targetFeature; }
new CoverageSlice( postRetypeRequired ? SimpleFeatureBuilder.retype(sf, target) : sf); coverageSliceDescriptorsCache.put(granuleIndex, slice);
SimpleFeatureBuilder.retype((SimpleFeature) link, linkFeatureType); builder.append(OGC_LINKS_PROPERTY_NAME, linkFeature);