[Fwd: Re: [Gdal-dev] ogrinfo output lists no features on a postgis layer created as a copy using "create table as"]

Dolf Andringa dolf.andringa at elcyion.nl
Sun Dec 17 05:54:31 EST 2006


Ok, Frank helped me a lot!
I found the difference between the two ogrinfo calls on the two tables.
The table which does not seem to contain any features show the following 
output when I turn on CPL_DEBUG:

INFO: ---------- General Layer Report ----------
OGR_PG: PQexec(DECLARE countCursor CURSOR for SELECT count(*) FROM 
promedico-acni_ds."lw" )

OGR_PG: DECLARE countCursor CURSOR for SELECT count(*) FROM 
promedico-acni_ds."lw" ; failed.
OGR_PG: Unable to get extent by PostGIS. Using standard OGRLayer method.
OGR_PG: PQexec(DECLARE OGRPGLayerReader CURSOR for SELECT "ogc_fid", 
AsEWKT("wkb_geometry"), "adresnr", "huislt", "huisnr", "postk_a", 
"postk_n", "straat", "toev", "x_coord", "y_coord" FROM 
promedico-acni_ds."lw" )



The table which does seem to contain features shows just the following 
General Layer Report:

OGR_PG: PQexec(DECLARE countCursor CURSOR for SELECT count(*) FROM 
acni_bnd."ACNi_shp" )


So I guess it is a problem with (my) PostGIS (setup). Any ideas? Thanks 
for your help!

Dolf.

-------- Originele bericht --------
Onderwerp: Re: [Gdal-dev] ogrinfo output lists no features on a postgis 
layer created as a copy using "create table as"
Datum: Sat, 16 Dec 2006 18:42:24 -0500
Van: Frank Warmerdam <warmerdam at pobox.com>
Aan: Dolf Andringa <dolf.andringa at elcyion.nl>
Referenties: <4584163B.8040908 at elcyion.nl>

Dolf Andringa wrote:
> Hello everybody,
> 
> I have a problem with ogrinfo (gdal-1.3.2) and postgres 8.1.5/postgis 
> 1.1.6 running on debian linux.
> 
> I have imported a shapefile into postgis using the python ogr module. 
> When I use ogrinfo to get the number of features of this pg table, the 
> correct number of features is shown. All other data is correct as well. 
> Using ogr2ogr to create a shapefile from this pg layer (as a check) 
> gives a correct shapefile again, so the postgres table is ok.
> Subsequently I do a create table as to make a copy of this table within 
> postgres. I am doing these queries:
> CREATE TABLE "promedico-acni_ds"."lw" AS SELECT * FROM 
> "acni_bnd"."ACNi_shp"
> INSERT INTO public.geometry_columns 
> (f_table_catalog,f_table_schema,f_table_name,f_geometry_column,coord_dimension,srid,type) 
> VALUES ('','promedico-acni_ds','lw','wkb_geometry',2,-1,'POINT')


Dolf,

I'm sorry but I don't know what is going wrong.  If you file a detailed
bug report with easy to reproduce steps (hopefully a small dataset for
instance) then hopefully we can dig into this before the 1.4.0 release
is finalized.

I would also note that you can see most of the SQL queries that OGR
is issuing to postgres if you define the CPL_DEBUG environment variable
with the value ON.  This might help with diagnosing the problem.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, 
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list