adonmo / mobilitydb-sqlalchemy Goto Github PK
View Code? Open in Web Editor NEWMobilityDB extensions for SQLAlchemy
Home Page: https://mobilitydb-sqlalchemy.readthedocs.io/en/latest/
License: MIT License
MobilityDB extensions for SQLAlchemy
Home Page: https://mobilitydb-sqlalchemy.readthedocs.io/en/latest/
License: MIT License
Pandas never completes compiling pandas 0.25.3 when installing the mobilitydb-sqlalchemy package.
Pandas 1.4.2 is already installed is it possible to omit pandas 0.25.3 installation while executing the subject command?
Thank you.
** verify pandas installed
root@74c5ed76b1e1:/tmp# python3
Python 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> pandas.__version__
'1.4.2'
** attempt mobilitydb-sqlalchemy installation
>>> root@74c5ed76b1e1:/tmp# pip3 install mobilitydb-sqlalchemy
Collecting mobilitydb-sqlalchemy
Downloading mobilitydb-sqlalchemy-0.4.tar.gz (11 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting geoalchemy2<0.9.0,>=0.8.4
Downloading GeoAlchemy2-0.8.5-py2.py3-none-any.whl (26 kB)
Requirement already satisfied: sqlalchemy<2.0.0,>=1.3.18 in /usr/local/lib/python3.10/dist-packages (from mobilitydb-sqlalchemy) (1.4.37)
Collecting mobilitydb-sqlalchemy
Downloading mobilitydb_sqlalchemy-0.3-py3-none-any.whl (10 kB)
Requirement already satisfied: shapely<2.0.0,>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from mobilitydb-sqlalchemy) (1.8.2)
Downloading mobilitydb_sqlalchemy-0.2.1-py3-none-any.whl (10 kB)
Collecting geoalchemy2<0.7.0,>=0.6.3
Downloading GeoAlchemy2-0.6.3-py2.py3-none-any.whl (21 kB)
Collecting pandas<0.26.0,>=0.25.3
Downloading pandas-0.25.3.tar.gz (12.6 MB)
For each of the range types defined in MobilityDB, a class that extends SQLAlchemy's UserDefinedType
needs to be defined, similar to how we already defined temporal types like TFloat
.
These include:
Check MobilityDB's documentation on Range Types: https://docs.mobilitydb.com/nightly/ch02.html
For details on how UserDefinedType
is used to create new column types in SQLAlchemy, refer to: https://docs.sqlalchemy.org/en/13/core/custom_types.html#sqlalchemy.types.UserDefinedType
For an example implementation, check code for TFloat
class: https://github.com/adonmo/mobilitydb-sqlalchemy/blob/master/mobilitydb_sqlalchemy/types/TFloat.py (or its base class TBaseType
)
This extension looks fantastic!
In the README.rst it says "A demo webapp built using this library is not available online:". I think it should say "A demo webapp built using this library is now available online:"
Wendell
For each of the box types defined in MobilityDB, a class that extends SQLAlchemy's UserDefinedType
needs to be defined, similar to how we already defined temporal types like TFloat
.
These include:
Check MobilityDB's documentation on Box Types: https://docs.mobilitydb.com/nightly/ch04.html
For details on how UserDefinedType
is used to create new column types in SQLAlchemy, refer to: https://docs.sqlalchemy.org/en/13/core/custom_types.html#sqlalchemy.types.UserDefinedType
For an example implementation, check code for TFloat
class: https://github.com/adonmo/mobilitydb-sqlalchemy/blob/master/mobilitydb_sqlalchemy/types/TFloat.py (or its base class TBaseType
)
In the demo, which uses TGeomPoint, the parameters are (lat, lon), but it seems that the standard order for TGeogPoint is (lon, lat). Does the code and the demo accept (lon, lat) as the parameter order when using TGeogPoint?
The Query example on https://mobilitydb-sqlalchemy.readthedocs.io/en/latest/quickstart.html requires the following updates, if one is using a recent set of libraries.
2,3c2
<
< from sqlalchemy import Column, Integer
---
> from sqlalchemy import Column, Integer, create_engine
4a4,10
> from sqlalchemy.orm import sessionmaker
> from sqlalchemy.sql import func
> import datetime
>
> engine = create_engine("postgresql://postgres:postgres@localhost:7432/mdb", echo=True)
> session = sessionmaker(bind=engine)()
>
8c14
< __tablename__ = "test_table_trips_01"
---
> __tablename__ = "trips_test_001"
18c24
< func.asText(
---
> func.ST_asText(
Does the TGeogPointSeq have an ST_Intersection function in mobilitydb-sqlalchemy?
It works when I reference it from within PostGIS/SQL or from Python using mobilitydb. However, with mobilitydb-sqlalchemy it results in:
AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object associated with Sched.the_traj has an attribute 'ST_Intersection'
The column is declared as a Column(TGeogPoint)
and other functions (valueAtTimestamp, atPeriod
) work fine.
Are there some examples that show how to do a spatial intersection/ST_Intersection on a TGeogPointSeq?
For each of the time types defined in MobilityDB, a class that extends SQLAlchemy's UserDefinedType
needs to be defined, similar to how we already defined temporal types like TFloat
.
These include:
Check MobilityDB's documentation on Time Types: https://docs.mobilitydb.com/nightly/ch02.html
For details on how UserDefinedType
is used to create new column types in SQLAlchemy, refer to: https://docs.sqlalchemy.org/en/13/core/custom_types.html#sqlalchemy.types.UserDefinedType
For an example implementation, check code for TFloat
class: https://github.com/adonmo/mobilitydb-sqlalchemy/blob/master/mobilitydb_sqlalchemy/types/TFloat.py (or its base class TBaseType
)
Does mobilitydb-sqlalchemy operate on TGeogPoint? Doesn't TGeomPoint use planar geometries for calculations (distance, etc.) whereas TGeogPoint uses spherical geometries for those calculations? Does that distinction make a difference to sqlalchemy?
Thanks,
Wendell
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.