Examples of buildFeature()


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

                .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

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);
        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

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

                                        + entry.getKey() + ")");
                            }
                        }
                    }
                }
                SimpleFeature feature = featureBuilder
                        .buildFeature(NodeRef.nodeFromPath(featureId));
                RevFeature revFeature = RevFeatureBuilder.build(feature);
                ggit.getRepository().stagingDatabase().put(revFeature);

                getResponse().setEntity(
View Full Code Here

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

                                property.getValue());
                    } else {
                        builder.set(property.getName(), property.getValue());
                    }
                }
                Feature modifiedFeature = builder.buildFeature(feature.getIdentifier().getID());
                return Optional.fromNullable(modifiedFeature);
            }

        };
View Full Code Here

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

                }
                Optional<Object> value = values.get(i);
                featureBuilder.set(descriptor.getName(), value.orNull());
            }
            Preconditions.checkNotNull(id, "No 'id' attribute found");
            SimpleFeature feature = featureBuilder.buildFeature(id);
            unmapFeature(feature, flusher);

        }

        flusher.flushAll();
View Full Code Here

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

                        }
                        Optional<Object> value = values.get(i);
                        featureBuilder.set(descriptor.getName(), value.orNull());
                    }
                    Preconditions.checkNotNull(id, "No 'id' attribute found");
                    SimpleFeature feature = featureBuilder.buildFeature(id);
                    Class<?> clazz = feature.getDefaultGeometryProperty().getType().getBinding();
                    String deletePath = clazz.equals(Point.class) ? OSMUtils.NODE_TYPE_NAME
                            : OSMUtils.WAY_TYPE_NAME;
                    workingTree().delete(deletePath, id);
                }
View Full Code Here

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

            // We reconstruct the feature and insert it
            featureBuilder.set("timestamp", System.currentTimeMillis());
            featureBuilder.set("changeset", null);
            featureBuilder.set("version", null);
            featureBuilder.set("visible", true);
            mapFlusher.put("node", featureBuilder.buildFeature(id));
        } else {
            // The feature didn't exist, so we have to add it
            mapFlusher.put("node", featureBuilder.buildFeature(id));
        }
View Full Code Here

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

            featureBuilder.set("version", null);
            featureBuilder.set("visible", true);
            mapFlusher.put("node", featureBuilder.buildFeature(id));
        } else {
            // The feature didn't exist, so we have to add it
            mapFlusher.put("node", featureBuilder.buildFeature(id));
        }

    }

    /**
 
View Full Code Here

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

        featureBuilder.set("changeset", null);
        featureBuilder.set("timestamp", System.currentTimeMillis());
        featureBuilder.set("version", 1);
        featureBuilder.set("user", null);
        featureBuilder.set("visible", true);
        flusher.put("node", featureBuilder.buildFeature(Long.toString(id)));
        return id;
    }

    private void unmapWay(SimpleFeature feature, FeatureMapFlusher flusher) {
        boolean modified = false;
View Full Code Here

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

        if (rawFeature.isPresent()) {
            // the feature has changed, so we cannot reuse some attributes
            featureBuilder.set("timestamp", System.currentTimeMillis());
            featureBuilder.set("changeset", -changeset); // temporary negative changeset ID
            // featureBuilder.set("version", version);
            flusher.put("way", featureBuilder.buildFeature(id));
        } else {
            flusher.put("way", featureBuilder.buildFeature(id));
        }

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