使用geotools中的gt2-shapefile-2.4-RC0.jar這個(gè)包對(duì)shp格式的文件進(jìn)行屬性讀取。不知道為什么會(huì)遇到這么一個(gè)錯(cuò)誤:
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的時(shí)候沒有這個(gè)錯(cuò)誤,只是因?yàn)?.3在讀取中文的時(shí)候存在編碼問題,需要修改geotools的源碼,結(jié)果發(fā)現(xiàn)2.4已經(jīng)可以支持使用shpDataStore.setStringCharset(Charset.forName("UTF-8"));的方法了,所以就更新了一把。。誰知道居然成了這樣的效果。繼續(xù)排查ing
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的時(shí)候沒有這個(gè)錯(cuò)誤,只是因?yàn)?.3在讀取中文的時(shí)候存在編碼問題,需要修改geotools的源碼,結(jié)果發(fā)現(xiàn)2.4已經(jīng)可以支持使用shpDataStore.setStringCharset(Charset.forName("UTF-8"));的方法了,所以就更新了一把。。誰知道居然成了這樣的效果。繼續(xù)排查ing