[postgis-users] PostGIS table doesn't show up in QGIS

Ben Madin lists at remoteinformation.com.au
Wed Sep 14 19:41:51 PDT 2011


Puneet,

Not uncommon problem - QGIS looks in the Geometry_columns table - you might want to check that the geometry column is registered in this table. If not you can run :

SELECT Populate_Geometry_Columns(); -- for all tables

or

SELECT Populate_Geometry_Columns('public.myspatial_table'::regclass); -- for myspatial_table

http://postgis.refractions.net/documentation/manual-1.5/Populate_Geometry_Columns.html

Note that using AddGeometryColumns() does this, but it can be corrupted. Importing tables doesn't do this automagically.

cheers

Ben






On 15/09/2011, at 10:07 AM, Puneet Kishor wrote:

> This happens from time to time... I have a table like so
> 
> CREATE TABLE foo
> (
>  gid serial NOT NULL,
>  the_geom geometry,
>  CONSTRAINT foo_pk PRIMARY KEY (gid ),
>  CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
>  CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 4326)
> )
> WITH (
>  OIDS=FALSE
> );
> 
> ALTER TABLE foo
>  OWNER TO postgres;
> 
> CREATE INDEX foo_geom_idx
>  ON states
>  USING gist
>  (the_geom );
> 
> Yet, the above table doesn't show up in QGIS open dialog. If I check the box to show tables with no geometry, then the above table shows up as not having any geometry. The table has 20K+ rows, and while a few rows have invalid geometry, for the most part, the table has good data in it.
> 
> What is the reason for the above?
> 
> Puneet.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list