简体   繁体   English

在qgis上的不同多边形层上分离每个点元素

[英]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, 我有一个名为all_the_points的表,该表包含一行中每个列中每个元素的几个点,现在所有元素都在名为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. 现在每个元素可以有几个点,对于我来说,可以在一个视图中按其在PostGIS上不同层上的元素来分隔所有点,我尝试使用group by,但是当我拖动到我的所有点和多边形时,仍然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 在一个视图中在PostGIS上的不同层

No, this is not possible. 不,这是不可能的。

There are several options: 有几种选择:

  • have one layer, and apply a different symbology for each category in QGIS 有一层,并对QGIS中的每个类别应用不同的符号

  • have one layer and filter data for a single category in QGIS. 在QGIS中只有一层并过滤单个类别的数据。 Eventually add the same layer a 2nd (and more) time and filter another category 最终第二次(或更多次)添加同一层并过滤其他类别

  • have a distinct view in Postgres for each layer 在Postgres中每一层都有不同的视图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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