Package org.geotools.feature.simple

Examples of org.geotools.feature.simple.SimpleFeatureBuilder.buildFeature()


                @Override
                @Nullable
                public Optional<Feature> apply(@Nullable Feature feature) {
                    SimpleFeature simpleFeature = (SimpleFeature) feature;
                    wrongFeatureBuilder.add(simpleFeature.getAttribute(0));
                    return Optional.of((Feature) wrongFeatureBuilder.buildFeature(null));
                }
            };
            geogig.command(ExportOp.class).setFeatureStore(featureStore).setPath(pointsName)
                    .setFeatureTypeConversionFunction(wrongFunction).call();
            fail();
View Full Code Here


            Preconditions.checkNotNull(desc, "Wrong attribute in feature description");
            FieldType type = FieldType.forBinding(desc.getType().getBinding());
            Object value = TextValueSerializer.fromString(type, tokens[1]);
            ftb.set(tokens[0], value);
        }
        return ftb.buildFeature(featureId);
    }
}
View Full Code Here

                    value = new WKTReader2().read((String) value);
                }
            }
            builder.set(i, value);
        }
        return builder.buildFeature(id);
    }

    protected List<RevCommit> populate(boolean oneCommitPerFeature, Feature... features)
            throws Exception {
        return populate(oneCommitPerFeature, Arrays.asList(features));
View Full Code Here

                featureBuilder.set(name, merged.orNull());
            } else {
                featureBuilder.set(name, valueB.orNull());
            }
        }
        return featureBuilder.buildFeature(nodeRefA.name());

    }

    public MergeFeaturesOp setFirstFeature(NodeRef feature) {
        this.nodeRefA = feature;
View Full Code Here

                .type());
        fb.set("geom", gf.createLineString(coords.toArray(new Coordinate[0])));
        fb.set("name", "newname");
        fb.set("id", 31347480l);
        fb.set("nodes", values.get(3).get());
        SimpleFeature newFeature = fb.buildFeature("31347480");
        geogig.getRepository().workingTree().insert("residential", newFeature);
        Optional<RevFeature> mapped = geogig.command(RevObjectParse.class)
                .setRefSpec("WORK_HEAD:residential/31347480").call(RevFeature.class);
        assertTrue(mapped.isPresent());
        values = mapped.get().getValues();
View Full Code Here

        SimpleFeatureBuilder fb = new SimpleFeatureBuilder((SimpleFeatureType) featureType.get()
                .type());
        fb.set("geom", gf.createPoint(new Coordinate(0, 1)));
        fb.set("name", "newname");
        fb.set("id", 507464799l);
        SimpleFeature newFeature = fb.buildFeature("507464799");
        geogig.getRepository().workingTree().insert("busstops", newFeature);

        // check that it was correctly inserted in the working tree
        Optional<RevFeature> mapped = geogig.command(RevObjectParse.class)
                .setRefSpec("WORK_HEAD:busstops/507464799").call(RevFeature.class);
View Full Code Here

        SimpleFeatureBuilder fb = new SimpleFeatureBuilder((SimpleFeatureType) featureType.get()
                .type());
        fb.set("geom", gf.createPoint(new Coordinate(0, 1)));
        fb.set("name_alias", "newname");
        fb.set("id", 507464799l);
        SimpleFeature newFeature = fb.buildFeature("507464799");
        geogig.getRepository().workingTree().insert("busstops", newFeature);

        // check that it was correctly inserted in the working tree
        Optional<RevFeature> mapped = geogig.command(RevObjectParse.class)
                .setRefSpec("WORK_HEAD:busstops/507464799").call(RevFeature.class);
View Full Code Here

        fb.set("name_alias", "newname");
        fb.set("id", 507464799l);
        fb.set("tags",
                "VRS:gemeinde:BONN|VRS:ortsteil:Hoholz|VRS:ref:68566|bus:yes|highway:bus_stop|name:Gielgen|public_transport:platform");
        fb.set("timestamp", 1355097351000l);
        SimpleFeature newFeature = fb.buildFeature("507464799");
        geogig.getRepository().workingTree().insert("busstops", newFeature);

        // check that it was correctly inserted in the working tree
        Optional<RevFeature> mapped = geogig.command(RevObjectParse.class)
                .setRefSpec("WORK_HEAD:busstops/507464799").call(RevFeature.class);
View Full Code Here

                .type());
        fb.set("geom", gf.createLineString(coords.toArray(new Coordinate[0])));
        fb.set("name_alias", "newname");
        fb.set("id", 31347480l);
        fb.set("nodes", values.get(3).get());
        SimpleFeature newFeature = fb.buildFeature("31347480");
        geogig.getRepository().workingTree().insert("residential", newFeature);
        Optional<RevFeature> mapped = geogig.command(RevObjectParse.class)
                .setRefSpec("WORK_HEAD:residential/31347480").call(RevFeature.class);
        assertTrue(mapped.isPresent());
        values = mapped.get().getValues();
View Full Code Here

        SimpleFeatureBuilder fb = new SimpleFeatureBuilder((SimpleFeatureType) featureType.get()
                .type());
        fb.set("geom", gf.createPoint(new Coordinate(0, 1)));
        fb.set("name", "newname");
        fb.set("id", 507464799l);
        SimpleFeature newFeature = fb.buildFeature("507464799");
        geogig.getRepository().workingTree().insert("busstops", newFeature);
        geogig.command(AddOp.class).call();
        geogig.command(CommitOp.class).setMessage("msg").call(); // this should trigger the hook

        // check that the unmapping has been triggered and the unmapped node has the changes we
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.