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

Make ftools work also when inputs have columns wider than 10 characters #17052

Closed
qgib opened this issue Jul 8, 2013 · 9 comments
Closed

Make ftools work also when inputs have columns wider than 10 characters #17052

qgib opened this issue Jul 8, 2013 · 9 comments
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

@qgib
Copy link
Contributor

qgib commented Jul 8, 2013

Author Name: Aren Cambre (Aren Cambre)
Original Redmine Issue: 8241
Affected QGIS version: master
Redmine category:processing/qgis


New description:

a few tools in the vector menu are unable to cope with attributes with names of > 10 chars. The tools are

doGeoprocessing.py

intersect
union
symetrical_difference

doSpatialJoin.py

spatialjoin

Please see #17052 (comment) for a detailed description


Old description:

I have a PostGIS table with a field name that has more than 10 characters in the name. The Symmetrical difference feature fails with a message that simply advises of this problem but gives no solutions.

I really, really need to keep descriptive field names in the original data, so renaming fields is very undesirable.

I can think of a few workarounds, but seems like it would be easy to just use a truncated field name, with a check to ensure the truncated field name dos not duplicate any other field names.

@qgib
Copy link
Contributor Author

qgib commented Jul 8, 2013

Author Name: Aren Cambre (Aren Cambre)


Related: #13915

@qgib
Copy link
Contributor Author

qgib commented Jul 8, 2013

Author Name: Giovanni Manghi (@gioman)


The error message could be a little more verbose, but it is right anyway: the output of the geoprocessing tools are shapefiles, regardless of the input data type, and shapefiles are limited to 10 chars for columns names.

Sure there can be workarounds (like truncating the columns names, like the "join" does) or real solutions (like make the geoprocessing tools create an output in the same data type as the inputs, or of a kind at user choice), but are all feature requests.


  • tracker_id was changed from 1 to 2
  • subject was changed from Symmetrical difference fails if field name is more than 10 characters to Make "symmetrical difference" work also when inputs have columns wider than 10 characters
  • operating_system was changed from Windows 7 x64 to
  • category_id was changed from Vectors to 44
  • fixed_version_id was changed from Version 2.0.0 to Future Release - Nice to have

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Minoru Akagi (@minorua)


Some fTools' processes are sometimes discontinued for the same reason. Especially with "Join attributes by location" tool, when we select the MEAN option, the length of the field names must be only six or less. Processes are often stopped unnecessarily and users are forced to change the field names, so I think this is a bug. Since no error occurs even when long field names are passed to QgsVectorFileWriter and the writer truncates the field names to the appropriate length, the fix should be very easy. Showing message like "Following field names will be truncated to 10 bytes" would be helpful for users, but we are currently in string freeze, and it is not necessary.

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Giovanni Manghi (@gioman)


Minoru Akagi wrote:

Some fTools' processes are sometimes discontinued for the same reason. Especially with "Join attributes by location" tool, when we select the MEAN option, the length of the field names must be only six or less. Processes are often stopped "unnecessarily" and users are forced to change the field names, so I think this is a bug. Since no error occurs even when long field names are passed to QgsVectorFileWriter and the writer truncates the field names to the appropriate length, the fix should be very easy. Showing message like "Following field names will be truncated to 10 bytes" would be helpful for users, but we are currently in string freeze, and it is not necessary.

If this issue is widespread in the vector menu tools then I agree that this should be a bug. Then title and description of this ticket must be rephrased (eventually listing all the tools that do not work because of this issue), please go ahead.

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Minoru Akagi (@minorua)


I cannot retitle this ticket, so I list 4 tools using @ftools_utils.checkFieldNameLength()@ instead.

doGeoprocessing.py

  • intersect
  • union
  • symetrical_difference

doSpatialJoin.py

  • spatialjoin

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Giovanni Manghi (@gioman)


  • tracker_id was changed from 2 to 1
  • subject was changed from Make "symmetrical difference" work also when inputs have columns wider than 10 characters to Make ftools work also when inputs have columns wider than 10 characters

@qgib
Copy link
Contributor Author

qgib commented Jul 13, 2013

Author Name: Minoru Akagi (@minorua)


Fixed in changeset "8ae64b438ecad7f927496af2c4d833339781b854".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

@qgib
Copy link
Contributor Author

qgib commented May 19, 2017

Author Name: Jürgen Fischer (@jef-n)


  • regression was configured as 0
  • description was changed from New description:

a few tools in the vector menu are unable to cope with attributes with names of > 10 chars. The tools are

doGeoprocessing.py

intersect
union
symetrical_difference

doSpatialJoin.py

spatialjoin

Please see "note !#3":https://issues.qgis.org/issues/8241#note-3 for a detailed description


Old description:

I have a PostGIS table with a field name that has more than 10 characters in the name. The Symmetrical difference feature fails with a message that simply advises of this problem but gives no solutions.

I really, really need to keep descriptive field names in the original data, so renaming fields is very undesirable.

I can think of a few workarounds, but seems like it would be easy to just use a truncated field name, with a check to ensure the truncated field name dos not duplicate any other field names. to New description:

a few tools in the vector menu are unable to cope with attributes with names of > 10 chars. The tools are

doGeoprocessing.py

intersect
union
symetrical_difference

doSpatialJoin.py

spatialjoin

Please see #17052 (comment) for a detailed description


Old description:

I have a PostGIS table with a field name that has more than 10 characters in the name. The Symmetrical difference feature fails with a message that simply advises of this problem but gives no solutions.

I really, really need to keep descriptive field names in the original data, so renaming fields is very undesirable.

I can think of a few workarounds, but seems like it would be easy to just use a truncated field name, with a check to ensure the truncated field name dos not duplicate any other field names.

  • easy_fix was configured as 0

@qgib qgib added 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 labels May 24, 2019
@qgib qgib added this to the Future Release - Nice to have milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
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

No branches or pull requests

1 participant