Define aliases in shapefiles
Barry Rowlingson <b.rowlingson at lancaster.ac.uk> writes:
On Wed, Apr 8, 2015 at 7:53 PM, Arnaud Mosnier <a.mosnier at gmail.com> wrote:
Dear useRs, I am searching for a way to break the 10 character limit of the field names in shapefiles created using for example the writeOGR function from the rgdal package. On way could be to define aliases for field names, but I am not aware of a function allowing me to do that.
Are aliases an ArcGIS thing for shapefile names? I can only see vague references on the internet to something like that. Do you create field name aliases in ArcGIS? Are they saved with the shapefile or with the ArcGIS file? Do you get a foo.shp.xml file that is keeping this extra metadata around? Perhaps we could reverse-engineer that and create it in R. Standards-compliant shapefiles can only have 10-character field names. You could use another file format, such as GML or Spatialite, as long as whatever you are saving these for can read them.
There is always the possibility of a homegrown version, which should not be to difficult to implement. As soon as the shape file has been loaded, you can change the field names, and before you save it, you could change them back. The longer field names could be saved in a file. Rainer
Barry
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer at krugs.de Skype: RMkrug PGP: 0x0F52F982 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 494 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150409/b8674f84/attachment.bin>