在上一篇我们已经建立了一个空的shp文件,接着我们为这个空文件装入数据,这个功能主要用到SimplefeatureStore.addFeatures()这个方法,传入的属性是Transaction transaction = new DefaultTransaction(null),这里的null是可以设置string类型的值的,这个值有什么影响还不清楚,求助大神!
以下是装载数据的代码:
File SHPfilepath=new File("E:\\workspace");
File SHPfile = JFileDataStoreChooser.showOpenFile("shp", SHPfilepath, null);
if (SHPfile == null)
{
return;
}
FileDataStore store = FileDataStoreFinder.getDataStore(SHPfile);
String typeName = store.getTypeNames()[0];
JOptionPane.showMessageDialog(nu