Package org.geotools.feature.simple

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


  public void create() throws Exception {
    WKTReader wktReader = new WKTReader();
    Point geometry = (Point) wktReader.read("POINT (0 0)");

    SimpleFeatureBuilder build = new SimpleFeatureBuilder(layer.getSchema());
    SimpleFeature feature = build.buildFeature("100000", new Object[] { geometry, "Tsjakamaka", 342 });

    Object created = layer.create(feature);
    Assert.assertNotNull(created);
  }
View Full Code Here


          values[i++] = null;
        }
      }
      values[i++] = internalFeature.getStyleInfo().getIndex();
      values[i++] = internalFeature.getGeometry();
      result.add(builder.buildFeature(internalFeature.getId(), values));
    }
    return result;
  }

  private SimpleFeatureType createFeatureType(VectorLayer layer, CoordinateReferenceSystem mapCrs) {
View Full Code Here

      } else {
        attr.add(feature.getGeometry());
      }
    }

    return builder.buildFeature(feature.getId(), attr.toArray());

  }

  /** {@inheritDoc} */
  public SimpleFeatureType toSimpleFeatureType(VectorLayerInfo vectorLayerInfo, List<String> attributeNames)
View Full Code Here

                    featureBuilder.add(s.stopName);
                    featureBuilder.add(s.stopCode);
                    featureBuilder.add(s.stopDesc);
                    featureBuilder.add(s.gtfsStopId);
                    featureBuilder.add(s.agency.name);
                    SimpleFeature feature = featureBuilder.buildFeature(null);
                    collection.add(feature)
              }
            }
            else if(gisExport.type.equals(GisUploadType.ROUTES))
            {
View Full Code Here

                     
                      featureBuilder.add(r.routeUrl);
                      featureBuilder.add(r.routeColor);
                      featureBuilder.add(r.routeTextColor);
                      featureBuilder.add(r.agency.name);
                      SimpleFeature feature = featureBuilder.buildFeature(null);
                      collection.add(feature)
                  }
              }
            }
            else
View Full Code Here

                Geometry reprojectPoint = JTS.transform(point, transform);

                SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
                Object[] values = new Object[]{reprojectPoint, text, dateTimeString, String.valueOf(altim)};
                builder.addAll(values);
                SimpleFeature feature = builder.buildFeature(featureType.getTypeName() + "." + i++);
                newCollection.add(feature);
                pm.worked(1);
            }
        } finally {
            pm.done();
View Full Code Here

                MultiLineString multiLineString = gF.createMultiLineString(new LineString[]{reprojectLineString});

                SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
                Object[] values = new Object[]{multiLineString, startDate, endDate, log.text};
                builder.addAll(values);
                SimpleFeature feature = builder.buildFeature(featureType.getTypeName() + "." + index++);

                newCollection.add(feature);
                pm.worked(1);
            }
            pm.done();
View Full Code Here

                    Point reprojectPoint = (Point) JTS.transform(point, transform);
                    Object[] values = new Object[]{reprojectPoint, String.valueOf(gpsPoint.altim), gpsPoint.utctime};

                    SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
                    builder.addAll(values);
                    SimpleFeature feature = builder.buildFeature(featureType.getTypeName() + "." + index++);
                    newCollection.add(feature);
                }
                pm.worked(1);
            }
            pm.done();
View Full Code Here

                    String dateTime = dateString + timeString;
                    Object[] values = new Object[]{reprojectPoint, String.valueOf(altim), dateTime, azimuth, imageRelativePath};

                    SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
                    builder.addAll(values);
                    SimpleFeature feature = builder.buildFeature(null);
                    newCollection.add(feature);
                }
                pm.worked(1);
            }
View Full Code Here

                                    Coordinate coordinate = placesMap.get(name);
                                    MultiPoint point = gF.createMultiPoint(new Coordinate[]{coordinate});
                                    SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
                                    Object[] values = new Object[]{point, name};
                                    builder.addAll(values);
                                    SimpleFeature feature = builder.buildFeature(type.getTypeName() + "." + id);
                                    id++;
                                    newCollection.add(feature);
                                    pm.worked(1);
                                }
                                pm.done();
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.