简体   繁体   中英

separate each points element on different polygon layers on qgis

I have a table called all_the_points which contains several points in rows for every element in a column, now all the elements are in the column called origin,
now each element can have several points, is possible for me to separate all points by their element on different layers on PostGIS in one view, I tried using the group by but still all my points and polygon are on one layer when I drag to my qgis. Thank you

 with 
bounds as (
    select
     origin
    ,min(x) as xmin
    ,min(y) as ymin
    ,max(x) as xmax
    ,max(y) as ymax
    from all_the_points
    group by  WHERE ((all_the_points.origin)::text = '126af84e-0a9b-407d-8036-1ffc316106dd'::text);
)
select 
 origin
,st_makepolygon(st_makeline(array[
     st_makepoint(xmin,ymin)
    ,st_makepoint(xmax,ymin)
    ,st_makepoint(xmax,ymax)
    ,st_makepoint(xmin,ymax)
    ,st_makepoint(xmin,ymin)
]))
from bounds

different layers on PostGIS in one view

No, this is not possible.

There are several options:

  • have one layer, and apply a different symbology for each category in QGIS

  • have one layer and filter data for a single category in QGIS. Eventually add the same layer a 2nd (and more) time and filter another category

  • have a distinct view in Postgres for each layer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM