ThinkGeo.com    |     Documentation    |     Premium Support

How to - Attach data to vertex

Dear support,


I need to attach data to vertices and I'm looking for the best approach to do it.


We need to add GPS info to vertex (#sat, time, DOP...) in order to display them on tooltips.

We are using our own file format to read/write so this is not a IO issue.


Regards


Patrick.



Patrick,


Maybe I am misunderstood; PLEASE let me know if I understand anything wrong!


Basically, what you are trying to do is to find a suitable class or structure to hold all the information from the GPS for later use(just like the tool tip)?


If so, hopefully my following answers can give you some help!


Vertex is just a light weight structure which holds the longitude and latitude, so I think it is not suitable to hold information data onto it.


Feature is a decent structure for this task. For example, the information for GPS contains following:
Time: 20090629
 DOP : “DOPValue”
SAT : “Sat” 
Etc.
 
Then you can create a feature like this:

Feature feature = new Feature(new Vertex(0.0, 1.0), "FirstGPSdata");
feature.ColumnValues.Add("Time", "20090629");
feature.ColumnValues.Add("DOP", "DOPValue");
//etc

Any more questions just let me know.


 
Thanks.
 
Yale

Ok, let me clarify. 
  
 Let say that I’ve a Line feature or a Polygon feature. 
 Column values allow me to add data for the entiere feature. 
  
 but what if I need to recall gps information for each vertices of the feature? 
  
 Patrick.

Patrick, 
  
 I think the best way is to add ONE point feature for EACH GPS information. All the vertexes in one Line feature or Polygon feature are sharing the same columns data; we CANNOT make a difference between any two different vertexes within one Line feature or Polygon feature according to the shared column data. 
  
 If I am not clear, just let me know! 
  
 Thanks. 
  
 Yale