[Qgis-user] How to use Sextante Pyculator correctly?

Rudi von Staden rudivs at gmail.com
Mon Jan 7 04:47:04 PST 2013


Hi Anita,

It took me a bit of trial and error to figure out how to get case
statements to work in Pyculator (there is no direct case equivalent in
Python). You have to define a function in the Global expression section,
and then implement it using the relevant attribute fields in the Formula
section. So if you've managed to get Pyculator working but are still
struggling with the formula, you could try the following (I haven't tested
it):

*Global expression:*
def f(x): return {None:0,}.get(x,1)

*Formula*
value = f( <maxspeed> )

You might get more clarity on how to translate a case statement for
Pyculator by looking at the following issues on the bug tracker:

http://hub.qgis.org/issues/6374#note-4
http://hub.qgis.org/issues/6578

See also:
http://stackoverflow.com/questions/60208/replacements-for-switch-statement-in-python
(case
statements in Python)
http://stackoverflow.com/questions/7030029/python-is-it-reasonable-to-use-none-as-a-dictionary-key


Kind regards,
Rudi


On Mon, Jan 7, 2013 at 2:23 PM, Nathan Woodrow <madmanwoo at gmail.com> wrote:

> No you can upload as many versions as you like. Just mark the plugin as
> experimental so that people know that it is under development.
>
> - Nathan
>
>
> On Mon, Jan 7, 2013 at 10:22 PM, Victor Olaya <volayaf at gmail.com> wrote:
>
>> But that will create a huge number of versions in the plugin page. I
>> thought that it was meant to be used for stable versions, not for
>> daily ones, right?
>>
>> Victor
>>
>> 2013/1/7 Paolo Cavallini <cavallini at faunalia.it>:
>> > Il 05/01/2013 16:31, Victor Olaya ha scritto:
>> >
>> >> I am thinking about creating daily versions of the SEXTANTE code, so
>> >
>> > can't you just publish it through plugins.qgis.org?
>> > a simple script to zip and upload it should do the trick.
>> > all the best.
>> > --
>> > Paolo Cavallini - Faunalia
>> > www.faunalia.eu
>> > Full contact details at www.faunalia.eu/pc
>> > Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario
>> > _______________________________________________
>> > Qgis-user mailing list
>> > Qgis-user at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/qgis-user
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130107/ef986834/attachment.html>


More information about the Qgis-user mailing list