GeoAlchemy2 0.13.0__tar.gz → 0.13.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/.github/workflows/test_and_publish.yml +35 -23
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/.pre-commit-config.yaml +8 -8
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/CHANGES.txt +5 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/COPYING.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/GeoAlchemy2.egg-info/PKG-INFO +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/GeoAlchemy2.egg-info/SOURCES.txt +4 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/GeoAlchemy2.egg-info/dependency_links.txt +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/GeoAlchemy2.egg-info/not-zip-safe +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/GeoAlchemy2.egg-info/requires.txt +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/GeoAlchemy2.egg-info/top_level.txt +0 -0
- GeoAlchemy2-0.13.2/GeoAlchemy2_dev.yml +8 -0
- GeoAlchemy2-0.13.2/Issues to add in gallery.txt +7 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/MANIFEST.in +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/PKG-INFO +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/README.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/TEST.rst +2 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/Makefile +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_static/geoalchemy.png +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_static/geoalchemy.svg +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_static/geoalchemy_small.png +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_static/geoalchemy_small.svg +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_templates/sidebar-about.html +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_templates/sidebar-links.html +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_templates/sidebar-logo.html +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/make.bat +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/migrate.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/shape.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/spatial_functions.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/spatial_operators.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/types.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/__init__.py +2 -6
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/alembic_helpers.py +8 -5
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/comparator.py +0 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/dialects/sqlite.py +41 -4
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/functions.py +0 -52
- GeoAlchemy2-0.13.2/log.txt +1 -0
- GeoAlchemy2-0.13.2/postgis_functions.txt +199 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/__init__.py +22 -2
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/conftest.py +21 -4
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/test_decipher_raster.py +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/test_disable_wrapping.py +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/test_length_at_insert.py +1 -3
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/test_raster_transform.py +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/test_specific_compilation.py +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/test_summarystatsagg.py +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/test_type_decorator.py +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/schema_fixtures.py +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_alembic_migrations.py +14 -8
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_elements.py +0 -4
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_functional.py +57 -4
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_functional_postgresql.py +1 -2
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_pickle.py +1 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_types.py +0 -1
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tox.ini +6 -4
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/.codespellrc +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/.coveragerc +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/.flake8 +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/.github/dependabot.yml +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/.gitignore +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/RELEASE.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_themes/LICENSE +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_themes/README +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_themes/flask/layout.html +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_themes/flask/relations.html +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_themes/flask/static/flasky.css_t +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_themes/flask/static/small_flask.css +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/_themes/flask/theme.conf +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/alembic.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/alembic_helpers.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/conf.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/core_tutorial.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/elements.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/index.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/orm_tutorial.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/doc/spatialite_tutorial.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/_functions.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/dialects/__init__.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/dialects/common.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/dialects/postgresql.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/elements.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/exc.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/shape.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/geoalchemy2/types.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/pyproject.toml +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/requirements-doc.txt +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/requirements-rtd.txt +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/requirements.txt +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/setup.cfg +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/setup.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/alembic_config/alembic.ini +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/data/spatialite_ge_4.sqlite +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/data/spatialite_lt_4.sqlite +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/README.rst +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/gallery/__init__.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_comparator.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_functional_sqlite.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_functions.py +0 -0
- {GeoAlchemy2-0.13.0 → GeoAlchemy2-0.13.2}/tests/test_shape.py +0 -0
@@ -17,11 +17,22 @@ jobs:
|
|
17
17
|
# This workflow runs the tests
|
18
18
|
tests:
|
19
19
|
|
20
|
+
# Set shell to work properly with Mamba
|
21
|
+
defaults:
|
22
|
+
run:
|
23
|
+
shell: bash -l {0}
|
24
|
+
|
20
25
|
# Setup test matrix
|
21
26
|
strategy:
|
22
27
|
fail-fast: false
|
23
28
|
matrix:
|
24
|
-
python-version: [
|
29
|
+
python-version: [
|
30
|
+
{"pkg_name": "python==3.7.*", "flag": "3.7"},
|
31
|
+
{"pkg_name": "python==3.8.*", "flag": "3.8"},
|
32
|
+
{"pkg_name": "python==3.9.*", "flag": "3.9"},
|
33
|
+
{"pkg_name": "python==3.10.*", "flag": "3.10"},
|
34
|
+
{"pkg_name": "pypy3.8", "flag": "pypy3.8"},
|
35
|
+
]
|
25
36
|
|
26
37
|
# The type of runner that the job will run on
|
27
38
|
runs-on: ubuntu-22.04
|
@@ -47,12 +58,18 @@ jobs:
|
|
47
58
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
48
59
|
- uses: actions/checkout@v3
|
49
60
|
|
50
|
-
# Setup Python
|
51
|
-
- name:
|
52
|
-
uses:
|
61
|
+
# Setup Conda for Python and Pypy
|
62
|
+
- name: Install Conda environment with Micromamba
|
63
|
+
uses: mamba-org/provision-with-micromamba@main
|
53
64
|
with:
|
54
|
-
|
55
|
-
|
65
|
+
environment-file: false
|
66
|
+
environment-name: test_${{ matrix.python-version.flag }}
|
67
|
+
channels: conda-forge,defaults
|
68
|
+
cache-downloads: true
|
69
|
+
extra-specs: |
|
70
|
+
${{ matrix.python-version.pkg_name }}
|
71
|
+
libspatialite
|
72
|
+
pyproj
|
56
73
|
|
57
74
|
# Config PostgreSQL
|
58
75
|
- name: Configure PostgreSQL
|
@@ -63,35 +80,30 @@ jobs:
|
|
63
80
|
# Add PostGIS extension to "gis" database
|
64
81
|
psql -h localhost -p 5432 -U gis -d gis -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
|
65
82
|
|
83
|
+
# Drop PostGIS Tiger Geocoder extension to "gis" database
|
84
|
+
psql -h localhost -p 5432 -U gis -d gis -c 'DROP EXTENSION IF EXISTS postgis_tiger_geocoder CASCADE;'
|
85
|
+
|
66
86
|
# Check python version
|
67
87
|
- name: Display Python version
|
68
|
-
run:
|
88
|
+
run: |
|
89
|
+
/home/runner/micromamba-bin/micromamba info
|
90
|
+
/home/runner/micromamba-bin/micromamba list
|
91
|
+
python -c "import sys; print(sys.version)"
|
69
92
|
|
70
93
|
# Install dependencies
|
71
94
|
- name: Install dependencies
|
72
95
|
run: |
|
73
|
-
|
74
|
-
sudo apt-get install -y autotools-dev \
|
75
|
-
git \
|
76
|
-
libexpat1-dev \
|
77
|
-
libfreexl-dev \
|
78
|
-
libgeos-dev \
|
79
|
-
libproj-dev \
|
80
|
-
libreadline-dev \
|
81
|
-
libsqlite3-dev \
|
82
|
-
libsqlite3-mod-spatialite \
|
83
|
-
libxml2-dev \
|
84
|
-
zlib1g-dev
|
85
|
-
pip install --upgrade pip setuptools
|
96
|
+
python -m pip install --upgrade pip setuptools
|
86
97
|
pip install tox-gh-actions
|
87
98
|
|
88
99
|
# Run the test suite
|
89
100
|
- name: Run the tests
|
90
101
|
env:
|
91
|
-
SPATIALITE_LIBRARY_PATH: /
|
102
|
+
SPATIALITE_LIBRARY_PATH: /home/runner/micromamba-root/envs/test_${{ matrix.python-version.flag }}/lib/mod_spatialite.so
|
103
|
+
PROJ_LIB: /home/runner/micromamba-root/envs/test_${{ matrix.python-version.flag }}/share/proj
|
92
104
|
COVERAGE_FILE: .coverage
|
93
105
|
run: |
|
94
|
-
# Run the unit test suite with SQLAlchemy=1.
|
106
|
+
# Run the unit test suite with SQLAlchemy=1.4.* and then with the latest version of SQLAlchemy
|
95
107
|
tox -vv
|
96
108
|
|
97
109
|
# Export coverage to Coveralls
|
@@ -99,7 +111,7 @@ jobs:
|
|
99
111
|
uses: AndreMiras/coveralls-python-action@v20201129
|
100
112
|
with:
|
101
113
|
parallel: true
|
102
|
-
flag-name: run-${{ matrix.python-version }}
|
114
|
+
flag-name: run-${{ matrix.python-version.flag }}
|
103
115
|
|
104
116
|
|
105
117
|
# This workflow aggregates coverages from all jobs and export it to Coveralls
|
@@ -1,8 +1,8 @@
|
|
1
1
|
default_language_version:
|
2
|
-
python: python3.
|
2
|
+
python: python3.8
|
3
3
|
repos:
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
5
|
-
rev: v4.
|
5
|
+
rev: v4.4.0
|
6
6
|
hooks:
|
7
7
|
- id: check-added-large-files
|
8
8
|
- id: check-case-conflict
|
@@ -13,24 +13,24 @@ repos:
|
|
13
13
|
- id: end-of-file-fixer
|
14
14
|
- id: trailing-whitespace
|
15
15
|
- repo: https://github.com/pycqa/isort
|
16
|
-
rev: 5.
|
16
|
+
rev: 5.12.0
|
17
17
|
hooks:
|
18
18
|
- id: isort
|
19
19
|
- repo: https://github.com/psf/black
|
20
|
-
rev:
|
20
|
+
rev: 23.1.0
|
21
21
|
hooks:
|
22
22
|
- id: black
|
23
23
|
- repo: https://github.com/codespell-project/codespell
|
24
|
-
rev: v2.
|
24
|
+
rev: v2.2.2
|
25
25
|
hooks:
|
26
26
|
- id: codespell
|
27
27
|
- repo: https://github.com/PyCQA/pydocstyle
|
28
|
-
rev: 6.
|
28
|
+
rev: 6.3.0
|
29
29
|
hooks:
|
30
30
|
- id: pydocstyle
|
31
|
-
additional_dependencies: ["
|
31
|
+
additional_dependencies: ["tomli"]
|
32
32
|
exclude: "tests"
|
33
33
|
- repo: https://github.com/PyCQA/flake8
|
34
|
-
rev:
|
34
|
+
rev: 6.0.0
|
35
35
|
hooks:
|
36
36
|
- id: flake8
|
File without changes
|
@@ -5,10 +5,14 @@
|
|
5
5
|
.pre-commit-config.yaml
|
6
6
|
CHANGES.txt
|
7
7
|
COPYING.rst
|
8
|
+
GeoAlchemy2_dev.yml
|
9
|
+
Issues to add in gallery.txt
|
8
10
|
MANIFEST.in
|
9
11
|
README.rst
|
10
12
|
RELEASE.rst
|
11
13
|
TEST.rst
|
14
|
+
log.txt
|
15
|
+
postgis_functions.txt
|
12
16
|
pyproject.toml
|
13
17
|
requirements-doc.txt
|
14
18
|
requirements-rtd.txt
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -7,6 +7,7 @@ from sqlalchemy.sql import func
|
|
7
7
|
|
8
8
|
from geoalchemy2 import functions # noqa
|
9
9
|
from geoalchemy2 import types # noqa
|
10
|
+
from geoalchemy2.dialects import common
|
10
11
|
from geoalchemy2.dialects import postgresql
|
11
12
|
from geoalchemy2.dialects import sqlite
|
12
13
|
from geoalchemy2.dialects.common import _check_spatial_type
|
@@ -27,12 +28,7 @@ def _select_dialect(dialect_name):
|
|
27
28
|
"postgresql": postgresql,
|
28
29
|
"sqlite": sqlite,
|
29
30
|
}
|
30
|
-
|
31
|
-
return known_dialects[dialect_name]
|
32
|
-
except KeyError:
|
33
|
-
raise ValueError(
|
34
|
-
f"The dialect '{dialect_name}' is unknown, please choose one of {known_dialects.keys()}"
|
35
|
-
)
|
31
|
+
return known_dialects.get(dialect_name, common)
|
36
32
|
|
37
33
|
|
38
34
|
def _setup_ddl_event_listeners():
|
@@ -41,11 +41,14 @@ def _monkey_patch_get_indexes_for_sqlite():
|
|
41
41
|
def spatial_behavior(self, connection, table_name, schema=None, **kw):
|
42
42
|
indexes = self._get_indexes_normal_behavior(connection, table_name, schema=None, **kw)
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
try:
|
45
|
+
# Check that SpatiaLite was loaded into the DB
|
46
|
+
is_spatial_db = connection.exec_driver_sql(
|
47
|
+
"""PRAGMA main.table_info(geometry_columns)"""
|
48
|
+
).fetchall()
|
49
|
+
if not is_spatial_db:
|
50
|
+
return indexes
|
51
|
+
except AttributeError:
|
49
52
|
return indexes
|
50
53
|
|
51
54
|
# Get spatial indexes
|
@@ -2,9 +2,11 @@
|
|
2
2
|
import os
|
3
3
|
|
4
4
|
from sqlalchemy import text
|
5
|
+
from sqlalchemy.ext.compiler import compiles
|
5
6
|
from sqlalchemy.sql import func
|
6
7
|
from sqlalchemy.sql import select
|
7
8
|
|
9
|
+
from geoalchemy2 import functions
|
8
10
|
from geoalchemy2.dialects.common import _check_spatial_type
|
9
11
|
from geoalchemy2.dialects.common import _format_select_args
|
10
12
|
from geoalchemy2.dialects.common import _spatial_idx_name
|
@@ -185,8 +187,7 @@ def after_create(table, bind, **kw):
|
|
185
187
|
col.type = col._actual_type
|
186
188
|
del col._actual_type
|
187
189
|
dimension = get_col_dim(col)
|
188
|
-
args = [table.
|
189
|
-
args.extend([table.name, col.name, col.type.srid, col.type.geometry_type, dimension])
|
190
|
+
args = [table.name, col.name, col.type.srid, col.type.geometry_type, dimension]
|
190
191
|
|
191
192
|
stmt = select(*_format_select_args(func.RecoverGeometryColumn(*args)))
|
192
193
|
stmt = stmt.execution_options(autocommit=True)
|
@@ -211,8 +212,7 @@ def before_drop(table, bind, **kw):
|
|
211
212
|
# Disable spatial indexes if present
|
212
213
|
disable_spatial_index(bind, table, col)
|
213
214
|
|
214
|
-
args = [table.
|
215
|
-
args.extend([table.name, col.name])
|
215
|
+
args = [table.name, col.name]
|
216
216
|
|
217
217
|
stmt = select(*_format_select_args(func.DiscardGeometryColumn(*args)))
|
218
218
|
stmt = stmt.execution_options(autocommit=True)
|
@@ -222,3 +222,40 @@ def before_drop(table, bind, **kw):
|
|
222
222
|
def after_drop(table, bind, **kw):
|
223
223
|
"""Handle spatial indexes during the after_drop event."""
|
224
224
|
table.columns = table.info.pop("_saved_columns")
|
225
|
+
|
226
|
+
|
227
|
+
# Define compiled versions for functions in SpatiaLite whose names don't have
|
228
|
+
# the ST_ prefix.
|
229
|
+
_SQLITE_FUNCTIONS = {
|
230
|
+
"ST_GeomFromEWKT": "GeomFromEWKT",
|
231
|
+
"ST_GeomFromEWKB": "GeomFromEWKB",
|
232
|
+
"ST_AsBinary": "AsBinary",
|
233
|
+
"ST_AsEWKB": "AsEWKB",
|
234
|
+
"ST_AsGeoJSON": "AsGeoJSON",
|
235
|
+
}
|
236
|
+
|
237
|
+
|
238
|
+
def _compiles_sqlite(cls, fn):
|
239
|
+
def _compile_sqlite(element, compiler, **kw):
|
240
|
+
return "{}({})".format(fn, compiler.process(element.clauses, **kw))
|
241
|
+
|
242
|
+
compiles(getattr(functions, cls), "sqlite")(_compile_sqlite)
|
243
|
+
|
244
|
+
|
245
|
+
def register_sqlite_mapping(mapping):
|
246
|
+
"""Register compilation mappings for the given functions.
|
247
|
+
|
248
|
+
Args:
|
249
|
+
mapping: Should have the following form::
|
250
|
+
|
251
|
+
{
|
252
|
+
"function_name_1": "sqlite_function_name_1",
|
253
|
+
"function_name_2": "sqlite_function_name_2",
|
254
|
+
...
|
255
|
+
}
|
256
|
+
"""
|
257
|
+
for cls, fn in mapping.items():
|
258
|
+
_compiles_sqlite(cls, fn)
|
259
|
+
|
260
|
+
|
261
|
+
register_sqlite_mapping(_SQLITE_FUNCTIONS)
|
@@ -125,7 +125,6 @@ except ImportError:
|
|
125
125
|
|
126
126
|
|
127
127
|
class TableRowElement(ColumnElement):
|
128
|
-
|
129
128
|
inherit_cache = False
|
130
129
|
"""The cache is disabled for this class."""
|
131
130
|
|
@@ -278,54 +277,3 @@ for name, type_, doc in _FUNCTIONS:
|
|
278
277
|
attributes["__doc__"] = "\n\n".join(docs)
|
279
278
|
|
280
279
|
globals()[name] = type(name, (GenericFunction,), attributes)
|
281
|
-
|
282
|
-
|
283
|
-
#
|
284
|
-
# Define compiled versions for functions in SpatiaLite whose names don't have
|
285
|
-
# the ST_ prefix.
|
286
|
-
#
|
287
|
-
|
288
|
-
|
289
|
-
_SQLITE_FUNCTIONS = {
|
290
|
-
"ST_GeomFromEWKT": "GeomFromEWKT",
|
291
|
-
"ST_GeomFromEWKB": "GeomFromEWKB",
|
292
|
-
"ST_AsBinary": "AsBinary",
|
293
|
-
"ST_AsEWKB": "AsEWKB",
|
294
|
-
"ST_AsGeoJSON": "AsGeoJSON",
|
295
|
-
}
|
296
|
-
|
297
|
-
|
298
|
-
# Default handlers are required for SQLAlchemy < 1.1
|
299
|
-
# See more details in https://github.com/geoalchemy/geoalchemy2/issues/213
|
300
|
-
def _compiles_default(cls):
|
301
|
-
def _compile_default(element, compiler, **kw):
|
302
|
-
return "{}({})".format(cls, compiler.process(element.clauses, **kw))
|
303
|
-
|
304
|
-
compiles(globals()[cls])(_compile_default)
|
305
|
-
|
306
|
-
|
307
|
-
def _compiles_sqlite(cls, fn):
|
308
|
-
def _compile_sqlite(element, compiler, **kw):
|
309
|
-
return "{}({})".format(fn, compiler.process(element.clauses, **kw))
|
310
|
-
|
311
|
-
compiles(globals()[cls], "sqlite")(_compile_sqlite)
|
312
|
-
|
313
|
-
|
314
|
-
def register_sqlite_mapping(mapping):
|
315
|
-
"""Register compilation mappings for the given functions.
|
316
|
-
|
317
|
-
Args:
|
318
|
-
mapping: Should have the following form::
|
319
|
-
|
320
|
-
{
|
321
|
-
"function_name_1": "sqlite_function_name_1",
|
322
|
-
"function_name_2": "sqlite_function_name_2",
|
323
|
-
...
|
324
|
-
}
|
325
|
-
"""
|
326
|
-
for cls, fn in mapping.items():
|
327
|
-
_compiles_default(cls)
|
328
|
-
_compiles_sqlite(cls, fn)
|
329
|
-
|
330
|
-
|
331
|
-
register_sqlite_mapping(_SQLITE_FUNCTIONS)
|
@@ -0,0 +1 @@
|
|
1
|
+
2022/08/10 19:27:05 Micro started
|
@@ -0,0 +1,199 @@
|
|
1
|
+
SELECT DISTINCT p.proname AS function_name, t.typname AS return_type
|
2
|
+
FROM pg_catalog.pg_extension AS e
|
3
|
+
INNER JOIN pg_catalog.pg_depend AS d ON (d.refobjid = e.oid)
|
4
|
+
INNER JOIN pg_catalog.pg_proc AS p ON (p.oid = d.objid)
|
5
|
+
INNER JOIN pg_type AS t ON (t.oid = p.prorettype)
|
6
|
+
WHERE e.extname = 'postgis' AND d.deptype = 'e' AND (t.typname = 'geometry' OR t.typname = 'geography')
|
7
|
+
ORDER BY 1, 2;
|
8
|
+
+----------------------------------+---------------+
|
9
|
+
| function_name | return_type |
|
10
|
+
|----------------------------------+---------------|
|
11
|
+
| _st_concavehull | geometry |
|
12
|
+
| _st_expand | geography |
|
13
|
+
| _st_geomfromgml | geometry |
|
14
|
+
| _st_longestline | geometry |
|
15
|
+
| _st_pointoutside | geography |
|
16
|
+
| _st_voronoi | geometry |
|
17
|
+
| geography | geography |
|
18
|
+
| geography_in | geography |
|
19
|
+
| geography_recv | geography |
|
20
|
+
| geometry | geometry |
|
21
|
+
| geometry_in | geometry |
|
22
|
+
| geometry_recv | geometry |
|
23
|
+
| geomfromewkb | geometry |
|
24
|
+
| geomfromewkt | geometry |
|
25
|
+
| pgis_geometry_collect_finalfn | geometry |
|
26
|
+
| pgis_geometry_makeline_finalfn | geometry |
|
27
|
+
| pgis_geometry_polygonize_finalfn | geometry |
|
28
|
+
| pgis_geometry_union_finalfn | geometry |
|
29
|
+
| postgis_addbbox | geometry |
|
30
|
+
| postgis_dropbbox | geometry |
|
31
|
+
| postgis_geos_noop | geometry |
|
32
|
+
| postgis_noop | geometry |
|
33
|
+
| postgis_transform_geometry | geometry |
|
34
|
+
| st_3dclosestpoint | geometry |
|
35
|
+
| st_3dlineinterpolatepoint | geometry |
|
36
|
+
| st_3dlongestline | geometry |
|
37
|
+
| st_3dshortestline | geometry |
|
38
|
+
| st_addmeasure | geometry |
|
39
|
+
| st_addpoint | geometry |
|
40
|
+
| st_affine | geometry |
|
41
|
+
| st_asmvtgeom | geometry |
|
42
|
+
| st_bdmpolyfromtext | geometry |
|
43
|
+
| st_bdpolyfromtext | geometry |
|
44
|
+
| st_boundary | geometry |
|
45
|
+
| st_boundingdiagonal | geometry |
|
46
|
+
| st_buffer | geography |
|
47
|
+
| st_buffer | geometry |
|
48
|
+
| st_buildarea | geometry |
|
49
|
+
| st_centroid | geography |
|
50
|
+
| st_centroid | geometry |
|
51
|
+
| st_chaikinsmoothing | geometry |
|
52
|
+
| st_cleangeometry | geometry |
|
53
|
+
| st_clipbybox2d | geometry |
|
54
|
+
| st_closestpoint | geometry |
|
55
|
+
| st_collect | geometry |
|
56
|
+
| st_collectionextract | geometry |
|
57
|
+
| st_collectionhomogenize | geometry |
|
58
|
+
| st_concavehull | geometry |
|
59
|
+
| st_convexhull | geometry |
|
60
|
+
| st_curvetoline | geometry |
|
61
|
+
| st_delaunaytriangles | geometry |
|
62
|
+
| st_difference | geometry |
|
63
|
+
| st_endpoint | geometry |
|
64
|
+
| st_envelope | geometry |
|
65
|
+
| st_expand | geometry |
|
66
|
+
| st_exteriorring | geometry |
|
67
|
+
| st_filterbym | geometry |
|
68
|
+
| st_flipcoordinates | geometry |
|
69
|
+
| st_force2d | geometry |
|
70
|
+
| st_force3d | geometry |
|
71
|
+
| st_force3dm | geometry |
|
72
|
+
| st_force3dz | geometry |
|
73
|
+
| st_force4d | geometry |
|
74
|
+
| st_forcecollection | geometry |
|
75
|
+
| st_forcecurve | geometry |
|
76
|
+
| st_forcepolygonccw | geometry |
|
77
|
+
| st_forcepolygoncw | geometry |
|
78
|
+
| st_forcerhr | geometry |
|
79
|
+
| st_forcesfs | geometry |
|
80
|
+
| st_generatepoints | geometry |
|
81
|
+
| st_geogfromtext | geography |
|
82
|
+
| st_geogfromwkb | geography |
|
83
|
+
| st_geographyfromtext | geography |
|
84
|
+
| st_geomcollfromtext | geometry |
|
85
|
+
| st_geomcollfromwkb | geometry |
|
86
|
+
| st_geometricmedian | geometry |
|
87
|
+
| st_geometryfromtext | geometry |
|
88
|
+
| st_geometryn | geometry |
|
89
|
+
| st_geomfromewkb | geometry |
|
90
|
+
| st_geomfromewkt | geometry |
|
91
|
+
| st_geomfromgeohash | geometry |
|
92
|
+
| st_geomfromgeojson | geometry |
|
93
|
+
| st_geomfromgml | geometry |
|
94
|
+
| st_geomfromkml | geometry |
|
95
|
+
| st_geomfromtext | geometry |
|
96
|
+
| st_geomfromtwkb | geometry |
|
97
|
+
| st_geomfromwkb | geometry |
|
98
|
+
| st_gmltosql | geometry |
|
99
|
+
| st_interiorringn | geometry |
|
100
|
+
| st_intersection | geography |
|
101
|
+
| st_intersection | geometry |
|
102
|
+
| st_linefromencodedpolyline | geometry |
|
103
|
+
| st_linefrommultipoint | geometry |
|
104
|
+
| st_linefromtext | geometry |
|
105
|
+
| st_linefromwkb | geometry |
|
106
|
+
| st_lineinterpolatepoint | geometry |
|
107
|
+
| st_lineinterpolatepoints | geometry |
|
108
|
+
| st_linemerge | geometry |
|
109
|
+
| st_linestringfromwkb | geometry |
|
110
|
+
| st_linesubstring | geometry |
|
111
|
+
| st_linetocurve | geometry |
|
112
|
+
| st_locatealong | geometry |
|
113
|
+
| st_locatebetween | geometry |
|
114
|
+
| st_locatebetweenelevations | geometry |
|
115
|
+
| st_longestline | geometry |
|
116
|
+
| st_makeenvelope | geometry |
|
117
|
+
| st_makeline | geometry |
|
118
|
+
| st_makepoint | geometry |
|
119
|
+
| st_makepointm | geometry |
|
120
|
+
| st_makepolygon | geometry |
|
121
|
+
| st_makevalid | geometry |
|
122
|
+
| st_memcollect | geometry |
|
123
|
+
| st_memunion | geometry |
|
124
|
+
| st_minimumboundingcircle | geometry |
|
125
|
+
| st_minimumclearanceline | geometry |
|
126
|
+
| st_mlinefromtext | geometry |
|
127
|
+
| st_mlinefromwkb | geometry |
|
128
|
+
| st_mpointfromtext | geometry |
|
129
|
+
| st_mpointfromwkb | geometry |
|
130
|
+
| st_mpolyfromtext | geometry |
|
131
|
+
| st_mpolyfromwkb | geometry |
|
132
|
+
| st_multi | geometry |
|
133
|
+
| st_multilinefromwkb | geometry |
|
134
|
+
| st_multilinestringfromtext | geometry |
|
135
|
+
| st_multipointfromtext | geometry |
|
136
|
+
| st_multipointfromwkb | geometry |
|
137
|
+
| st_multipolyfromwkb | geometry |
|
138
|
+
| st_multipolygonfromtext | geometry |
|
139
|
+
| st_node | geometry |
|
140
|
+
| st_normalize | geometry |
|
141
|
+
| st_offsetcurve | geometry |
|
142
|
+
| st_orientedenvelope | geometry |
|
143
|
+
| st_patchn | geometry |
|
144
|
+
| st_point | geometry |
|
145
|
+
| st_pointfromgeohash | geometry |
|
146
|
+
| st_pointfromtext | geometry |
|
147
|
+
| st_pointfromwkb | geometry |
|
148
|
+
| st_pointn | geometry |
|
149
|
+
| st_pointonsurface | geometry |
|
150
|
+
| st_points | geometry |
|
151
|
+
| st_polyfromtext | geometry |
|
152
|
+
| st_polyfromwkb | geometry |
|
153
|
+
| st_polygon | geometry |
|
154
|
+
| st_polygonfromtext | geometry |
|
155
|
+
| st_polygonfromwkb | geometry |
|
156
|
+
| st_polygonize | geometry |
|
157
|
+
| st_project | geography |
|
158
|
+
| st_quantizecoordinates | geometry |
|
159
|
+
| st_removepoint | geometry |
|
160
|
+
| st_removerepeatedpoints | geometry |
|
161
|
+
| st_reverse | geometry |
|
162
|
+
| st_rotate | geometry |
|
163
|
+
| st_rotatex | geometry |
|
164
|
+
| st_rotatey | geometry |
|
165
|
+
| st_rotatez | geometry |
|
166
|
+
| st_scale | geometry |
|
167
|
+
| st_segmentize | geography |
|
168
|
+
| st_segmentize | geometry |
|
169
|
+
| st_seteffectivearea | geometry |
|
170
|
+
| st_setpoint | geometry |
|
171
|
+
| st_setsrid | geography |
|
172
|
+
| st_setsrid | geometry |
|
173
|
+
| st_sharedpaths | geometry |
|
174
|
+
| st_shiftlongitude | geometry |
|
175
|
+
| st_shortestline | geometry |
|
176
|
+
| st_simplify | geometry |
|
177
|
+
| st_simplifypreservetopology | geometry |
|
178
|
+
| st_simplifyvw | geometry |
|
179
|
+
| st_snap | geometry |
|
180
|
+
| st_snaptogrid | geometry |
|
181
|
+
| st_split | geometry |
|
182
|
+
| st_startpoint | geometry |
|
183
|
+
| st_subdivide | geometry |
|
184
|
+
| st_swapordinates | geometry |
|
185
|
+
| st_symdifference | geometry |
|
186
|
+
| st_symmetricdifference | geometry |
|
187
|
+
| st_tileenvelope | geometry |
|
188
|
+
| st_transform | geometry |
|
189
|
+
| st_translate | geometry |
|
190
|
+
| st_transscale | geometry |
|
191
|
+
| st_unaryunion | geometry |
|
192
|
+
| st_union | geometry |
|
193
|
+
| st_voronoilines | geometry |
|
194
|
+
| st_voronoipolygons | geometry |
|
195
|
+
| st_wkbtosql | geometry |
|
196
|
+
| st_wkttosql | geometry |
|
197
|
+
| st_wrapx | geometry |
|
198
|
+
+----------------------------------+---------------+
|
199
|
+
SELECT 187
|