This project is read-only.

OgrVectorProvider missing?

Aug 14, 2012 at 7:17 PM

Hi all, trying to get to grips with DotSpatial and so for having some great experiences with it's ease of use.  Couple of questions though...

I'm trying to figure out how to connect to my running Postgres + Postgis install and display / edit features in there rather than in shape files.

I can't really find any consistant "How to" code to do this, the only one that even makes a small amount of sense uses 'OgrVectorProvider' which I just can't seem to find in ANY of the latest dot spatial download anywhere.

Iv'e reverse engineered everything using IL-Spy and the Object browser in VS2010, and I cannot find any class or name space that matches, so my questions are as follows:

 

1) Where is - OgrVectorProvider and exactly what do I need to reference / add to my usings to get it?

2) Does anyone have a straight forward step by step no nonsense code snippet on how to connect my DotSpatial map control to my PostGis server?

Cheers

 

Shawty

Aug 14, 2012 at 11:31 PM
Edited Aug 14, 2012 at 11:32 PM

1) DotSpatial.Data.Rasters.GdalExtension assembly. The namespace for usings will be a bit different.

Aug 15, 2012 at 1:47 PM

Thanks mudnug.

 

Any tips on best way to connect the database?

Aug 19, 2012 at 12:33 PM

Ok so Iv'e been through everything I downloaded from here and no where can I find the above mentioned namespace in any of the DLL's provided in ANY of the DotSpatial downloads.

While I appreciate that a lot of this stuff is handled by the app manager, and put into the plugins folder for it all to happen automagically, that's not what I'm attempting to do.

I'm trying to put together a simple GIS application of my own using just the dotspatial DLL's as an example program in the book I'm writing on creating GIS apps in .NET, and so I actually need to be able to code against this library and not just have it loaded to allow usage from the app.

All I simply want to do is have the user click a button, it opens a postgis layer in a DB, allows them to alter it, then click another button to save it.

From the scatered documentation I've found so far about opening a PostGis connection everyone of them has mentioned 'OgrVectorProvider' , from Mudnugs response above it's in 'Dotspatial.Data.Rasters.GdalExtension' , this assembly DLL doe not exist in any of the downloads I have.

I'd love to use Dot Spatial for my Book Examples (and give it a bit of an extra plug to the general dev community too, not just GIS specialists) but as my deadline is fast approaching if I can't resolve this I may have to find something else.

Does anyone have a simple set of steps / or source code / or blog post that starts at A and ends at Z, everything else I need my program to do Iv'e already got working, what I need to finish it off is to say....

These are namespaces you need

This is how you use them

This is how you connect to PostGis

This is how you alter the data

This is how you save the altered data back to Postgis

 

Since PG is the grandaddy of all GIS databases, I find it odd that no-one has yet written any code to perform this relitively simple task, any help form anyone?

Even just assistance getting the correct assembly / namespace loaded so I can write code against it to use OgrVectorProvider will help.

Cheers

Shawty

Aug 24, 2012 at 6:50 PM

OgrVectorProvider is in GdalExtension. I've updated  DotSpatial 1.3 Extended.zip today to include this in the Plugins/GDAL folder.

Aug 25, 2012 at 1:00 PM

Thanks mudnug :-)

Aug 27, 2012 at 6:37 PM

You're welcome.

Nov 28, 2012 at 4:43 AM

Continuing on this type of question, you may be interested

http://dotspatial.codeplex.com/discussions/404817