north-road / qgis-processing-r

QGIS Processing R Provider Plugin
https://north-road.github.io/qgis-processing-r/
GNU General Public License v3.0
63 stars 14 forks source link

bug on reading with R-QGIS a filtered vector layer #130

Closed fpirotti closed 10 months ago

fpirotti commented 10 months ago

What is the bug or the crash?

When creating an R script in QGIS with a vector input layer, the column names of the vector are getting truncated to 10 characters when such vector layer is filtered with a query in the feature filter. This blocks further processing that requires to select columns.

Steps to reproduce the issue

My scripts=group

Layer=vector

print(names(Layer))

Versions

3.32, 3.34

JanCaha commented 10 months ago

Found the reason :)

It happens because if the layer cannot be opened directly using OGR (which with filter cannot happen) the default format for saving temporary layer is SHP (which causes the issue - field name length is limited to 10 or 12 in this format).

I have switched default format for these cases to GPKG which should work much better. I added some tests as well.

Might be able to release fixed version soon ;-)

JanCaha commented 10 months ago

The version is on it is way to plugin repostiory. Should be online in few days (usually 2-3).

If you need quick fix, you can get the zip file from release page https://github.com/north-road/qgis-processing-r/releases/tag/v4.1.0 and install it in QGIS from zip file.