Hello Victor,
thanks for replying.
It does run form the command line. But I can't figure out the correct
syntax for python. When the "feat" line is omitted in python, it does run
but all polygons are classified in one class, which is wrong... In the
command line I also specify all the attribute table columns to be used, as
a 'list', like:

- feat area perimeter complexity etc...

And I haven't found any sample code that includes more than one features.
Do you have any idea where to look for an answer? Also posted a question on
GIS stack exchange with no results yet..

Regards,
E

- feat area perimeter complexity etc..

jhm



On Tue, Dec 4, 2018 at 5:09 PM Poughon Victor <victor.poug...@cnes.fr>
wrote:

> Hi Efi
>
> What are the field names in your shapefile? Are you sure it contains
> "area"? You can see it in QGIS (right click -> "Open attributes table" I
> think).
>
> Another debug thing you can try is calling from the command line (with
> otbcli_VectorClassifier...) to see if you get the same error.
>
> Best,
>
> Victor Poughon
> ------------------------------
> *De :* otb-users@googlegroups.com [otb-users@googlegroups.com] de la part
> de Efi [efili...@gmail.com]
> *Envoyé :* mardi 4 décembre 2018 14:39
> *À :* otb-users
> *Objet :* [otb-users] vector classification, specifying parameters
>
> Hello,
>
> I am trying to classify a vector layer with otb and python. In Monteverdi
> all works fine. I think there must be a mistake in the code when defining
> the 'cfield' and/ or the 'feat' parameters. Here is the code (also attached
> as .py file):
>
> import otbApplication
> VectorClassifier =
> otbApplication.Registry.CreateApplication("VectorClassifier")
> VectorClassifier.SetParameterString("in", "zonals_22.shp")
> VectorClassifier.SetParameterString("model", "model.txt")
> #VectorClassifier.SetParameterString("cfield", "class")
> #VectorClassifier.SetParameterString("feat", "area", "perimeter",
> "complexity", "_mean", "_std", "pmr")
> VectorClassifier.SetParameterString("out", "out4.shp")
> VectorClassifier.ExecuteAndWriteOutput()
>
> Output is: itk::ERROR: ListViewParameter(0000000001023A20): Cannot find
> area
> Any suggestions?
> E
>
> --
> --
> Check the OTB FAQ at
> http://www.orfeo-toolbox.org/FAQ.html
>
> You received this message because you are subscribed to the Google
> Groups "otb-users" group.
> To post to this group, send email to otb-users@googlegroups.com
> To unsubscribe from this group, send email to
> otb-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/otb-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "otb-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to otb-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> Check the OTB FAQ at
> http://www.orfeo-toolbox.org/FAQ.html
>
> You received this message because you are subscribed to the Google
> Groups "otb-users" group.
> To post to this group, send email to otb-users@googlegroups.com
> To unsubscribe from this group, send email to
> otb-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/otb-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "otb-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to otb-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to