Skip to content

Commit 0e09ebf

Browse files
committed
Imported Upstream version 1.4.1
1 parent 99bac80 commit 0e09ebf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1580
-491
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
*.pyc
2+
*.c
3+
*.so
4+
25
VERSION.txt
36
Shapely.egg-info/
47
build/
58
dist/
69
docs/_build/
7-
shapely/speedups/_speedups.*
810
docs/shapely.*.txt
911
docs/shapely.txt
1012
docs/modules.txt

.travis.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@ language: python
33
python:
44
- "2.6"
55
- "2.7"
6-
- "3.2"
76
- "3.3"
7+
- "3.4"
8+
9+
env:
10+
- "TRAVIS_SPEEDUP_OPTS=--with-speedups"
11+
- "TRAVIS_SPEEDUP_OPTS="
812

913
before_install:
1014
- sudo add-apt-repository -y ppa:ubuntugis/ppa
1115
- sudo apt-get update -qq
12-
- sudo apt-get install -qq libgeos-dev
16+
- sudo apt-get install -qq libgeos-dev python-numpy cython
1317
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install unittest2; fi
1418
- pip install -r requirements-dev.txt
1519

1620
install:
17-
- python setup.py build
21+
- pip install -e .
1822

19-
script: "python setup.py test"
23+
script: "py.test tests ${TRAVIS_SPEEDUP_OPTS}"
2024

2125
notifications:
2226
email: false

CHANGES.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
Changes
22
=======
33

4+
1.4.1 (2014-09-23)
5+
------------------
6+
- Return of support for GEOS 3.2 (#176, #178).
7+
8+
1.4.0 (2014-09-08)
9+
------------------
10+
- SVG representations for IPython's inline image protocol.
11+
- Efficient and fast vectorized contains().
12+
- Change mitre_limit default to 5.0; raise ValueError with 0.0 (#139).
13+
- Allow mix of tuples and Points in sped-up LineString ctor (#152).
14+
- New STRtree class (#73).
15+
- Add ops.nearest_points() (#147).
16+
- Faster creation of geometric objects from others (cloning) (#165).
17+
- Removal of tests from package.
18+
19+
1.3.3 (2014-07-23)
20+
------------------
21+
- Allow single-part geometries as argument to ops.cacaded_union() (#135).
22+
- Support affine transformations of LinearRings (#112).
23+
24+
1.3.3 (2014-07-23)
25+
------------------
26+
- Allow single-part geometries as argument to ops.cacaded_union() (#135).
27+
- Support affine transformations of LinearRings (#112).
28+
29+
1.3.2 (2014-05-13)
30+
------------------
31+
- Let LineString() take a sequence of Points (#130).
32+
33+
1.3.1 (2014-04-22)
34+
------------------
35+
- More reliable proxy cleanup on exit (#106).
36+
- More robust DLL loading on all platforms (#114).
37+
438
1.3.0 (2013-12-31)
539
------------------
640
- Include support for Python 3.2 and 3.3 (#56), minimum version is now 2.6.

CREDITS.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Shapely is written by:
1111
Patches contributed by:
1212

1313
* Allan Adair (https://github.com/allanadair)
14+
* Joshua Arnott (https://github.com/snorfalorpagus)
1415
* Howard Butler
1516
* Gabi Davar (https://github.com/mindw)
1617
* Phil Elson (https://github.com/pelson)
@@ -20,8 +21,10 @@ Patches contributed by:
2021
* Kelsey Jordahl (https://github.com/kjordahl)
2122
* Fr |eaigue| d |eaigue| ric Junod
2223
* Thomas Kluyver (https://github.com/takluyver)
24+
* William Kyngesburye (https://github.com/kyngchaos)
2325
* Eric Lemoine
2426
* Naveen Michaud-Agrawal (https://github.com/nmichaud)
27+
* om-henners (https://github.com/om-henners)
2528
* psagers https://github.com/psagers
2629
* Jeethu Rao (https://github.com/jeethu)
2730
* Benjamin Root (https://github.com/WeatherGod)
@@ -31,6 +34,8 @@ Patches contributed by:
3134
* Kristian Thy
3235
* Mike Toews (https://github.com/mwtoews)
3336
* Maarten Vermeyen (https://github.com/maarten-vermeyen)
37+
* Jacob Wasserman (https://github.com/jwass)
38+
* Brandon Wood (https://github.com/woodb)
3439

3540
See also: https://github.com/Toblerity/Shapely/graphs/contributors.
3641

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ recursive-exclude docs *
55
recursive-exclude DLLs_AMD64 *
66
recursive-exclude DLLs_x86 *
77
include CHANGES.txt CREDITS.txt LICENSE.txt README.rst VERSION.txt
8-
recursive-include shapely/tests *.py *.txt
8+
recursive-include tests *.py *.txt
99
recursive-include shapely/examples *.py
1010
recursive-exclude shapely/speedups *.pyx
11-
include docs/manual.txt
11+
include docs/*.rst
1212
exclude MANIFEST.in

README.rst

Lines changed: 62 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Shapely
44

55
Manipulation and analysis of geometric objects in the Cartesian plane.
66

7+
.. image:: https://travis-ci.org/Toblerity/Shapely.png?branch=master
8+
:target: https://travis-ci.org/Toblerity/Shapely
9+
710
.. image:: http://farm3.staticflickr.com/2738/4511827859_b5822043b7_o_d.png
811
:width: 800
912
:height: 400
@@ -20,7 +23,7 @@ integrated with packages that are. For more details, see:
2023
Requirements
2124
============
2225

23-
Shapely 1.3 requires
26+
Shapely 1.4 requires
2427

2528
* Python >=2.6 (including Python 3.x)
2629
* libgeos_c >=3.1 (3.0 and below have not been tested, YMMV)
@@ -30,13 +33,14 @@ Installation
3033

3134
Windows users should use the executable installer, which contains the required
3235
GEOS DLL. Other users should acquire libgeos_c by any means, make sure that it
33-
is on the system library path, and install from the Python package index::
36+
is on the system library path, and install from the Python package index.
3437

35-
$ pip install Shapely
38+
.. code-block:: console
3639
37-
or from a source distribution with the setup script::
40+
$ pip install shapely
3841
39-
$ python setup.py install
42+
Shapely is also provided by popular Python distributions like Enthought Canopy
43+
and Continuum Analytics Anaconda.
4044

4145
.. warning:: Windows users:
4246
do not under any circumstances use pip (or easy_install) to uninstall
@@ -48,7 +52,9 @@ Usage
4852
=====
4953

5054
Here is the canonical example of building an approximately circular patch by
51-
buffering a point::
55+
buffering a point.
56+
57+
.. code-block:: pycon
5258
5359
>>> from shapely.geometry import Point
5460
>>> patch = Point(0.0, 0.0).buffer(10.0)
@@ -65,40 +71,51 @@ Integration
6571

6672
Shapely does not read or write data files, but it can serialize and deserialize
6773
using several well known formats and protocols. The shapely.wkb and shapely.wkt
68-
modules provide dumpers and loaders inspired by Python's pickle module.::
74+
modules provide dumpers and loaders inspired by Python's pickle module.
75+
76+
.. code-block:: pycon
6977
7078
>>> from shapely.wkt import dumps, loads
7179
>>> dumps(loads('POINT (0 0)'))
7280
'POINT (0.0000000000000000 0.0000000000000000)'
7381
7482
All linear objects, such as the rings of a polygon (like ``patch`` above),
75-
provide the Numpy array interface.::
83+
provide the Numpy array interface.
84+
85+
.. code-block:: pycon
7686
77-
>>> from numpy import asarray
78-
>>> ag = asarray(patch.exterior)
79-
>>> ag
87+
>>> import numpy as np
88+
>>> np.array(patch.exterior)
8089
array([[ 1.00000000e+01, 0.00000000e+00],
8190
[ 9.95184727e+00, -9.80171403e-01],
8291
[ 9.80785280e+00, -1.95090322e+00],
8392
...
8493
[ 1.00000000e+01, 0.00000000e+00]])
8594
86-
That yields a Numpy array of [x, y] arrays. This is not always exactly what one
87-
wants for plotting shapes with Matplotlib (for example), so Shapely 1.2 adds
88-
a `xy` property for obtaining separate arrays of coordinate x and y values.::
95+
That yields a Numpy array of `[x, y]` arrays. This is not always exactly what one
96+
wants for plotting shapes with Matplotlib (for example), so Shapely adds
97+
a `xy` property for obtaining separate arrays of coordinate x and y values.
98+
99+
.. code-block:: pycon
89100
90101
>>> x, y = patch.exterior.xy
91-
>>> ax = asarray(x)
92-
>>> ax
102+
>>> np.array(x)
93103
array([ 1.00000000e+01, 9.95184727e+00, 9.80785280e+00, ...])
94104
95-
Numpy arrays can also be adapted to Shapely linestrings::
105+
Numpy arrays of `[x, y]` arrays can also be adapted to Shapely linestrings.
106+
107+
.. code-block:: pycon
96108
97-
>>> from shapely.geometry import asLineString
98-
>>> asLineString(ag).length
109+
>>> from shapely.geometry import LineString
110+
>>> LineString(np.array(patch.exterior)).length
99111
62.806623139095073
100-
>>> asLineString(ag).wkt
101-
'LINESTRING (10.0000000000000000 0.0000000000000000, ...)'
112+
113+
Numpy arrays of x and y must be transposed.
114+
115+
.. code-block::
116+
117+
>>> LineString(np.transpose(np.array(patch.exterior.xy))).length
118+
62.80662313909507
102119
103120
Shapely can also integrate with other Python GIS packages using data modeled
104121
after GeoJSON.
@@ -116,22 +133,36 @@ after GeoJSON.
116133
Development and Testing
117134
=======================
118135

119-
Dependecies for developing Shapely are listed in requirements-dev.txt. Cython
136+
Dependencies for developing Shapely are listed in requirements-dev.txt. Cython
120137
and Numpy are not required for production installations, only for development.
121-
Use of a virtual environment is strongly recommended.::
138+
Use of a virtual environment is strongly recommended.
139+
140+
.. code-block:: console
122141
123142
$ virtualenv .
124143
$ source bin/activate
125144
(env)$ pip install -r requirements-dev.txt
126-
(env)$ python setup.py develop
145+
(env)$ pip install -e .
146+
147+
We use py.test to run Shapely's suite of unittests and doctests.
148+
149+
.. code-block:: console
150+
151+
(env)$ py.test tests
152+
153+
Roadmap and Maintenance
154+
=======================
127155

128-
Shapely uses a Zope-stye suite of unittests and doctests, exercised via
129-
setup.py.::
156+
Shapely 1.2.x is a maintenance-only branch which supports Python 2.4-2.6, but
157+
not Python 3+. There will be no new features in Shapely 1.2.x and only fixes
158+
for major bugs.
130159

131-
(env)$ python setup.py test
160+
Shapely 1.3.x is a maintenance-only branch supporting Pythons 2.7 and 3+.
132161

133-
Nosetests won't run the tests properly; Zope doctest suites are not currently
134-
supported well by nose.
162+
"Shapely 3000" is the name of the next milestone. New features will include
163+
vectorized operations, better integration with IPython Notebook, support for
164+
fixed precision models, and more. Less ctypes and more Cython is another theme
165+
in this branch. A 1.4 release should come out of this by Summer, 2014.
135166

136167
Support
137168
=======
@@ -141,12 +172,12 @@ http://lists.gispython.org/mailman/listinfo/community.
141172

142173
Bugs may be reported at https://github.com/Toblerity/Shapely.
143174

144-
.. include:: ../CREDITS.txt
175+
.. include:: CREDITS.txt
145176

146177
.. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
147178
.. _PostGIS: http://postgis.org
148179
.. _GEOS: http://trac.osgeo.org/geos/
149-
.. _example apps: https://github.com/sgillies/shapely/tree/master/shapely/examples
180+
.. _example apps: https://github.com/Toblerity/shapely/tree/master/shapely/examples
150181
.. _manual: http://toblerity.github.com/shapely/manual.html
151182
.. _Pleiades: http://pleiades.stoa.org
152183

docs/code/triangulate.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from shapely.geometry import MultiPoint
2+
from shapely.ops import triangulate
3+
4+
from matplotlib import pyplot
5+
from descartes.patch import PolygonPatch
6+
from figures import SIZE, BLUE, GRAY
7+
8+
points = MultiPoint([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
9+
triangles = triangulate(points)
10+
11+
fig = pyplot.figure(1, figsize=SIZE, dpi=90)
12+
fig.set_frameon(True)
13+
ax = fig.add_subplot(111)
14+
15+
for triangle in triangles:
16+
patch = PolygonPatch(triangle, facecolor=BLUE, edgecolor=BLUE, alpha=0.5, zorder=2)
17+
ax.add_patch(patch)
18+
19+
for point in points:
20+
pyplot.plot(point.x, point.y, 'o', color=GRAY)
21+
22+
pyplot.xlim(-0.5, 3.5)
23+
pyplot.ylim(-0.5, 2.5)
24+
pyplot.show()

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
'matplotlib.sphinxext.only_directives',
3636
'matplotlib.sphinxext.plot_directive',
3737
'sphinx.ext.autodoc',
38-
'sphinx.ext.pngmath', # <----- pick one, not both
39-
#'sphinx.ext.mathjax', # <--/
38+
#'sphinx.ext.pngmath', # <----- pick one, not both
39+
'sphinx.ext.mathjax', # <--/
4040
]
4141

4242
# Add any paths that contain templates here, relative to this directory.
4343
#templates_path = ['_templates']
4444

4545
# The suffix of source filenames.
46-
source_suffix = '.txt'
46+
source_suffix = '.rst'
4747

4848
# The encoding of source files.
4949
#source_encoding = 'utf-8'
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)