Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Densify by interval always resorts to default value if field is given #33470

Closed
lukasvd opened this issue Dec 18, 2019 · 4 comments · Fixed by #34193
Closed

Densify by interval always resorts to default value if field is given #33470

lukasvd opened this issue Dec 18, 2019 · 4 comments · Fixed by #34193
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@lukasvd
Copy link

lukasvd commented Dec 18, 2019

Describe the bug
QGIS 3.10.1 > Vector geometry > Densify by interval
The tool works properly when a direct value is given. When a field type is given, it always resorts to the default value of 1,0.

How to Reproduce
Open the tool. Select a layer with linestrings which has attributes/fields. Click on the "data defined override" button and select a field. In my case it is a field of type double called "ps_width". When the job has run the log shows that the script tried to use the field ('INTERVAL' : QgsProperty.fromExpression('"ps_width"'). The value of the field is 2,8. The value used for the calculations is still 1,0 (the default)

image

image

QGIS and OS versions

image

@lukasvd lukasvd added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Dec 18, 2019
@nyalldawson
Copy link
Collaborator

Does it work if the field value is "2.8" (using . as decimal separator)

@nyalldawson nyalldawson added the Feedback Waiting on the submitter for answers label Dec 18, 2019
@lukasvd
Copy link
Author

lukasvd commented Dec 19, 2019 via email

@gioman gioman added Processing Relating to QGIS Processing framework or individual Processing algorithms and removed Feedback Waiting on the submitter for answers labels Dec 19, 2019
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Feb 1, 2020

@nyalldawson @m-kuhn It could be due to

double interval = mInterval;
if ( mDynamicInterval )
interval = mIntervalProperty.valueAsDouble( context.expressionContext(), interval );
if ( feature.hasGeometry() )
modifiedFeature.setGeometry( feature.geometry().densifyByDistance( mInterval ) );
where modifiedFeature.setGeometry( feature.geometry().densifyByDistance( mInterval ) ) should be modifiedFeature.setGeometry( feature.geometry().densifyByDistance( interval ) )
It's probably an oversight in 9fec8ed (#8923).

@nyalldawson
Copy link
Collaborator

Right - good solving! Can you open a pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants