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

Displaying Geometrydata on map

Topics: General Topics, SharpMap v2.0, WinForms Controls
Dec 14, 2010 at 8:59 AM


Is there any way, and if so how, to display geometry shapes on a map when i have the data in a text field in my database...??


I have a database, where the Point/MultiPolygon and so on, are stored as simple text fields (nvarchar) .. How do i put that data up on a map with SharpMap ??



Dec 14, 2010 at 9:12 AM

Please have look here for a similar problem with a solution. I think it will work for your situation as well.

Dec 14, 2010 at 11:26 AM

Hello FStampe,

for your Point data you can use OleDbPoint provider, for polygon data you will have to adapt some provider that matches your db the closest.

For parsing your geometry data, you can use

  • SharpMap.Converters.WellKnownText.GeometryFromWKT and
  • SharpMap.Converters.WellKnownText.GeometryToWKT

for parsing your geometries. Keep in mind, that this is an expensive Task and consider importing your spatial data into some spatially enabled database.

Hth FObermaier

Dec 14, 2010 at 12:01 PM

Thanks to both of you...


I've tried some of the how to's, but for now i can't even seem to put a basic map on my form, let alone any overlays...


I was sort of hoping to be able to draw an overlay to something like a googlemap or something like that...



Dec 14, 2010 at 12:05 PM

Try to experiment with the WinFormsExamples which you can find in the sourcecode.