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

Adrian Dușa dusa.adrian at unibuc.ro
Thu Oct 31 18:18:47 CET 2013


Apologies for a second message, the previous one did not make it to the
list (the attachement exceeded 50KB).
Hopefully, this time will make it.

----
Thanks very much for these hints.
What I would <really> want to achieve is a sort of a spline contour.

In the mean time, I've played with QGIS (and mapshaper.org), both of
them make a good job to simplify the Shape file, but the number of
vertices is still too high for a webpage (my intention is to simply
make an interactive map with coloured polygons function of some social
indicators). The geographical information is of a little interest
here, but very important are:
- visual appeal
- size of the map, given that it's included in a webpage (a small SVG
definition is perfect)

>From QGIS, I've exported a SVG file and at a first impression it has
way too many details. A "smooth" contour would be ideal, something
like in the attached print screen (not sure if it will go through the
r-sig-geo archive, though).

Will play with rgeos::gSimplify and GRASS, if this would be achievable.

Best wishes, thanks again,
Adrian


On Wed, Oct 30, 2013 at 11:42 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:

> 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<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
>



-- 
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
Tel.:+40 21 3126618 \
        +40 21 3120210 / int.101
Fax: +40 21 3158391
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131031/1a077cf2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smooth spline.png
Type: image/png
Size: 20481 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20131031/1a077cf2/attachment.png>


More information about the R-sig-Geo mailing list