geotools创建线文件

来源:互联网 发布:生产流程管理优化论文 编辑:程序博客网 时间:2024/05/24 07:44
final SimpleFeatureType TYPE = DataUtilities.createType("Location",                  "location:LineString," + // <- the geometry attribute: Point type                  "POIID:String," + // <- a String attribute                  "MESHID:String," + // a number attribute                  "OWNER:String"              );


 Coordinate[] pp = new Coordinate[] {new Coordinate(longitude, latitude),new Coordinate(116.222, 39.220001)};LineString lineStr = geometryFactory.createLineString(pp);                Object[] obj = {lineStr, POIID, MESHID, OWNER};              SimpleFeature feature = featureBuilder.buildFeature(null, obj);              collection.add(feature);              feature = featureBuilder.buildFeature(null, obj);              collection.add(feature);              File newFile = new File("D:/newPoi.shp"); 


0 0
原创粉丝点击