0

I have a situation that seems complex, or at least it feels complex to me. I have a layer for administrative divisions, and initially, this layer contained only one field to determine the type of administrator (boundary_en). All types of divisions were in this single field. Now, I’ve decided to separate each type of division into its own field. So, instead of having (District, Sub-District, etc.) in one field, I plan to create a field for (District) and a field for (Sub-District).

The issue I encountered is that I can't populate the data correctly. Each Sub-District belongs to a District, but I'm unable to match them accurately. For example, if District 1 has Sub-Districts 2, 3, and 4, I need the District value to be repeated as 1-2, 1-3, 1-4 for each Sub-District. However, I'm struggling to do this. I’ve attached a snapshot to illustrate the problem more clearly.

By the way, I used the "Join Attribute by Location (Intersect)" tool, but it gave me incorrect results, like assigning different Districts to the same Sub-District.

I hope this clarifies the issue.

sample file here https://we.tl/t-2oFgAm1jz5

enter image description here

6
  • Your question is not clear to me. Please tell us exactly from which fields of the above screenshot you want to extract what kind of information. Even better would be to share a sample of the data or at least post it in form of a table, not a screenshot.
    – Babel
    Commented Aug 12 at 10:30
  • Well it's all about converting the data from field to another , because i'm working on project of adminstrative division so each district have sub district and in my situation i'm trying to seperate the district from sub district Commented Aug 12 at 11:32
  • I understood the general purpose of separate district from sub-district. But what does that exactly mean in your case? I don't know which of the fields in your list we're speaking about and what part of the content you want to separate. If you don't give us this information, there is just a general answer: You can do it using the field calculator. But that would not be very helpful, would it?
    – Babel
    Commented Aug 12 at 11:45
  • Give us one example of how the input looks like and what output you expect.
    – Babel
    Commented Aug 12 at 11:46
  • i have uploaded a test file you can see it has 2 layers district and subdistrict and if you check the attribute table of subdistrict layer you can see there is 2 fields ( district , district_e ) is NULL but the values here should be the values on layer district fields name and name_en Commented Aug 12 at 12:21

1 Answer 1

1

To get the name of the district on the layer subdistrict, use field calculator with this expression: overlay_within('district',name)[0]

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.