-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed "Z" type shapefiles to also read measure values as per the Es…
…ri specification - Check for "nodata" values (< -10e38) in measures as per the Esri specification and return "None" - Added the ability to read from Python file-like objects git-svn-id: https://pyshp.googlecode.com/svn/trunk@55 6bd14dac-74e7-11de-ab85-01204adfcb19
- Loading branch information
1 parent
12a5adb
commit 55a5e7b
Showing
8 changed files
with
152 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>pyshp</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.python.pydev.PyDevBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.python.pydev.pythonNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?eclipse-pydev version="1.0"?> | ||
|
||
<pydev_project> | ||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> | ||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property> | ||
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> | ||
<path>/pyshp</path> | ||
</pydev_pathproperty> | ||
</pydev_project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,32 +3,39 @@ | |
Python Shapefile Library | ||
======================== | ||
:Author: Joel Lawhead <[email protected]> | ||
:Revised: August 31, 2011 | ||
:Revised: September 21, 2011 | ||
Overview | ||
-------- | ||
The Python Shapefile Library (PSL) provides read and write support for the ESRI | ||
The Python Shapefile Library (pyshp) provides read and write support for the ESRI | ||
Shapefile format. The Shapefile format is a popular Geographic Information | ||
System vector data format. | ||
System vector data format created by Esri. For more information about this format | ||
please read the well-written "ESRI Shapefile Technical Description - July 1998". | ||
The Esri document describes the shp and shx file formats. However a third file | ||
format called dbf is also required. 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. Both 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 documentation covers the Python 2.x-compatible version of the library. A | ||
Python 3-compatible version is available in the Subversion trunk of the pyshp | ||
project on Google Code. | ||
This document provides usage examples for using the Python Shapefile Library. | ||
This document provides examples for using pyshp to read and write shapefiles. | ||
Currently the sample census blockgroup shapefile referenced in the examples is | ||
only available on the google code project site at http://code.google.com/p/pyshp. | ||
These examples are straight-forward and you can also easily run these simple | ||
examples on your own shapefiles manually. Other examples for specific topics are | ||
continually added to the pyshp wiki on google code and the blog: | ||
These examples are straight-forward and you can also easily run them against your | ||
own shapefiles manually with minimal modification. Other examples for specific | ||
topics are continually added to the pyshp wiki on google code and the blog | ||
GeospatialPython.com. | ||
Important: For information about map projections, shapefiles, | ||
and Python please visit:http://code.google.com/p/pyshp/wiki/MapProjections | ||
and Python please visit: http://code.google.com/p/pyshp/wiki/MapProjections | ||
I sincerely hope this libarary eliminates the mundane distraction of simply | ||
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 project. | ||
|
@@ -64,7 +71,22 @@ | |
>>> sf = shapefile.Reader("shapefiles/blockgroups.dbf") | ||
OR any of the other 5+ formats which are potentially part of a shapefile. | ||
OR any of the other 5+ formats which are potentially part of a shapefile. | ||
The library does not care | ||
You can ALSO load shapefiles from any Python file-like object using keyword | ||
arguments to specify any of the three files. This feature is very powerful | ||
and allows you to load shapefiles from a url, from a zip file, serialized | ||
object, or in some cases a database. | ||
>>> myshp = file("shapefiles/blockgroups.shp", "rb") | ||
>>> mydbf = file("shapefiles/blockgroups.dbf", "rb") | ||
>>> r = shapefile.Reader(shp=myshp, dbf=mydbf) | ||
Notice in the examples above the shx file is never used. The shx file is a | ||
very simple fixed-record index for the variable length records in the shp file. | ||
This file is optional for reading. If it's available pyshp will use the shx file | ||
to access shape records a little faster but will do just fine without it. | ||
Reading Geometry | ||
................ | ||
|