Package org.geotools.feature.simple

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()


            return;
        }
        builder.remove(defaultGeometry);
        builder.add(geom);
        builder.setDefaultGeometry(geom.getLocalName());
        dialog.setDefaultFeatureType(builder.buildFeatureType());
  }

    @SuppressWarnings("unchecked")
  private GeometryDescriptor findGeometryType(ISelection selection) {
View Full Code Here


        try {
            SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
            b.init(original);
            b.setName(transfomedName);
            return b.buildFeatureType();
        } catch (Exception e) {
            throw new DataSourceException("Could not build the renamed feature type.", e);
        }
    }
View Full Code Here

        tb.setName( "widgets" );
        tb.setSRS( "EPSG:4326");
        tb.add( "g", Point.class );
        tb.add( "name", String.class );
       
        ds.createSchema( tb.buildFeatureType() );
       
        FeatureWriter fw = ds.getFeatureWriterAppend( "widgets", Transaction.AUTO_COMMIT );
        fw.hasNext();
        SimpleFeature sf = (SimpleFeature) fw.next();
        sf.setAttribute("g", new GeometryFactory().createPoint( new Coordinate(1,1)));
View Full Code Here

       
        SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
        tb.setName( "widgetsNG" );
        tb.add( "name", String.class );
       
        ds.createSchema( tb.buildFeatureType() );
       
        FeatureWriter fw = ds.getFeatureWriterAppend( "widgetsNG", Transaction.AUTO_COMMIT );
        fw.hasNext();
        SimpleFeature sf = (SimpleFeature) fw.next();
        sf.setAttribute( "name", "one");
View Full Code Here

        SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder();
        ftb.setNamespaceURI(TEST_NAMESPACE);
        ftb.setName(name);
        ftb.add("name", String.class);
        ftb.add("geom", geometryType, wgs84);
        SimpleFeatureType featureType = ftb.buildFeatureType();
        dataStore.createSchema(featureType);

        return new MapLayerInfo(layerInfo);
    }
View Full Code Here

                        new Coordinate(200, 0), new Coordinate(0, 0) }), null);
       
        SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder();
        ftb.setName("test");
        ftb.add("geom", Geometry.class);
        SimpleFeatureType type = ftb.buildFeatureType();

        SimpleFeature f1 = SimpleFeatureBuilder.build(type, new Object[] { point }, null);
        SimpleFeature f2 = SimpleFeatureBuilder.build(type, new Object[] { line }, null);
        SimpleFeature f3 = SimpleFeatureBuilder.build(type, new Object[] { polygon }, null);
View Full Code Here

            }
           
            b.addattName, types[ i ] );
        }
       
        return b.buildFeatureType();
    }
   
    static String cdf ="http://www.opengis.net/cite/data" ;
    static String cgf ="http://www.opengis.net/cite/geometry";
   
View Full Code Here

        if(schema.getTypeName().contains(".")) {
          // having dots in the name prevents various programs to recognize the file as a shapefile
          SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
          tb.init(c.getSchema());
          tb.setName(c.getSchema().getTypeName().replace('.', '_'));
          SimpleFeatureType renamed = tb.buildFeatureType();
          c = new RetypingFeatureCollection(c, renamed);
        }

        FeatureStore<SimpleFeatureType, SimpleFeature> fstore = null;
        ShapefileDataStore dstore = null;
View Full Code Here

                        }
                    }
                }
            }
            tb.setName(fc.getSchema().getTypeName().replace('.', '_'));
            SimpleFeatureType renamed = tb.buildFeatureType();
            fc = new RetypingFeatureCollection(fc, renamed);
        }
       
        // create attribute name mappings, to be compatible
        // with shapefile constraints:
View Full Code Here

                    builder.add(d);
                }
            }
            builder.setName(original.getTypeName().replace('.', '_') + suffix);
            builder.setNamespaceURI(original.getName().getURI());
            SimpleFeatureType retyped = builder.buildFeatureType();
           
            // create the datastore for the current geom type
            DataStore dstore = buildStore(tempDir, charset, retyped);
           
            // cache it
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.