From 95a5b2eea2a606e1ba2dd730448951949603b034 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 20 Dec 2012 18:16:40 -0600 Subject: [PATCH] geoPoint, getLine, geoPolygon --- VERSION | 2 +- gluon/dal.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 65ba0428..67f1a9fd 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/dal.py b/gluon/dal.py index 79b78e53..98445be1 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -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 ################################################################################