fixed st_x and st_y, thanks Paolo Valleri

This commit is contained in:
mdipierro
2013-01-08 08:49:18 -06:00
parent 69d00a50a6
commit bd485d37c9
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.4.1-alpha.2+timestamp.2013.01.07.10.33.48
Version 2.4.1-alpha.2+timestamp.2013.01.08.08.48.34
+20
View File
@@ -2582,6 +2582,18 @@ class PostgreSQLAdapter(BaseAdapter):
"""
return 'ST_AsText(%s)' %(self.expand(first))
def ST_X(self, first):
"""
http://postgis.org/docs/ST_X.html
"""
return 'ST_X(%s)' %(self.expand(first))
def ST_Y(self, first):
"""
http://postgis.org/docs/ST_Y.html
"""
return 'ST_Y(%s)' %(self.expand(first))
def ST_CONTAINS(self, first, second):
"""
http://postgis.org/docs/ST_Contains.html
@@ -8417,6 +8429,14 @@ class Expression(object):
db = self.db
return Expression(db, db._adapter.ST_ASTEXT, self, type='string')
def st_x(self):
db = self.db
return Expression(db, db._adapter.ST_X, self, type='string')
def st_y(self):
db = self.db
return Expression(db, db._adapter.ST_Y, self, type='string')
def st_distance(self, other):
db = self.db
return Expression(db,db._adapter.ST_DISTANCE,self,other, 'double')