Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 113
Registered: ‎01-14-2018
Accepted Solution

PostGIS Connection

Dear all,

 

What is the connection Type property corrseponding to PostGIS?

 

Best Regards,

Khaled

Technical Evangelist
Posts: 927
Registered: ‎09-11-2015

Re: PostGIS Connection

Hi Khaled,

 

It's: PostGISRW.GDatabase

 

Can be found in registry > HKEY_CLASSES_ROOT\PostGISRW.GDatabase

 

Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Frequent Contributor
Posts: 113
Registered: ‎01-14-2018

Re: PostGIS Connection

Thanks Jan,

 

What about the connection parameters? as I tried to connect using the location property as following:

PClient.Connection postGisConn = _currentApplication.CreateService("GeoMedia.Connection") as PClient.Connection;
postGisConn.Type = "PostGISRW.GDatabase";
postGisConn.Name = "PostGIS Connection";
postGisConn.Location = @"geodata@192.168.56.101:5432";
postGisConn.Mode = 1;
postGisConn.Connect();

Are there any properties I should specify before connecting?

 

Thanks

Khaled

Technical Evangelist
Posts: 927
Registered: ‎09-11-2015

Re: PostGIS Connection

Hi Khaled,

 

Use .ConnectInfo instead of .Location property.

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Technical Evangelist
Posts: 927
Registered: ‎09-11-2015

Re: PostGIS Connection

Actually, the correct syntax for ConnectInfo is:

"host=<host name> dbname=<db name> user=<user name> password=<password> port=<port>". 
Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.