Message-ID: <50B9067A.5060205@ase-research.org>
Date: 2012-11-30T19:18:18Z
From: Mathieu Basille
Subject: readOGR and PostGIS: "Error getting field 0"
In-Reply-To: <alpine.LRH.2.02.1211301752110.28713@reclus.nhh.no>
Roger,
It works beautifully! Checkout and compilation went successfully without
any problem, and now readOGR can read layers with no field. As a matter of
fact, it doesn't even need a primary key, just the geometry field. If there
is a primary key, it is used as 'FID', if there is no primary key, a 'FID'
field is created starting at 0.
This is perfect, thanks a lot!
Mathieu.
Le 30/11/2012 11:56, Roger Bivand a ?crit :
> On Fri, 30 Nov 2012, Mathieu Basille wrote:
>
>> Le 30/11/2012 11:27, Roger Bivand a ?crit :
>>> [...]
>>>
>>> Thanks very much, this is the information needed, that there are no fields.
>>> It appears that at least in this driver, readOGR() needs to be able to
>>> return a geometry-only object, or to create a GID column in the data.frame.
>>> I'll let you know when I've committed to R-forge, and will be very grateful
>>> if you can check out the source package, install, and test whether the
>>> changes have helped. It may take a little time to get there, but I'll give
>>> it priority.
>>
>> I'd be happy to test when it's ready! However, no need to hurry: in the
>> meantime, it is still possible (and easy) to add a dummy field to make
>> readOGR work.
>
> OK, thanks. SVN revision 389 committed to R-forge project rgdal, checkout
> from:
>
> svn checkout svn://scm.r-forge.r-project.org/svnroot/rgdal/pkg
>
> and rename pkg -> rgdal (to avoid getting multiple branches), then try
> R CMD check rgdal, if OK INSTALL, and try your problem.
>
> Roger
>
>>
>> Thank you very much for you work!
>> Mathieu.
>>
>>
>>> Roger
>>
>>
>>
>
--
~$ whoami
Mathieu Basille, PhD
~$ locate --details
University of Florida \\
Fort Lauderdale Research and Education Center
(+1) 954-577-6314
http://ase-research.org/basille
~$ fortune
? Le tout est de tout dire, et je manque de mots
Et je manque de temps, et je manque d'audace. ?
-- Paul ?luard