Re: [Qgis-developer] Does Sextante Field Calculator support all functions of attribute table field calc?

2013-04-22 Thread Alexander Bruy
Hi Anita

and sorry for late response. Advanced calculator used a bit different syntax — 
field names should be included in , so
your formula will look like

value = $geom.area() / area

You can find documentation here (nfortunately only in Russian)
http://gis-lab.info/qa/fieldpyculator.html

On Thu, 18 Apr 2013 19:15:24 +0200
Anita Graser anitagra...@gmx.at wrote:

 On Thu, Apr 18, 2013 at 9:21 AM, Alexander Bruy 
 alexander.b...@gmail.comwrote:
 
 
 
  BTW, there is also Advanced Field Calculator that should allow
  calculate area and perform much more complex calculations
 
 
 Could you show me how?
 
 value = $area / area
 
 causes
 
 Traceback (most recent call last):
 
 File
 C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\core\GeoAlgorithm.py,
 line 147, in execute
 
 self.processAlgorithm(progress)
 
 File
 C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\algs\FieldPyculator.py,
 line 125, in processAlgorithm
 
 unicode(sys.exc_info()[0].__name__), unicode(sys.exc_info()[1]))
 
 TypeError: __init__() takes exactly 2 arguments (4 given)


-- 
Alexander Bruy
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Does Sextante Field Calculator support all functions of attribute table field calc?

2013-04-18 Thread Alexander Bruy
Hi Anita,

Field calculator in SEXTANTE is very simple calculator based on
Python eval() function. So it allows only basic math with native
data types and some string operations (like concatenation).

Seems we need to improve it and add QgsExpression support.

BTW, there is also Advanced Field Calculator that should allow
calculate area and perform much more complex calculations

On Wed, 17 Apr 2013 22:42:05 +0200
Anita Graser anitagra...@gmx.at wrote:

 Hi,
 
 I have a polygon layer with an area field and want to calculate $area /  
 area. This works well in attribute table field calculator.
 
 If I try to use Sextante Field Calculator, the resulting field contains  
 only NULL values. Is this supposed to work? Is this a bug you can confirm?
 
 Best wishes,
 Anita

-- 
Alexander Bruy
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Does Sextante Field Calculator support all functions of attribute table field calc?

2013-04-18 Thread Anita Graser
On Thu, Apr 18, 2013 at 9:21 AM, Alexander Bruy alexander.b...@gmail.comwrote:



 BTW, there is also Advanced Field Calculator that should allow
 calculate area and perform much more complex calculations


Could you show me how?

value = $area / area

causes

Traceback (most recent call last):

File
C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\core\GeoAlgorithm.py,
line 147, in execute

self.processAlgorithm(progress)

File
C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\algs\FieldPyculator.py,
line 125, in processAlgorithm

unicode(sys.exc_info()[0].__name__), unicode(sys.exc_info()[1]))

TypeError: __init__() takes exactly 2 arguments (4 given)

Thanks!

Anita



 On Wed, 17 Apr 2013 22:42:05 +0200
 Anita Graser anitagra...@gmx.at wrote:

  Hi,
 
  I have a polygon layer with an area field and want to calculate $area /
  area. This works well in attribute table field calculator.
 
  If I try to use Sextante Field Calculator, the resulting field contains
  only NULL values. Is this supposed to work? Is this a bug you can
 confirm?
 
  Best wishes,
  Anita

 --
 Alexander Bruy

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer