使用geotools中的gt2-shapefile-2.4-RC0.jar這個包對shp格式的文件進行屬性讀取。不知道為什么會遇到這么一個錯誤:
Exception in thread "main" java.net.MalformedURLException: no protocol: shp/res1_4m.dbf
?at java.net.URL.<init>(Unknown Source)
?at java.net.URL.<init>(Unknown Source)
?at java.net.URL.<init>(Unknown Source)
?at com.geotools.readshp.ReadSHP.main(ReadSHP.java:35)
早上用2.3的時候沒有這個錯誤,只是因為2.3在讀取中文的時候存在編碼問題,需要修改geotools的源碼,結果發(fā)現2.4已經可以支持使用shpDataStore.setStringCharset(Charset.forName("UTF-8"));的方法了,所以就更新了一把。。誰知道居然成了這樣的效果。繼續(xù)排查ing