[Gdal-dev] gdal 1.2.6 and postgis 0.9.2 OK - gdal 1.3.1 and
postgis 1.1.3 KO
Arlo
arlo.borras at dryade.net
Thu Jul 20 03:50:39 EDT 2006
Frank Warmerdam a écrit :
> Arlo wrote:
>> Hi All,
>>
>> I'm dealing now with a big issue on my project.
>> I use GDAL in my c++ code to connect to a custom database wich contains
>> a few geometrics data like this
> ...
>> Everything works fine as long as i used gdal 1.2.6 and postgis 0.9.2,
>> but i need to install my project on a new platform which contains
>> postgis 1.1.3.
>>
>> My first try with a updated postgis was'nt sucessful. My c++ code fail
>> on getting the geometry of my feature (feature->GetGeometryRef() = NULL)
>>
>> I thought that gdal 1.2.6 isn't compatible with postgis >= 1 (new
>> postgresql binary stockage of geometry ?), so i try gdal 1.3.2 without
>> more success
>>
>> Symtoms are :
>>
>> * the new orginfo (1.3.1) are silent about the two databases i test
>> (postgis 0.9.2 and 1.1.3 ). It just say
>>
>> ./ogrinfo -al "PG:dbname=...host=192.168.0.129 user=...password=..."
>> INFO: Open of `PG:dbname=...host=192.168.0.129 user=sytadin
>> password=...'
>> using driver `PostgreSQL' successful.
>
> Arlo,
>
> Are your layers properly registered in the GEOMETRY_COLUMNS table?
> I think that at some point in history, the OGR PG driver was changed
> to only treat tables listed in GEOMETRY_COLUMNS as layers.
>
> I'm not surprised that GDAL 1.2.6 doesn't work against PostGIS 1.0+.
> I'm currently using PostGIS 1.0.x, so it is possible there are some
> issues with 1.1.x but I would expect them to be debilitating or I
> would have heard quite a bit about it.
>
> Best regards,
Frank,
You've just given me the right way. Indeed, i've never registered my
layers in the GEOMETRY_COLUMNS table.
So, i just insert information about by layer like this :
insert into geometry_columns
values('','public','theme_arc_general','the_geom',2,27582,'LINESTRING');
insert into geometry_columns
values('','public','theme_arc_general_fond','the_geom',2,27582,'LINESTRING');
insert into geometry_columns
values('','public','theme_arc_sectoriel','the_geom',2,27582,'LINESTRING');
...
After that, my programs works now perfectly
Many thanks for your helpfull response.
Arlo
More information about the Gdal-dev
mailing list