Examples of buildFeature()


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

                nameAttribute = f.getAttribute("name");
            } catch (Exception e){
                // ignore name attribute
            }
            builder.addAll(new Object[]{nameAttribute, geometry });
            SimpleFeature feature = builder.buildFeature(type.getTypeName() + "." + index++); //$NON-NLS-1$
            newCollection.add(feature);
        }

        return newCollection;
    }
View Full Code Here

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

          else {
            String colValue = node.getValue().asString();
            featureBuilder.add(colValue);
          }
        }
        SimpleFeature feature = featureBuilder.buildFeature(null);
        features.add(feature);
      } catch (Exception e) {
        logger.error("Error creating geometry! Skipping it.", e);
        continue;
      }
View Full Code Here

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

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

        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

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

                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

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

        } 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

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(GeoGIG geogig, boolean oneCommitPerFeature,
            Feature... features) throws Exception {
        return populate(geogig, oneCommitPerFeature, Arrays.asList(features));
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);
    }

}
View Full Code Here

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

                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

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

                    value = new WKTReader2().read((String) value);
                }
            }
            builder.set(i, value);
        }
        return builder.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.