This project is read-only.

How use PostGIS in a client desktop application?

Apr 3, 2011 at 3:44 PM

Dear friends,

I have a doubt about how use a postgis database in a client desktop application.

If I need to use a database created and maintained with a desktop gis application in a client computer. Do I need to install postgre and postgis in the client computer to connect and maintain the database?

I only know the steps to install and create the database in the developer computer, but the later stepts I don't know how need to work.

Thanks in advanced.

Francisco J.

Apr 4, 2011 at 7:49 AM

You do not have to have the postgresql/postgis server on your desktop machine.

Depending on which way you go, you have to modify the connection string. If you use the DotSpatial.Data.Database solution you would have to setup your connection string according to http://www.connectionstrings.com/postgre-sql (Npgsql). Just change Server token to the ip of your postgresql server.

If you use OgrProvider, you'd have to change the filename property to something like

PG:"dbname='databasename' host='addr' port='5432' user='x' password='y'"

see: http://www.gdal.org/ogr/drv_pg.html. You'd have to expose an additional string property Layername to set the table to display.

Hth FObermaier

Apr 4, 2011 at 11:33 AM

Many thanks FObermaier,

 

I will try it as you comment and reference to me.

 

Francisco J.