Timeline for How to speed up this script in PyQGIS?
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 29, 2016 at 13:47 | comment | added | HMadadi | Hi gene, thanks for your solution but I don't want to use Fiona, I believe pyqgis and gdal have potential for solve this problem! | |
Jan 28, 2016 at 21:51 | comment | added | gene |
A solution is to use generators in place of lists. Generators are iterables, but you can only read them once. It's because they do not store all the values in memory, they generate the values on the fly - > ds = (Point((s * x) + originX + (s/2), (s2 * y) + originY + (s2/2)) for x in range(colums) for y in range(rows)) is a generator for Shapely, for example, and you can use it with Fiona to create shapefiles with very big files without problem.
|
|
Jan 28, 2016 at 5:58 | comment | added | HMadadi | Hi ndawson, I run two times your revision posted, but after 3 minutes, without any error closed QGIS program! | |
Jan 27, 2016 at 22:32 | comment | added | ndawson | Ok, revision posted | |
Jan 27, 2016 at 22:32 | history | edited | ndawson | CC BY-SA 3.0 |
deleted 161 characters in body
|
Jan 27, 2016 at 22:15 | comment | added | HMadadi | I used updated version, first time without any error, closed QGIS program, in second time, after 1 minute, appeared an "Exception window" with "bad allocation" message!! Is this relation to my Computer? My system is win 8.1 64bit, RAM 4 GB, Core i7 2.2 GHz. I installed QGIS 2.12.3 Lyon from OSGeo4W. | |
Jan 27, 2016 at 21:43 | comment | added | ndawson | Try the updated version | |
Jan 27, 2016 at 21:43 | history | edited | ndawson | CC BY-SA 3.0 |
added 1341 characters in body
|
Jan 27, 2016 at 21:32 | vote | accept | HMadadi | ||
Jan 27, 2016 at 21:26 | comment | added | HMadadi | Hi ndawson, you are a professional programmer, It's work very well, for 291*220 pixels, time change from 5 minutes to 8 seconds, for 418*326 pixels time is 14 seconds, It's very good,but when I want to run for 10393* 7170 pixels layer below error appear!!!! Traceback (most recent call last):........... new_features.append(fet) MemoryError. what's happend!!? | |
Jan 27, 2016 at 20:59 | history | answered | ndawson | CC BY-SA 3.0 |