public Object duplicate(Object src) throws IllegalAttributeException { if(src instanceof Feature){ return featureType.duplicate((Feature)src); } throw new IllegalArgumentException("Not an Object []"); }
public Object duplicate(Object src) throws IllegalAttributeException { if(src instanceof Feature){ return featureType.duplicate((Feature)src); } throw new IllegalArgumentException("Not an Object []"); }
public Feature next() throws IOException, IllegalAttributeException, NoSuchElementException { if (iterator == null) { throw new IOException("Feature Reader has been closed"); } try { return featureType.duplicate((Feature) iterator.next()); } catch (NoSuchElementException end) { throw new DataSourceException("There are no more Features", end); } }
public void validate(Object obj) throws IllegalArgumentException { if(obj instanceof Feature){ try { featureType.duplicate((Feature)obj); return; } catch (IllegalAttributeException e) { IllegalArgumentException ee = new IllegalArgumentException(e.getMessage()); ee.initCause(e); throw ee; } } //users should call parse first - ch. /*if(obj instanceof Object[]){ try { featureType.create((Object[])obj); return; } catch (IllegalAttributeException e) { IllegalArgumentException ee = new IllegalArgumentException(e.getMessage()); ee.initCause(e); throw ee; } }*/ throw new IllegalArgumentException("Not a Feature"); }
public void validate(Object obj) throws IllegalArgumentException { if(obj instanceof Feature){ try { featureType.duplicate((Feature)obj); return; } catch (IllegalAttributeException e) { IllegalArgumentException ee = new IllegalArgumentException(e.getMessage()); ee.initCause(e); throw ee; } } //users should call parse first - ch. /*if(obj instanceof Object[]){ try { featureType.create((Object[])obj); return; } catch (IllegalAttributeException e) { IllegalArgumentException ee = new IllegalArgumentException(e.getMessage()); ee.initCause(e); throw ee; } }*/ throw new IllegalArgumentException("Not a Feature"); }
public Feature next() throws IOException { try { if (originalFeature_ != null) { writeFeature(originalFeature_); // keep the original } if (innerReader_ != null && innerReader_.hasNext()) { originalFeature_ = innerReader_.next(); // ; editFeature_ = featureType_.duplicate(originalFeature_); } else { originalFeature_ = null; editFeature_ = featureType_.create(featureDefaults_); } return editFeature_; } catch (final Exception e) { throw new IOException(e.toString()); } }
org.geotools.feature.Feature feature = (org.geotools.feature.Feature) src; return feature.getFeatureType().duplicate(feature);
current = type.duplicate(live);
org.geotools.feature.Feature feature = (org.geotools.feature.Feature) src; return feature.getFeatureType().duplicate(feature);
public FeatureCollection collection() throws IOException { FeatureCollection copy = new DefaultFeatureCollection( null, featureType ); List list = new ArrayList( contents.size() ); for( FeatureIterator iterator = features(); iterator.hasNext(); ){ Feature feature = iterator.next(); Feature duplicate; try { duplicate = feature.getFeatureType().duplicate( feature ); } catch (IllegalAttributeException e) { throw new DataSourceException( "Unable to copy "+feature.getID(), e ); } list.add( duplicate ); } copy.addAll( list ); return copy; }
while( reader.hasNext() ){ Feature feature = reader.next(); Feature copy = schema.duplicate( feature ); list.add( copy );
public Feature next() throws IOException, NoSuchElementException { if (hasNext()) { // existing content live = (SimpleFeature) iterator.next(); try { current = featureType.duplicate(live); } catch (IllegalAttributeException e) { throw new DataSourceException("Unable to edit " + live.getID() + " of " + typeName); } } else { // new content live = null; try { current = DataUtilities.template(featureType); } catch (IllegalAttributeException e) { throw new DataSourceException("Unable to add additional Features of " + typeName); } } return current; }
/** * Creates duplicate of feature adjusted to the provided featureType. * * @param featureType FeatureType requested * @param feature Origional Feature from DataStore * * @return An instance of featureType based on feature * * @throws IllegalAttributeException If opperation could not be performed */ public static Feature reType(FeatureType featureType, Feature feature) throws IllegalAttributeException { FeatureType origional = feature.getFeatureType(); if (featureType.equals(origional)) { return featureType.duplicate(feature); } String id = feature.getID(); int numAtts = featureType.getAttributeCount(); Object[] attributes = new Object[numAtts]; String xpath; for (int i = 0; i < numAtts; i++) { AttributeType curAttType = featureType.getAttributeType(i); xpath = curAttType.getName(); attributes[i] = curAttType.duplicate(feature.getAttribute(xpath)); } return featureType.create(attributes, id); }
live = type.duplicate( origional ); return live;
live = type.duplicate( origional ); return live;
try { live = reader.next(); current = featureType.duplicate(live); LOGGER.finer("Calling next on writer"); } catch (IllegalAttributeException e) {