Package org.geotools.feature

Examples of org.geotools.feature.FeatureTypeBuilder


    }
   
    private FeatureType superFeatureType(FeatureType oldType) {
        FeatureType featureType = null;
        try {
            FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(oldType.getTypeName());
            typeBuilder.setNamespace(oldType.getNamespace());

            //typeBuilder.setDefaultGeometry(oldType.getDefaultGeometry());
            for (int i = 0; i < oldType.getAttributeCount(); i++) {
                //if (oldType.getAttributeType(i).equals(oldType.getDefaultGeometry())) continue;
                typeBuilder.addType(oldType.getAttributeType(i));
            }
            typeBuilder.addType(new NumericAttributeType("nearest_distance", Double.class, false, 0, 999, null, null));       
            typeBuilder.addType(new NumericAttributeType("nearest_bearing", Double.class, false, 0, 999, null, null));       

            featureType = typeBuilder.getFeatureType();
        } catch (Exception e) {
            LOGGER.severe("Error createing super feature type: " + e); e.printStackTrace();
        }
        return featureType;
    }
View Full Code Here

TOP

Related Classes of org.geotools.feature.FeatureTypeBuilder

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.