r - 如何读取 R 中的 Mapinfo 文件

标签 r mapinfo

法国国家研究所 (Insee) 提供 MapInfo 格式的地理数据(两个文件 .mid 和 .mif 以及一个 dbf 文件)。如何在 R 中读取这些文件?

这是一个 example .

最佳答案

MapInfo 文件有一个 OGR 驱动程序(包 rgdal):

R> library("rgdal")
R> ogrDrivers()[28, ]
           name write
28 MapInfo File  TRUE

但是你的文件/几何有问题,readOGR给出错误信息:
R> ogrListLayers("R02_rfl09_UTM20N1000.mid")
[1] "R02_rfl09_UTM20N1000"

R> readOGR("R02_rfl09_UTM20N1000.mid", layer="R02_rfl09_UTM20N1000")
OGR data source with driver: MapInfo File 
Source: "R02_rfl09_UTM20N1000.mid", layer: "R02_rfl09_UTM20N1000"
with 967 features and 4 fields
Feature type: wkbPolygon with 2 dimensions
Error in stopifnot(is.list(srl)) : ring not closed

但是,我能够使用 GRASS GIS 读取文件。 ,可以从 R 编写脚本(包 spgrass6):
v.in.ogr dsn=R02_rfl09_UTM20N1000.mid output=R02_rfl09_UTM20N1000 snap=1e-08

GRASS screenshot

关于r - 如何读取 R 中的 Mapinfo 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20101083/

相关文章:

c# - 如何从调用应用程序获取实例

r - ggplot2 跨组中的嵌套方面

r - 矩阵和向量形式的数据点数量

gis - 有人知道一个好的mapinfo论坛吗?

c# - 如何通过 .NET 使用外部数据(XML、SQL Server)创建 MapInfo 选项卡文件

delphi - 如何区分 mitab 读取的 MapInfo 文件中的折线和曲线?

r - 如何从 R 统计程序中完全删除 renv

删除 R 图形设备中的所有边距

r - 无法在 R 中安装插入符包