备忘 :Shapefile 属性表中的中文显示乱码如何处理 问题:shapefile 的属性表中,中文字符显示为乱码。 原因:字符编码方式不匹配。系统解读的编码方式和文件实际存储的编码方式不匹配,无法正常显示。“ Before ArcGIS 10.2.1, shapefiles were encoded in the languagelocale of the system on which the shapefile was created. As of version 10.2.1,shapefiles are always encoded in UTF-8, which presents a problem on systemsthat use languages with multibyte character encodings, such as Chinese,Japanese or Russian. ” 解决: 1 、打补丁,参考esri 的文档下载补丁,目前只有10.2.1 和10.2.2 的补丁。原理是修改注册表,更改编码方式。更高版本似乎没有补丁。 2 、手动修改注册表,更改默认编码方式;所有的文件以后都以相同的指定默认编码方式打开。自己修改注册表,又一定风险。 3 、为特定shapefile 指定编码方式,创建一个与*shp 同名的*.cpg 文件用于存储编码方式信息,用记事本编辑,写入需要使用的编码方式,如OEM ,UTF-8 ,……。好处在于可以针对不同的中文编码方式。 参考资料: a 、http://www.faceye.net/search/101949.html b 、http://support.esri.com/en/knowledgebase/techarticles/detail/21106
Sometimes, one shapefile, supported by Esri, displayed in ArcMap as follow, look at the red line, linear Unit is METER. And, If you want to read this shapefile to IDL/Matlab, in general, it does not work well with specific functions/routines. Due to its X/Y Coorfinate of entities’vertices, they are in Geodetic Coordinate Style, namely, every vertex coordinate value is not longitude/latitude, look at below in IDL/Matlab, See above two figures, imagine that these values can’t deliver coordinates correctly. And the result is not what you expect. Let me show it in the tool developed by David W. Fanning. How to convert Geodetic Coordinate to Geographic Coordinate properly? Method1, you can change display unit in ArcMap without convertion. Start ArcMap, add your shapefile. On the table of contents, right click “Layers”. Choose “Properties” form the menu. On the “Data Frame Properties”dialog, choose “General” Tab, look at the “Units” area, “Map: Meters” indicates the source map’s unit, shouldn’t be changed at present. Next, “Display: Meters”indicates the ArcMap Window’s unit, one can change to another, set this as below, Method2, convert to Geographic Coordinate. Start ArcMap, add another shapefile, which qualifies the geographic coordinate you want convert to. Look at the red line below, Add the shapefile you want to convert. On the table of contents, right click the shapefile’s name, choose “Data—Export Data” from the menu. On the Export Data dialog, attention,choose “the data frame”, and set the output location, that’s all. Let me see the result below. Acknowledgements This work was supported by SHAWNQIAO, KAYSNOWIVY, they both sent their solutions to me by Email. Special thanks to them, and appreciate their contributions and look forward to continued collaboration.