可以按照下面方法做:
将两个图层放到pg的sde数据库中后,操作如下:
sde=# alter table testpolygon add column info text;
ALTER TABLE
sde=# \d testpolygon
数据表 "sde.testpolygon"
栏位 | 类型 | Collation | Nullable | Default
----------+-------------+-----------+----------+---------
objectid | integer | | not null |
shape | st_geometry | | |
info | text | | |
索引:
"r67_sde_rowid_uk" UNIQUE, btree (objectid) WITH (fillfactor='75')
"a56_ix1" gist (shape)
执行如下SQL:
with t1 as
(select polygon.objectid as polygonid,point.objectid as pointid from gis_poi point,testpolygon polygon where st_within(point.shape,polygon.shape)='t')
,
t2 as
(select polygonid,string_agg(pointid::text,',') as info from t1 group by polygonid)、
update testpolygon set info=(select t2.info from t2 where t2.polygonid=testpolygon.objectid);
处理结果如下:
4 个回复
刘锋
赞同来自: salecn
将两个图层放到pg的sde数据库中后,操作如下:
sde=# alter table testpolygon add column info text;
ALTER TABLE
sde=# \d testpolygon
数据表 "sde.testpolygon"
栏位 | 类型 | Collation | Nullable | Default
----------+-------------+-----------+----------+---------
objectid | integer | | not null |
shape | st_geometry | | |
info | text | | |
索引:
"r67_sde_rowid_uk" UNIQUE, btree (objectid) WITH (fillfactor='75')
"a56_ix1" gist (shape)
执行如下SQL:
with t1 as
(select polygon.objectid as polygonid,point.objectid as pointid from gis_poi point,testpolygon polygon where st_within(point.shape,polygon.shape)='t')
,
t2 as
(select polygonid,string_agg(pointid::text,',') as info from t1 group by polygonid)、
update testpolygon set info=(select t2.info from t2 where t2.polygonid=testpolygon.objectid);
处理结果如下:
atlas1563
赞同来自:
salecn
赞同来自:
zmg920
赞同来自:
要回复问题请先登录或注册
发起人
相关问题
问题状态
—— 扫技术支持中心微信服务号!
—— 让GIS知乎问答随时随地!