Skip to content

Instantly share code, notes, and snippets.

@Robinlovelace
Last active November 15, 2017 03:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Robinlovelace/29d387f6b48fd9bf9d2d to your computer and use it in GitHub Desktop.
Save Robinlovelace/29d387f6b48fd9bf9d2d to your computer and use it in GitHub Desktop.
Loading MapInfo .mid files with R
# Loading MapInfo .mid files
library(rgdal) # rgdal library
drvs <- ogrDrivers() # ogr capabilities
drvs[grep("Inf", drvs$name),] # test MapInfo reading capability of gdal
f <- "folder/filename.mid" # filename
l <- ogrListLayers(f) # layer name
sp_object <- readOGR(f, layer = l[[1]]) # load!
@Robinlovelace
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment