Skip to content

Commit bf968a0

Browse files
authored
Merge pull request #398 from JamesParrott/shxReader
Add ShpReader and ShxReader
2 parents 7e14702 + 0e75543 commit bf968a0

4 files changed

Lines changed: 667 additions & 448 deletions

File tree

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ part of your geospatial project.
9393

9494
# Version Changes
9595

96-
## 3.0.9
96+
## 3.0.9.dev
97+
### Bug fix
98+
- Correct NODATA lower threshold to -1e38 (as per [spec](https://www.esri.com/content/dam/esrisites/sitecore-archive/Files/Pdfs/library/whitepapers/pdfs/shapefile.pdf) 2, Numeric Types). This is 10% of
99+
PyShp's previous threshold -10e38, so it is possible large negative values x (-1e39 < x < -1e38 will now be NODATA.
100+
101+
97102
### Security
98103
- Add python_version >= 3.10 to pre-commit dev & lint groups' 'dependency' (due to CVE in filelock 3.19).
99104

@@ -514,7 +519,7 @@ and the bounding box area the shapefile covers:
514519
>>> len(sf)
515520
663
516521
>>> sf.bbox
517-
(-122.515048, 37.652916, -122.327622, 37.863433)
522+
BBox(xmin=-122.515048, ymin=37.652916, xmax=-122.327622, ymax=37.863433)
518523

519524
Finally, if you would prefer to work with the entire shapefile in a different
520525
format, you can convert all of it to a GeoJSON dictionary, although you may lose
@@ -1473,7 +1478,7 @@ Shapefiles containing M-values can be examined in several ways:
14731478
>>> r = shapefile.Reader('shapefiles/test/linem')
14741479

14751480
>>> r.mbox # the lower and upper bound of M-values in the shapefile
1476-
(0.0, 3.0)
1481+
MBox(mmin=0.0, mmax=3.0)
14771482

14781483
>>> r.shape(0).m # flat list of M-values
14791484
[0.0, None, 3.0, None, 0.0, None, None]
@@ -1506,7 +1511,7 @@ To examine a Z-type shapefile you can do:
15061511
>>> r = shapefile.Reader('shapefiles/test/linez')
15071512

15081513
>>> r.zbox # the lower and upper bound of Z-values in the shapefile
1509-
(0.0, 22.0)
1514+
ZBox(zmin=0.0, zmax=22.0)
15101515

15111516
>>> r.shape(0).z # flat list of Z-values
15121517
[18.0, 20.0, 22.0, 0.0, 0.0, 0.0, 0.0, 15.0, 13.0, 14.0]

changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
VERSION 3.0.9.dev
22

3+
2026-05-23
4+
Bug fix (BREAKING CHANGE):
5+
* Correct NODATA lower threshold to -1e38 (as per [spec](https://www.esri.com/content/dam/esrisites/sitecore-archive/Files/Pdfs/library/whitepapers/pdfs/shapefile.pdf)
6+
page 2, Numeric Types). This is a tenth of PyShp's previous threshold -10e38, but still a huge negative number.
7+
38
2026-05-20
49
Security:
510
* Add python_version >= 3.10 to pre-commit dev & lint groups' 'dependency' (due to CVE in filelock 3.19).

0 commit comments

Comments
 (0)