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

Reclassify by layer/table #29081

Open
qgib opened this issue Feb 14, 2019 · 7 comments
Open

Reclassify by layer/table #29081

qgib opened this issue Feb 14, 2019 · 7 comments
Labels
Feature Request Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented Feb 14, 2019

Author Name: Henk Thoma (Henk Thoma)
Original Redmine Issue: 21263

Redmine category:map_tools


The current Reclassify by layer tool requires a vector layer (with geometry info) to select table fields for minimum, maximum & values. It doesn't work with a standalone table (e.g. one imported from Excel or CSV).
In the new Reclassify by table tool one has to manually provide the table values. It could be upgraded by providing an input for a standalone table as well.

@qgib qgib added Feature Request Map Tools Related to non-digitizing map tools labels May 25, 2019
@baswein
Copy link
Contributor

baswein commented Jul 20, 2019

In QGIS 3.6 I have been using both Excel and CSV files in the Reclassify by Layer tool. I have found that it is a little sensitive. For example with CSV I can't have field names in the table. With excel I can have names but sometimes I need to save it as a CSV open it up with a text editor delete any extra blank rows at the bottom and then resave it as an excel. I have also found I can save the excel as a shapefile even without geometry and use the .dbf file as the layer or save it to a geopackage and load the layer from there. Unless I am confusing the situation this is already a feature but the naming and is confusing.

@alexbruy alexbruy added Processing Relating to QGIS Processing framework or individual Processing algorithms and removed Map Tools Related to non-digitizing map tools labels Apr 22, 2020
@nyalldawson
Copy link
Collaborator

Is this still an issue? I can't reproduce

@nyalldawson nyalldawson added the Feedback Waiting on the submitter for answers label Jun 1, 2020
@baswein
Copy link
Contributor

baswein commented Jun 1, 2020

I'll check later today. At this point I have a model set up that works around it so haven't encountered it lately.

@baswein
Copy link
Contributor

baswein commented Jun 4, 2020

@nyalldawson It seems to be working with an excel file but not a CSV.
Here is a screenshot of the table.
image

Here is a gif of it working with an excel file.
xlsx_working

Here not working with a CSV.
csv_table_not_working

I tried removing the header of the csv and cleaning it up in a text editor and that didn't help. I also tried to add it to the layer panel and connect to it through that ans that didn't work.

QGIS version
3.12.2-București
QGIS code revision
8a1fb33
Compiled against Qt
5.11.2
Running against Qt
5.11.2
Compiled against GDAL/OGR
3.0.4
Running against GDAL/OGR
3.0.4
Compiled against GEOS
3.8.1-CAPI-1.13.3
Running against GEOS
3.8.1-CAPI-1.13.3
Compiled against SQLite
3.29.0
Running against SQLite
3.29.0
PostgreSQL Client Version
11.5
SpatiaLite Version
4.3.0
QWT Version
6.1.3
QScintilla2 Version
2.10.8
Compiled against PROJ
6.3.1
Running against PROJ
Rel. 6.3.2, May 1st, 2020
OS Version
Windows 10 (10.0)
Active python plugins
db_manager;
MetaSearch;
processing

@gioman gioman removed the Feedback Waiting on the submitter for answers label Jun 4, 2020
@nyalldawson
Copy link
Collaborator

Right -- I suspect that's because the csv has imported those columns as a text column, and the dialog is only allowing choices of numeric columns.

Try opening your dataset through the Data Source Manager -> Delimited Text option. That should automatically detect that the column is numeric and avoid the forced string conversion.

@baswein
Copy link
Contributor

baswein commented Jun 5, 2020

That works and makes sense. So the excel file has more info and it can parse it. If I remember right
I originally noticed it when using it through graphical modeler (that's always a tongue twister) where I was using the csv I generated as a new input and i had to work around it.
Could Detect field types be turned on for all ways you can import a csv? For example today I created a csv using Raster layer zonal statistics with the csv automatically added to the map and the zones 1-22 came in as text. If so should I add that as a feature request? I was pleasantly surprised that QGIS could join fields even if they were different types. This is always an issue with my students in ArcMAP. Thanks again

@nyalldawson
Copy link
Collaborator

Right - the graphical modeler doesn't currently offer an easy way to import CSV data and perform the column type autodetection.

To do that we need a new "import delimited text" algorithm in processing which exposes all the nice options that you see in the dialog...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

5 participants