使用GeoTools讀取ShapeFile文件,測試版本為geotools-16.1。 所需jar包有
測試類如下。
package com.test;import org.geotools.data.simple.SimpleFeatureCollection;import org.geotools.data.simple.SimpleFeatureIterator;import org.opengis.feature.simple.SimpleFeature;import com.tongtu.mobile.cuanalysis.utils.ShapeFileUtils;import com.vividsolutions.jts.geom.Geometry;public class ShapeFileTest { public static void main(String[] args) throws Exception{ SimpleFeatureCollection sfc = ShapeFileUtils.ReadShapeFileFeatures("D://z工具類持續完善中…… 參考資料:http://www.cnblogs.com/cugwx/p/3719195.html新聞熱點
疑難解答