@@ -10,6 +10,8 @@ The Python Shapefile Library (pyshp) reads and writes ESRI Shapefiles in pure Py
10
10
11
11
[ Overview] ( #overview )
12
12
13
+ [ Version Changes] ( #version-changes )
14
+
13
15
[ Basic Use] ( #basic-use )
14
16
- [ Reading Shapefiles] ( #reading-shapefiles )
15
17
- [ Reading Shapefiles Using the Context Manager] ( #reading-shapefiles-using-the-context-manager )
@@ -33,6 +35,7 @@ The Python Shapefile Library (pyshp) reads and writes ESRI Shapefiles in pure Py
33
35
34
36
[ Testing] ( #testing )
35
37
38
+
36
39
# Overview
37
40
38
41
The Python Shapefile Library (pyshp) provides read and write support for the
@@ -53,7 +56,7 @@ despite the numerous ways to store and exchange GIS data available today.
53
56
Pyshp is compatible with Python 2.7-3.x.
54
57
55
58
This document provides examples for using pyshp to read and write shapefiles. However
56
- many more examples are continually added to the pyshp wiki on GitHub, the blog [ http://GeospatialPython.com ] ( http://GeospatialPython.com ) ,
59
+ many more examples are continually added to the blog [ http://GeospatialPython.com ] ( http://GeospatialPython.com ) ,
57
60
and by searching for pyshp on [ https://gis.stackexchange.com ] ( https://gis.stackexchange.com ) .
58
61
59
62
Currently the sample census blockgroup shapefile referenced in the examples is available on the GitHub project site at
@@ -69,6 +72,47 @@ reading and writing data, and allows you to focus on the challenging and FUN
69
72
part of your geospatial project.
70
73
71
74
75
+ # Version Changes
76
+
77
+ ## 2.0.0
78
+
79
+ The newest version of PyShp, version 2.x introduced some major new features.
80
+ This resulted in some API changes that are incompatible with previous versions.
81
+ Users of the previous version 1.x should therefore take note of the following changes
82
+ (Note: Some contributor attributions may be missing):
83
+
84
+ Major Changes:
85
+
86
+ - Full support for unicode text, with custom encoding, and exception handling.
87
+ - Means that the Reader returns unicode, and the Writer accepts unicode.
88
+ - PyShp has been simplified to a pure input-output library using the Reader and Writer classes, dropping the Editor class.
89
+ - Switched to a new streaming approach when writing files, keeping memory-usage at a minimum:
90
+ - Specify filepath/destination and text encoding when creating the Writer.
91
+ - The file is written incrementally with each call to shape/record.
92
+ - Adding shapes is now done using dedicated methods for each shapetype.
93
+ - Reading shapefiles is now more convenient:
94
+ - Shapefiles can be opened using the context manager, and files are properly closed.
95
+ - Shapefiles can be iterated, have a length, and supports the geo interface.
96
+ - New ways of inspecing shapefile metadata by printing. [ @megies ]
97
+ - More convenient accessing of Record values as attributes. [ @philippkraft ]
98
+ - More convenient shape type name checking. [ @megies ]
99
+ - Add more support and documentation for MultiPatch 3D shapes.
100
+ - Better documentation of previously unclear aspects, such as field types.
101
+
102
+ Important Fixes:
103
+
104
+ - More reliable/robust:
105
+ - Fixed shapefile bbox error for empty or point type shapefiles. [ @mcuprjak ]
106
+ - Reading and writing Z and M type shapes is now more robust, fixing many errors, and has been added to the documentation. [ @ShinNoNoir ]
107
+ - Improved parsing of field value types, fixed errors and made more flexible.
108
+ - Fixed bug when writing shapefiles with datefield and date values earlier than 1900 [ @megies ]
109
+ - Fix some geo interface errors, including checking polygon directions.
110
+ - Bug fixes for reading from case sensitive file names, individual files separately, and from file-like objects. [ @gastoneb , @kb003308 , @erickskb ]
111
+ - Enforce maximum field limit. [ @mwtoews ]
112
+
113
+ A great thanks to all who have contributed code and raised issues for version 2.x, and for the patience and understanding during the
114
+ transition period.
115
+
72
116
73
117
# Basic Use
74
118
@@ -393,7 +437,7 @@ Calling the shapeRecords() method will return the geometry and attributes for
393
437
all shapes as a list of ShapeRecord objects. Each ShapeRecord instance has a
394
438
"shape" and "record" attribute. The shape attribute is a Shape object as
395
439
discussed in the first section "Reading Geometry". The record attribute is a
396
- list of field values as demonstrated in the "Reading Records" section.
440
+ list-like object containing field values as demonstrated in the "Reading Records" section.
397
441
398
442
399
443
>>> shapeRecs = sf.shapeRecords()
0 commit comments