2014-09-19 79 views

回答

1

使用下面的代碼創建一個POINT,然後創建一個FeatureCollection然後shape文件:

SimpleFeatureCollection collection = FeatureCollections.newCollection(); 
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); 
SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE); 
Point point = geometryFactory.createPoint(new Coordinate(longitude, latitude)); 
featureBuilder.add(point); 
SimpleFeature feature = featureBuilder.buildFeature(null); 
collection.add(feature); 

閱讀geoTools feature tutorial以獲取更多信息。

相關問題