Hi,

You have used the wrong fields functor type. The one you use here (LabelObjectWithClassLabelFieldsFunctor) is made to work on label ojects "LabelObjectWithClassLabel". It appears there is no "AttributesMapLabelObjectWithClassLabelFieldsFunctor", so you have to write your own : - write a new functor (take "otbLabelObjectWithClassLabelFieldsFunctor.h" as an example) - in the *operator()* function, you will have to copy the attributes of your current label object into a FieldsMapType (which is a plain *map<string,string>*) and return it. - then you can use this new functor as the field functor of your LabelMapToVectorDataFilter.

Regards,
Guillaume

Le 19/09/2014 03:00, DavDub a écrit :

Good day,

I am using an attributesmaplabelobjectwithclasslabel as labelobject type... I insert computed attributes into my labelmap and then use LabelMapToVectorDataFilter and then the attributes are NOT transfered into the shapefile...

What is wrong?

typedef otb::VectorData<double,2,double> VectorDataType;
typedef otb::Functor::LabelObjectWithClassLabelFieldsFunctor<FLSTReconstructFilterType::LabelObjectType> LabelObjectFieldsFunctorType;

typedef otb::LabelMapToVectorDataFilter<FLSTReconstructFilterType::LabelMapType, VectorDataType, LabelObjectFieldsFunctorType> LabelMapToVectorDataFilterType;

LabelMapToVectorDataFilterType::Pointer lm2vdFilter = LabelMapToVectorDataFilterType::New();

LabelObjectFieldsFunctorType functor = LabelObjectFieldsFunctorType();

lm2vdFilter->SetInput(reconstructFilter->GetLabelMap());
lm2vdFilter->Update();

Thank you!

DD
--
--
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.


--
<www.c-s.fr>      *Guillaume PASERO*
Ingénieur d'études et développement
*Business Unit E-SPACE & Geo Information* <https://thor.si.c-s.fr/blogs/cs-blogs-business/>*- Département APPLICATIONS*

*CS Systèmes d'Information*
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
+33 561 17 64 21 - [email protected]

--
--
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