Open mariusfm54 opened 3 years ago
Not sure of the cause, but do you experience this slowness also in a project with, say, just 1 or 2 layers?
Thank you for the quick answer.
I do not experience this slowness when I reduce the number of drawn features of the project (points, polylines,...) on computer.
However I still experience it in an empty project (only with an annotation layer) when I try to use the beePen on a tablet (which is the main support for me to use the beePen). This tablet is a Panasonic FZG1 with a i5, 8 Go RAM and Windows 10 where you can use a real pen to write on the tablet.
Before, it used to be possible to write like on paper using the beePen but now because of this slowness it is not possible anymore, every time you realease the pen, QGIS sort of load things which create an undesired delay.
Hi mauroalberti,
It seems I have almost the same problem as Va2sili.
I recently upgraded QGIS from 3.4.15 to 3.16.13 also on an Panasonic FZG1 tablet (exactly same conf as Va2sili, so Windows) and a very noticeable change happened in the behavior of the pen since that upgrade: it seems as if at each release of the stylus the complete canvas is being refreshed and there is a rather large delay before being able to use the pen again. As an example trying to write a dashed line has become very frustrating. The number of loaded layers in the project don't seem to have any influence on this behavior. Text writing has also unfortunately become quite hindered and slow.
I also tried intermediate versions of QGIS and it seems that this problem can only be seen since QGIS 3.10 (I didn't go further than version 3.16.13)
I use beePen almost daily on the field and I must admit that if you managed to provide a solution to this problem that would be really appreciated!
Thank you for writing beePen in the first place and for any solution that you could find to this problem.
For what I have read in the QGIS Developer emails, the 3.16.12 QGIS Windows packaging, depending on its specifics, could be broken from the Python plugins side, while the 3.16.13, always specific Windows-version, is broken with regards to CRS and so on.
I am not sure the beePen issue is related to this QGIS problem, since you write that the slowness starts at 3.10 (Windows, I suppose).
I again just tried beePen 0.2.3 on QGIS 3.10.4-A Coruña Linux Mint and didn't notice any particular problem (I previously tried to install 3.16 but was unsuccessful). Moreover I do not dispose of Windows laptops or Panasonic tablets, so I cannot check and test the bottlenecks.
Based on what you write, I see in freehandeditingtool.py line 250 and followings that the canvas is refreshed:
def canvasReleaseEvent(self, event):
if self.ignoreclick:
return
self.drawing = False
if not self.rb:
return
if self.rb.numberOfVertices() > 2:
geom = self.rb.asGeometry()
else:
geom = None
# reset rubberband and refresh the canvas
self.rb.reset()
self.rb = None
self.canvas.refresh() # <---------------------- CANVAS REFRESH
try:
self.rbFinished.emit(geom)
except:
pass
Could you comment that single line in the code and check whether the slowness disappears (apart from possibly broking other plugin things)?
I did a fresh install of QGIS 3.16.11 on the tablet with a dedicated new profile and downloaded beePen's current version (0.2.4).
I commented both lines 127 and 269 to be sure but couldn't notice any substantial difference (qualitatively speaking) with having those lines uncommented.
I should add that creating a simple dash or a very complex curve behaves almost the same in terms of the observed delay.
Drawing by itself (drawing and erasing) is fine but delays arise in both cases just after releasing the stylus although differently whether I add or erase annotations.
Scenario 1: adding an annotation During a delay of approximately 1.5 seconds all labels in non beePen layers disapear, all annotations in all beePen layers also disappear, all other displayed objects remain visible. After the delay everything reappears but during this time creating a new annotation is impossible.
Scenario 2: erasing an annotation Only intersected annotations disappear after a delay of 1.5 seconds as well, no blinking of any displayed objects.
I also tried something different than what you suggested. I restored the self.canvas.refresh() lines but I then removed both self.rbFinished.emit(geom) lines. As a result no blinking or substantial delay between drawing strokes could be noticed, as if saving the annotation to the layer was responsible for the delay, which is far from being that long in QGIS 3.4, very strange.
I hope this helps
Thanks for helping.
If I remove self.rbFinished.emit(geom)
, nothing is drawn anymore and I still see this blinking if I unzoom far enough. Are you able to write with the beePen while removing these lines?
However, if I remove all the layer.commitChanges()
in _beePengui.py, the delay is significantly decreased. It is even better if you zoom close enough so you do not see many objects on your screen.
By removing these lines, everything you draw with the beepen is not automatically saved anymore so you have to do it manually (which is fine for me).
The blinking is still here though, which is quite annoying. I tried to remove it by replacing self.canvas.refresh()
by
layer = self.interface.layerTreeView().selectedLayers()[0]
layer.triggerRepaint()
but it did not remove the blinking either... The labels of the objects from other layers seem to be also repainted.
Please let me know if you manage to remove this blinking.
Perhaps 'smooth_iterations' or 'simplify_tolerance', always in 'create_feature', could be responsible for the blinking?
I do not think so because when I use the beepen smooth_iterations
and simplify_tolerance
are always False, I also tried it.
I just created a KML layer compatible with beePen and drawing in this layer is lightning fast, too bad the eraser doesn't work. But the culprit clearly is the SHAPEFILE data provider.
@Poaplum will look if KML is a workable alternative to shapefile
Thank you for the hint! How do you create a KML layer compatible with beePen?
I am currently using a GEOJSON layer as a replacement (writing and erasing both work fine) by:
@Poaplum yes, geojson works without any problems. very good
Hello, I think beePen is a great tool but since QGIS 3.10 (I think) it is extremely slow.
I am using the beePen in a QGIS 3.16 project containing a lot of Vector layers that contain a lot of features. Now, when I try to write something with the beePen, every time I release my mouse left button, QGIS seems to save everything (during arround 2s) which makes writing smoothly with the beePen impossible.
Do you know what is causing that and what line in the code I should remove to prevent this saving every time I release the left button? Thank you for your help.