Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#962 closed defect (fixed)

Postgis table with float type attribute interprets null as zero.

Reported by: cgsbob Owned by: jef
Priority: major: does not work as expected Milestone:
Component: Vectors Version: Trunk
Keywords: Cc: warmerdam
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: yes

Description

I tried to use Symbology>Continuous Color on a field that has nulls and noticed that these null values are interpreted as 0. As a result, I am getting a lot of black dots on my map (which I hoped would not show up on my map) along with white to red colored dots.

I also notice that "Open attribute table" shows these fields as 0 instead of null.

Attachments (4)

nullprob.png (170.2 KB ) - added by cgsbob 16 years ago.
This illustrates Continuous Color (and other) rendering problems with nulls
nulls_appear.png (51.8 KB ) - added by cgsbob 16 years ago.
shades of red is from continuous color render. black feature has null attribute.
zoom_lower_right.png (12.0 KB ) - added by cgsbob 16 years ago.
zoom into lower right of maps...red features disappear
gw_elev.pgdmp (33.8 KB ) - added by cgsbob 16 years ago.
postgresql dump of the problem feature

Download all attachments as: .zip

Change History (20)

comment:1 by warmerdam, 16 years ago

Cc: warmerdam added

I chatted about this very briefly on IRC and Bob reasonable suggested that the attribute table ought to show the field as NULL (perhaps blank) and the rendering might just not draw features with null fields for classification.

I skimmed the OGR provider and I see it makes no effort to distingish between NULL and non-null fields. Is it intended that providers can return features with NULL attributes marked in some fashion in the attribute map? Perhaps, those attributes should just not be added to the attribute map for that feature?

Skimming the Postgres provider, it also seems to make no effort to distingish between null and non-null field values.

Perhaps the problem is just at the provider level?

by cgsbob, 16 years ago

Attachment: nullprob.png added

This illustrates Continuous Color (and other) rendering problems with nulls

in reply to:  description ; comment:2 by cgsbob, 16 years ago

Replying to cgsbob: The image I just uploaded has a bug :-) The beginning arrow coming from the pgadmin3 window should begin at record 141 (one cell below).

in reply to:  2 comment:3 by cgsbob, 16 years ago

Replying to cgsbob:

Replying to cgsbob: The image I just uploaded has a bug :-) The beginning arrow coming from the pgadmin3 window should begin at record 141 (one cell below).

Disregard this the comment above...it is correct. Is there a way to delete comments?

comment:4 by jef, 16 years ago

Owner: changed from nobody to jef

comment:5 by jef, 16 years ago

Resolution: fixed
Status: newclosed

in reply to:  5 comment:6 by cgsbob, 16 years ago

Replying to jef: I see that the attribute table now shows nulls as NULL, but the feature is still rendered as black dots. I was hoping that fixing #962 meant that the null attributes would not be rendered.

comment:7 by jef, 16 years ago

Resolution: fixed
Status: closedreopened

comment:8 by jef, 16 years ago

Resolution: fixed
Status: reopenedclosed

fixed in r8282

in reply to:  8 ; comment:9 by cgsbob, 16 years ago

Replying to jef:

fixed in r8282

I wish this was an easier bug to fix, but there is still a problem :-) The null point features the color range white to red). When you zoom in these null point features disappears.

in reply to:  9 ; comment:10 by jef, 16 years ago

Awaiting user input: set
Resolution: fixed
Status: closedreopened

Replying to cgsbob:

Replying to jef:

fixed in r8282

I wish this was an easier bug to fix, but there is still a problem :-) The null point features the color range white to red). When you zoom in these null point features disappears.

Sorry, I don't get what you're saying. Did you post get mixed up?

in reply to:  10 comment:11 by cgsbob, 16 years ago

Replying to jef:

Replying to cgsbob:

Replying to jef:

fixed in r8282

I wish this was an easier bug to fix, but there is still a problem :-) The null point features the color range white to red). When you zoom in these null point features disappears.

Sorry, I don't get what you're saying. Did you post get mixed up?

Yes, I did mix up my post. I was trying to say that the features that have null attribute still appear in my map and when I zoom in those features they disappear. I'll upload some pics to demonstrate.

by cgsbob, 16 years ago

Attachment: nulls_appear.png added

shades of red is from continuous color render. black feature has null attribute.

by cgsbob, 16 years ago

Attachment: zoom_lower_right.png added

zoom into lower right of maps...red features disappear

comment:12 by jef, 16 years ago

Resolution: fixed
Status: reopenedclosed

You probably missed the working version. r8282 might have worked, but my optimization in r8286 actually broke the postgres provider. I think I've fixed that in r8290.

by cgsbob, 16 years ago

Attachment: gw_elev.pgdmp added

postgresql dump of the problem feature

comment:13 by jef, 16 years ago

Resolution: fixed
Status: closedreopened

comment:14 by jef, 16 years ago

Resolution: fixed
Status: reopenedclosed

thanks for the patience. I think I finally got it right.

in reply to:  14 ; comment:15 by cgsbob, 16 years ago

Replying to jef:

thanks for the patience. I think I finally got it right.

I just updated from svn. Everything (well, almost everything :) ) is all right. One little cosmetic change you can make is to update the extent.

Thanks for all your work!

in reply to:  15 comment:16 by jef, 16 years ago

Replying to cgsbob:

One little cosmetic change you can make is to update the extent.

I don't think the is a rendering issue. If you don't want to handle the null features at all, I'd suggest that you filter them out using a where clause.

Note: See TracTickets for help on using tickets.