[R-sig-Geo] Problems With Cartography - Help

Andrés Peralta tirico85 at gmail.com
Wed May 10 10:17:42 CEST 2017


Hi to everyone,

I`m working with the second administrative level cartography from Ecuador
(available in:
http://www.ecuadorencifras.gob.ec//documentos/web-inec/Cartografia/2015/Clasificador_Geografico/2012/SHP.zip).
The shape file is called nxcantones.shp. I`ve been having a lot of problems
opening and working with this cartography in R; but i can open it in Q-GIS
and ARCGIS without any problem (I have opened it in both programs and saved
it again). As the cartography has various objects with the same ID -
aparently the same areas but repeated; we had to run the following sintax
in order to have one ID in each area:

*carto2012 <- readOGR("CANTONES2012/2012CLEAN.shp", "2012CLEAN",
stringsAsFactors=F) *
*proj4string(carto2012) <- CRS("+proj=utm +zone=17 +south +datum=WGS84
+units=m +no_defs")*

*carto2012x <- unionSpatialPolygons(carto2012, IDs=carto2012$DPA_CANTON)*
*proj4string(carto2012x) <- CRS("+proj=utm +zone=17 +south +datum=WGS84
+units=m +no_defs")*


*datos <- data.frame(ID=row.names(carto2012x), stringsAsFactors = F)*
*row.names(datos) <- row.names(carto2012x)*
*carto2012x2 <- SpatialPolygonsDataFrame(carto2012x, data=datos)*

*carto2012 <- carto2012x2 *

Either using the original (nxcantones) or the modified cartography
(carto2012), I can plot the map in R, but I can´t plot it in R Leaflet. It
just opens the base map. I seems as the projection is lost in the way or
that the cartography has a problem.

Any ideas?

-- 

*             Andrés Peralta*
        Pre-doctoral Researcher
     GREDS/EMCONET / ASPB
<https://www.upf.edu/greds-emconet/en/>   <http://aspb.cat/>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list