This project has moved and is read-only. For the latest updates, please go here.

Creating labels from data in a related table?

Topics: Algorithms, Data Access, General Topics, SharpMap v0.9 / v1.x
Nov 8, 2010 at 8:31 PM

Hello all,

I'm still using SharpMap v0.9.  Is it possible to create labels based on related data?

In other words, if I have a point shape file with one field "MapID" that's related to another table say MapInformation with a matching MapID field and a text field "LabelText", can I use the related "LabelText" field as the source of the label text?

Currently my data is in MSSQLCE3.1 and I am using ESRI shape files. 

If this isn't possible, is it possible in v2?

Is this possible in some other data source or geometry source?

If some combination is possible, could someone provide an example of how it could be accomplished?








Nov 9, 2010 at 3:22 PM

Hi Rick, try:


public string GetLabelText(FeatureDataRow fdr){

return LookupSomeValue(fdr.OID);

labelLayer.LabelStringDelegate = GetLabelText;

Nov 9, 2010 at 3:58 PM


Thanks for the tip, I'll give it a try & post the results to the discussion thread.