New answers tagged

1 vote

Field Calculator If Statement

Adjust your code with the following code block def ifBlock(Parcel_Year_Built, Decade_Grouping): if (Parcel_Year_Built < '1960' and Parcel_Year_Built > '0'): return "59 and ...
foxhq's user avatar
  • 81
1 vote
Accepted

Calculate the ratio of intersection to union in using the field calculator in QGIS

Try something like this: with_variable( 'B', overlay_intersects( 'PolyB layer name / id', -- set inside quotes PolyB layer name or id $geometry )[0], area(intersection($...
Mayo's user avatar
  • 3,682
0 votes

Script field calculation Python parser

Figured it out. I didnt need my Creata and Field_number fields anymore. Thank You. Here's the code Below. rec = 0 letter = "A" def autoIncrement(): global rec, letter pStart = 1 ...
Jmerryline's user avatar
1 vote

Script field calculation Python parser

Using @Hornydd 's recommendation. You need to feed the "Creata" field into the script. You script should read: def autoIncrement(Creata): creata = Creata rec = 0 letter = "A&...
Keagan Allan's user avatar
  • 3,696
0 votes

Converting string field into date field in QGIS

Workaround-----you are unable to edit this (your error message above) until you save into a GeoPackage, per Why can't I edit attribute table imported through 'text as layer'
Elizabeth's user avatar
0 votes

Script field calculation Python parser

Firstly you are calculating into the numeric field Field_number so you would never be able to create your code as that is text. You need to be calculating into a text field. Secondly you don't pass ...
Hornbydd's user avatar
  • 42.6k
2 votes
Accepted

QGIS Overlay analysis in field calculator

Overlay_disjoint when used with the [,expression] parameter will return an array of all polygon that are disjoint from the current feature so unless a polygon intersect all other polygon it will ...
J.R's user avatar
  • 14.6k
5 votes
Accepted

Converting text date to numbers date using QGIS Field Calculator

First I'd like to note that only the international date format is of type "date": yyyy-mm-dd. All other types are just representations of this date and depend e.g. on your settings about ...
MrXsquared's user avatar
  • 32.6k
4 votes
Accepted

How to replace multiple independent values using QGIS field calculator

It would be better to use a CASE statement Like so : CASE WHEN "land_classes"='6' THEN 'type 1' WHEN "land_classes"='7' THEN 'type 2' ... ... ELSE 'Not a valid land use ...
J.R's user avatar
  • 14.6k

Top 50 recent answers are included