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
Delimited text substring capability - also bug #7742 #569
Delimited text substring capability - also bug #7742 #569
Conversation
…t framework not handling very long strings?)
…from CSV files - reduced max length to 200
What a great advance! I can manage graduated style with values of joined fields that come from csv (fine with 5200 records). |
Looking at the code for managing joins it seems that in fact the subset string capability is not required if the join is cached. I'm guessing that this is why it is fast. However the GUI for defining joins does require it. Could be worth fixing the GUI to allow joins for any vector provider, but force cached join if layer doesn't support subsets. The code in QgsVectorLayerFeatureIterator::FetchJoinInfo::addJoinedAttributesDirect which uses subset string would be a lot slower (and actually looks quite buggy - original subset string is not enclosed in parentheses when adding subset string, join value is in double quotes " rather than single quotes '). Probably wouldn't want to use this option with delimited text in any case, as with no indexing could be quite slow... Fixed the join error in #571. |
Delimited text substring capability - also bug #7742
Thanks Chris I have gone ahead and merged this as it adds useful functionality to delimited provider to bring it more into parity to other providers. |
Brilliant! Thanks |
This request adds substring functionality to the delimited text plugin. That is you can define a subset string in the url, and update via the UI.
This also means that delimited text data can be joined to other layers (which requires subset string support). Note that at the moment the implementation is not well optimised for this use. However for small tables it can be very convenient.
The main issue with this is implementation that the vector layer properties dialog opens an SQL expression dialog,whereas this uses the standard QgsExpression to select. However the functionality is still all available - just the query builder doesn't quite match.
Maybe wishful thinking for 2.0, but very useful capability and makes delimited text more compatible with other providers. Also very safe in terms of impact - doesn't affect API and scope is completely contained within delimited text provider (apart from additional documentation comments in vector data provider header file)
Also this has been raised as a regression bug http://hub.qgis.org/issues/7742. I'm not sure if technically it is a regression (ie I'm not sure if it was ever working).
The user manual http://docs.qgis.org/1.8/html/en/docs/user_manual/working_with_vector/vector_properties.html#joins-tab states joins to delimited text providers is supported, but it doesn't work for me in 1.8?