[R-sig-Geo] Help needed with spplot

Thomas Adams Thomas.Adams at noaa.gov
Sat Apr 17 23:05:03 CEST 2010


Dylan,

Thank you for the suggestion and it did help. But, I think another 
problem is the way spplot handles drawing off-screen. This does not seem 
to be handled well. Ultimately, I was able to find a generalized 
shapefile of the CONUS (48) states; this draws tolerably well. I 
conducted a few little experiments…

I think the moral of the story is to restrict the vector map to the area 
one is interested in and not to be sloppy. I'm still trying to grasp the 
subtleties of v.generalize…

Thanks again,
Tom

Dylan Beaudette wrote:
> On Tuesday 13 April 2010, Thomas Adams wrote:
>   
>> All:
>>
>> I'm using GRASS 6.4 with R 2.9.2 and sp/spgrass6. When plotting a vector
>> file, read in from GRASS, using spplot, the drawing takes many minutes
>> to complete. Apart from the fact that the vector file is probably more
>> detailed than I need, I know time is spent drawing off-screen. I tried
>> specifying xlim & ylim, but, of course, this just zooms into the area
>> I'm mapping, and does not solve my underlying problem.
>>
>> I also tried using pruneMap(), but this did not seem to make any
>> difference in the length of time before my R prompt returned. By
>> contrast, GRASS re-draws very fast, within a few seconds instead of ~5
>> minutes. I want to use spplot to draw an array of maps (21), so 1+ hours
>> will not work for what I am doing.
>>
>> Any thoughts how I might speed-up the process?
>>
>> Regards,
>> Tom
>>     
>
> Hi Tom,
>
> What kind of vector data are you plotting? Probably not points. If you are 
> working with very detailed lines or polygons, I would suggest simplifying 
> them in GRASS first. In GRASS 6.4, v.clean is the module of choice. If you 
> can get GRASS 6.5, then v.generalize will work even better. Note that you 
> need to work on boundaries with v.generalize, and too much "pruning" will 
> result in broken topology.
>
> I recently used an incantation like this:
> v.generalize in=ca_counties out=ca_counties_simple type=boundary  
> method=douglas_reduction threshold=1000
>
> ... to reduce the number of vertices in a map of CA counties, so that I could 
> plot it with spplot().
>
> Cheers,
> Dylan
>
>   


-- 
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:	thomas.adams at noaa.gov

VOICE:	937-383-0528
FAX:	937-383-0033



More information about the R-sig-Geo mailing list