Show attributes of a polyline (from dbf of SHP file)

Feel free to ask any question here
Post Reply
miaowang
Posts: 7
Joined: Mon Apr 15, 2019 8:54 am

Show attributes of a polyline (from dbf of SHP file)

Post by miaowang »

Hello,
When I select a polyline of a SHP file by mouse clicking, Properties Tree shows the properties of the polyline.
Is it possible to view attributes (from the corresponding Dbf file) alone with the polyline at Properties Tree or cc2DLable?
BTW, it seems that the dbf file is opened after loading shp file but not been closed.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Show attributes of a polyline (from dbf of SHP file)

Post by daniel »

Indeed the file was not closed (that's fixed). Thanks for the feedback.

For the attributes, one would have to load them as scalar fields... But that's not done this way currently (just as 'z' coordinate if chosen by the user)
Daniel, CloudCompare admin
miaowang
Posts: 7
Joined: Mon Apr 15, 2019 8:54 am

Re: Show attributes of a polyline (from dbf of SHP file)

Post by miaowang »

Hello Daniel,
Thank you for the reply.
miaowang
Posts: 7
Joined: Mon Apr 15, 2019 8:54 am

Re: Show attributes of a polyline (from dbf of SHP file)

Post by miaowang »

Hi Daniel,
I am trying to implement this function. First, a class named ccShpDbf is declared. ccShpDbf contains a member variable
vector < GenericDBFField* > m_Fields;
to store attributes loaded from a DBF file. Thd DBF file is loaded after loading SHP entities at ShpFilter.cpp. The attributes of a SHP entity can be retrieved via its index.
BUT, where should a ccShpDbf be stored. I have tried to add ccShpDbf to a SHP container (ccHObject) using addDependency(). It is obviously a bad idea. Could you give me a hint for this?
I know that all SHP entities are currently direct children of a container. I don't want to change this hierarchy because it will lead to more change of the other codes, e.g., Mouse Click.
Post Reply