Antonio
Antonio

Reputation: 1111

Problems viewing shapefile in R

I'm having problems with viewing a shapefile and would like your help with this. In this file (https://encurtador.com.br/ivKS2) is the Brazilian pipeline, but I would like to check how I can view this from R. The file is in zip format.

I did as follows:

library(rgdal)
library(sf)

temp <- tempfile()
temp2 <- tempfile()
download.file("https://encurtador.com.br/ivKS2",temp)
unzip(zipfile = temp, exdir = temp2)
shp <- sf::read_sf(temp2)

But it's going wrong.

Other link to test:

https://github.com/JovaniSouza/JovaniSouza5/blob/ac61a729b3856112bcb100f4dfb2c900565fdb54/gasoduto1.zip

Upvotes: 0

Views: 61

Answers (1)

Wencheng Lau-Medrano
Wencheng Lau-Medrano

Reputation: 753

I could read and plot your directory by using:

require(sp)
require(rgdal)

gasoducto <- readOGR(dsn = "gasoduto/gasoduto_SIRGAS_2000.shp", 
                     layer = "gasoduto_SIRGAS_2000")

plot(gasoducto)

axis(side = 1)
axis(side = 2)

Upvotes: 1

Related Questions