I am not sure if I have discovered a regression, or if I have not enough sleep. While I manage to create shapefiles with point geometries with pyshp, line and polygon features don't show up in QGIS. In ArcMap, however, they show up as expected.
Steps to reproduce
- Get pyshp (version 1.1.7)
Execute one or both of these example scripts, taken directly from the pyshp documentation:
import shapefile w = shapefile.Writer(shapefile.POLYGON) w.poly(parts=[[[1,5],[5,5],[5,1],[3,3],[1,1]]]) w.field('FIRST_FLD','C','40') w.field('SECOND_FLD','C','40') w.record('First','Polygon') w.save('test-polygon')
import shapefile w = shapefile.Writer(shapefile.POLYLINE) w.line(parts=[[[1,5],[5,5],[5,1],[3,3],[1,1]]]) w.field('FIRST_FLD','C','40') w.field('SECOND_FLD','C','40') w.record(FIRST_FLD='First', SECOND_FLD='Line') w.save('test-line')
Open the resulting shapefile in an empty QGIS session (tested in 1.7.3, 1.8.0 and 1.9.0 Alpha)
A polygon or a line in the map window (at least after a "zoom to layer extent").
What I get
An empty map.
Did I miss something?
After contacting the package author, version 1.1.9 was mentioned on the homepage. After an upgrade, the issue vanished. That's good customer support!