[GRASS-stats] readVECT6 problem fo importing null data

Roger Bivand Roger.Bivand at nhh.no
Tue Nov 27 07:28:16 EST 2007


On Tue, 27 Nov 2007, Jarosaw Jasiewicz wrote:

> Roger Bivand pisze:
>>  On Mon, 26 Nov 2007, Jarek Jasiewicz wrote:
>> 
>> >  Dear Collages!
>> > 
>> >  I found some Issue (seems problematic) with readVECT6 (there are all 
>> >  commands I used, complete my answer)
>> > 
>> >  I have vector file attached table (pgSQL) with null values both for int4 
>> >  and char columns (example table):
>> >  I import the table via RdbiPgSQL
>>
>>  Dear Jarek,
>>
>>  Could you please try readOGR() directly from the PostgreSQL/PostGIS
>>  source? This will remove the imposition of the intermediary DBF format,
>>  and if it succeeds provides a feasible solution, and if it doesn't,
>>  suggests that OGR drivers have problems with missing value handling in
>>  some implementations (in GRASS and in rgdal, where v.in.ogr and readOGR()
>>  use the same basic approach, as do v.out.ogr and writeOGR()).
>>
>>  Roger
>> 
>> 
>
>
> So the problem is in r.out.ogr?

No, we do not know that (v.out.ogr). It could just as easily be readOGR() 
using the "ESRI Shapefile" driver. In fact the root of the problem is that 
there is no standard for setting missing values in DBF files. The one used 
in the OGR library and in its included shapelib is only one of many, and 
the header does not encode any information about missing values, so that 
DBF files are not self-describing.

> There are some other methods as you 
> describe. So I solved problem easyly. I rather point out issue, maybe for 
> some other R and GRASS users.

Certainly - I will add a warning to the readOGR() help page. What was your 
solution - reading from PostgreSQL directly or using readOGR() on the 
PostGIS data source?

Roger

> Best ragards
>
> Jarek
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the grass-stats mailing list