我的github

由于粗心在建立了shpdatastore创建之后,没有关闭,导致了上述的错误。

//shp文件的读取
ShapefileDataStore shpDataStore = null;
File shpfile = new File(shppath);
shpDataStore = new ShapefileDataStore(shpfile.toURI().toURL());

在将shpdatastore关闭之后,问题就没有了

itertor.close();
shpDataStore.dispose();//使用之后必须关掉
shpfile.exists();
indexWriter.close();//提交索引到磁盘上的索引库,关闭索引器

参考: https://wap.sciencenet.cn/home.php?mod=space&uid=3134052&do=blog&id=1081104

posted on 2022-06-23 19:06  XiaoNiuFeiTian  阅读(847)  评论(0编辑  收藏  举报