当前位置: 首页>>代码示例>>Java>>正文


Java SimpleFeatureBuilder.copy方法代码示例

本文整理汇总了Java中org.geotools.feature.simple.SimpleFeatureBuilder.copy方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleFeatureBuilder.copy方法的具体用法?Java SimpleFeatureBuilder.copy怎么用?Java SimpleFeatureBuilder.copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.geotools.feature.simple.SimpleFeatureBuilder的用法示例。


在下文中一共展示了SimpleFeatureBuilder.copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: feature2Dxf

import org.geotools.feature.simple.SimpleFeatureBuilder; //导入方法依赖的package包/类
/**
 * Write a {@link SimpleFeature} to dxf string.
 * 
 * @param featureMate the feature to convert.
 * @param layerName the layer name in case none is in the attributes.
 * @param elevationAttrName the attribute defining elevation or <code>null</code>.
 * @param suffix <code>true</code> if suffix is needed.
 * @param force2CoordsToLine if <code>true</code>, lines that are composed of just 2 coordinates
 *                      will be handled as LINE instead of the default which is POLYLINE.
 * @return the string representation.
 */
public static String feature2Dxf( FeatureMate featureMate, String layerName, String elevationAttrName, boolean suffix,
        boolean force2CoordsToLine ) {
    Geometry g = featureMate.getGeometry();

    if (EGeometryType.isPoint(g)) {
        return point2Dxf(featureMate, layerName, elevationAttrName);
    } else if (EGeometryType.isLine(g)) {
        return lineString2Dxf(featureMate, layerName, elevationAttrName, force2CoordsToLine);
    } else if (EGeometryType.isPolygon(g)) {
        return polygon2Dxf(featureMate, layerName, elevationAttrName, suffix);
    } else if (g instanceof GeometryCollection) {
        StringBuilder sb = new StringBuilder();
        for( int i = 0; i < g.getNumGeometries(); i++ ) {
            SimpleFeature ff = SimpleFeatureBuilder.copy(featureMate.getFeature());
            ff.setDefaultGeometry(g.getGeometryN(i));
            FeatureMate fm = new FeatureMate(ff);
            sb.append(feature2Dxf(fm, layerName, elevationAttrName, suffix, force2CoordsToLine));
        }
        return sb.toString();
    } else {
        return null;
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:35,代码来源:DxfUtils.java

示例2: cloneFeatureCollection

import org.geotools.feature.simple.SimpleFeatureBuilder; //导入方法依赖的package包/类
public static FeatureCollection cloneFeatureCollection(FeatureCollection collection) throws IllegalAttributeException{
		FeatureCollection clonedFeatureCollection  = new TempFeatureCollection(collection.getID(), (SimpleFeatureType) collection.getSchema());
		//clonedFeatureCollection.setDefaultGeometry(collection.getDefaultGeometry());
        Iterator iter = collection.iterator();
        while(iter.hasNext()) {
        	SimpleFeature defaultFeature = (SimpleFeature) iter.next();
        	SimpleFeature clonedFeature = SimpleFeatureBuilder.copy(defaultFeature);
;
        	clonedFeatureCollection.add(clonedFeature);
      
       }
        return clonedFeatureCollection;
	}
 
开发者ID:52North,项目名称:uDig-WPS-plugin,代码行数:14,代码来源:UdigHelper.java


注:本文中的org.geotools.feature.simple.SimpleFeatureBuilder.copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。