Re: [Qgis-user] Adding postgis views to qgis

2015-10-21 Thread Alexandre Neto
You can add views from the add postgis layer but your view must have a few
tweaks.

First, add an Id, even if a fake id with rownumber () over ().

Then, you need to explicitly cast your geometry and CRS.  Therefore use
this instead

ST_DumpPoints(geom).geom::geometry('point',your_EPSG_code)

A 17h06 Ter, 20 de Out de 2015, Clifford Snow 
escreveu:

>
> On Tue, Oct 20, 2015 at 7:35 AM, Piotr Kania  wrote:
>
>> In my postgis database I have multipolygon layer 'public.polygons'
>> (gid,geom), I'd like to see vertices of those layer during editing, that's
>> why I thought of postgis view. I create that in database:
>>
>> CREATE VIEW points_of_polygons AS SELECT ST_DumpPoints(geom) AS geom FROM
>> public.polygons;
>>
>> But I can't add that view to Qgis, I found that info:
>>
>
> Views are not selectable from the Add PostGIS icon. But starting in
> version 2.10 you can add the view points_of_polygons by using the DB
> Manager. A unique id is no longer required. If you are using an earlier
> version then you'll need to create a unique row number. The stackexchange
> link you provided gives an example of using ROWNUMBER() OVER() to create
> the unique id.
>
>
>
> --
> @osm_seattle
> osm_seattle.snowandsnow.us
> OpenStreetMap: Maps with a human touch
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Adding postgis views to qgis

2015-10-20 Thread Piotr Kania

Hi!

I just started to explore "postgis world" so sorry if my question is 
"silly".


In my postgis database I have multipolygon layer 'public.polygons' 
(gid,geom), I'd like to see vertices of those layer during editing, 
that's why I thought of postgis view. I create that in database:


CREATE VIEW points_of_polygons AS SELECT ST_DumpPoints(geom) AS geom 
FROM public.polygons;


But I can't add that view to Qgis, I found that info:

http://gis.stackexchange.com/questions/12233/in-postgis-is-it-possible-to-create-a-view-with-a-unique-id

http://linfiniti.com/2011/11/adding-a-counter-to-postgresql-query-results/

but I don't know how to use it, can anyone (step by step) explain how to 
do that? Thanks

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Adding postgis views to qgis

2015-10-20 Thread Clifford Snow
On Tue, Oct 20, 2015 at 7:35 AM, Piotr Kania  wrote:

> In my postgis database I have multipolygon layer 'public.polygons'
> (gid,geom), I'd like to see vertices of those layer during editing, that's
> why I thought of postgis view. I create that in database:
>
> CREATE VIEW points_of_polygons AS SELECT ST_DumpPoints(geom) AS geom FROM
> public.polygons;
>
> But I can't add that view to Qgis, I found that info:
>

Views are not selectable from the Add PostGIS icon. But starting in version
2.10 you can add the view points_of_polygons by using the DB Manager. A
unique id is no longer required. If you are using an earlier version then
you'll need to create a unique row number. The stackexchange link you
provided gives an example of using ROWNUMBER() OVER() to create the unique
id.


-- 
@osm_seattle
osm_seattle.snowandsnow.us
OpenStreetMap: Maps with a human touch
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user