
Shape object information when calling repr().More informative Shape to geojson warnings (see #219).More examples and restructuring of README.Allow fast filtering which shapes to read from the file through a bbox arg.Allow fast extraction of only a subset of dbf fields through a fields arg.Read shapefiles directly from zipfiles.I sincerely hope this library eliminates the mundane distraction of simply reading and writing data, and allows you to focus on the challenging and FUN part of your geospatial project. Important: If you are new to GIS you should read about map projections. These examples are straight-forward and you can also easily run them against your own shapefiles with minimal modification. Ĭurrently the sample census blockgroup shapefile referenced in the examples is available on the GitHub project site at. However many more examples are continually added to the blog, and by searching for PyShp on. This document provides examples for using PyShp to read and write shapefiles. For more on this specification see: īoth the Esri and XBase file-formats are very simple in design and memory efficient which is part of the reason the shapefile format remains popular despite the numerous ways to store and exchange GIS data available today. This format is documented on the web as the "XBase File Format Description" and is a simple file-based database format created in the 1960's. However a third file format called dbf is also required. The Esri document describes the shp and shx file formats. For more information about this format please read the well-written "ESRI Shapefile Technical Description - July 1998" located at dfs/shapefile.pdf.


The Shapefile format is a popular Geographic Information System vector data format created by Esri. The Python Shapefile Library (PyShp) provides read and write support for the Esri Shapefile format. Shapefile Language and Character Encoding.Writing Shapefiles Using the Context Manager.Writing Shapefiles to File-Like Objects.Reading Geometry and Records Simultaneously.Reading Shapefiles Using the Context Manager.Reading Shapefiles from File-Like Objects.The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles in pure Python.
