[R-br] Não consigo ler shapefile

Pedro Rafael pedro.rafael.marinho em gmail.com
Sexta Setembro 28 17:30:47 BRT 2012


Tenta rodar antes de tudo a função Sys.setlocale("LC_ALL", "C"). Ver
se funciona e retorne se deu ou não certo.
[   ],
Pedro Rafael Diniz Marinho.


Em 28 de setembro de 2012 14:52, Emerson Cotta Bodevan-2 [via R-br]
<ml-node+s2285057n4656366h23 em n4.nabble.com> escreveu:
> 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 <[hidden email]>
> escreveu:
>
>> 2012/9/26 Emerson Cotta Bodevan <[hidden email]>:
>> > 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
>> [hidden email]
>> 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.
>
>
>
> _______________________________________________
> R-br mailing list
> [hidden email]
> 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.
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://r-br.2285057.n4.nabble.com/R-br-Nao-consigo-ler-shapefile-tp4656331p4656366.html
> To unsubscribe from R-br, click here.
> NAML


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