[R-sig-Geo] problems loading spproj library for transform()
Edzer J. Pebesma
e.pebesma at geo.uu.nl
Mon May 29 10:41:09 CEST 2006
Roger Bivand wrote:
> On Thu, 25 May 2006 karl.sommer at dpi.vic.gov.au wrote:
>
>
>> thanks for the prompt reply
>>
>> the method spTransform() worked
>>
>> I now have an attribute file of class SpatiaPointsDataFrame with EM38
>> readings. I also have a separate shape file of class
>> SpatialPolygonsDataFrame which I imported form an ESRI shape file using the
>> readOGR() method of rgdal. I would like to superpose the two files in a
>> plot but so far have not been successful in lining them up satisfactorily.
>> I am not sure if the misalignement is due to my misguided plotting method
>>
>> p1 <- spplot(x, c("var")) #attribute data
>> p2 <- spplot (x2) # shapefile
>>
>> print(p1, split = c(1,1,1,1), more = TRUE)
>> print(p2, split = c(1,1,1,1), more = FALSE)
>>
>
> Th spplot() methods use lattice graphics, so I am not confident that you
> can validly overplot. Can you try first with base graphics, possibly using
> xlim= and ylim= to zoom in and locator() to check coordinates?
>
>
I can confirm that you cannot validly overplot using the print() method
for trellis objects (as you do): axes tics, axes labels, titles, everything
plays a role in determining the size before gets done.
Alternatively to base plot, you could try to use the sp.layout argument
to spplot, which is exactly designed to plot more than one "thing" in
a single map. See examples on the r-spatial.sourceforge.net gallery.
Bests,
--
Edzer
More information about the R-sig-Geo
mailing list