[Qgis-user] Question on PostGIS Table and QGIS

Jeff McKenna jmckenna at gatewaygeomatics.com
Mon Jun 8 08:03:46 PDT 2015


On 2015-06-07 11:50 AM, Randal Hale wrote:
> I'm breaking new ground and I'm pretty sure this might be a mistake on
> my end. I just need to understand why.
>
> I've set up a PostGIS database. I'm importing data through DB manager
> into my schema.
>
> I imported some parcel records and discovered that I had multipolygons.
> So I decided to break them up into single polygons through the psql
> interface:
> create table trgtgis.parcels as select *, (st_dump(geom)).geom as
> the_geom from trgtgis.boundary;
>
> When I go back to QGIS I have two tables called parcels (only one listed
> if I look through postgresql). One table is what I suspect to see with
> column called the_geom, data Type as Geometry, Spatial type of Polygon,
> SRID of 26916. The second parcel table is greyed out and doesn't have a
> spatial type or a SRID. Neither lists a primary key (I need to go back
> and add one) but I don't think this is the problem...I think.
>
> Screenshot:
> https://drive.google.com/file/d/0B8WLtz606XDdcFIxaG5fNExpMlU/view?usp=sharing
>
>

Hi Randy,

I've seen this issue before (QGIS listing multiple layers for one 
PostGIS table), but I did solve it, I just can't remember how I did that 
ha :)

I believe one of my issues was that QGIS (and MapServer in fact) need a 
unique ID field, to display the data from PostGIS, so I always make sure 
to specify a unique ID field when creating tables for use in both QGIS 
and MapServer.

-jeff





-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/









More information about the Qgis-user mailing list