Skip to content

Commit 58ab017

Browse files
OGC API – Moving Features over MobilityDB via PyMEOS
A Python implementation of the OGC API – Moving Features standard served over MobilityDB through PyMEOS: collection and feature CRUD, MovingFeature and FeatureCollection responses, user-supplied temporal properties, an NDJSON and Parquet lakehouse export feed, bulk fleet-feed ingest, vendored MEOS-API artefacts, an HTTP server, tutorial notebooks, and a test suite.
0 parents  commit 58ab017

88 files changed

Lines changed: 575040 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Report unexpected behaviour, errors, or test failures
4+
title: "[BUG] "
5+
labels: bug
6+
---
7+
8+
## Description
9+
10+
Brief description of the bug.
11+
12+
## Steps to reproduce
13+
14+
1. ...
15+
2. ...
16+
3. ...
17+
18+
## Expected behaviour
19+
20+
What you expected to happen.
21+
22+
## Actual behaviour
23+
24+
What actually happened. Include error messages, stack traces, or response bodies as appropriate.
25+
26+
## Environment
27+
28+
- MobilityAPI version / commit:
29+
- Python version:
30+
- PostgreSQL version:
31+
- MobilityDB version:
32+
- OS:
33+
34+
## Additional context
35+
36+
Anything else that might help — minimal reproducer, related issues, OGC API – Moving Features specification reference if relevant.

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new endpoint, OGC-conformance improvement, or backend integration
4+
title: "[FEAT] "
5+
labels: enhancement
6+
---
7+
8+
## Motivation
9+
10+
What problem does this feature solve, or what use case does it enable?
11+
12+
## Proposed change
13+
14+
A clear description of the new endpoint, behaviour, or integration. If it relates to the OGC API – Moving Features standard, link to the relevant section: https://docs.ogc.org/is/22-003r3/22-003r3.html
15+
16+
## Alternatives considered
17+
18+
Other approaches you considered and why this one is preferable.
19+
20+
## Additional context
21+
22+
Related issues, references, or examples from sister projects (PyMEOS, JMEOS, MobilityDB, MobilityDuck).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Summary
2+
3+
Brief description of what this PR does and why.
4+
5+
## Changes
6+
7+
- ...
8+
9+
## Related issues
10+
11+
Fixes #N / Refs #N
12+
13+
## Testing
14+
15+
How you verified the change. Output of `./run.sh --with-tests` for substantive changes; for documentation-only changes a description of what you read suffices.
16+
17+
## Checklist
18+
19+
- [ ] Tests pass locally
20+
- [ ] `ruff check .` passes
21+
- [ ] Documentation updated where relevant
22+
- [ ] Entries in `AUTHORS.md` / `CITATION.cff` updated if this is a first-time substantial contribution

.github/workflows/python.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Python checks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
lint:
10+
name: Lint (ruff)
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.11"
17+
- name: Install ruff
18+
run: pip install ruff
19+
- name: Run ruff
20+
run: ruff check . || echo "::warning::ruff found issues — please fix before merging"
21+
continue-on-error: true
22+
23+
python-import:
24+
name: Import smoke test
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.11"
31+
- name: Install dependencies
32+
run: |
33+
pip install --upgrade pip
34+
pip install -r requirements.txt
35+
- name: Verify modules import
36+
run: |
37+
python -c "import server" || true
38+
python -c "import utils"
39+
python -c "from resource.collections import Create, Retrieve"
40+
python -c "from resource.moving_features import Create, Retrieve"
41+
python -c "from resource.temporal_geom_query import distance, velocity, acceleration"
42+
43+
unit-tests:
44+
name: Unit tests (PyMEOS-free)
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-python@v5
49+
with:
50+
python-version: "3.11"
51+
- name: Install test dependencies
52+
run: pip install pytest pyarrow
53+
- name: Run unit tests
54+
run: python -m pytest tests/test_bulk.py -v

.github/workflows/vendor-drift.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Vendor drift (MEOS-API)
2+
3+
# Re-runs the `make vendor-meos-api` target against the live MEOS-API master
4+
# and fails if the vendored artefacts under `vendor/meos-api/` are out of date.
5+
#
6+
# Surfaces upstream changes as actionable PR diffs instead of letting them
7+
# silently rot. The CI failure message tells the maintainer to run
8+
#
9+
# make vendor-meos-api
10+
#
11+
# locally and submit a refresh PR.
12+
#
13+
# Step 3 of `docs/MEOS_API_INGESTION_PLAN.md`.
14+
15+
on:
16+
pull_request:
17+
paths:
18+
- 'vendor/meos-api/**'
19+
- 'Makefile'
20+
- '.github/workflows/vendor-drift.yml'
21+
push:
22+
branches: [master]
23+
schedule:
24+
# Daily 06:00 UTC — pings the maintainer if MEOS-API master moves and the
25+
# vendored copy goes stale, even without a MobilityAPI PR open.
26+
- cron: '0 6 * * *'
27+
workflow_dispatch:
28+
29+
jobs:
30+
vendor-drift:
31+
name: Refresh & diff vendored artefacts
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
# libclang (the Python wheel) bundles the .so but not the system C
37+
# headers MEOS depends on (json-c, gsl, proj, postgres). Without them,
38+
# `size_t` degrades to `int`, `json_object *` degrades to `int *`, etc.,
39+
# which would show up as false drift on every CI run. Install the same
40+
# dev headers a local MobilityDB build expects so libclang resolves
41+
# everything correctly.
42+
- name: Install dev headers for libclang sysroot (matches local parse)
43+
run: |
44+
sudo apt-get update -qq
45+
sudo apt-get install -y --no-install-recommends \
46+
clang libclang-dev \
47+
libjson-c-dev libgsl-dev libproj-dev libgeos-dev \
48+
postgresql-server-dev-16
49+
50+
- name: Refresh vendored MEOS-API artefacts from master
51+
run: make vendor-meos-api
52+
53+
- name: Detect drift
54+
id: drift
55+
run: |
56+
if git diff --exit-code -- vendor/meos-api/; then
57+
echo "drift=false" >> "$GITHUB_OUTPUT"
58+
echo "::notice::vendor/meos-api/ is up to date with MEOS-API master."
59+
else
60+
echo "drift=true" >> "$GITHUB_OUTPUT"
61+
echo "::error::vendor/meos-api/ is stale. Run \`make vendor-meos-api\` locally and open a refresh PR."
62+
git diff --stat -- vendor/meos-api/
63+
exit 1
64+
fi

.gitignore

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
# C extensions
6+
*.so
7+
poetry.lock
8+
MobilityDB
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
win/
131+
132+
# Spyder project settings
133+
.spyderproject
134+
.spyproject
135+
136+
# Rope project settings
137+
.ropeproject
138+
139+
# mkdocs documentation
140+
/site
141+
142+
# mypy
143+
.mypy_cache/
144+
.dmypy.json
145+
dmypy.json
146+
147+
# Pyre type checker
148+
.pyre/
149+
150+
# pytype static type analyzer
151+
.pytype/
152+
153+
# Cython debug symbols
154+
cython_debug/
155+
156+
# PyCharm
157+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159+
# and can be added to the global gitignore or merged into this file. For a more nuclear
160+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161+
#.idea/
162+
163+
*.zip
164+
*.csv
165+
#developement
166+
notes.md
167+
debug.md
168+
tests/api_logs.json
169+
RTDATA
170+
rest-clients
171+
.vscode
172+
docker-compose.yml
173+
tmp.txt
174+
# database dumps are not tracked
175+
mydb_dump.sql
176+
*.dump

0 commit comments

Comments
 (0)