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

Application crashes with data layers #58527

Open
1 of 2 tasks
josecarlosbcn opened this issue Aug 29, 2024 · 2 comments
Open
1 of 2 tasks

Application crashes with data layers #58527

josecarlosbcn opened this issue Aug 29, 2024 · 2 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Feedback Waiting on the submitter for answers PyQGIS Related to the PyQGIS API stale Uh oh! Seems this work is abandoned, and the PR is about to close.

Comments

@josecarlosbcn
Copy link

josecarlosbcn commented Aug 29, 2024

What is the bug or the crash?

I'm totally newbie with QGis.

I want to draw in a layer several polygons. To do this, I load the data in the layer from a csv file. This csv file has a total amount of 65.000 rows and a weight of 109MB. The load of information in the layer works fine.

The problem is when I try to get this information and process it.

the 65,000 records in the csv file but when I read the information the application crashes.

Steps to reproduce the issue

If I try to process the total amount in a batch processing.

`
layer = iface.activeLayer()
features = layer.getFeatures()

batch_size = 5000
batch = []

def process_batch(batch):
for feat in batch:
id_pts = feat["id_"]
pts_perim = feat["points"]
print(id_pts)
#print(pts_perim)
print("Batch processing succesfully!!!")

for i, feat in enumerate(features):
batch.append(feat)
print(f"Feature {i} added to the list")
if i % batch_size == 0:
process_batch(batch)
batch = []
`

The process usually to crash in this line of code for i, feat in enumerate(features):

And it's not possible to advance because the application crashes. ¡¡¡In other computer happens the same!!!

However, If I try to get access to the information loading this infromation over a dataframe, I can run through the entire dataframe and print the value of the variable id_ on the screen.!!!

Here is my code:

`
import pandas as pd
pd.options.display.max_columns = None

df = pd.read_csv('F:\Proyectos\QGis\cent_cont_P8_xd3_id.csv')

df["points"] = df["points"].astype("string")
#df["coords"] = df.points.split(";")

df["coords"] = 0
for index, row in df.iterrows():
df["coords"][index] = df["points"][index]
df["coords"][index] = df["points"][index].split(";")
df["coords"][index] = [tuple(map(float, cadena.strip('()').split(','))) for cadena in df["coords"][index]]

batch_size = 5000
batch = []

for index, row in df.iterrows():
print(row["id_"])
print("Proceso finalizado!!!")

`
This code works for me from time to time. Because the same code with the same data sometimes works fine and another the application crashes. But in another computer the application crashes always!!! How is that possible? This other computer has installed the version 3.23 of QGis.

I am desperate, because I have learned how to create a polygon on the layer, but now I need to create a polygon based on each of the registers of the csv file, around 65.000 polygons.

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
Versión de QGIS 3.34.10-Prizren Revisión del código de QGIS 113de9e
Versión Qt 5.15.13
Versión de Python 3.12.5
Versión de GDAL/OGR 3.9.2
Versión de PROJ 9.4.0
Versión del registro de base de datos EPSG v11.004 (2024-02-24)
Versión de GEOS 3.12.2-CAPI-1.18.2
Versión de SQLite 3.45.1
Versión de PDAL 2.6.3
Versión del cliente de PostgreSQL 16.2
Versión de SpatiaLite 5.1.0
Versión de QWT 6.2.0
Versión de QScintilla2 2.14.1
Versión del SO Windows 10 Version 2009
       
Complementos activos de Python
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.6
processing 2.12.99
Versión de QGIS 3.34.10-Prizren Revisión del código de QGIS [113de9e](https://github.com/qgis/QGIS/commit/113de9e1) Versión Qt 5.15.13 Versión de Python 3.12.5 Versión de GDAL/OGR 3.9.2 Versión de PROJ 9.4.0 Versión del registro de base de datos EPSG v11.004 (2024-02-24) Versión de GEOS 3.12.2-CAPI-1.18.2 Versión de SQLite 3.45.1 Versión de PDAL 2.6.3 Versión del cliente de PostgreSQL 16.2 Versión de SpatiaLite 5.1.0 Versión de QWT 6.2.0 Versión de QScintilla2 2.14.1 Versión del SO Windows 10 Version 2009

Complementos activos de Python
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

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

New profile

Additional context

No response

@josecarlosbcn josecarlosbcn added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Aug 29, 2024
@agiudiceandrea agiudiceandrea added Crash/Data Corruption PyQGIS Related to the PyQGIS API labels Aug 31, 2024
@nyalldawson
Copy link
Collaborator

More information is required here. Please provide the full script and sample data which demonstrates the crash.

@nyalldawson nyalldawson added the Feedback Waiting on the submitter for answers label Oct 3, 2024
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 Oct 18, 2024
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! Crash/Data Corruption Feedback Waiting on the submitter for answers PyQGIS Related to the PyQGIS API stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

No branches or pull requests

3 participants