Hi Barry,

I agree this is not a bug in R but a well known bug in ArcGIS. I guess
misphrased my question - I would like to make a feature request for rgdal
to have a parameter that makes field names (and contents) "safe" for
ArcGIS, as I suspect I am not alone in producing shapefiles in R for
consumption by ArcGIS users.

Best,

Francis

On 22 March 2012 10:57, Barry Rowlingson <b.rowlingson@lancaster.ac.uk>wrote:

> On Wed, Mar 21, 2012 at 10:29 PM, Francis Markham <fmarkham@gmail.com>
> wrote:
> > I've experienced the same problem. How would one go about submitting a
> bug
> > report to rgdal on this?
>
>  How is it a bug with rgdal? I've just had a look for the spec of
> dBase files, and the only one I can find:
>
> http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
>
>  says the field name is "32 bytes       Field name in ASCII (zero-filled)."
> I just tried R with rgdal and it could write and read quite happily a
> SpatialPointsDataFrame with dots in the field names. Try this:
>
> library(sp)
> library(rgdal)
> df = data.frame(x=runif(10),y=runif(10),zz=runif(10))
> coordinates(df)=~x+y
> writeOGR(df,".","junk","ESRI Shapefile")
>
> names(df)="z.z"
> writeOGR(df,".","junk2","ESRI Shapefile")
>
>  - both work for me, and QGIS can read them in, and R can read them
> back into fresh sessions. If anything its a bug in ArcGIS, but without
> a good description of the failing shapefile (exact item names for
> starters) we're guessing.
>
>  It might be *non-ascii* field names, which aren't covered by the spec
> I just read but might be by some other extension. You can handle this
> in R by setting the Encoding of the field names explicitly.
>
> Barry
>

	[[alternative HTML version deleted]]

