Package org.geotools.filter.identity

Examples of org.geotools.filter.identity.FeatureIdImpl


       
        SimpleFeatureSource source = wfs.getFeatureSource(typeName);
        SimpleFeature sf = getSampleSimpleFeature(source);
       
        Set<FeatureId> fids = new HashSet<FeatureId>();
        fids.add(new FeatureIdImpl("comuni11.2671"));
       
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        PropertyName bboxProperty = ff.property(sf.getDefaultGeometryProperty().getName());
        Query query = new Query(typeName.getLocalPart(), ff.and(
                ff.bbox(bboxProperty, sf.getBounds()),
View Full Code Here


       
        SimpleFeatureSource source = wfs.getFeatureSource(typeName);
        SimpleFeature sf = getSampleSimpleFeature(source);
       
        Set<FeatureId> fids = new HashSet<FeatureId>();
        fids.add(new FeatureIdImpl("comuni11.2671"));
       
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        PropertyName bboxProperty = ff.property(sf.getDefaultGeometryProperty().getName());
        Query query = new Query(typeName.getLocalPart(), ff.and(
                ff.greater(ff.property("cod_reg"), ff.literal(0)),
View Full Code Here

    }   
   
    private SimpleFeature getSampleSimpleFeature(SimpleFeatureSource source) throws IOException {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        Set<FeatureId> fids = new HashSet<FeatureId>();
        fids.add(new FeatureIdImpl("comuni11.2671"));
        Query query = new Query(typeName.getLocalPart(), ff.id(fids));
        SimpleFeatureIterator reader = source.getFeatures(query).features();
        try {
            return reader.next();
        } finally {
View Full Code Here

     * a real value after a commit.
     * @param suggestedId suggsted id
     */
    public static FeatureIdImpl createDefaultFeatureIdentifier( String suggestedId ) {
      if( suggestedId != null ){
        return new FeatureIdImpl( suggestedId )
      }
      return new FeatureIdImpl( createDefaultFeatureId() );
    }
View Full Code Here

        SimpleFeatureType type = DataUtilities.createType("trees",
                "the_geom:Point,FID:String,NAME:String");

        SimpleFeatureStore fs = createMock(SimpleFeatureStore.class);
        expect(fs.addFeatures(isA(FeatureCollection.class))).andReturn(
                Collections.singletonList((FeatureId)(new FeatureIdImpl("trees.105"))));
        replay(fs);

        DataStore ds = createMock(DataStore.class);
        expect(ds.getTypeNames()).andReturn(new String[] { "trees" }).anyTimes();
        expect(ds.getSchema("trees")).andReturn(type).anyTimes();
View Full Code Here

        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;
    }
View Full Code Here

                    "Invalid fid filter provides, has no fids inside");
        }
        Filter external = null;
        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);
    }
View Full Code Here

  }

  private void changeSomeFids() {
    for (int i = 0; i < 10; i++) {
      int f = i+1;
      FeatureAccessor accessor = m_features.get(new FeatureIdImpl("states." + f));
      Feature feature = accessor.getFeature();
      feature.getProperty("STATE_NAME").setValue("Changed." + i);
    }
  }
View Full Code Here

        SimpleFeatureType type = DataUtilities.createType("trees",
                "the_geom:Point,FID:String,NAME:String");

        SimpleFeatureStore fs = createMock(SimpleFeatureStore.class);
        expect(fs.addFeatures(isA(FeatureCollection.class))).andReturn(
                Collections.singletonList((FeatureId)(new FeatureIdImpl("trees.105"))));
        replay(fs);

        DataStore ds = createMock(DataStore.class);
        expect(ds.getTypeNames()).andReturn(new String[] { "trees" }).anyTimes();
        expect(ds.getSchema("trees")).andReturn(type).anyTimes();
View Full Code Here

        SimpleFeatureType type = DataUtilities.createType("trees",
                "the_geom:Point,FID:String,NAME:String");

        SimpleFeatureStore fs = createMock(SimpleFeatureStore.class);
        expect(fs.addFeatures(isA(FeatureCollection.class))).andReturn(
                Collections.singletonList((FeatureId)(new FeatureIdImpl("trees.105"))));
        replay(fs);

        DataStore ds = createMock(DataStore.class);
        expect(ds.getTypeNames()).andReturn(new String[] { "trees" }).anyTimes();
        expect(ds.getSchema("trees")).andReturn(type).anyTimes();
View Full Code Here

TOP

Related Classes of org.geotools.filter.identity.FeatureIdImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.