Commit 1b034809 authored by Vincent Michel's avatar Vincent Michel
Browse files

[site cubicweb] Add more postgis functions, closes #3390052

Add functions for distance computation and point creation
parent e44c1654b48d
......@@ -126,6 +126,20 @@ class ST_LENGTH(FunctionDescr):
rtype = 'Float'
class ST_DISTANCE(FunctionDescr):
minargs = 2
maxargs = 2
supported_backends = ('postgres',)
rtype = 'Float'
class ST_DISTANCE_SPHERE(FunctionDescr):
minargs = 2
maxargs = 2
supported_backends = ('postgres',)
rtype = 'Float'
class ST_AREA(FunctionDescr):
minargs = 1
maxargs = 1
......@@ -177,6 +191,20 @@ class DISPLAY(FunctionDescr):
return 'ST_ASGeoJSON(ST_Transform(%s, %s)' % (args[0], args[1])
class ST_MAKEPOINT(FunctionDescr):
minargs = 2
maxargs = 2
supported_backends = ('postgres',)
rtype = 'Geometry'
class ST_SETSRID(FunctionDescr):
minargs = 2
maxargs = 2
supported_backends = ('postgres',)
rtype = 'Geometry'
register_function(ST_EQUALS)
register_function(ST_INTERSECTS)
register_function(ST_INTERSECTION)
......@@ -188,6 +216,7 @@ register_function(ST_WITHIN)
register_function(ST_CONTAINS)
register_function(ST_DWITHIN)
register_function(ST_LENGTH)
register_function(ST_DISTANCE)
register_function(ST_AREA)
register_function(ST_NUMINTERIORRINGS)
register_function(ST_SIMPLIFY)
......@@ -195,3 +224,6 @@ register_function(ST_TRANSFORM)
register_function(DISPLAY)
register_function(ST_ASGEOJSON)
register_function(ST_UNION)
register_function(ST_MAKEPOINT)
register_function(ST_SETSRID)
register_function(ST_DISTANCE_SPHERE)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment