2

So, the geological classification shapefile of the Philippines has the 'DESCRIPT' field which contains the geological time scale of each feature.

  • "Oligocene-miocene" and "Oligocene-miocene (igneous Rocks)" and "Oligocene-miocene (sedimentary & Metamorphic Rocks)"
  • "Paleocene(?)-eocene (igneous Rocks)" and "Paleocene-eocene (sedimentary & Metamorphic Rocks)"
  • "Undifferentiated" and "Undifferentiated (igneous Rocks)"

However, some attributes have varying but same time scale.

How could the "same" time scales categorized by creating another field which contains the category?

Categorizing the features by spotting if a keyword is in the feature or specifying the exact name of the feature.

2

CONTAINS KEYWORD

You can make a field that writes the "category" of 'DESCRIPT' features if it has a certain keyword using this code in the field calculator in the attribute table.

CASE
    WHEN "DESCRIPT" ILIKE '%Undifferentiated%' THEN 'dog'
    ELSE 'cat'
END

example1

EQUALS EXACT KEYWORD

If you want to categorize by exact word, the use this code:

CASE
    WHEN "DESCRIPT" = 'UNDIFFERENTIATED' THEN 'dog'
    WHEN "DESCRIPT" = 'UNDIFFERENTIATED (IGNEOUS ROCKS)' THEN 'fish'
    ELSE 'cat'
END

example2

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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