2

I'm relatively new to Python and GIS.

I am attempting to read in a 1.1 GB shapefile using geopandas. I let the code run for an hour and it is still not complete. Is this normal? How can I optimize the time it takes for the file to be read?

Here's my code:

polygons = gpd.read_file(r"path_to_shapefile.shp")

Edit: My system is an SSD, 64bit Python, and 8gb of RAM.

Memory Usage during File Reading

Edit 2: Not sure what was different, but running this code a third time, the shapefile was able to be read by Geopandas in less than 5 minutes.

closed as off-topic by user2856, BERA, Fran Raga, Vince, whyzar Apr 30 at 16:21

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – BERA, Fran Raga, Vince, whyzar
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Added those details. How do I check how much RAM the process took to read the shapefile? Is that the memory being used in Task Manager? – Sumit Dalsania Apr 30 at 0:45
  • Added a picture with this info, about 4GB of memory being used – Sumit Dalsania Apr 30 at 0:57
  • 1
    Looks like you're running out of RAM and the process memory is getting swapped to disk which is very slow. Close everything on your PC before running. Don't have a web browser open. Don't use an IDE, use command line to run your code. – user2856 Apr 30 at 1:12

Browse other questions tagged or ask your own question.