[Gdal-dev] Connect to Postgre?

Tyler Mitchell tjmitchell at riverside.bc.ca
Fri Jun 25 19:28:35 EDT 2004


I'd highly recommend getting a hold of the openev_fw build which includes 
a whack of other tools, including a more complete set of GDAL already 
built for your platform.
ftp://ftp.remotesensing.org/pub/gdal/openev/

Hope that helps.

"Chapman, Martin" <MChapman at sanz.com> wrote on 06/25/2004 04:07:14 PM:

> Tyler,
> 
> I tried that but it doesn't recognize pg as a driver:
> 
> C:\gdal\ogr>ogrinfo "PG:dbname=ew host=172.17.38.86"
> FAILURE:
> Unable to open datasource `PG:dbname=ew host=172.17.38.86' with the
> following drivers.
>   -> ESRI Shapefile
>   -> UK .NTF
>   -> SDTS
>   -> TIGER
>   -> IHO S-57 (ENC)
>   -> MapInfo File
>   -> DGN
>   -> GML
>   -> AVCBin
>   -> REC
>   -> Memory
> 
> I am using Windows 2000 server and VC++ (latest version).  I use GDAL
> and OGR a lot, so I know the libs work.  I think that the PG support is
> not enabled in my build.  How do I enable the build to turn on support
> for PG?  By the way, I actually have my app on both Linux Redhat 9 and
> Windows, so instructions on how to enable it on both, or either, is
> fine.
> 
> Thanks for the help.
> 
> Martin
> 
> -----Original Message-----
> From: Tyler Mitchell [mailto:tjmitchell at riverside.bc.ca] 
> Sent: Friday, June 25, 2004 4:59 PM
> To: Chapman, Martin
> Cc: gdal-dev at remotesensing.org
> Subject: Re: [Gdal-dev] Connect to Postgre?
> 
> 
> Hi Martin,
> It is quite often already enabled.  I'd try using one of the command
> line 
> utilities first to ensure it works.  I.e.:
> > ogrinfo "PG:dbname=mydatabase host=giserver"
> 
> That should give you a list of layers (tables) in the db.
> 
> What language are you programming in?
> 
> Tyler
> 
> gdal-dev-bounces at xserve.flids.com wrote on 06/25/2004 01:58:44 PM:
> 
> > All,
> > 
> > How do I connect to a Postgre database using OGR?  In other words,
> > how do I put together my connection string to pass to 
> > OGRSFDriverRegistrar::Open()?  I tried the following:
> > 
> > OGRSFDriverRegistrar::Open("PG:pghost=172.17.38.85;pguser=pbarker;
> > pgpass=pbarker;dbname=ew", 0);
> > 
> > but it returns a NULL dataset.  Does anyone know what I'm doing
> > wrong?  Is Postgre support enabled in the GDAL build automatically?
> > 
> > Thanks,
> > 
> > Martin Chapman
> > Cell 303-885-1936
> > Office 303-660-3933 x226
> > mchapman at sanz.com
> > http://www.sanz.com
> > 
> >  _______________________________________________
> > Gdal-dev mailing list
> > Gdal-dev at xserve.flids.com 
> > http://xserve.flids.com/mailman/listinfo/gdal-dev
> 




More information about the Gdal-dev mailing list