Displaying Geometrydata on map

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

Hi..

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 ??

 

/Fstampe

Developer
Dec 14, 2010 at 8:12 AM

Please have look here for a similar problem with a solution. I think it will work for your situation as well. http://sharpmap.codeplex.com/Thread/View.aspx?ThreadId=238076

Coordinator
Dec 14, 2010 at 10: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 11:01 AM

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...

 

/FSTampe

Developer
Dec 14, 2010 at 11:05 AM

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