Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way in QGIS to import a shape file that is a variable rate dry fertilizer prescription that has a large number of rates (can be in excess of 50) and reduce the number of rates to less than 10?

For example, rates of 50 to 65 lbs/A can be reduced to 57. Rates of 66 to 80 can be reduced to 74. Rates of 81 to 95 can be reduced to 87. These are just examples, but hopefully it further details what i am trying to do. I want to export the resulting shapefile with the reduced number of rates into the Mapstar software to create a PMH file that can be imported directly into the aircraft for application.

share|improve this question
    
You can add a new field, select rate >= 50 and rate <65, calculate new field to 57. After all ranges are calculated, run Dissolve, selecting the new field as the Unique ID parameter. – klewis 9 hours ago

This can be done by Field Calculator.

  1. Select your shapefile layer
  2. Open Attribute Table
  3. Open Field Calculator

Then check Create a new field and give a new field name. (Here I calculated "reduced" value from "fertilizer" value.)

In the Expression Field:

CASE 
WHEN  "fertilizer" < 50 THEN 25
WHEN  "fertilizer" <= 65 THEN 57
WHEN  "fertilizer" <= 80 THEN 74
WHEN  "fertilizer" <= 95 THEN 87
ELSE  "fertilizer"
END

will give you something like image below

enter image description here

Please modify the Expression to fit for your requirement.

enter image description here

NB. This does not affect your shapefile geometry.

share|improve this answer

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.