Open moritzsproll opened 3 years ago
@moritzsproll please attach the CSV file.
also please describe the necessary steps to replicate.
also please describe the necessary steps to replicate.
Everything else has been described or what else do you mean by steps to replicate ?
I've had watched csv layers misbehave like that when new points were added outside the initial layer's extent. My solution was to add four points to the initial csv that defined a bigger initial extent.
I've had watched csv layers misbehave like that when new points were added outside the initial layer's extent
@uclaros was this unreported previously?
I remember only finding some closed reports regarding csv watch functionality.
I think snapping was also affected, some points were visible but not snappable...
My other solution was running the following:
filePath = r'c:\coords.txt'
from PyQt5.QtCore import QFileSystemWatcher
import os
layerName = os.path.splitext(os.path.basename(filePath))[0]
watcher = QFileSystemWatcher()
watcher.addPath(filePath)
watchedLayer = QgsProject.instance().mapLayersByName(layerName)[0]
def reload_watched_layer():
watchedLayer.dataProvider().forceReload()
watcher.fileChanged.connect(reload_watched_layer)
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.
Don't close this, having delimited text layers that work properly with dynamic data would be super useful! It is not clear by the docs if watch file is supposed to trigger an automatic reload (ie not need to zoom/pan for the new points to appear) or if without it no content is added/removed at all, but here's some more info on how it currently misbehaves:
points.csv
with one line containing 1,1
2,1
and save.points.csv
with one line containing 1,1
2,1
and save.3,1
and save.
What is the bug or the crash?
I have added a layer that is loaded into QGIS via a CSV file. At the beginning everything seems to be correct and the layer is visible in every zoom level. The layer is added with the "Watch File" option and is supposed to change its position when the coordinates in the CSV file change.
However, as soon as the coordinates have changed and the position of the layer has changed, it is no longer visible at certain zoom levels. Has anyone had a similar problem and knows how to solve it?
`if(QgsProject.instance().mapLayersByName(self.ambulance)): layers = QgsProject.instance().mapLayersByName(self.ambulance) rr = layers[0] QgsProject.instance().removeMapLayer(rr) if self.ambulance == "Ambulance I": coords_var = "coords1" elif self.ambulance == "Ambulance II": coords_var = "coords2" elif self.ambulance == "Ambulance III": pass
Steps to reproduce the issue
The layer is still visible at this zoom level If I zoom in, the layer disappears. The zoom level display has already been checked, that can't be the problem.
Versions
QGIS version 3.20.2-Odense QGIS code revision 9f59a15664 Qt version 5.12.8 Python version 3.8.10 GDAL/OGR version 3.0.4 PROJ version 6.3.1 EPSG Registry database version v9.8.6 (2020-01-22) Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1 SQLite version 3.31.1 PDAL version 2.0.1 PostgreSQL client version 12.8 (Ubuntu 12.8-0ubuntu0.20.04.1) SpatiaLite version 4.3.0a QWT version 6.1.4 QScintilla2 version 2.11.2 OS version Ubuntu 20.04.3 LTS
Active Python plugins location_help incident_report map_legend sendingmail information_health_facilities GeoCoding capture_coordinates open_telegram open_traccar open_whatsapp get_location_whatsapp change_layers clear MetaSearch processing db_manager
Supported QGIS version
New profile
Additional context
No response