GIS4DEV / GIS4DEV.github.io

Open Source GIScience & GIS for Development
1 stars 12 forks source link

Specifying a table column with general language? #16

Closed mtango99 closed 3 years ago

mtango99 commented 3 years ago

Hello! I'm using "extract by expression" to specify that input and target weights should be higher than 0 and distance should be higher than 1. If I use @InputWeight or @TargetWeight it doesn't work because those are where the columns came from, not where they are now. If I use "Population" or "BEDS" it works, but then the model could only run if the attributes are named exactly that. Any ideas for how to specify a column without using its name?

mtango99 commented 3 years ago

Oh, just figured it out. Can just take out where potential is 0 later on, since the potential field will always be called potential

josephholler commented 3 years ago

Yes, I suppose that works! If you want to incorporate the field parameters in an expression, you probably want to build the expression with the "precalculated value" option for entering the expression, in which case you'll need to add together text strings to form the expression. See what happens with the towns having zero population in the output. It still might be more desirable to filter them out earlier.

mtango99 commented 3 years ago

Filtering after calculating potential worked for me. And if I'm understanding your answer right, that's what I was trying to do before, I just wasn't sure how to specify "population" and "beds" in the text string expression without actually making it specific to "population" and "beds"