[postgis-users] How to make some geometry column visible to Qgis

Pietro Rossin pierigis at gmail.com
Fri Oct 19 02:34:42 PDT 2012


>> INSERT INTO geometry_columns (f_table_catalog,f_table_schema,
>> f_table_name, 
>> f_geometry_column, coord_dimension, srid,type) 
>>   VALUES ('testdb','public', 'pointdata', 'geom', 3, 3004,'POINT'); 

>This shouldn't work, as "geometry_columns" is a view (assuming you
correctly 
>installed PostGIS-2.0).

It works instead..
I saw that "geometry_columns" is a view but the method works.

The view created is correctly and immediately seen by qgis that loads the
point data.
The only problem is that it takes a year to load it..

My postgis is:

SELECT name, default_version,installed_version
FROM pg_available_extensions WHERE name LIKE 'postgis%' ;

"postgis";"2.0.0";"2.0.0"
"postgis_topology";"2.0.0";"2.0.0"

I don't understand this:
Instead you want to cast your "wkb_geometry" field to a typed geometry: 

 SELECT "wkb_geometry::geometry(3004, pointz), ... 

I made my view like this:

CREATE OR REPLACE VIEW public.points AS 
 SELECT entities.ogc_fid, ST_TRANSFORM(entities.wkb_geometry,
3004)::geometry(pointz, 3004) as the_geom, entities.layer
   FROM entities
  WHERE entities.layer like 'mypointlayer';

Then

INSERT INTO geometry_columns (f_table_catalog,f_table_schema, f_table_name,
f_geometry_column, coord_dimension, srid,type)
  VALUES ('','', 'points', 'the_geom', 3, 3004,'POINTS');

It works..

But I'm learning, so if you have some hints, reccomendations or tutorial
please point me to that.

Thanks again
Pietro



--
View this message in context: http://postgis.17.n6.nabble.com/How-to-make-some-geometry-column-visible-to-Qgis-tp5000570p5000605.html
Sent from the PostGIS - User mailing list archive at Nabble.com.



More information about the postgis-users mailing list