postGIS导入shp出现字符问题解决方法


今天把一个shp导入postGIS时出现以下错误:

Unable to convert data value to UTF-8 (iconv reports "Illegal byte sequence"). Current encoding is "WINDOWS-1252". Try "LATIN1" (Western European), or one of the values described at http://www.postgresql.org/docs/current/static/multibyte.html.

明显是字符集问题,使用百度方式还是报错,后来想到一个笨方法(高手可以自己写个脚本实现自动处理),具体方法如下:

  • 使用excel工具打开.dbf文件,删除或者清除中文数据
  • 然后通过postGIS自带的工具导入(一定会成功的)
  • 如果是删除了字段,可以到数据库中创建该字段,并整体复制该field.

转载自:https://blog.csdn.net/YH20090580118/article/details/80249322

You may also like...