summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2015-11-24 14:21:32 +0500
committerTim Graham <timograham@gmail.com>2015-12-14 13:29:38 -0500
commit5146e2cf984a83c2eb9d8102ea73ee0792a9528b (patch)
treeb464f59550d16d03a227eed0aab7adeb6dbcfca9 /docs/ref
parent8035cee92293f3319919c8248c7787ba43c05917 (diff)
Fixed #25662 -- Allowed creation of empty GEOS geometries.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/gis/geos.txt75
1 files changed, 58 insertions, 17 deletions
diff --git a/docs/ref/contrib/gis/geos.txt b/docs/ref/contrib/gis/geos.txt
index e53acbc99c..74fb2e5e54 100644
--- a/docs/ref/contrib/gis/geos.txt
+++ b/docs/ref/contrib/gis/geos.txt
@@ -647,7 +647,7 @@ is returned instead.
``Point``
---------
-.. class:: Point(x, y, z=None, srid=None)
+.. class:: Point(x=None, y=None, z=None, srid=None)
``Point`` objects are instantiated using arguments that represent
the component coordinates of the point or with a single sequence
@@ -656,6 +656,16 @@ is returned instead.
>>> pnt = Point(5, 23)
>>> pnt = Point([5, 23])
+ Empty ``Point`` objects may be instantiated by passing no arguments or an
+ empty sequence. The following are equivalent::
+
+ >>> pnt = Point()
+ >>> pnt = Point([])
+
+ .. versionchanged:: 1.10
+
+ In previous versions, an empty ``Point`` couldn't be instantiated.
+
``LineString``
--------------
@@ -674,6 +684,16 @@ is returned instead.
>>> ls = LineString( ((0, 0), (1, 1)) )
>>> ls = LineString( [Point(0, 0), Point(1, 1)] )
+ Empty ``LineString`` objects may be instantiated by passing no arguments
+ or an empty sequence. The following are equivalent::
+
+ >>> ls = LineString()
+ >>> ls = LineString([])
+
+ .. versionchanged:: 1.10
+
+ In previous versions, an empty ``LineString`` couldn't be instantiated.
+
``LinearRing``
--------------
@@ -694,16 +714,20 @@ is returned instead.
.. class:: Polygon(*args, **kwargs)
- ``Polygon`` objects may be instantiated by passing in one or
- more parameters that represent the rings of the polygon. The
- parameters must either be :class:`LinearRing` instances, or
- a sequence that may be used to construct a :class:`LinearRing`::
+ ``Polygon`` objects may be instantiated by passing in parameters that
+ represent the rings of the polygon. The parameters must either be
+ :class:`LinearRing` instances, or a sequence that may be used to construct a
+ :class:`LinearRing`::
>>> ext_coords = ((0, 0), (0, 1), (1, 1), (1, 0), (0, 0))
>>> int_coords = ((0.4, 0.4), (0.4, 0.6), (0.6, 0.6), (0.6, 0.4), (0.4, 0.4))
>>> poly = Polygon(ext_coords, int_coords)
>>> poly = Polygon(LinearRing(ext_coords), LinearRing(int_coords))
+ .. versionchanged:: 1.10
+
+ In previous versions, an empty ``Polygon`` couldn't be instantiated.
+
.. classmethod:: from_bbox(bbox)
Returns a polygon object from the given bounding-box, a 4-tuple
@@ -732,27 +756,35 @@ Geometry Collections
.. class:: MultiPoint(*args, **kwargs)
- ``MultiPoint`` objects may be instantiated by passing in one
- or more :class:`Point` objects as arguments, or a single
- sequence of :class:`Point` objects::
+ ``MultiPoint`` objects may be instantiated by passing in :class:`Point`
+ objects as arguments, or a single sequence of :class:`Point` objects::
>>> mp = MultiPoint(Point(0, 0), Point(1, 1))
>>> mp = MultiPoint( (Point(0, 0), Point(1, 1)) )
+ .. versionchanged:: 1.10
+
+ In previous versions, an empty ``MultiPoint`` couldn't be instantiated.
+
``MultiLineString``
-------------------
.. class:: MultiLineString(*args, **kwargs)
- ``MultiLineString`` objects may be instantiated by passing in one
- or more :class:`LineString` objects as arguments, or a single
- sequence of :class:`LineString` objects::
+ ``MultiLineString`` objects may be instantiated by passing in
+ :class:`LineString` objects as arguments, or a single sequence of
+ :class:`LineString` objects::
>>> ls1 = LineString((0, 0), (1, 1))
>>> ls2 = LineString((2, 2), (3, 3))
>>> mls = MultiLineString(ls1, ls2)
>>> mls = MultiLineString([ls1, ls2])
+ .. versionchanged:: 1.10
+
+ In previous versions, an empty ``MultiLineString`` couldn't be
+ instantiated.
+
.. attribute:: merged
Returns a :class:`LineString` representing the line merge of
@@ -764,15 +796,19 @@ Geometry Collections
.. class:: MultiPolygon(*args, **kwargs)
- ``MultiPolygon`` objects may be instantiated by passing one or
- more :class:`Polygon` objects as arguments, or a single sequence
- of :class:`Polygon` objects::
+ ``MultiPolygon`` objects may be instantiated by passing :class:`Polygon`
+ objects as arguments, or a single sequence of :class:`Polygon` objects::
>>> p1 = Polygon( ((0, 0), (0, 1), (1, 1), (0, 0)) )
>>> p2 = Polygon( ((1, 1), (1, 2), (2, 2), (1, 1)) )
>>> mp = MultiPolygon(p1, p2)
>>> mp = MultiPolygon([p1, p2])
+ .. versionchanged:: 1.10
+
+ In previous versions, an empty ``MultiPolygon`` couldn't be
+ instantiated.
+
.. attribute:: cascaded_union
.. deprecated:: 1.10
@@ -789,14 +825,19 @@ Geometry Collections
.. class:: GeometryCollection(*args, **kwargs)
- ``GeometryCollection`` objects may be instantiated by passing in
- one or more other :class:`GEOSGeometry` as arguments, or a single
- sequence of :class:`GEOSGeometry` objects::
+ ``GeometryCollection`` objects may be instantiated by passing in other
+ :class:`GEOSGeometry` as arguments, or a single sequence of
+ :class:`GEOSGeometry` objects::
>>> poly = Polygon( ((0, 0), (0, 1), (1, 1), (0, 0)) )
>>> gc = GeometryCollection(Point(0, 0), MultiPoint(Point(0, 0), Point(1, 1)), poly)
>>> gc = GeometryCollection((Point(0, 0), MultiPoint(Point(0, 0), Point(1, 1)), poly))
+ .. versionchanged:: 1.10
+
+ In previous versions, an empty ``GeometryCollection`` couldn't be
+ instantiated.
+
.. _prepared-geometries:
Prepared Geometries