Repository navigation
Open
Labels
dialect: mssqlFor issues and PRs. Things that involve MSSQL (and do not involve all dialects).dialect: sqliteFor issues and PRs. Things that involve SQLite (and do not involve all dialects).status: awaiting responseFor issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action
Description
All sequelize supported databases can hold geometry:
- Postgresql via postgis: http://postgis.org/
- Sqlite3 via spatialite: https://www.gaia-gis.it/fossil/libspatialite/index
- MySQL: https://dev.mysql.com/doc/refman/5.0/en/spatial-datatypes.html
- MariaDB: https://mariadb.com/kb/en/mariadb/documentation/gis-functionality/geometry-types/
- MSSQL: http://msdn.microsoft.com/en-us/library/bb933790.aspx
Wouldn't it be a nice enhancement to support
- Point
- LineString
- Polygon
geometry datatypes?
Reacted by Shahar Hadas, Tine Jozelj, Andrew Schmadel, Wesley, Lucas Astrada, Matt Tortolani, Vincenzo Ferrari, Jim Janke, Marilyn Morales and Wilk
Metadata
Metadata
Assignees
Labels
dialect: mssqlFor issues and PRs. Things that involve MSSQL (and do not involve all dialects).dialect: sqliteFor issues and PRs. Things that involve SQLite (and do not involve all dialects).status: awaiting responseFor issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action
Activity
mickhansen commentedon Jan 5, 2015
#1445 related.
mickhansen commentedon Jan 5, 2015
@milovanderlinden Mind summizing how each type is defined in each dialect. (unless 'Point' etc literally works in all of them)
milovanderlinden commentedon Jan 5, 2015
@mickhansen unfortunatly not :-(
The key concept is of course X and Y, but also a projection identifier for the more advanced databases. If in the first installment, we assume geometry to always be latitude and longitude and 2D, this are the constructors.
POINTconstructors:ST_PointmFromText('POINT(-71.064544 42.28787)',4326);ST_PointFromText('POINT(-71.064544 42.28787)',4326);Point(-71.064544, 42.28787);Point(-71.064544, 42.28787);geometry::STGeomFromText('POINT (-71.064544 42.28787)', 4326);Note: mysql and mariadb do not support projections, also mind the , in the constructor!
milovanderlinden commentedon Jan 5, 2015
I would like to help out myself. Are there any instructions on which files in sequelize need to be touched when constructing a new datatype?
mickhansen commentedon Jan 5, 2015
@milovanderlinden you can help out by providing the syntax for all of them :)
Unfortuneatly we don't have a good system in place for how data types should work in different dialects (we use some wonky replaces right now)
ptmt commentedon Jan 10, 2015
+1
Fow now, I use
DataTypes.STRINGto be able to display the point on the client, though changing is available with simple raw query like this'UPDATE some_table SET geo = POINT(:lat, :lng)Pana commentedon Mar 16, 2015
+1
rafaelveloso commentedon Mar 16, 2015
+1
nford commentedon Mar 21, 2015
+1
johnraber commentedon Mar 24, 2015
+1
mickhansen commentedon Mar 24, 2015
@milovanderlinden is the projection required or optional? Is it important?
paulxtiseo commentedon Mar 24, 2015
@mickhansen: projection is critical to accuracy of calculations with geographic data (but not geometry data), but not mandatory and not supported by some databases (ex: MySQL). Thus, it would have to be optional in Sequelize.
mickhansen commentedon Mar 24, 2015
@paulxtiseo I see so in PG you could store a POINT without a projection for geometric data and a POINT with a projection for gps/geographic data?
Implementing the data types wouldn't be too tricky.
But i don't currently have an API for how values would be inputted.
mbroadst commentedon Mar 24, 2015
@mickhansen it's worth mentioning that @theverything has written this which might be a good start for a unified geo types module in sequelize
53 remaining items
stale commentedon Jul 23, 2019
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂
papb commentedon Jul 31, 2019
What is the current status on this? I am confused.
GEOMETRY seems already supported for PostgreSQL, MySQL and MariaDB. So is this issue just a feature request for SQLite and MSSQL? Or am I missing something?
Akila1928 commentedon Aug 27, 2019
Does sequelize support MSSQL geometry?
papb commentedon Aug 27, 2019
@Akila1928 I should know, but I don't... Would you be willing to perform a quick test and let me know?
CompuTecMJS commentedon Feb 4, 2020
pensierinmusica commentedon Feb 17, 2020
@CompuTecMJS I ended up using a raw query.
seonglae commentedon Dec 18, 2020
wkxmodule in sequelize does not supportPOINTZ,LINESTRINGZ,POLYGONZso sequelize can't accept Z data with errorimdkbj commentedon Mar 5, 2021
5 years and still no support for mssql.