Package org.geotools.feature.simple

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


                    i++;

                    exitForIntermediateSaving = ((i % ITEM_X_PAGE) == 0);

                    SimpleFeature sf = featureIterator.next();
                    SimpleFeature data = featureBuilderData.buildFeature(sf.getID());
                    for (int j = 0; j < srcAttributeDescriptor.size(); j++) {
                        String srcName = srcAttributeDescriptor.get(j).getLocalName();
                        String dstName = srcName.toLowerCase(); // FIXME: this is a worksroung for SHP 2 PG attrib name conversion. make it general!

                        Property p = sf.getProperty(srcName);
View Full Code Here


        String id = null;
        if (config.has("id", config)) {
            id = Context.toString(config.get("id", config));
        }

        feature = builder.buildFeature(id);
    }
   
    /**
     * Translate a GeoJSON config into a Feature config.
     * @param config
View Full Code Here

                Entry<Name, Optional<?>> entry = iterator.next();
                featureBuilder.set(entry.getKey(), entry.getValue().orNull());

            }

            SimpleFeature featureToInsert = featureBuilder.buildFeature(NodeRef.nodeFromPath(path));
            workTree.insert(NodeRef.parentPath(path), featureToInsert);

        }
        ImmutableList<FeatureTypeDiff> alteredTrees = patch.getAlteredTrees();
        for (FeatureTypeDiff diff : alteredTrees) {
View Full Code Here

        } else {
            throw new IllegalArgumentException();
        }

        String fid = String.valueOf(entity.getId());
        SimpleFeature simpleFeature = builder.buildFeature(fid);
        return simpleFeature;
    }

    protected String buildNodesString(List<WayNode> wayNodes) {
        StringBuilder sb = new StringBuilder();
View Full Code Here

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

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

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

}
View Full Code Here

                for (int i = 0; i < descriptors.size(); i++) {
                    PropertyDescriptor descriptor = descriptors.get(i);
                    Optional<Object> value = values.get(i);
                    featureBuilder.set(descriptor.getName(), value.orNull());
                }
                SimpleFeature feature = featureBuilder.buildFeature(ref.name());
                Entity entity = converter.toEntity(feature, id);
                EntityContainer container;
                if (entity instanceof Node) {
                    container = new NodeContainer((Node) entity);
                } else {
View Full Code Here

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

                    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

            @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

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.