public Object visit(Id filter, Object extraData) { Set ids = filter.getIDs(); if (ids.isEmpty()) { throw new IllegalArgumentException("Invalid fid filter provides, has no fids inside"); } Set<FeatureId> fids = new HashSet<FeatureId>(); for (Iterator it = ids.iterator(); it.hasNext(); ) { FeatureId id = new FeatureIdImpl((String) it.next()); FeatureId retyped = RetypingFeatureCollection.reTypeId( id, map.getFeatureType(), map.getOriginalFeatureType()); fids.add(retyped); } return ff.id(fids); } }
/** * Sets the FID, used by datastores only. * * <p>I would love to protect this for safety reason, i.e. so client classes can't use it by * casting to it. * * @param id The fid to set. */ public void setID(String fid) { ((FeatureIdImpl) id).setID(fid); } }
public boolean matches(Object object) { if (object instanceof org.opengis.feature.Feature) { return new FeatureIdImpl(gmlId).matches((org.opengis.feature.Feature) object); } // TODO: geometries return false; }
public boolean matches(Object object) { if (object instanceof Feature) { return matches((Feature) object); } return false; }
public boolean matches(Object object) { if (object instanceof Feature) { return matches((Feature) object); } return false; }
/** * Given a feature id following the <typename>.<internalId> convention, the original type and * the destination type, this converts the id from <original>.<internalid> to * <target>.<internalid> * * @param id * @param original * @param target */ public static FeatureId reTypeId( FeatureId sourceId, SimpleFeatureType original, SimpleFeatureType target) { final String originalTypeName = original.getName().getLocalPart(); final String destTypeName = target.getName().getLocalPart(); if (destTypeName.equals(originalTypeName)) return sourceId; final String prefix = originalTypeName + "."; if (sourceId.getID().startsWith(prefix)) { return new FeatureIdImpl( destTypeName + "." + sourceId.getID().substring(prefix.length())); } else return sourceId; }
public void setID(String id) { ((FeatureIdImpl) fid).setID(id); }
public boolean matches( Object object ) { if ( object instanceof org.opengis.feature.Feature ) { return new FeatureIdImpl( gmlId ).matches( (org.opengis.feature.Feature) object ); } //TODO: geometries return false; }
public boolean matches(Object object) { if ( object instanceof Feature ) { return matches( (Feature) object ); } if ( object instanceof org.geotools.feature.Feature ) { return fid.equals( ( (org.geotools.feature.Feature) object ).getID() ); } return false; }
public Object convert(Object source, Class target) { if (source != null) { return new FeatureIdImpl((String) source); } return null; } };
/** Used to update any FeatureId during a commit. */ public void replaceFid(String tempFid, String actualFid) { for (Identifier id : fids) { if (tempFid.equals(id.getID())) { // we have a match! if (id instanceof FeatureIdImpl) { FeatureIdImpl featureId = (FeatureIdImpl) id; // update internal structure! featureId.setID(actualFid); } } } }
public boolean matches( Object object ) { if ( object instanceof Feature || object instanceof org.opengis.feature.Feature ) { return new FeatureIdImpl( gmlId ).matches( object ); } //TODO: geometries return false; }
public MongoFeature( DBObject mongoObject, Object[] values, SimpleFeatureType featureType, String id) { super(values, featureType, new FeatureIdImpl(id), false); this.values = values; this.mongoObject = mongoObject; }
cur.getUserData().get(ContentFeatureStore.ORIGINAL_FEATURE_KEY); if (orig != null) { ((FeatureIdImpl) orig.getIdentifier()).setID(fid); orig.getUserData().putAll(cur.getUserData()); orig.getUserData().remove(ContentFeatureStore.ORIGINAL_FEATURE_KEY);
public FeatureId featureId(String id) { return new FeatureIdImpl(id); }
Boolean.TRUE.equals(feature.getUserData().get(Hints.USE_PROVIDED_FID)); if (getQueryCapabilities().isUseProvidedFIDSupported() && useExisting) { ((FeatureIdImpl) toWrite.getIdentifier()).setID(feature.getID());
.andReturn(Collections.singletonList((FeatureId) (new FeatureIdImpl("trees.105")))); replay(fs);
public void setID( String id ) { ((FeatureIdImpl)fid).setID(id); }
.andReturn(Collections.singletonList((FeatureId) (new FeatureIdImpl("trees.105")))); replay(fs);
/** * Sets the FID, used by datastores only. * * I would love to protect this for safety reason, i.e. so client classes can't use it by * casting to it. * * @param id * The fid to set. */ public void setID(String fid) { ((FeatureIdImpl) id).setID(fid); } }