Ticket #342 (closed defect: fixed)
Allow memory-mapping of shapefiles to be optional param for shape.input
| Reported by: | springmeyer | Owned by: | artem |
|---|---|---|---|
| Priority: | critical (top) | Milestone: | 0.6.1 |
| Component: | Core Library | Version: | 0.6.0 |
| Severity: | Blocker | Keywords: | |
| Cc: | crschmidt | Patch Needs Improvement: | no |
| Needs Docmentation: | no | Has Patch?: | no |
| Design Decision Needed: | no |
Description
The use of boost memory-mapped filesources on windows can create problems when access to shapefiles is shared. It seems that on windows the shape.input needs exclusive access so that if the shapefile it open (read-only) in another program Mapnik will fail to open the file and boost will throw an 'invalid handle' error:
>>> Shapefile(file='c:/temp_files/world_borders.shp')
got exception ...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\mapnik_0_6_0\site-packages\mapnik\__init__.py", line 132, in Shapefile
return CreateDatasource(keywords)
RuntimeError: failed opening file: The handle is invalid.
So, it would be great to have memory-mapped file loading be able to be a parameter that could be turned off. This will also benefit Mapnik usage on systems with less memory.
Change History
Note: See
TracTickets for help on using
tickets.
