Examples of FeatureIdImpl


Examples of org.geotools.filter.identity.FeatureIdImpl

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

Examples of org.geotools.filter.identity.FeatureIdImpl

    public void testAddSeveral() throws FileNotFoundException, IOException {
        DataStore csv = this.getDataStore();
        SimpleFeatureStore rows = (SimpleFeatureStore) csv.getFeatureSource(TYPE_NAME);
        SimpleFeatureType featureType = csv.getSchema(TYPE_NAME);
        DefaultFeatureCollection toAdd = new DefaultFeatureCollection("test", featureType);
        SimpleFeature newFeature = new SimpleFeatureImpl(new Object[] {this.newPoint(new Coordinate(12, 34)), "Manhattan Beach", 444}, featureType, new FeatureIdImpl("test1"), false);
        toAdd.add(newFeature);
        newFeature = new SimpleFeatureImpl(new Object[] {this.newPoint(new Coordinate(56, 78)), "Hermosa Beach", 555}, featureType, new FeatureIdImpl("test2"), false);
        toAdd.add(newFeature);
        newFeature = new SimpleFeatureImpl(new Object[] {this.newPoint(new Coordinate(90, 12)), "Redondo Beach", 666}, featureType, new FeatureIdImpl("test3"), false);
        toAdd.add(newFeature);
        rows.addFeatures(toAdd);

        // re-open
        csv = this.getDataStore();
View Full Code Here

Examples of org.geotools.filter.identity.FeatureIdImpl

        // String to FeatureId comparison
        if (FeatureId.class.isAssignableFrom(target) && String.class.isAssignableFrom(source)) {
            return new Converter() {
                public Object convert(Object source, Class target) {
                    if (source != null) {
                        return new FeatureIdImpl((String) source);
                    }
                    return null;
                }
            };
        }
View Full Code Here

Examples of org.geotools.filter.identity.FeatureIdImpl

    public void testAdd() throws FileNotFoundException, IOException {
        DataStore csv = this.getDataStore();
        SimpleFeatureStore rows = (SimpleFeatureStore) csv.getFeatureSource(TYPE_NAME);
        SimpleFeatureType featureType = csv.getSchema(TYPE_NAME);
        DefaultFeatureCollection toAdd = new DefaultFeatureCollection("test", featureType);
        SimpleFeature newFeature = new SimpleFeatureImpl(new Object[] {this.newPoint(new Coordinate(12, 34)), "Manhattan Beach", 444}, featureType, new FeatureIdImpl("test"), false);
        toAdd.add(newFeature);
        rows.addFeatures(toAdd);

        // re-open
        csv = this.getDataStore();
View Full Code Here

Examples of org.geotools.filter.identity.FeatureIdImpl

        MemoryFeatureCollection collection = new MemoryFeatureCollection(featureType1);
       
        Coordinate insideCoord = new Coordinate(5.2, 7.5);
        Point myPoint = geomfac.createPoint(insideCoord);
       
        SimpleFeature feat = new SimpleFeatureImpl(Arrays.asList(new Object[]{myPoint, "mypoint""pics/x.jpg", "pics/y.jpg"}), featureType1, new FeatureIdImpl("myid") );
       
        collection.add(feat);
       
        List<FeatureId> fids = store.addFeatures((SimpleFeatureCollection) collection);
       
View Full Code Here

Examples of org.geotools.filter.identity.FeatureIdImpl

        MemoryFeatureCollection collection = new MemoryFeatureCollection(featureType1);
       
        Coordinate insideCoord = new Coordinate(5.2, 7.5);
        Point myPoint = geomfac.createPoint(insideCoord);
       
        SimpleFeature feat = new SimpleFeatureImpl(Arrays.asList(new Object[]{myPoint, "mypoint""pics/x.jpg", "pics/y.jpg"}), featureType1, new FeatureIdImpl("myid") );
       
        collection.add(feat);
       
        Transaction transaction = new DefaultTransaction();
        store.setTransaction(transaction);
View Full Code Here

Examples of org.geotools.filter.identity.FeatureIdImpl

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

Examples of org.geotools.filter.identity.FeatureIdImpl

    public ESimpleFeatureImpl(EFeatureInfo eStructure, EObject eObject, String eID, List<Object> values) {
        //
        // Forward to SimpleFeatureImpl
        //
        super(values.toArray(), eStructure.getFeatureType(),
                new FeatureIdImpl(eID), false, eStructure.eGetAttributeIndex());
        //
        // Prepare
        //
        this.eObject = eObject;
        this.eStructure = eStructure;
View Full Code Here

Examples of org.geotools.filter.identity.FeatureIdImpl

                    : EcoreUtil.convertToString(eIDAttribute.getEAttributeType(),
                            eFeature().eGet(eIDAttribute)));
            //
            // Create feature id instance
            //
            eID = new FeatureIdImpl(fid);
        }
        //
        // Finished
        //
        return eID;
View Full Code Here

Examples of org.geotools.filter.identity.FeatureIdImpl

        // axis order used will be NORTH / EAST
        ds.setAxisOrder(WFSDataStore.AXIS_ORDER_COMPLIANT, WFSDataStore.AXIS_ORDER_COMPLIANT);
       
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        Set<FeatureId> fids = new HashSet<FeatureId>();
        fids.add(new FeatureIdImpl("comuni11.2671"));
        Query query = new Query(typeName, ff.id(fids));

        SimpleFeatureSource source = ds.getFeatureSource(typeName);
        SimpleFeature feature = iterate(source.getFeatures(query), 1, true);
        Geometry geometry = (Geometry) feature.getDefaultGeometry();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.