Hi Guillaume,

I was under the impression that a FieldS functor would already get to 
fields, but indeed looking at the code I see that I should not assume.

I have created AttributesMapLabelObjectWithClassLabelFieldsFunctor and it 
works great.

Some limitation: 8 characters maximum for field names else there are errors 
in the transfer and the values are lost...

Let me know if you want to integrate this new functor into OTB.

Thank you for the help!

Regards,

DD


On Friday, 19 September 2014 08:36:12 UTC-4, Guillaume Pasero wrote:
>
>  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] 
> <javascript:>
> To unsubscribe from this group, send email to
> [email protected] <javascript:>
> 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] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> -- 
>   <http://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] <javascript:>   
>  

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