Skip to content
Prev 23771 / 29559 Next

rgdal 1.1-1 bug?

Thank you Tom and Roger for your attention to this issue.

Here is a link to a zipfile (17 MB).  It contains two folders/shapefiles.  One is the single big polygon with many holes that I had sent to Tom.  The other is the shapefile it was extracted from, with many additional polygons showing similar problems.  

https://www.dropbox.com/s/xkp8sdoccg6jyg4/offending_shapefile.zip?dl=0

These shapefiles are from Arc and have never been written by writeOGR, so should be fine when first opened.

For now, I have been unable to revert to the earlier version of rgdal as R complains that it doesn't match the R version.
Jim

-----Original Message-----
From: R-sig-Geo [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Roger Bivand
Sent: Saturday, December 05, 2015 3:50 AM
To: Tom Philippi
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] rgdal 1.1-1 bug?
On Sat, 5 Dec 2015, Tom Philippi wrote:

            
If you make the offending shapefile available, I'll look at this in a week or so (no time before then). The possible change is from:

https://stat.ethz.ch/pipermail/r-sig-geo/2015-November/023656.html

and affected writing - before Shapefiles were written as-is, from 1.1-1 all output geometries without comments are put through
OGRGeometryFactory::organizePolygons() in GDAL/OGR. This may be a case in which the OGR function fails to organise the polygons in the intended fashion. I have a build of rgdal 1.1-2 for Windows using GDAL
2.0.1 (thanks again to Brian Ripley) which you may try, but it will most likely not change anything. Also, we don't know whether the input data (Polygons objects) have comments or not, but if read through readOGR(), the Shapefile driver also runs OGRGeometryFactory::organizePolygons() on read.

I need access to the offending shapefile to see whether alternative settings to OGRGeometryFactory::organizePolygons(), or a user option to avoid this very sensible function with possibly bad data, might alleviate the problem. Please put on URL or attach offlist.

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