Opened 14 years ago

Last modified 13 years ago

#3132 reopened bug

Field calculator cannot calculates area of polygon

Reported by: dr Owned by: jef
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: Vectors Version: Trunk
Keywords: Cc: dr, gislab, alexbruy
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

Description

I have vector layer, which contains one polygon. When I try to calculate their area with field calculator I get NULL result, but ftools Export/Add geometry columns tool works fine. My layer in attachment.

Attachments (1)

err.zip (44.6 KB ) - added by dr 14 years ago.

Download all attachments as: .zip

Change History (14)

by dr, 14 years ago

Attachment: err.zip added

comment:1 by jef, 14 years ago

Resolution: fixed
Status: newclosed

fixed in r14395.

comment:2 by dr, 14 years ago

Resolution: fixed
Status: closedreopened

Now area of this polygon is negative value.

comment:3 by jef, 14 years ago

um, I get 2849751229.32861 - just like in the identify results. And the earlier problem wasn't that the area wasn't calculated, but only that the attribute table didn't show the updated result.

comment:4 by gislab, 14 years ago

r14410, tried new and existing AREA field - all seems normal (result is correct)

comment:5 by gislab, 14 years ago

I'm afraid I have to take it back, I do have negatives too, please check this video: http://screencast.com/t/58exsAG3vz

comment:6 by jef, 14 years ago

Resolution: fixed
Status: reopenedclosed

That's what you get when you try to save 2849751229.32861 in a 32bit integer. Use a real field.

comment:7 by dr, 14 years ago

Resolution: fixed
Status: closedreopened

I've tried use real field but get the same negative result.

comment:8 by pcav, 13 years ago

Is this still true?

comment:9 by alexbruy, 13 years ago

Resolution: fixed
Status: reopenedclosed

Seems fixed for now (tested with r15264)

comment:10 by dr, 13 years ago

Resolution: fixed
Status: closedreopened

Bug still present at r15306.

comment:11 by borysiasty, 13 years ago

I can confirm. Creating integer as well as floating point fails. Right after calculating you can see proper values (as they're not updated from layer), but after layer save they becomes negative.

However, updating the existing AREA field works fine.

comment:12 by borysiasty, 13 years ago

Platform: WindowsAll

(tested on Ubuntu)

in reply to:  11 comment:13 by enrico80, 13 years ago

Replying to borysiasty:

I can confirm. Creating integer as well as floating point fails.

For floating values the problem happen if you assign precision = 0, otherwise area is correct.

Note: See TracTickets for help on using tickets.