Skip to content
Snippets Groups Projects

Resolve "Implement Quadkey functions"

Files

+ 14
0
@@ -23,6 +23,7 @@ import psycopg2
from packaging import version
from uuid import uuid4
from quadkeyfunctions import get_quadkey_functions
logger = logging.getLogger()
@@ -280,6 +281,19 @@ class PostGISDatabase(AbstractDatabase):
for result in cursor:
yield result
def implement_quadkey_functions(self):
"""
Get all Quadkey functions from the `quadkeyfunctions` module and implement them in the
PostGIS database.
"""
if self.connection is None:
raise AssertionError("PostGIS database not connected.")
for sql_function in get_quadkey_functions():
logger.info(f"Implementing function:\n{sql_function}")
self.cursor.execute(sql_function)
def __copy__(self):
return PostGISDatabase(
self.host,
Loading