That will be a great idea..I didn't know about the possibility of using Jython in gvSIG!<br><br><div class="gmail_quote">2012/3/29 Nacho Uve <span dir="ltr"><<a href="mailto:nachouve@gmail.com">nachouve@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Antonio, great trick!!<br><br>We have to do a manual "Jython for gvSIG" and also create a repo with such scripts, functions and CodeSnippets. I think it will be a great success!<br>
<br>I've tried to do some tests from scripts Antonio on github. But I think it's better to do something collaboratively ... What do think?<br>
<br>Regards,<br>Nacho V<div class="HOEnZb"><div class="h5"><br><br><br><div class="gmail_quote">2012/3/29 Francisco Puga <span dir="ltr"><<a href="mailto:fpuga@cartolab.es" target="_blank">fpuga@cartolab.es</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
guou, it works like a charm. Thanks Antonio.<br>
<br>
I didn't remember about the "global" operator of python to allow set a<br>
counter for various rows. Very nice tip.<br>
<br>
El día 28 de marzo de 2012 14:36, Antonio Falciano<br>
<<a href="mailto:afalciano@yahoo.it" target="_blank">afalciano@yahoo.it</a>> escribió:<br>
<div><div>> Hi all,<br>
> field expression is based on the values of the same row, however field<br>
> calculator commands are Jython's functions. So it's possible to memorize<br>
> a variable during field calculations using the advanced tab, for<br>
> instance loading and evaluating the following script consecutiveN.py:<br>
><br>
> #consecutiveN.py<br>
> from javax.swing import JOptionPane<br>
><br>
> def consecutiveN():<br>
> global index<br>
> try:<br>
> if rec() == 0:<br>
> index = 0<br>
> else:<br>
> index = index + 1<br>
> except:<br>
> index = ''<br>
> return index<br>
><br>
> # Usage: consecutiveN()<br>
> JOptionPane.showMessageDialog(None, 'Usage: consecutiveN()',<br>
> "consecutiveN", JOptionPane.INFORMATION_MESSAGE)<br>
><br>
> Its usage is very simple. If the first record is not selected, the index<br>
> will be 1-based and so consecutiveN() will do the trick, otherwise it<br>
> will start from 0 and so consecutiveN()+1 would be necessary.<br>
><br>
> Cheers,<br>
> Antonio<br>
><br>
> Il 27/03/2012 20.17, Francisco Puga ha scritto:<br>
>> Seems like a simple request but after think a bit more, i don't find a<br>
>> way to accomplish it. Field Expression is based on the values of the<br>
>> row actual being processing, it hasn't have memory, so the program<br>
>> doesn't know which is the next number to use.<br>
>><br>
>> Sorry.<br>
>><br>
>> El día 27 de marzo de 2012 19:07, spatialjoeescribió:<br>
>>> Hi Francisco,<br>
>>><br>
>>> thanks for your advice. With sextante numbering individual selections of a<br>
>>> layer will result in new individual shapefiles which then can be merged back<br>
>>> into one. Not sure if I like this but that's the way it'll work.<br>
>>> Nonetheless pointing to sextante was useful anyway. I somehow got mentally<br>
>>> stuck with rec()+1.<br>
>>> Thanks again!<br>
>>><br>
>>> best,<br>
>>><br>
>>> Johannes<br>
>>><br>
>>> --<br>
>>> View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/gvSIG-1-11-add-consecutive-numbers-to-selection-tp4661202p4661647.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/gvSIG-1-11-add-consecutive-numbers-to-selection-tp4661202p4661647.html</a><br>
>>> Sent from the gvSIG users mailing list archive at Nabble.com.<br>
>>> _______________________________________________<br>
>>> Gvsig_internacional mailing list<br>
>>> <a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a><br>
>>><br>
>>> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url:<br>
>>><br>
>>> <a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
>><br>
>><br>
>><br>
><br>
> --<br>
> Antonio Falciano<br>
> <a href="http://www.linkedin.com/in/antoniofalciano" target="_blank">http://www.linkedin.com/in/antoniofalciano</a><br>
> _______________________________________________<br>
> Gvsig_internacional mailing list<br>
> <a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a><br>
><br>
> To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url:<br>
><br>
> <a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
<br>
<br>
<br>
</div></div><div>--<br>
Francisco Puga<br>
Grupo de Desarrollo<br>
Cartolab - Laboratorio de Ingeniería Cartográfica.<br>
<a href="http://www.cartolab.es" target="_blank">http://www.cartolab.es</a><br>
<br>
ETS Ingeniería de Caminos, Canales y Puertos<br>
Universidade da Coruña<br>
Campus de Elviña - 15071 A Coruña (España)<br>
(34)981167000 ext. 5493<br>
</div><div><div>_______________________________________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a><br>
<br>
To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url:<br>
<br>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div>Juan Ignacio Varela García <br></div><div><br></div></div><br>
</font></span><br>_______________________________________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a><br>
<br>
To see the archives, edit your preferences or unsubscribe from this mailing list, please access this url:<br>
<br>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
<br></blockquote></div><br>