[R-sig-Geo] Error at reading shape file (readOGR())

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon May 17 12:36:55 CEST 2010


On Mon, May 17, 2010 at 10:08 AM, Agustin Lobo <alobolistas at gmail.com> wrote:
>
> Solved: it was an accent, I just edited the name of the field with plugin
> Table manager in QGIS.
> Nevertheless, if QGIS can manage the file, why not R? should not be a matter
> of having
> an option for the charset?
> I tend to not to use non-ascii characters in files, but many agencies do.

 It's either your version of R/rgdal or something more specific in the
column names. I've just created a shapefile with accented column names
and it's read into R fine:

> s=readOGR(".","accents")
OGR data source with driver: ESRI Shapefile
Source: ".", layer: "accents"
with 2 features and 2 fields
Feature type: wkbPoint with 2 dimensions
> s
            coordinates  ëå ID
1 (-0.438119, 0.515347) Foo  1
2 (0.0163366, 0.182673) Bar  2

 - that's a column name of e-with-two-dots and a-with-a-circle. it was
created in Qgis by pasting characters from the Latin page in a
character map utility. The Unicodes are  U+00EB and U+00E5.

  Suggest you post a cut-down version of your DBF somewhere with a few
rows and columns (not the whole thing if its more than 10 rows and
cols) and we'll see if it croaks with us too. And your R/rgdal
version!

 Barry



More information about the R-sig-Geo mailing list