Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a shape file which contains land use typology for my administrative area. I’m investigating deficiency in certain land uses and there are 2 ‘standards’ that we have to use. These standards use different land uses. The Shapefile has a field in the attribute table that contains all the land uses, for example each polygon can have a land use of either A1 – 12, B1 – 12, C1-12 etc. One standard requires land uses A1 – 6 and C5 -9 and the other A1-12 and B1-9. The Land uses A, B & C have separate fields. I have created an SQL query in the advanced search that selects these land uses. What I now want to do is create 2 new fields, one which populates the selected land use for each standard. I know I can select the attributes and save as a new selection but ideally I would like to populate 2 new fields with the attributes from the existing land use field.

share|improve this question
add comment

1 Answer

Use the field calculator. Essentially you are asking the field calculator to read the values from one column and input them in the new fields. Set "use selected features" and "update existing" if you have already created the target column. In the tree of options to the lower left, you expand the bottom branch and double click on the name of the field as the source. With luck, this will automagically put that field name into the dialog box, surrounded by double quotes.

I think what you are asking to be done, is the most elementary thing the field calculator does so it may be a bit daunting with all the possibilities.

Also there is a plugin called something like "Quick Multi Attribute Edit/Update" which might be of use in similar circumstances.

share|improve this answer
1  
Thanks for your response. Having re-read my original post I don't think I expressed my problem properly. What I want to do is to select certain land uses from Field 1 and if that Field does not have the relevant value then I need to check Field 2 for a certain land use value (sorry if this is a little vague!). Anyway, I think I have the solution by using something like this: CASE WHEN "LandUse1" like 'D%' then 'D' WHEN "LandUse1" like 'A%' then 'A' WHEN "LandUse1" IS NULL then substr("LandUse2",1,1) ELSE 'FAIL' END –  user7688 Sep 8 '13 at 9:30
    
easiest way is import data to postgis, and just use sql , akter table xx add xxx text , update xxx set ... –  simplexio Dec 16 '13 at 8:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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