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 : [email protected] [[email protected]] de la part de Efi 
[[email protected]]
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 
[email protected]<mailto:[email protected]>.
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to