diff python/utils.py @ 19:5a21d2cfee44

added polygon plotting
author Nicolas Saunier <nico@confins.net>
date Fri, 27 Nov 2009 19:16:12 -0500
parents 9d6831cfe675
children 6fb59cfb201e
line wrap: on
line diff
--- a/python/utils.py	Fri Nov 27 00:21:18 2009 -0500
+++ b/python/utils.py	Fri Nov 27 19:16:12 2009 -0500
@@ -85,6 +85,14 @@
 def printPoint(x,y):
     return '(%f,%f)'%(x,y)
 
+def plotPolygon(poly, options = ''):
+    from numpy.core.multiarray import array
+    from matplotlib.pyplot import plot
+    from shapely.geometry import Polygon
+
+    tmp = array(poly.exterior)
+    plot(tmp[:,0], tmp[:,1], options)
+
 if __name__ == "__main__":
     import doctest
     import unittest