[R-sig-Geo] rgdal 1.1-1 bug?

Michael Sumner mdsumner at gmail.com
Fri Dec 4 23:34:23 CET 2015


On Sat, 5 Dec 2015 at 05:26 Worrall, James -FS <jworrall at fs.fed.us> wrote:

> [image: image001.gif]
>
> We have been happily using rgdal to read and write ESRI Shapefiles.
> Recently my colleague began using it.  We noticed that after saving and
> reopening files, many polygons had been reconfigured, as if the order of
> the vertices had become jumbled and there were many straight lines cutting
> across the polygon.  I’m not sure if an image can be pasted in this list
> but I’ll try.
>
> I did the same thing on my computer and the problem did not occur.  We
> found that I had an older version of rgdal, 1.0-7.  When I updated it to
> 1.1-1, the problem occurred just as it had with her.
>
> Simply opening and saving a shapefile causes the problem and essentially
> jumbles the shapefile.  The bug, if it is one, was introduced after 1.0-7
>




I can't reproduce this. Can you provide a reproducible example?  Also,
"opening and saving a shapefiles" is not the way to describe what is done
in the usual rgdal workflow, so it's not clear what you did. Here's what I
tried:

library(maptools)
data(wrld_simpl)

library(rgdal)
#rgdal: version: 1.1-1, (SVN revision 572)
# Geospatial Data Abstraction Library extensions to R successfully loaded
# Loaded GDAL runtime: GDAL 1.11.2, released 2015/02/10
# Path to GDAL shared files: E:/inst/R/R/library/rgdal/gdal
# GDAL does not use iconv for recoding strings.
# Loaded PROJ.4 runtime: Rel. 4.9.1, 04 March 2015, [PJ_VERSION: 491]
# Path to PROJ.4 shared files: E:/inst/R/R/library/rgdal/proj
# Linking to sp version: 1.2-1


writeOGR(wrld_simpl, ".", "1.1-1", "ESRI Shapefile")
x1 <- readOGR(".", "1.1-1")
plot(x1)  ## all good


 sessionInfo()
R version 3.2.2 Patched (2015-08-27 r69201)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600)

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgdal_1.1-1     maptools_0.8-37 sp_1.2-1

loaded via a namespace (and not attached):
[1] tools_3.2.2     foreign_0.8-66  grid_3.2.2      lattice_0.20-33


Cheers, Mike.




> I will attach images of one complex polygon, before and after saving with
> writeOGR.
>
> Jim
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20151204/2cfa3e18/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 92 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20151204/2cfa3e18/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 92 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20151204/2cfa3e18/attachment-0001.gif>


More information about the R-sig-Geo mailing list