3

I'm transitioning to QGIS from ArcGIS. I'm having trouble getting my python field calculator expressions to work in the QGIS advanced python field calculator.

Here is a screenshot of the working script in ArcGIS: enter image description here

Here is what the Advanced Python field calculator window looks like in Q. I've made some changes based on posted Q&A's that I've seen here and in other places: enter image description here

I've gotten some syntax errors that I think I've worked out, but then I'm also getting some "NoneType" errors, which I have no idea what they mean. I'm assuming the "Global Expression [Optional]" block in QGIS is the same as the optional code block in ArcGIS?

What does a "NoneType" error mean?

Below I'll post a snippet of the code.

    def getvalue( Exemption_Code, Ag_Value, Appraised_Value, TaxRate_Municipal, Exemption_Local_Homestead, Exemption_Local_O65, Exemption_Local_Disability, Exemption_Vet_3, Exemption_Vet_4 ) :
      if (Exemption_Code == '000') :
        value (Appraised_Value / 100) * TaxRate_Municipal
      elif (Exemption_Code == '002') :
        value (Ag_Value / 100) * TaxRate_Municipal
      elif (Exemption_Code == '004') :
        value 0


    value = getvalue( <Exemption_Code>, <Ag_Value>, <Appraised_Value>, <TaxRate_Municipal>, <Exemption_Local_Homestead>, <Exemption_Local_O65>, <Exemption_Local_Disability>, <Exemption_Vet_3>, <Exemption_Vet_4> )
  • I notice the layer doesn't appear to be selected in your screenshot? That could be the problem if the plug-in doesn't check for that. – Steven Kay Apr 24 '16 at 20:24
  • Well, the screen shots are staged for the question. I had been working on it earlier in the day. I've gotten to where I can run it in the basic field calculator but still no luck so far in the advanced python calculator. I wonder if I'll beat everybody to it. If I do I'll post it up. – FelixTX83 Apr 25 '16 at 0:33

Your Answer

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

Browse other questions tagged or ask your own question.