[R-sig-Geo] readOGR() in rgdal and 64-bit integers

Roger Bivand Roger.Bivand at nhh.no
Thu Oct 27 19:55:00 CEST 2016


Since the release of GDAL 2, feature IDs are 64-bit integers and fields of 
vector data may be 64-bit integers. Most often, the declarations of these 
fields are misunderstandings, as such data is almost always a long key ID 
(should be string), or may be an area in square metres (should be float).

readOGR() received an argument integer64= with the default value of 
"allow.loss", which silently clamps 64-bit integers to 32-bit signed 
integers. Of course, users who first read the output of ogrInfo() on their 
input files would have been warned that action may be required on their 
part to avoid data loss.

The alternative values, as in base::type.convert(), are "warn.loss" - 
which issues a warning if clamping takes place, and "no.loss" which 
returns character strings (often represented as a factor) instead of 
clamping.

The current default assumes that users actually use ogrInfo() to examine 
their data before reading it. Is this overly optimistic? Would it be 
better to change the default to "no.loss" or "warn.loss"? A doodle is 
here: http://doodle.com/poll/9qaqrkbs6q7k5skz - I'd be grateful for 
feedback.

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
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412



More information about the R-sig-Geo mailing list