Read DGN with sharpmap

Dec 1, 2010 at 12:16 AM


I am using sharpmap in your project to display shapefile, its great.

I try display dgn file on sharpmap using ogr, it works, but labels in label layer can not rotate, I don't find name of RotationColumn.

Help me. please


Dec 1, 2010 at 7:17 AM

Hello ngvanmy,

RotationColumn is a property of LabelLayer. If it is not there, updating your sharpmap source will help ;-).

Hth FObermaier

Dec 1, 2010 at 10:03 AM

Hello FObermaier,

Thanks for reply,

when i try display dgn file, first it only display vector layer, i add a label layer to mapcontrol and set LabelColumn = "text" then it display text from dgn to mapimage,

but this text can not rotate (because i have not set RotationColumn property of LabelLayer).

I can not find name of RotationColumn so that i can not set RotationColumn property, eg (labelLayer.RotationColum="xxxx")

sorry for my english


Dec 1, 2010 at 10:44 AM

You are saying that your datasource does not have a column from where to retrieve the label rotation angle?

If you do not have such column in your datasource and you want to set an overall rotation angle, you can set the LabelStyle.Rotation value

Hth FObermaier

Dec 3, 2010 at 6:25 AM


I don't want to set an overall rotation angle, each text in dgn file have a rotation angle, my code:

SharpMap.Data.Providers.Ogr provider = new SharpMap.Data.Providers.Ogr("HSKT.dgn");

SharpMap.Layers.LabelLayer lblLayer = new SharpMap.Layers.LabelLayer("lbl");

lblLayer.DataSource = provider;

lblLayer.LabelColumn = "text";

lblLayer.RotationColumn = "?????";// i want to set this value, but i can not find it anywhere


Dec 3, 2010 at 6:54 AM

It must be one of the columns in the featuredatatable that the ogr provider returns using ExecuteIntersectionQuery function.

I assume though, that the rotation angle is not part of the features attributes but instead stored in the ogr-style definition.
ATM those are not evaluated. If this is the case you can join efforts with

Hth FObermaier