Hello Frank,<br>thanks for your answer.<br><br>I tried looking at OGR documentation, and I found the method you wrote:<br><br>OGRDataSource * OGRSFDriverRegistrar::Open ( const char * pszName, int bUpdate = FALSE, OGRSFDriver ** ppoDriver = NULL ) .<br>
<br>I don't understand the first parameter: is it the NAME of a PSQL istance or an handle? And, in this case, should I connect using the psql library? <br>Please can you give me a simple example? <br><br>Thanks a lot,<br>
Flavio<br><br><div class="gmail_quote">2009/7/7 Frank Warmerdam <span dir="ltr"><<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Flavio Perri - QMap srl wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
dataSource = poDriver->CreateDataSource("layerName",(char**)options );<br>
<br>
[...]<br>
<br>
I always get a NULL dataSource, and I'm stuck.<br>
<br>
I'm sure that OGR is capable to connect to PGSQL, because I tried the tool "ogr2ogr" and it connects to PG and manipulate GIS data with a simple connection string like: PG:"dbname='databasename' host='addr' port='5432' user='x' passwd='y'".<br>
</blockquote>
<br></div>
Flavio,<br>
<br>
OGR does not support creating new postgres database instances. What<br>
you want to do is connect to an existing instance in update mode using<br>
OGROpen() or OGRSFDriverRegistrar::Open().<br>
<br>
Best regards,<br><font color="#888888">
-- <br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/%7Ewarmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush | Geospatial Programmer for Rent<br>
<br>
<br>
</font></blockquote></div><br>