Package org.geotools.data.memory

Examples of org.geotools.data.memory.MemoryFeatureCollection


    protected void addFeature(int id, Date time, Double elevation, Date referenceTime, Double scanningAngle) throws IOException {
        FeatureTypeInfo timeElevationCustom = getCatalog().getFeatureTypeByName(
                TIME_ELEVATION_CUSTOM.getLocalPart());
        FeatureStore fs = (FeatureStore) timeElevationCustom.getFeatureSource(null, null);
        SimpleFeatureType type = (SimpleFeatureType)timeElevationCustom.getFeatureType();
        MemoryFeatureCollection coll = new MemoryFeatureCollection(type);
        StringBuffer content = new StringBuffer();
        content.append(id);
        content.append('|');
        content.append(time.toString());
        content.append('|');
        content.append(elevation);
        content.append('|');
        content.append(referenceTime.toString());
        content.append('|');
        content.append(scanningAngle);
       
        SimpleFeature f = DataUtilities.createFeature(type, content.toString());
        coll.add(f);
        org.geotools.data.Transaction tx = fs.getTransaction();
        fs.addFeatures(coll);
        tx.commit();
    }
View Full Code Here


    protected void addFeature(int id, Date time, Double elevation) throws IOException {
        FeatureTypeInfo timeWithStartEnd = getCatalog().getFeatureTypeByName(
                ELEVATION_WITH_START_END.getLocalPart());
        FeatureStore fs = (FeatureStore) timeWithStartEnd.getFeatureSource(null, null);
        SimpleFeatureType type = (SimpleFeatureType) timeWithStartEnd.getFeatureType();
        MemoryFeatureCollection coll = new MemoryFeatureCollection(type);
        StringBuffer content = new StringBuffer();
        content.append(id);
        content.append('|');
        content.append(time.toString());
        content.append("||");
        content.append(elevation);
        content.append('|');
       
        SimpleFeature f = DataUtilities.createFeature(type, content.toString());
        coll.add(f);
        org.geotools.data.Transaction tx = fs.getTransaction();
        fs.addFeatures(coll);
        tx.commit();
    }
View Full Code Here

    protected void addFeature(int id, Date time, Double elevation) throws IOException {
        FeatureTypeInfo timeWithStartEnd = getCatalog().getFeatureTypeByName(
                TIME_WITH_START_END.getLocalPart());
        FeatureStore fs = (FeatureStore) timeWithStartEnd.getFeatureSource(null, null);
        SimpleFeatureType type = (SimpleFeatureType) timeWithStartEnd.getFeatureType();
        MemoryFeatureCollection coll = new MemoryFeatureCollection(type);
        StringBuffer content = new StringBuffer();
        content.append(id);
        content.append('|');
        content.append(time.toString());
        content.append("||");
        content.append(elevation);
        content.append('|');
       
        SimpleFeature f = DataUtilities.createFeature(type, content.toString());
        coll.add(f);
        org.geotools.data.Transaction tx = fs.getTransaction();
        fs.addFeatures(coll);
        tx.commit();
    }
View Full Code Here

    private void addPointToMap(Point point) {
        //the type, schema = ( name:String, classification:Integer, height:Double, location:Point)
        SimpleFeatureType type = createPointFeatureType();

        MemoryFeatureCollection memoryFeatureCollection = new MemoryFeatureCollection(type);

        //create the builder
        SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);

        //add the values
        builder.add(point);
        //builder.add("City");

        //build the feature with provided ID
        SimpleFeature feature = builder.buildFeature(null);

        memoryFeatureCollection.add(feature);
        Style style = SLD.createPointStyle("Circle", Color.RED, Color.GREEN, 1, 10);

        Layer layer = new FeatureLayer(memoryFeatureCollection, style);
        map.addLayer(layer);
    }
View Full Code Here

TOP

Related Classes of org.geotools.data.memory.MemoryFeatureCollection

Copyright © 2018 www.massapicom. 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.