[GRASS-SVN] r72750 - grass/trunk/lib/python/pygrass/vector
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 30 15:27:40 PDT 2018
Author: lucadelu
Date: 2018-05-30 15:27:40 -0700 (Wed, 30 May 2018)
New Revision: 72750
Modified:
grass/trunk/lib/python/pygrass/vector/__init__.py
grass/trunk/lib/python/pygrass/vector/find.py
grass/trunk/lib/python/pygrass/vector/geometry.py
Log:
working on #2881, should it backport?
Modified: grass/trunk/lib/python/pygrass/vector/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/__init__.py 2018-05-28 21:42:31 UTC (rev 72749)
+++ grass/trunk/lib/python/pygrass/vector/__init__.py 2018-05-30 22:27:40 UTC (rev 72750)
@@ -510,11 +510,11 @@
>>> feature1.length()
4.0
>>> test_vect.read(-1)
- Centoid(7.500000, 3.500000)
+ Centroid(7.500000, 3.500000)
>>> len(test_vect)
21
>>> test_vect.read(21)
- Centoid(7.500000, 3.500000)
+ Centroid(7.500000, 3.500000)
>>> test_vect.read(22) #doctest: +ELLIPSIS
Traceback (most recent call last):
...
Modified: grass/trunk/lib/python/pygrass/vector/find.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/find.py 2018-05-28 21:42:31 UTC (rev 72749)
+++ grass/trunk/lib/python/pygrass/vector/find.py 2018-05-30 22:27:40 UTC (rev 72750)
@@ -227,8 +227,8 @@
... type="centroid",
... maxdist=1.5)
>>> result #doctest: +NORMALIZE_WHITESPACE
- [Centoid(2.500000, 2.500000),
- Centoid(3.500000, 3.500000)]
+ [Centroid(2.500000, 2.500000),
+ Centroid(3.500000, 3.500000)]
>>> test_vect.find_by_point.geos(point=Point(20,20), maxdist=0)
@@ -419,7 +419,7 @@
Boundary([Point(1.000000, 1.000000), Point(1.000000, 3.000000),
Point(3.000000, 3.000000), Point(3.000000, 1.000000),
Point(1.000000, 1.000000)]),
- Centoid(2.500000, 2.500000)]
+ Centroid(2.500000, 2.500000)]
>>> bbox = Bbox(north=5, south=-1, east=3, west=-1)
>>> result = test_vect.find_by_bbox.geos(bbox=bbox,
Modified: grass/trunk/lib/python/pygrass/vector/geometry.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/geometry.py 2018-05-28 21:42:31 UTC (rev 72749)
+++ grass/trunk/lib/python/pygrass/vector/geometry.py 2018-05-30 22:27:40 UTC (rev 72750)
@@ -1377,13 +1377,13 @@
>>> centroid = Centroid(x=0, y=10)
>>> centroid
- Centoid(0.000000, 10.000000)
+ Centroid(0.000000, 10.000000)
>>> from grass.pygrass.vector import VectorTopo
>>> test_vect = VectorTopo(test_vector_name)
>>> test_vect.open(mode='r')
>>> centroid = Centroid(v_id=18, c_mapinfo=test_vect.c_mapinfo)
>>> centroid
- Centoid(3.500000, 3.500000)
+ Centroid(3.500000, 3.500000)
>>> test_vect.close()
..
@@ -1404,7 +1404,7 @@
#self.c_pline = ctypes.pointer(libvect.P_line()) if topology else None
def __repr__(self):
- return "Centoid(%s)" % ', '.join(['%f' % co for co in self.coords()])
+ return "Centroid(%s)" % ', '.join(['%f' % co for co in self.coords()])
@mapinfo_must_be_set
def _centroid_id(self):
More information about the grass-commit
mailing list