Better late than never.
Thanks Roger !
2018-02-07 13:58 GMT-05:00 Roger Bivand <roger.biv...@nhh.no>:
> On Wed, 7 Feb 2018, Barry Rowlingson wrote:
> I'd do this by saving the image on the graphics device as a PNG, then
>> creating a "world" file (with extension PNGW) from the coordinates of the
>> corners and the resolution of the PNG. This is a six line text file with
>> sufficient information to georeference a grid. That's enough for `gdal` to
>> understand it, and then the `gdal` utilities can convert it to a GeoTIFF
>> (or load into R using `raster` and then save as a GeoTIFF).
>> The tricky bit might be finding the corner coordinates of the graphics
>> device image. This is complicated by R leaving space for margins, or not
>> using your coordinate system.
> Right - see the example in ASDAR 1st edition, chapter 4 chunks 42-44 in
> http://www.asdar-book.org/data.php?chapter=3 (zero-based php)
> which has par(mar=c(0,0,0,0), xaxs="i", yaxs="i") and widths and heights
> from maptools::GE_SpatialGrid().
>> If this is a base graphics plot using the coordinate system units then you
>> can probably get them via some combination of the par() values, or you
>> might have set the margins to zero and that gives you the corners from
>> par()$usr (I think).
>> If its grid graphics (like spplot) then.... uhhh. someone else probably
>> knows how to do it.
>> On Wed, Feb 7, 2018 at 3:07 PM, Arnaud Mosnier <a.mosn...@gmail.com>
>>> Long version:
>>> I made a plot (a map) including SpatialPolygons representing the coast of
>>> my region of interest, and a SpatialPointsDataframe representing
>>> of cities, and I want to save this map in GeoTiff format to allow other
>>> people to use this map as a georeferenced background without having to
>>> manage the various data sources. Is there a package/function in R that
>>> would allow me to do that?
>>> Note that converting the Spatial* objects to the raster format is not an
>>> option because I want to be able to see the names of the cities on the
>>> In short:
>>> Is there a way to save a plot composed of Spatial* elements in a GeoTiff
>>> [[alternative HTML version deleted]]
>>> R-sig-Geo mailing list
>> [[alternative HTML version deleted]]
>> R-sig-Geo mailing list
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
[[alternative HTML version deleted]]
R-sig-Geo mailing list