[R-sig-Geo] simplify map for web use

Roger Bivand Roger.Bivand at nhh.no
Wed Oct 30 22:42:13 CET 2013


On Wed, 30 Oct 2013, Alex Mandel wrote:

> On 10/30/2013 01:59 PM, Adrian Dușa wrote:
>> Dear All,
>> 
>> A question from a very beginner with maps and geographic data.
>> I have a map with many (too many) vertices which I would like to use
>> interactively over a web page. What I need is to simplify that map,
>> make it <similar> to the original one but discarding 90% of the
>> current information.
>> 
>> I read that is possible using QGIS (which I have installed), but I
>> wonder if it would be possible in R. I would gladly use an R function
>> instead of learning how to use QGIS.
>> 
>> Thanks in advance,
>> Adrian
>> 
>
> Not an R method but way easy, http://www.mapshaper.org/
>

but no documentation anywhere, not on github either, but you get what you 
might expect, maybe?

> A quick search shows several R packages that also have the
> Douglas-Peucker algorithm. Look at 'shapefiles' or 'cshapes' packages

The obvious choice is rgeos::gSimplify, unless you need to preserve 
topology accurately (which mapshaper doesn't do either) - GEOS will have 
shared nodes, but not all on an arc will be shared. If you need simplified 
arcs, use GRASS from R.

Hope this helps,

Roger

>
> Enjoy,
> Alex
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the R-sig-Geo mailing list