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

If you try to offset a line without moving it manually but just by typing the offset value into the widget and pressing ENTER the geometry will not be modified #44866

Open
2 tasks done
thbaumann opened this issue Aug 27, 2021 · 4 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality

Comments

@thbaumann
Copy link
Contributor

What is the bug or the crash?

The offset-tool (qgsmaptooloffsetcurve.cpp) has two bugs at the moment.
Bug1: If you try to offset a line without moving it manually but just by typing the offset value into the widget and pressing ENTER the geometry will not be modified. The reason for this is the fact that only in the CanvasMoveEvent the geometry is flagged as modified (mGeometryModified = true):
grafik

If you type in the offset without moving the line first the offset will be canceled in the ApplyOffset function:
grafik

I tried to add mGeometryModified = true in the updateGeometryAndRubberBand function after mModifiedGeometry = offsetGeom (https://github.com/qgis/QGIS/blob/master/src/app/qgsmaptooloffsetcurve.cpp#L648) and this seems to solve this problem.

Bug2: Sometimes the maptool creates empty geometries which lead to Null-Geometries in Shapefiles after saving them to disk.
You can see both bugs in this screencast:

offset_bug.mp4

Steps to reproduce the issue

Bug1:

  • activate the offset tool
  • click the line you want to offset
  • type in the offset value and click enter without moving the mouse

Bug2:
Paste this geometry as temp layer (EPSG 25832):
MULTILINESTRING ((435916.931276825 5317307.89296271,435918.66095346 5317306.55315136,435918.74215247 5317306.49645725,435919.681002279 5317305.90786128,435921.21792646 5317304.70052204,435922.432700873 5317303.23810423,435923.312958213 5317301.55302567,435923.819370855 5317299.72057131,435923.929313594 5317297.82261048,435923.629705377 5317295.89127962,435921.31706914 5317287.19038841,435921.221701166 5317286.85631381,435915.908874538 5317269.4572725,435914.7633747 5317267.01641003,435903.842360859 5317250.39158356,435899.758588329 5317244.17647954,435899.455360435 5317243.7419094,435893.628526679 5317235.86859603,435893.224487222 5317235.35998225,435872.782446377 5317211.35986935,435872.372693834 5317210.90893047,435869.15930026 5317207.59274011,435867.883192455 5317206.49082854,435864.610150099 5317204.13727291,435863.353861139 5317203.37399972,435860.256010043 5317201.80619905,435857.848390088 5317200.9709003,435853.922745693 5317200.17766004,435851.682719877 5317199.99627125,435846.607217165 5317200.18812387,435845.378374182 5317200.31495892,435839.281241994 5317201.34852148,435837.464642851 5317201.8458565,435832.430833488 5317203.77821505,435831.484909335 5317204.20189893,435825.880474749 5317207.08899965,435825.12124478 5317207.52552405,435821.328166785 5317209.94561359,435821.149319795 5317210.05972295,435820.050621375 5317210.76072319,435814.860158069 5317214.07238352,435814.838370797 5317214.08589461,435814.618838194 5317214.21816895,435814.596711727 5317214.23111709,435808.966860142 5317217.4294731,435808.951285284 5317217.43813861,435808.794789304 5317217.52339208,435808.779062482 5317217.53177862,435803.01073606 5317220.54210429,435802.963122261 5317220.56536872,435802.481495028 5317220.78508349,435802.432715656 5317220.80579291,435796.863819116 5317222.99780748,435796.782502639 5317223.02583973,435795.960323675 5317223.27025114,435795.876899097 5317223.29119192,435780.347449045 5317226.48630237,435780.324337614 5317226.49077457,435780.092761038 5317226.53276446,435780.069550738 5317226.5366914,435772.817567975 5317227.67602179,435772.690430921 5317227.68774518,435771.421984674 5317227.72335853,435771.294390119 5317227.71878707,435767.88348365 5317227.37760801,435767.768182103 5317227.35922466,435766.633702871 5317227.10967695,435766.521329982 5317227.0779795,435764.078125903 5317226.23198537,435763.991190552 5317226.19724517,435763.141855147 5317225.81080517,435763.058549573 5317225.76808728,435758.411152463 5317223.1031489,435758.339817555 5317223.0581432,435757.64793541 5317222.57968342,435757.580646902 5317222.52882637,435753.413664903 5317219.09392388,435753.336942071 5317219.02366753,435752.610260899 5317218.28516032,435752.541252137 5317218.20731343,435749.175172161 5317213.98682501,435749.13533911 5317213.93331258,435748.755714259 5317213.38611485,435748.71953768 5317213.3300657,435745.16310407 5317207.39440303,435745.13520682 5317207.34468047,435744.87084485 5317206.84032003,435744.845826669 5317206.7890884,435743.664101745 5317204.18330231,435743.65119553 5317204.15357146,435743.527017347 5317203.85432842,435743.515081399 5317203.82419493,435741.053643157 5317197.30333302,435741.045265524 5317197.28028762,435740.964339211 5317197.04887603,435740.956529148 5317197.02563215,435739.842565796 5317193.57057633,435739.814521057 5317193.46369936,435739.594561963 5317192.38603107,435739.578479782 5317192.27671247,435739.189692389 5317188.00618857,435739.186229563 5317187.9517313,435739.16649418 5317187.40702564,435739.166006987 5317187.35246056,435739.348268731 5317177.42570189,435739.348688227 5317177.40977135,435739.354151883 5317177.25051952,435739.354825188 5317177.23459768,435739.623028294 5317171.89970192,435739.629281655 5317171.82754814,435739.717728252 5317171.11016272,435739.729187468 5317171.03865078,435742.114519534 5317158.96868311,435742.206127242 5317158.4216151,435745.170399421 5317136.87464647,435745.255376311 5317135.45819151,435745.12265794 5317134.04541002,435744.780030139 5317132.05489557))

  • try to apply an offset of 1 meter and the output will be an empty MultiLine

Versions

tested in 3.16.10

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

No response

@thbaumann thbaumann added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Aug 27, 2021
@nicogodet
Copy link
Member

Could you create another issue to separate the 2 bugs ?

@gioman gioman added Digitizing Related to feature digitizing map tools or functionality Feedback Waiting on the submitter for answers labels Aug 27, 2021
@gioman gioman changed the title Two bugs of the Offset-Tool (offset without canvas move and EMTPY Geometry as output) If you try to offset a line without moving it manually but just by typing the offset value into the widget and pressing ENTER the geometry will not be modified Aug 27, 2021
@nyalldawson nyalldawson self-assigned this Aug 30, 2021
@nyalldawson
Copy link
Collaborator

Bug 2 is an upstream GEOS issue -- I've filed a bug report here: libgeos/geos#477

nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Aug 30, 2021
entered into the offset distance widget (without mouse moves)

Refs qgis#44866
nyalldawson added a commit that referenced this issue Aug 30, 2021
entered into the offset distance widget (without mouse moves)

Refs #44866
qgis-bot pushed a commit that referenced this issue Aug 30, 2021
entered into the offset distance widget (without mouse moves)

Refs #44866
qgis-bot pushed a commit that referenced this issue Aug 30, 2021
entered into the offset distance widget (without mouse moves)

Refs #44866
nyalldawson added a commit that referenced this issue Aug 31, 2021
entered into the offset distance widget (without mouse moves)

Refs #44866
nyalldawson added a commit that referenced this issue Aug 31, 2021
entered into the offset distance widget (without mouse moves)

Refs #44866
Koyaani pushed a commit to Koyaani/QGIS that referenced this issue Sep 2, 2021
entered into the offset distance widget (without mouse moves)

Refs qgis#44866
@github-actions
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Sep 14, 2021
@thbaumann
Copy link
Contributor Author

To prevent the bot from closing the ticket here one comment: GEOS Bug still unresolved: libgeos/geos#477

@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Sep 15, 2021
@gioman gioman removed the Feedback Waiting on the submitter for answers label Sep 15, 2021
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! Digitizing Related to feature digitizing map tools or functionality
Projects
None yet
Development

No branches or pull requests

4 participants