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

iaborsi borsi at math.unifi.it
Wed Dec 14 11:50:21 CET 2011


SOLVED!
It is enough to save the new Module(s) within the following gvSIG path:

/bin/gvSIG/extensiones/org.gvsig.scripting/scripts/jython/Lib

Of course, the Module has to be Jython compliant.

Regards,
Iacopo


Iacopo Borsi
Dipartimento di Matematica U.Dini
Università di Firenze.
V.le Morgagni 67/A
50134 Firenze - Italy
Tel. +39.0554237147
Fax. +39.0554237133
e-mail borsi at math.unifi.it
Web:   http://web.math.unifi.it/users/borsi
http://sidgrid.isti.cnr.it

Quoting "Antonio Falciano [via OSGeo.org]"  
<ml-node+s1803224n7092993h57 at n2.nabble.com>:

>
>
> Il 13/12/2011 10.28, iaborsi ha scritto:
>> Hi Antonio,
>> thanks a lot! I've tried that: very easy, and it works perfectly!
>> I take this opportunity to make an additional question: if in writing
>> this Jython function I need additional Modules (typically an original
>> group of functions defined by myself) which is the right path to save
>> this stuff? I guess is the same directory from which I upload my Jython
>> function, isn't it?
>> To be clearer (following you example below): I want to modify your
>> example script "conversion.py" in this way:
>> -------
>> from MyNewModule import *
>>
>> def m2tokm2(value):
>> temp=value/1000000
>> result = MyNewFunction(temp)
>> return result
>> -------
>> where MyNewFunction() is defined within the module MyNewModule.
>>
>> I guess I have to save the module within the same path of conversion.py.
>> Right?
>
> Good idea, Iacopo! Importing further modules would extend the
> potentiality of advanced expressions. It should be possible to import a
> module within the same path, however it returns always a Jython
> exception. Probably the simplest way to use other functions contained in
> other module(s) consists in processing them before, even if it's not
> pythonic at all.
>
> Cheers,
> Antonio
>
> --
> Antonio Falciano
> http://www.linkedin.com/in/antoniofalciano
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at listserv.gva.es
>
> To see the archives, edit your preferences or unsubscribe from this   
> mailing list, please access this url:
>
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the   
> discussion below:
> http://osgeo-org.1803224.n2.nabble.com/Field-Calculator-look-for-an-expression-saved-in-a-file-tp7086102p7092993.html
> To start a new topic under gvSIG users, email   
> ml-node+s1803224n2009903h67 at n2.nabble.com
> To unsubscribe from gvSIG users, visit   
> http://osgeo-org.1803224.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2009903&code=Ym9yc2lAbWF0aC51bmlmaS5pdHwyMDA5OTAzfC01MjEyNTE4ODM=



-- 


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Field-Calculator-look-for-an-expression-saved-in-a-file-tp7086102p7093061.html
Sent from the gvSIG users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20111214/ca68788d/attachment.htm 


More information about the Gvsig_internacional mailing list