Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
postgis
Commits
ad76e6d2d3e5
Commit
1b034809
authored
Dec 20, 2013
by
Vincent Michel
Browse files
[site cubicweb] Add more postgis functions, closes #3390052
Add functions for distance computation and point creation
parent
e44c1654b48d
Changes
1
Hide whitespace changes
Inline
Side-by-side
site_cubicweb.py
View file @
ad76e6d2
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment