Procházet zdrojové kódy

Fix WKT export for Point class and return more than one value from the Attrs class

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55923 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli před 12 roky
rodič
revize
65311c9a16
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      lib/python/pygrass/vector/geometry.py

+ 4 - 4
lib/python/pygrass/vector/geometry.py

@@ -163,7 +163,7 @@ class Attrs(object):
                                                          tname=self.table.name,
                                                          condition=self.cond))
         results = cur.fetchone()
-        return results[0]
+        return results[0] if len(results) == 1 else results
 
     def __setitem__(self, key, value):
         """Set value of a given column of a table attribute. ::
@@ -395,15 +395,15 @@ class Point(Geo):
 
             >>> pnt = Point(10, 100)
             >>> pnt.get_wkt()
-            'POINT(10.000000, 100.000000)'
+            'POINT(10.000000 100.000000)'
 
         .. warning::
 
             Only ``POINT`` (2/3D) are supported, ``POINTM`` and ``POINT`` with:
             ``XYZM`` are not supported yet.
         """
-        return "POINT(%s)" % ', '.join(['%f' % coord
-                                        for coord in self.coords()])
+        return "POINT(%s)" % ' '.join(['%f' % coord
+                                      for coord in self.coords()])
 
     def get_wkb(self):
         """Return a "well know binary" (WKB) geometry buffer