[R] EXTENTS DO NOT OVERLAP

Jim Lemon jim at bitwrit.com.au
Sun Sep 28 05:17:47 CEST 2014


On Sat, 27 Sep 2014 02:10:36 PM Girija Kalyani wrote:
> WHEN I CHECK MY IMAGE AND SHAPE FILE IN ERDAS, IT IS 
OVERALYING.
> 
> BUT WHEN I WANTED TO OVERLAY IT IN R.
> 
> I GET THE FOLLOWING ERROR.
> 
> 
> Error in .local(x, y, ...) : extents do not overlap In addition: Warning
> message: In intersect(extent(x), extent(y)) : Objects do not overlap
> 
> 
> BUT RASTER EXTENTS SHOW UP IN METERS AND POLYGON IS IN 
LAT/LON
> 
> 
> THE FOLLOWING IS MY BOUNDING BOX RANGE
> 
> > bbox(raster)       min     max
> 
> s1  571045 1006045
> s2 3405030 3788030> bbox(map)      min     max
> x 3663120 3875470
> y 4845817 5013605
> 
> 
>  THE FOLLOWING ARE MY PROJECTIONS
> 
> > proj4string(map)[1] "+proj=lcc +lat_1=35.17280444444445 
+lat_2=12.472955
> > +lat_0=24 +lon_0=80 +x_0=4000000 +y_0=4000000 
+datum=WGS84 +units=m
> > +no_defs +ellps=WGS84 +towgs84=0,0,0"> proj4string(raster)
[1] "+proj=utm
> > +zone=43 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m 
+no_defs"
> 	[[alternative HTML version deleted]]
> 
Hi Girija,
Try this and you will see what is happening:

plot(0,xlim=c(57000,3900000),
 ylim=c(3410000,5020000),type="n",
 main="The case of the non-overlapping rectangles")
rect(571045,3405030,1006045,3788030,col="green")
rect(3663120,4845817,3875470,5013605,col="blue")

Jim



More information about the R-help mailing list