Opened 18 years ago

Closed 15 years ago

#243 closed enhancement (fixed)

Add a feature to calculate field values in attribut tables

Reported by: horst.duester@… Owned by: gsherman
Priority: minor: annoyance Milestone: Version 1.4.0
Component: Data Provider Version: Trunk
Keywords: Cc: cdavilam@…
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description


Attachments (1)

Screenshot-2.png (29.2 KB ) - added by lutra 15 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 by g_j_m, 18 years ago

Milestone: Version 0.8 ReleaseVersion 0.9 Release

Can you provide some more details on what you mean?

comment:2 by horst.duester@…, 18 years ago

Often I need to calculate new field values based on existing layer attribute table fields. For this issue it would be great if I do have a field calculator. Think about the following situation:

  1. open layer attribute table.
  2. start digitizing.
  3. add a new field NEWFIELD to the opened attribute table if you don't like to overwrite existing table field values.
  4. select the field you want to calculate values for. In our case NEWFIELD.
  5. open the field calculator. (Opening the field calculator via button like the add field button).
  6. select a math function to calculate the NEWFIELD value. p.e. NEWFIELD = sin(EXISTINGFIELD1) + cos(EXISTINGFIELD2)
  7. stop digitizing.

Please let me know whether my details do explain my idea.

comment:3 by anonymous, 17 years ago

Awaiting user input: unset
Must Fix for Release: No
Version: 0.8

comment:4 by timlinux, 17 years ago

Priority: majorminor

Changed to minor under the following scheme:

  • blocker - bugs that should block the release. Since we are going to release pretty much 'come what may' I would like no bugs
  • allocated to this category without consultation with me and / or PSC
  • critical - bugs that cause the application to crash or corrupt data
  • major - application features that do not function at all
  • minor - features that function but imerfectly e.g. labels placing incorrectly
  • trivial - gui useability issues or small issues with the documentation, install notes etc.

comment:5 by pcav, 16 years ago

Looks like you want to reimplement a spreadsheet within QGIS? This can be done eg in OOo, the issue could be how to recall a spreadsheet easily (single-click) from QGIS?

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

Replying to pcav:

Looks like you want to reimplement a spreadsheet within QGIS? This can be done eg in OOo, the issue could be how to recall a spreadsheet easily (single-click) from QGIS?

It's not the idea to reimplement a spreadsheet! But it is very helpful to calculate new column values. P.e. for Classification of objects. The first part of my request, add a new column, is realised (PostGIS Layer)

in reply to:  5 comment:7 by cdavilam, 16 years ago

Milestone: Version 0.9.2Version 1.0
Platform: DebianAll
Version: 0.80.10.0

Replying to pcav:

Looks like you want to reimplement a spreadsheet within QGIS? This can be done eg in OOo, the issue could be how to recall a spreadsheet easily (single-click) from QGIS?

Although it can be done in a spreadsheet, it would be very useful enabling it within QGIS. Otherwise it's necessary to remove the layer/close project->open dbf in OOo->edit and save->reload in QGIS/reopen project->rearrange simbology (if you don't have it saved), which is a very annoying process.

comment:8 by cdavilam, 16 years ago

Cc: cdavilam@… added

comment:9 by pcav, 16 years ago

Isn't this implemented as a python plugin? Should we close this?

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

Replying to pcav:

Isn't this implemented as a python plugin? Should we close this?

Which plugin do you mean?

comment:11 by pcav, 15 years ago

Table Manager, by Borys. Please check whether it has the functions you need.

comment:12 by cdavilam, 15 years ago

Version: 0.10.01.0.0

No, it has a Calculate button, but currently not functional (to be implemented...)

comment:13 by borysiasty, 15 years ago

Exactly. It's on very hign position on my TODO list, but I haven't touch it yet. I'll do my best to implement it in February.

comment:14 by lutra, 15 years ago

Milestone: Version 1.0.3Version 1.2.0

I would like also to see this feature implemented, not only because I think is useful, but also because -the missing of this tool- is one of that things that (other software) users do notice when using for the first time QGis.

in reply to:  14 comment:15 by hdus, 15 years ago

Replying to lutra:

I would like also to see this feature implemented, not only because I think is useful, but also because -the missing of this tool- is one of that things that (other software) users do notice when using for the first time QGis.

+1

comment:16 by wonder, 15 years ago

What operations and functions should such field calculator support?

in reply to:  16 comment:17 by lutra, 15 years ago

Replying to wonder:

What operations and functions should such field calculator support?

I know that make comparisons it is always bad, but (if you want to stay out of the arc* playground) I would suggest to have a look at the "field calculator" of gvSIG. It has many commands, every one has his own short description, so you may want to have a look to the program (I cannot find references of all the commands, not even in the manual, pag. 220 here).

See the attached image.

Among the others you can calculate areas, perimeters and lenghts without having to create a new shapefile like ftools requires.

Command list:

ABS 
ACOS
AREA
ASIN
ATAN
CEIL
COS
< >
/
E
==
EXP
<=
<
LOG
MAX
MIN
-
>=
>
PERIMETER
PI
+
POW
RANDOM
ROUND
SIN
SSQRT
TAN
*
TODEGREES
TONUMBER
TORADIANS
TOSTRING

by lutra, 15 years ago

Attachment: Screenshot-2.png added

comment:18 by mhugent, 15 years ago

Note: a field calculator is on my (implementation) roadmap for this summer.

Marco

comment:19 by lutra, 15 years ago

Version: 1.0.0HEAD

comment:20 by mhugent, 15 years ago

Resolution: fixed
Status: newclosed

A field calculator is available from r11735 on (more operators will follow)

Marco

Note: See TracTickets for help on using tickets.