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

properties such as distance and travel_time should be Int, not String #41

Open
ajakubauskas opened this issue Jun 22, 2021 · 0 comments

Comments

@ajakubauskas
Copy link

Some of the properties returned by routing, time-filter etc. are of the wrong type: we can safely assume distance and travel_time will be a single integer therefore it would be nice if such values returned to qgis layers would be of corresponding type.
I suggest adding something like:

def propType(propName):
            if propName == "distance" or propName == "travel_time" :
                return QVariant.Int
            else:
                return QVariant.String

and using it in result prop processing such as calls:

output_fields.append(QgsField("prop_" + prop, QVariant.String, "text"))

use QgsField("prop_" + prop, propType(prop), "text") instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant