使用geotools和jts进行GIS数据生成

使用geotools和jts进行GIS数据生成

1,添加maven依赖,如下

		
		    org.geotools
		    gt-geojson
		    17.2
		
		
		
		    org.geotools
		    gt-data
		    17.2
		
				
		
		
		    com.vividsolutions
		    jts
		    1.13
		

2,You can create new features and add them to this FeatureCollection as needed:

SimpleFeatureType TYPE = DataUtilities.createType("location","geom:Point,name:String");

DefaultFeatureCollection featureCollection = new DefaultFeatureCollection("internal",TYPE);
WKTReader2 wkt = new WKTReader2();

featureCollection.add( SimpleFeatureBuilder.build( TYPE, new Object[]{ wkt.read("POINT(1,2)"), "name1"}, null) );
featureCollection.add( SimpleFeatureBuilder.build( TYPE, new Object[]{ wkt.read("POINT(4,4)"), "name2"}, null) );

你可能感兴趣的:(GIS)