You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [Reading Large Shapefiles](#reading-large-shapefiles)
43
45
- [Iterating through a shapefile](#iterating-through-a-shapefile)
44
46
- [Limiting which fields to read](#limiting-which-fields-to-read)
@@ -1029,11 +1031,30 @@ most shapefile software.
1029
1031
1030
1032
# Advanced Use
1031
1033
1032
-
## Shapefile Language and Character Encoding
1034
+
## Common Errors and Fixes
1035
+
1036
+
Below we list some commonly encountered errors and ways to fix them.
1037
+
1038
+
### Warnings and Logging
1039
+
1040
+
By default, PyShp chooses to be transparent and provide the user with logging information and warnings about non-critical issues when reading or writing shapefiles. This behavior is controlled by the module constant `VERBOSE` (which defaults to True). If you would rather suppress this information, you can simply set this to False:
1041
+
1042
+
1043
+
>>> shapefile.VERBOSE = False
1044
+
1045
+
All logging happens under the namespace `shapefile`. So another way to suppress all PyShp warnings would be to alter the logging behavior for that namespace:
PyShp supports reading and writing shapefiles in any language or character encoding, and provides several options for decoding and encoding text.
1035
-
Most shapefiles are written in UTF-8 encoding, PyShp's default encoding, so in most cases you don't
1036
-
have to specify the encoding. For reading shapefiles in any other encoding, such as Latin-1, just
1054
+
Most shapefiles are written in UTF-8 encoding, PyShp's default encoding, so in most cases you don't have to specify the encoding.
1055
+
If you encounter an encoding error when reading a shapefile, this means the shapefile was likely written in a non-utf8 encoding.
1056
+
For instance, when working with English language shapefiles, a common reason for encoding errors is that the shapefile was written in Latin-1 encoding.
1057
+
For reading shapefiles in any non-utf8 encoding, such as Latin-1, just
1037
1058
supply the encoding option when creating the Reader class.
0 commit comments