How to solve problem with reading a shapefile in R

Antonio

How do I show a map that is in shapefile format that is in a zip file. The file is this:

https://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2015/UFs/PR/pr_municipios.zip

I tried to do the following:

library(rgdal)

temp <- tempfile()
download.file("https://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2015/UFs/PR/pr_municipios.zip",temp)
data <- readOGR(unz(temp, "41MUE250GC_SIR.shp"))

But it did not work.

The map will look like the one below:

enter image description here

Lucca Nielsen

Try this

library(rgdal)

temp <- tempfile()
temp2 <- tempfile()
download.file("https://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2015/UFs/PR/pr_municipios.zip",temp)

unzip(zipfile = temp, exdir = temp2)
shp <- readOGR(temp2)

plot(shp)

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I solve this stream reading problem?

How to solve this unicode problem in reading text file?

How to solve problem when reading from a file in c++

How to solve problem during reading of a json file in Python?

error reading shapefile in R that works fine in QGIS

R: How to solve the following linear programming problem

How to solve personal library problem in r

How to solve simple optimization problem in R

How to solve R linear regression graph problem?

How to solve this problem: filter, grep in R?

How to solve this problem in DataGridView?

How to solve the problem for stackNavigator

How to construct & solve a linear programming problem using lpsolve in r?

How can I solve easy linear equations with minimization problem in R?

Problem while computing class = case_when in R, how to solve it?

How can I solve the NA problem in AUC calculation with if statement in R?

How to fix data reading and table formatting problem with web scrapin in R

R Shiny, how to display a shapefile (map) in a tab?

How to limit boundaries when plotting a shapefile in R

How to use CAST package for a shapefile (polygons) in R?

Problem of reading numbers as factors in reading files in R

How to solve this java problem efficiently

How to solve a problem with a DocblockTypeContradiction in Psalm

How to solve problem with the items in a list

How to solve problem with a for loop in python?

How to solve Problem with Multiprocessing in Tkinter?

How to solve "compare to undefined" problem?

How to solve a KeyError problem in Pandas

How to solve this problem with my navbar?