Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am currently doing a project that needs a GIS front-end interface to visualize geographical objects (road networks), and a back-end geo-spatial database to implement network analysis (SQL based). Our development platform is based on C#. I understand QGIS is powerful and available but as we really want to build an independent platform so we do not consider it.

Now, the progresses include:

  • I have built a front-end Dotspatial based GIS interface, it can display the road networks and query them as we want.
  • I have installed the PostgresSQL and its spatial extension PostGIS.

However, the current issue is how to connect the Dotspatial GIS platform with PostGIS/PostgresSQL in order to perform the analysis we need. What I really want is to do all activies at interface side. For example, by selecting a button the software do analysis automatically, and everything is going without other operation at PostGIS database side.

How can I start? Any information or helps? Many thanks!

share|improve this question

2 Answers 2

Russel is right, currently there is no driver that would let you connect your dotSpatial application to a PostgreSQL/PostGis database.

However you could load your features into a FeatureSet and display that. There is an example in the dotSpatial discussion forum that describes how to do just that with an SqlServer 2008+ database table. You can use that as a head start. A side note, this is a readonly, all-in-memory approach.

I don't know why you're going with dotSpatial, SharpMap is my first choice.

share|improve this answer
    
Hello FObermaier, –  Hao Ye Jul 1 '13 at 13:08
1  
Hello FObermaier, I have just found a library called Npgsql which allow me easily connecting to PostGIS and PostSQL database based on windows form C#. I think I might need to write some code to read the data table and display it on the map? –  Hao Ye Jul 1 '13 at 13:18
    
Hello FObermaier, you mentioned a example in the discussion as it was shown in dotspatial.codeplex.com/workitem/206, but I could not find this example as the web has gone. Do you have other example shown on the internet? –  Hao Ye Jul 1 '13 at 13:23
    
Hello FObermaier, Do you know any Open-source GIS that has the extension to PostGIS so I can work with? Can SharpeMap do that for me? –  Hao Ye Jul 1 '13 at 13:42
    
The code to read the featureset is at the bottom of the discussion. You certainly need to adapt that for the use of PostGis. Basically it boils down to replacing system.data.sqlclient with npgsql and Sql[Geometry|Geography]Reader with PostGisReader. SharpMap has a PostGis provider and can display that kind of data nicely –  FObermaier Jul 2 '13 at 7:42

From a quick look at the Dotspatial documentation it appears that it only works with shapefiles and you would need to write your own extension for PostGIS or OGR.

You might have a look at MapDotNet- www.mapdotnet.com - a fully featured .Net GIS suite supporting a number of back-ends including PostGIS.

Disclaimer: I am a MapDotNet developer.

share|improve this answer
    
Many thanks for your reply.I had a look at MapDotNet but i think as it is commercial one and our project cannot provide that big sum of money, (up to $1000 per/year is expensive) –  Hao Ye Jun 26 '13 at 14:44
1  
You can develop and run in Express mode without licensing, however, the server engine will only use two threads instead of letting you configure thread limits. –  Russell at ISC Jun 26 '13 at 16:00
    
Hello Russell, thanks. But what is the difference of using two threads rather than self-configured thread limits?Do you mean the speed of computation is heavily influenced? –  Hao Ye Jul 1 '13 at 13:31
    
The thread limit reduces throughput especially under load. Two threads are fine for development or just a small user base (in-house app) but for maximum performance I generally configure 2 threads per core. –  Russell at ISC Jul 2 '13 at 13:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.