ft.setId(Integer.toString(i)); } else { ft.setId(feature.getProperty(originIDField).getValue().toString());
public Property getProperty(Name name) { return delegate.getProperty(name); }
public Property getProperty(String arg0) { return delegate.getProperty(arg0); }
public Property getProperty(String name) { return delegate.getProperty(name); }
public Property getProperty(Name arg0) { return delegate.getProperty(arg0); }
public void testGeometryPropertyType() { assertTrue( "expected GeometryAttribute, got " + feature.getProperty("the_geom").getClass().getName(), feature.getProperty("the_geom") instanceof GeometryAttribute); }
public void testGetPropertyNullValue() { assertNotNull(feature.getProperty("the_geom")); assertNull(feature.getProperty("the_geom").getValue()); }
public void testGetProperty() { assertEquals("ABC", feature.getProperty("name").getValue()); assertNull(feature.getProperty("NOWHERE")); assertEquals(0, feature.getProperties("NOWHERE").size()); }
readFeature.getProperty(jdbcMultipleValue.getTargetColumn()).getValue(); List<MultiValueContainer> candidatesValues = candidates.get(targetColumnValue); if (candidatesValues == null) {
for (int i = 0; i < userData.length; i++) { if (userData[i] != null) { sf.getProperty(featureType.getDescriptor(i).getName()) .getUserData() .putAll(userData[i]);
public void testDefaultGeometryProperty() { assertTrue( "expected GeometryAttribute, got " + feature.getProperty("the_geom").getClass().getName(), feature.getProperty("the_geom") instanceof GeometryAttribute); GeometryAttribute defaultGeometryProperty = feature.getDefaultGeometryProperty(); assertNotNull(defaultGeometryProperty); assertNull(defaultGeometryProperty.getValue()); assertNotNull(defaultGeometryProperty.getDescriptor()); assertTrue(defaultGeometryProperty.getDescriptor() instanceof GeometryDescriptor); }
@Override public Property getProperty(Name name) { return simpleFeature.getProperty(name); }
@Override public Property getProperty(String s) { return simpleFeature.getProperty(s); }
public Property getProperty(Name arg0) { return delegate.getProperty(arg0); }
public Property getProperty(String arg0) { return delegate.getProperty(arg0); }
public Property getProperty(Name name) { return simpleFeature.getProperty(name); }
public Property getProperty(String name) { return simpleFeature.getProperty(name); }
/** * The type of filter that returns should be in a single Or filter OR(a,b,c) instead of ((a OR * b) or c) */ @Test public void testUnrollFid() throws Exception { Set<FeatureId> fids = new HashSet(); String fid1 = "station_no.1"; // exists String fid2 = "station_no.500"; // doesn't exists fids.add(ff.featureId(fid1)); fids.add(ff.featureId(fid2)); Id fidFilter = ff.id(fids); Filter unrolled = (Filter) fidFilter.accept(visitor, null); assertNotNull(unrolled); assertTrue(unrolled instanceof OrImpl); List<Filter> filters = ((OrImpl) unrolled).getChildren(); assertEquals(2, filters.size()); for (Filter f : filters) { assertTrue(f instanceof IsEqualsToImpl); } FeatureCollection<SimpleFeatureType, SimpleFeature> results = mapping.getSource().getFeatures(unrolled); assertEquals(1, getCount(results)); FeatureIterator<SimpleFeature> features = results.features(); SimpleFeature unmappedFeature = (SimpleFeature) features.next(); features.close(); assertNotNull(unmappedFeature); Object object = unmappedFeature.getProperty("station_no").getValue(); assertEquals(fid1, object); }
/** * Mapping specifies station_no --> wq_plus/@id. A FidFilter over wq_plus type should result in * a compare equals filter over the station_no attribute of wq_ir_results simple type. */ @Test public void testUnrollFidMappedToAttribute() throws Exception { String fid = "station_no.1"; Id fidFilter = ff.id(Collections.singleton(ff.featureId(fid))); Filter unrolled = (Filter) fidFilter.accept(visitor, null); assertNotNull(unrolled); FeatureCollection<SimpleFeatureType, SimpleFeature> results = mapping.getSource().getFeatures(unrolled); assertEquals(1, getCount(results)); FeatureIterator<SimpleFeature> features = results.features(); SimpleFeature unmappedFeature = (SimpleFeature) features.next(); features.close(); assertNotNull(unmappedFeature); Object object = unmappedFeature.getProperty("station_no").getValue(); assertEquals(fid, object); }
/** * Mapping specifies station_no --> wq_plus/@id. A FidFilter over wq_plus type should result in * a compare equals filter over the station_no attribute of wq_ir_results simple type. */ @Test public void testUnrollFidMappedToAttribute() throws Exception { String fid = "station_no.1"; Id fidFilter = ff.id(Collections.singleton(ff.featureId(fid))); Filter unrolled = (Filter) fidFilter.accept(visitor, null); assertNotNull(unrolled); FeatureCollection<SimpleFeatureType,SimpleFeature> results = mapping.getSource() .getFeatures(unrolled); assertEquals(1, getCount(results)); Iterator<SimpleFeature> features = results.iterator(); SimpleFeature unmappedFeature = (SimpleFeature) features.next(); results.close(features); assertNotNull(unmappedFeature); Object object = unmappedFeature.getProperty("station_no").getValue(); assertEquals(fid, object); }