Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
4

The code you posted is missing a multiplication symbol between the second radius calculation and math.pi. There is also no operator listed between 144 and !Shape.STLength()! Assuming the rest of your calculation is correct and that the missing operator is multiplication: (!DIAMETER!/2)*( !DIAMETER!/2)*math.pi/144*!Shape.STLength()!*7.48 You likely also ...


3

You can use the field calculator. You would first extract the 4 rightmost characters, then convert them to an integer: to_int(right(dato,4))


3

Please take a look at the aggregate function of the field-calculator. In the layer properties the tab attribute form (8th from the top) you may set standard/preset values for your fields, e.g. based on field calculator formulas.


2

Your formula is correct and valid in QGIS, and will yield a Gaussian kernel: However, the field you are trying to calculate needs more digits, since the exp decay you defined is very "slow" (the squared Distance is divided by 200.000.000). Depending on the magnitude of your Distance values you will need to allocate more decimal digits when you define the ...


2

You can use the aggregate function in the expression editor: aggregate( layer:= 'N_LAYER', aggregate:='concatenate', expression:="FIELDNAME_IN_N_LAYER", concatenator:=', ', filter:=attribute( $currentfeature ,'FOREIGNKEY_IN_N_LAYER')=attribute( @parent ,'KEY_IN_1_LAYER')) where you tell the aggregate ...


2

QGIS 3.6.2 - Noosa This will generate a memory layer of a spatial join between the polygon layer being edited and an existing points layer. The fields to be joined can be specified with the JOIN_FIELDS option. The function is fired when editing a shape is finished (right-click during editing). It saves the edits made (commitChanges()) and then performs the ...


2

This expression: max(CS1,CS2,CS3,CS4,CS5,CS6,CS7,CS8) will return highest CS value. Put that expression into a new field, let's call it max_CS. Make sure the new field has as many decimal places as your CS fields (if the CS fields have different numbers of decimal places, use the highest number). This expression uses nested if() functions to find the name ...


1

You can use re module, see How to extract numbers from a string in Python? Example: import re a = "Other deciduous trees with 11- 25% impervious cover" def giveintegers(data): if 'cover' in data: integers = [int(s) for s in re.findall(r'\b\d+\b', data)] return integers giveintegers(a) [11, 25] giveintegers(a)[0] 11 giveintegers(a)[1] ...


1

You haven’t posted the rest of your field calculator. But you code block looks OK. Some minor changes below may help, and you would need an expression some thing like this (assuming a field name of ‘text’): EXPRESSION: reclass(!text!) CODE BLOCK: def reclass(C_TEXT): if "cover" in C_TEXT.lower(): return 10 return None The last line isn’...


1

alternatively without scripting : multiply side 2 value by -1 (field calculator) summarize table asking the sum of you field, based on the LineID field join the resulting table to you original table


Only top voted, non community-wiki answers of a minimum length are eligible