geoPoint, getLine, geoPolygon

This commit is contained in:
mdipierro
2012-12-20 18:16:40 -06:00
parent 76ad8258f5
commit 95a5b2eea2
2 changed files with 14 additions and 1 deletions

View File

@@ -1 +1 @@
Version 2.4.1-alpha.1+timestamp.2012.12.20.15.47.02
Version 2.4.1-alpha.1+timestamp.2012.12.20.18.16.02

View File

@@ -9666,6 +9666,19 @@ GQLDB = DAL
DAL.Field = Field # was necessary in gluon/globals.py session.connect
DAL.Table = Table # was necessary in gluon/globals.py session.connect
################################################################################
# Geodal utils
################################################################################
def geoPoint(*line):
return "POINT (%f %f)" % (x,y)
def geoLine(*line):
return "LINESTRING (%s)" % ','.join("%f %f" % item for item in line)
def geoPolygon(*line):
return "POLYGON ((%s))" % ','.join("%f %f" % item for item in line)
################################################################################
# run tests
################################################################################