Ticket #342 (closed defect: fixed)

Opened 16 months ago

Last modified 14 months ago

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

Changed 16 months ago by springmeyer

Will need to look through r628 to see what shape.input looked like before memory-mapped files were implemented.

Changed 15 months ago by springmeyer

  • priority changed from normal to critical (top)

Changed 14 months ago by springmeyer

  • cc crschmidt added

r1213 adds the compile-time ability to switch off the default use of SHAPE_MEMORY_MAPPED_FILE, and r1217 add the ability to control this in the SCons build options.

Changed 14 months ago by artem

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.