]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Modified the Geometry.Polygon.from_wkt() method to return a Geometry.Polygon.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 25 Oct 2009 22:08:03 +0000 (18:08 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 25 Oct 2009 22:08:03 +0000 (18:08 -0400)
src/Geometry.py

index 6c039a8e445a908acc290c9f06f8bf1a551bb96f..2bee60addc97ad27f6cde94d860336b1bf0d105d 100644 (file)
@@ -242,8 +242,9 @@ class Polygon:
         # Ex: POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))
         if (text.lower().find('polygon') == -1):
             return None
-        
-        return shapely.wkt.loads(text)
+
+        sp = shapely.wkt.loads(text)
+        return Polygon.from_shapely(sp)
 
 
     def drag_rectangle(self, v):