Examples of buildFeature()


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

                    String name = featureType.getDescriptor(i + 1).getLocalName();
                    Object value = values.get(i).orNull();
                    featureBuilder.set(name, value);
                }
                featureBuilder.set("geogig_fid", nodeRef.name());
                Feature feature = featureBuilder.buildFeature(nodeRef.name());
                feature.getUserData().put(Hints.USE_PROVIDED_FID, true);
                feature.getUserData().put(RevFeature.class, revFeature);
                feature.getUserData().put(RevFeatureType.class, revFeatureType);

                if (feature instanceof SimpleFeature) {
View Full Code Here

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

            @Nullable
            public Optional<Feature> apply(@Nullable Feature feature) {
                SimpleFeature simpleFeature = (SimpleFeature) feature;
                featureBuilder.add(simpleFeature.getAttribute(0));
                featureBuilder.add(simpleFeature.getAttribute(2));
                return Optional.of((Feature) featureBuilder.buildFeature(null));
            }
        };

        Feature[] points = new Feature[] { points1, points2, points3 };
        for (Feature feature : points) {
View Full Code Here

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

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

            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

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

                    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

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

                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

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

                .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

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

        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

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

        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

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

        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
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.