OK, my view is called puntigronda and is based on a layer storing height of civil buildings (
4P000QG_QUOTA_GRONDA). It's geometry column is "the_geom".<div><br><div>SELECT f_table_name, f_geometry_column, srid, type </div><div>FROM geometry_columns;</div><div><br></div><div>returns:</div><div><br></div>
<div><div>"gtest";"geom";0;"LINESTRING"</div><div>"puntigronda";"the_geom";3004;"POINT"</div><div>"entities";"wkb_geometry";3004;"GEOMETRY"</div>
</div><div><br></div><div>then:</div><div><br></div><div><div>DROP VIEW puntigronda;</div><div>DELETE FROM geometry_columns WHERE f_table_name = 'puntigronda';</div><div><br></div><div>SELECT f_table_name, f_geometry_column, srid, type </div>
<div>FROM geometry_columns;</div></div><div><br></div><div>returns:</div><div><br></div><div><div>"gtest";"geom";0;"LINESTRING"</div><div>"entities";"wkb_geometry";3004;"GEOMETRY"</div>
</div><div><br></div><div>then:</div><div><br></div><div><div>CREATE OR REPLACE VIEW public.puntigronda AS </div><div> SELECT entities.ogc_fid, ST_TRANSFORM(entities.wkb_geometry, 3004)::geometry(pointz, 3004) as the_geom, entities.layer </div>
<div>   FROM entities </div><div>  WHERE entities.layer like '4P000QG_QUOTA_GRONDA';</div><div>  </div><div>INSERT INTO geometry_columns (f_table_catalog,f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid,type) </div>
<div>  VALUES ('','', 'puntigronda', 'the_geom', 3, 3004,'POINTS');</div><div><br></div><div>SELECT f_table_name, f_geometry_column, srid, type </div><div>FROM geometry_columns WHERE f_table_name = 'puntigronda';</div>
</div><div><br></div><div>returns:</div><div><br></div><div>"puntigronda";"the_geom";3004;"POINT"</div><div><br></div><div>and:</div><div><div>SELECT f_table_name, f_geometry_column, srid, type </div>
<div>FROM geometry_columns;</div></div><div><br></div><div>returns:</div><div><br></div><div><div>"gtest";"geom";0;"LINESTRING"</div><div>"puntigronda";"the_geom";3004;"POINT"</div>
<div>"entities";"wkb_geometry";3004;"GEOMETRY"</div></div><div><br></div><div>The view puntigronda, as I connect qgis to postgis, is seen as point layer. Qgis don't need to scan the whole table to understand which geometry type is in there.</div>
<div>At the same time Qgis takes a lot to scan the view entities (mixed point and polylines table), so if I want to load the view/layer puntigronda I have to wait until qgis finish to scan the entities layer.</div><div><br>
</div><div>Is there something wrong?</div><div>Thankyou</div><div>Pietro</div><div><br></div><br><div class="gmail_quote">2012/10/19 Pietro Rossin <span dir="ltr"><<a href="mailto:pierigis@gmail.com" target="_blank">pierigis@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><p><br>
> > <br>
> > It works instead.. <br>
> > I saw that "geometry_columns" is a view but the method works.<br>
><br>
> Works at doing what ? It probably just silently does nothing. <br></p>
</div><div class="im"><p>If I make the above command and I look into the geometry column view I can see a row with my information added.</p>
</div><p>> What does this return ? <br></p><div class="im">
><br>
>   SELECT f_table_name, f_geometry_column, srid, type <br>
>   FROM geometry_columns WHERE f_table_name = 'pointdata'; </div><p></p>
<p>I'll try Monday at work.. </p>
<p>> > The view created is correctly and immediately seen by qgis that loads the <br></p><div class="im">
> > point data. <br>
> > The only problem is that it takes a year to load it.. <br>
><br>
> That's because QGis scans the whole table since it's unable to find <br>
> the type and srid information in the geometry_column table. <br>
> Am I wrong ? <br>
></div><p></p>
<p>No it immediately find the type and srid information. <br></p><div class="im">
In qgis when I open a connection there is a layer called mypointdata and it's seen as point feature. When I click on add layer qgis take a lot to load it. <br>
But I think It's a question of data to be loaded.  In fact I tried to make a new view with only 2 fields in it and qgis is much more fast on loading it.<br>
Pietro </div><p></p>


        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://postgis.17.n6.nabble.com/How-to-make-some-geometry-column-visible-to-Qgis-tp5000570p5000607.html" target="_blank">Re: How to make some geometry column visible to Qgis</a><div class="HOEnZb">
<div class="h5"><br>
Sent from the <a href="http://postgis.17.n6.nabble.com/PostGIS-User-f3516033.html" target="_blank">PostGIS - User mailing list archive</a> at Nabble.com.<br></div></div><br>_______________________________________________<br>

postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br></div>