public SimpleFeature next() throws IOException, IllegalAttributeException, NoSuchElementException { return RetypingFeatureCollection.retype(delegate.next(), builder); } }
@Override public SimpleFeature next() throws IOException, IllegalArgumentException, NoSuchElementException { return (SimpleFeature) r.next(); } };
public SimpleFeature next() throws IOException, IllegalArgumentException, NoSuchElementException { return (SimpleFeature) reader.next(); }
public SimpleFeature next() throws IOException, IllegalArgumentException, NoSuchElementException { return reader.next(); }
public SimpleFeature next() throws java.util.NoSuchElementException { try { return delegate.next(); } catch (IOException e) { throw new RuntimeException(e); } }
@Test public void testGetFeaturesReader() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED), Transaction.AUTO_COMMIT); SimpleFeature sf = fr.next(); fr.close(); assertEquals(primitive, sf.getFeatureType()); // check the feature ids have been renamed as well assertTrue( "Feature id has not been renamed, it's still " + sf.getID(), sf.getID().startsWith(RENAMED)); }
@Test public void testGetFeaturesReader() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED), Transaction.AUTO_COMMIT); SimpleFeature sf = fr.next(); fr.close(); assertEquals(RENAMED, sf.getFeatureType().getName().getLocalPart()); // check the feature ids have been renamed as well assertTrue( "Feature id has not been renamed, it's still " + sf.getID(), sf.getID().startsWith(RENAMED)); }
public SimpleFeature next() throws IOException, IllegalArgumentException, NoSuchElementException { SimpleFeature next = backendReader.next(); if (next == null) return null; return new PreGeneralizedSimpleFeature( featureTyp, indexMapping, next, geomPropertyName, backendGeomPropertyName); } }
public F next() throws IOException, IllegalAttributeException, NoSuchElementException { if (hasNext()) { counter++; return featureReader.next(); } else { throw new NoSuchElementException("No such Feature exists"); } }
/** @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); }
@Test public void testFeatureReaderFidFilter() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED, fidFilter), Transaction.AUTO_COMMIT); assertEquals(primitive, fr.getFeatureType()); assertTrue(fr.hasNext()); SimpleFeature sf = fr.next(); assertFalse(fr.hasNext()); fr.close(); assertEquals(fid, sf.getID()); }
public F next() throws NoSuchElementException { try { return reader.next(); } catch (IOException e) { throw new AssertionError(e); } }
@Test public void testFeautureReaderFidFilter() throws Exception { FeatureReader<SimpleFeatureType, SimpleFeature> fr; fr = rts.getFeatureReader(new Query(RENAMED, fidFilter), Transaction.AUTO_COMMIT); assertEquals(RENAMED, fr.getFeatureType().getName().getLocalPart()); assertTrue(fr.hasNext()); SimpleFeature sf = fr.next(); assertFalse(fr.hasNext()); fr.close(); assertEquals(fid, sf.getID()); }
/** @see FeatureWriter#next() */ public final SimpleFeature next() throws IOException { if (hasNext()) { feature = filteredContent.next(); } else { final String newFid = newFid(); final SimpleFeature newFeature = featureBuilder.buildFeature(newFid); final List<Object> properties = newFeature.getAttributes(); feature = new MutableFIDFeature(properties, featureType, newFid); } return feature; }
void dump(FeatureReader<SimpleFeatureType, SimpleFeature> reader) throws NoSuchElementException, IOException { SimpleFeature feature; int count = 0; try { while (reader.hasNext()) { feature = reader.next(); // System.out.println(count + " feature:" + feature); count++; } } finally { reader.close(); } }
public void testGetFeatures() throws Exception { try (FeatureReader<SimpleFeatureType, SimpleFeature> r = dataStore.getFeatureReader(new Query(tname(("guid"))), Transaction.AUTO_COMMIT)) { r.hasNext(); Set<UUID> uuids = new HashSet<UUID>(); uuids.add(uuid1); uuids.add(uuid2); while (r.hasNext()) { SimpleFeature f = (SimpleFeature) r.next(); assertNotNull(uuids.remove(f.getAttribute(aname("uuidProperty")))); } assertTrue(uuids.isEmpty()); } }
public void testGetFeatures() throws Exception { try (FeatureReader r = dataStore.getFeatureReader(new Query(tname("b")), Transaction.AUTO_COMMIT)) { r.hasNext(); SimpleFeature f = (SimpleFeature) r.next(); assertEquals(Boolean.FALSE, f.getAttribute("boolProperty")); r.hasNext(); f = (SimpleFeature) r.next(); assertEquals(Boolean.TRUE, f.getAttribute("boolProperty")); } } }
@Override public SimpleFeature next() throws IOException { SimpleFeature f = wrapped.next(); for (AttributeDescriptor ad : target.getAttributeDescriptors()) { Expression ex = transformer.getExpression(ad.getLocalName()); if (ex != null) { Object value = ex.evaluate(f, ad.getType().getBinding()); fb.add(value); } else { fb.add(null); } } return fb.buildFeature(transformer.transformFid(f)); }
public void testGetFeatureReaderLake() throws IOException, IllegalFilterException { try (Transaction t = new DefaultTransaction(); FeatureReader<SimpleFeatureType, SimpleFeature> reader = dataStore.getFeatureReader(new Query(tname("lake")), t)) { assertNotNull(reader); assertTrue(reader.hasNext()); assertNotNull(reader.next()); assertFalse(reader.hasNext()); } }
public void testReader() throws Exception { if (!isGeographySupportAvailable()) { return; } Query q = new Query(tname("geopoint")); try (FeatureReader r = dataStore.getFeatureReader(q, Transaction.AUTO_COMMIT)) { assertTrue(r.hasNext()); while (r.hasNext()) { SimpleFeature f = (SimpleFeature) r.next(); assertTrue(f.getAttribute(aname("geo")) instanceof Point); } } }