[R-br] Não consigo ler shapefile

Emerson Cotta Bodevan bodevan.ec em gmail.com
Sexta Setembro 28 14:52:14 BRT 2012


Prezado Alexandro,

seguindo sua sugestão ocorreu o seguinte, com os dois arquivos que tenho:

> library(maptools)
> mg<-readShapePoly(file.choose())
Enter file name: 31DSE250GC_SIR
Shapefile type: PolygonM (25), # of Shapes: 1633

Erro em read.shape(filen = fn, verbose = verbose, repair = repair) :
  Shapefile type not (yet) handled by this function

> mg<-readShapePoly(file.choose())
Enter file name: 31MUE250GC_SIR
Shapefile type: PolygonM (25), # of Shapes: 853

Erro em read.shape(filen = fn, verbose = verbose, repair = repair) :
  Shapefile type not (yet) handled by this function

Sabe como resolver?

Prezado Jackson,

seguindo sua sugestão, utilizando o rgal, consegui ler os dois arquivos,
mas você sabe o que significa esta mensagem de aviso perdida?

> mg <- readOGR(".", "31DSE250GC_SIR")
OGR data source with driver: ESRI Shapefile
Source: ".", layer: "31DSE250GC_SIR"
with 1633 features and 3 fields
Feature type: wkbPolygon with 3 dimensions
Mensagens de aviso perdidas:
In readOGR(".", "31DSE250GC_SIR") : Z-dimension discarded
> names(mg)
[1] "ID"         "CD_GEOCODD" "NM_DISTRIT"

> mg1 <- readOGR(".", "31MUE250GC_SIR")
OGR data source with driver: ESRI Shapefile
Source: ".", layer: "31MUE250GC_SIR"
with 853 features and 3 fields
Feature type: wkbPolygon with 3 dimensions
Mensagens de aviso perdidas:
In readOGR(".", "31MUE250GC_SIR") : Z-dimension discarded

Agradeço antecipadamente a ajuda.

Att.,
Emerson.

Em 27 de setembro de 2012 19:32, Jakson Alves de Aquino
<jalvesaq em gmail.com>escreveu:

> 2012/9/26 Emerson Cotta Bodevan <bodevan.ec em gmail.com>:
> > Primeiramente, uso o UBUNTU e o EMACS.
> >
> > Estou tentando ler um shapefile que baixei do site do IBGE. São dois
> > arquivos:
> >
> > 31mu2500gsd.shp e 31mu2500gsr.shp
> >
> > Instalei o pacote maptools e não consegui instalar o rgeos (dúvida
> enviada
> > para a lista em outro e-mail)
> >
> > ao digitar o comando:
> >
> > mg<-readShapePoly("31mu2500gsr.shp") ou
> > mg<-readShapePoly("31mu2500gsd.shp")
> >
> > Aparece a mensagem
> >
> >  mg<-readShapePoly("31mu2500gsd.shp")
> > Erro em make.names(onames, unique = TRUE) : string multibyte inválida 5
> >
> >  mg<-readShapePoly("31mu2500gsr.shp")
> > Erro em make.names(onames, unique = TRUE) : string multibyte inválida 5
>
> O pacote rgdal também tem uma função para ler shapefile. Talvez funcione:
>
> library(rgdal)
> mg <- readOGR(".", "31mu2500gsr")
> _______________________________________________
> R-br mailing list
> R-br em listas.c3sl.ufpr.br
> https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
> Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça
> código mínimo reproduzível.
>
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20120928/93175c36/attachment.html>


Mais detalhes sobre a lista de discussão R-br