[R-sig-Geo] Overlaying maps

Raphael Saldanha saldanha.plangeo at gmail.com
Wed Apr 25 16:26:45 CEST 2012


Hi Cyrille,

This can be something linked to the projection of your files. All
geographical data have a projection, and, for a correct overlaying,
the projection should be informed to the software (ArcView, ArcGIS, R,
etc), and will be better if all the data have the same projection. Can
you inform us the projection of your files?

On Wed, Apr 25, 2012 at 11:05 AM, mas.cyrille2 <mas.cyrille2 at wanadoo.fr> wrote:
>
>
> Dear all,
>
>
>
> I am a botanist and I need some assistance for overlaying maps under R. I have an altimetric file for Madagascar in .gri. This file come from http://www.diva-gis.org/gdata (and the original data seem to have been edited by CGIAR STRM). I realize a plot of this file and I’m overlaying an Arview file (bioclimate 5) in .shp (polygon) but I don’t know his specific features. Finally I’m overlaying my sheet herbarium geographical localities points. My final map don’t have any problems in a global points of view (figure 1). Problems come when 1) I would a more detailed part of this final map or 2) I wish to modify the size of the final plot (figure 2). For the detailed plot : the files are not correctly superposed and numerous pixels of the .gri file are outside of the limits of the polygons of the .shp file. For the modified size of the final plot : the .gri file not change his conformation but the .shp file and the distance between my sheet herbarium geographical localities points are proportionally modified with the draw of the plot. Is it a problem with the geographical projections ? Who know how to do have a good overlaying between .gri file and .shp file for the removal of my problems ?
>
>
>
> As an advance, thank you for your responses,
>
>
>
> Cyrille MAS
>
>
>
>
>
>
>
> My code is :
>
>
>
> # display the bioclimate 5 file
>
> library(maptools)
>
> SHP="E:/Bioclimate 5/bc5.shp"
>
> bc5
>
> plot(bc5,xlim=c(44,50),ylim=c(-26,-12),cex.axis=0.6,cex.names=0.6,axis.lty=0,xlab="Longitude",
>
> ylab="Latitude",axes=TRUE,border="black",col="white")
>
>
>
> # display the altimetric file
>
> require(raster)
>
> alt
>
> str(alt)
>
> plot(alt,cex.axis=0.6,cex.names=0.6,axis.lty=0,xlab="Longitude (en °E)",ylab="Latitude (en °S)",axes=TRUE)
>
>
>
> # overlaying the bioclimate 5 file upon the altimetric file
>
> plot(bc5,add=TRUE)
>
>
>
> # apply of my sheet herbarium geographical localities data
>
> library(dismo)
>
> data
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



--
Atenciosamente,

Raphael Saldanha
saldanha.plangeo at gmail.com



More information about the R-sig-Geo mailing list