[GRASS-stats] readVECT6 problem fo importing null data

Jarosław Jasiewicz jarekj at amu.edu.pl
Wed Dec 5 05:28:40 EST 2007


Markus Neteler pisze:
> Dear Jarek,
>
> ok, I made again a test using out NC OSGeo data set
> but now PostgreSQL:
>
> db.connect driver=pg database="host=localhost,dbname=postgres"
> db.tables -p
> information_schema.sql_features
> ...
>
> # copy the map into your MAPSET and check for NULL
> g.copy vect=lakes,mylakes
> v.db.select mylakes
> v.db.select mylakes where="FTYPE IS NULL"
>
> # display the lakes, show undefined FTYPE lakes in red
> g.region swwake_10m
> d.mon x0
> d.erase
> d.vect mylakes where="FTYPE IS NOT NULL" type=area col=blue
> d.vect mylakes where="FTYPE IS NULL" type=area col=red
> # ... works.
>
> # Export test:
> v.out.ogr mylakes dsn=mylakes.shp type=area
>
> # Looking at it in openoffice: 
> openoffice.org2.3 mylakes.dbf
> cat,N,11,0,area,N,24,15,perimeter,N,24,15,full_hydro,N,24,15,full_hydr2,N,24,15,ftype,C,80,fcode,N,11,0,name,C,80
> 8,5310.04,334.89,9,55660,LAKE/POND,39000,
> 33,21739.17,709.53,34,54836,LAKE/POND,39000,
> 63,469.77,105.84,64,0,,0,
> 84,10564.66,402.43,85,55595,ROCK/ISLAND,44100,
> 93,7655.72,344.71,94,53621,DAM/WEIR,34300,
> 94,1357.21,178.47,95,0,,0,
> 96,26382.58,1286.95,97,53957,ROCK/ISLAND,44100,
> ...
>
> Also the expected empty fields here. I am using PG 8.2.5 and
> GRASS 6.3-CVS.
> Can you replicate this example?
>
> Markus
>
>
> Jarek Jasiewicz wrote:
>   
>> Dear Markus!
>>
>> The problem most probable concerns export only, when atributres are 
>> stored in postgreSQL database and it happens when data during v.out.ogr 
>> to shp with dbf table, in spite of NOT NULL in pgsql  is set
>> cheers
>> Jarek
>>
>>     
>
>   
Marcus!

FCODE type is character, but problem concerns ONLY numeric data. 
Character data are exported propertly, probably because it is rather 
zerolengh string for dbf

AFAIK, handling numeric NULL in dbf is problematic not only for grass users

best wishes
Jarek


More information about the grass-stats mailing list