Geographic Information Systems Asked by Alice123 on December 2, 2020
In my attribute table (neighbors) there is a comma-separated list in which the IDs of adjacent polygons are located. But now I want one line to appear for each adjacent polygon. So there would be e.g. (check the picture below) the line with the oid DENW17ALxE000051DENW17AL00003neWTF twice. Once with the adjacent polygon DENW17ALW600005aDENW17ALZb00007HTF and once with this one DENW17ALW600005dDENW17AL00003pGQTF. It was just an example, I would need it for every single line.
If there is no way to regulate this using the comma-separated list, I think another formula would have to be specified in the previous step (field calculator). So that the result is not the comma-separated list, but an attribute table extended by rows. I entered the following into the field calculator:
aggregates (
layer: = 'street polygons',
aggregate: = 'concatenate',
expression: = oid,
concatenator: = ',',
filter: = intersects ($ geometry, geometry (@parent))
)
Try "Split features by character" (in the Processing Toolbox > Vector general
) tool.
An example:
(1) Prepared a small test case: one point with neighbors
field, with a record 'aaa, bbb'
(2) Started Split features by character tool.
Split value
is a comma. Also please take notice of a small space after the comma. (Pointed by the red arrow, between the comma and the black caret mark).
(3) Ran the tool, then it returned a new Split
layer, with duplicated geometries of aaa
and bbb
values.
Answered by Kazuhito on December 2, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP