[Gvsig_english] Field Calculator: look for an expression saved in a file

Antonio Falciano afalciano at yahoo.it
Fri Sep 27 11:19:23 CEST 2013


Il 27/09/2013 10:23, Antonio Falciano ha scritto:
> Il 27/09/2013 10:18, Antonio Falciano ha scritto:
>> Il 27/09/2013 09:43, phil_murcia ha scritto:
>>> Hi Antonio,
>>>
>>> Thanks so much for the advice. It seems once you get to grips with the
>>> Jython functions you gain a lot of capabilities. However I cannot get my
>>> expression to work, without wanting to turn this extremely useful thread
>>> into a troubleshooting discussion, I cannot work out why.
>>>
>>> I have created my .py file, and switched in all the correct headings
>>> (I have
>>> also checked for line errors in spyder environment). In gvSIG I begin
>>> editing the layer, open the attribute table, select the 'compat'
>>> column and
>>> then open the expression calculator. I then go to the advance tab and
>>> explore for the correct .py file, on loading this I am still unable to
>>> click
>>> 'ok' and the 'evaluate' seemingly still does nothing. With the .py
>>> loaded I
>>> then tried switching back to the general tab and entering the second
>>> expression "compat([Agr],[Urb],[For],[Com],[Pub])" - but when I then
>>> try and
>>> click ok I then get an error expression with a traceback description.
>>>
>>> I am not implementing the expression correctly or am I missing something
>>> obvious?
>>
>> Hi Phil,
>> sorry, I haven't tested the script yesterday. You can try with the
>> script in attachment in order to respect the right indentation. I have
>> also substituted the "for" reserved word with "fore". Hope this helps!
>
> Ops... It seems that an elif was not well indented. Please correct it!

Ops again... The right expression to type is:
compat([Agr],[Urb],[For],[Com],[Pub],[Land-use B])
[Land-use B] was missing.

Antonio

-- 
Antonio Falciano
http://www.linkedin.com/in/antoniofalciano


More information about the Gvsig_internacional mailing list