[R-sig-Geo] Help with gpclib
Roger Bivand
Roger.Bivand at nhh.no
Thu Jul 19 16:26:04 CEST 2012
On Thu, 19 Jul 2012, hadley wickham wrote:
>> The chief problem is the totally unnecessary use of gpclib in fortify() in
>> ggplot2. gpclib should never, ever be used, as its licence only permits
>> hobby use to learn about polygon clipping - imposed against the author's
>> will by his former university. The rgeos package provides all functionality
>> provided by gpclib except breaking polygons into component triangles, which
>> is not relevant here. Specifically, ggplot2/R/fortify-spatial.R says (l.
>> 33-5):
>>
>> # Union together all polygons that make up a region
>> try_require(c("gpclib", "maptools"))
>> unioned <- unionSpatialPolygons(cp, invert(polys))
>
> That code is out of date. The current code is
> https://github.com/hadley/ggplot2/blob/master/R/fortify-spatial.r
The released code is as quoted, which is what users see. I think github
does not provide automatic check, build, and binary build of development
versions of packages (like R-forge). So users cannot install from github
without checking out the source code?
>
> That only uses try_require("maptools") (and only if you use a
> non-default grouping). As far as I know, that should automatically
> pick between gpclib and rgeos depending on which is installed.
>
Exactly. This will only fail if non-default grouping is requested and
neither gpclib nor rgeos are available.
> Despite the license for gpclib making it only suitable for
> "hobbyists", it is much easier to install than rgeos, which requires
> an external install.
Not "much easier", for all Windows and OSX users installing CRAN binary
packages, there is now, thanks to Brian Ripley, Uwe Ligges, and Simon
Urbanek, no difference at all. GEOS is available as a binary install for
most popular Linux versions, from there a source install of rgeos is no
harder than other source packages with external dependencies (like XML).
The gpclib licence is rather perverse (and the link on the CRAN package
page dead, the href includes a semicolon):
http://www.cs.man.ac.uk/~toby/gpc/
"GPC Licensing
GPC is free for downloading and time-unlimited evaluation by anyone.
Non-commercial use of GPC (for example: private / hobbyist / education)
GPC is free for non-commercial use only.
We invite non-commercial users to make a voluntary donation towards the
upkeep of GPC.
Commercial use of GPC (for example: product development / commercial
research)
If you wish to use GPC in support of a commercial product,
you must obtain an official GPC Commercial Use Licence from The University
of Manchester. Please email for details."
I have seen a definition of "education" as self-learning only, but cannot
trace it; it is not "free software" for non-commercial use in the "normal"
(ACM?) sense. I consider that using it in taught courses for which payment
is received to be borderline (for example useR! tutorials), possibly on
the wrong side of the border. Simply avoid gpclib!
Roger
>
> Hadley
>
>
--
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