Repository navigation
Conversation
|
Sorry worth also noting that if you're a relatively new GeoJSON/Postgis user then you'll need to specify the SRID on the GeoJson objects when inserting (from there they'll be retrieved automatically). An example is: var GeoJSON = {
type: 'Point',
coordinates: [ 54.57, 41.29 ],
crs : {
type: 'name',
properties: {
'name' : 'EPSG:4326'
}
}
}The |
|
I don't have time to review this yet, but it may be duplicate of #3641 and my comments there probably apply to that as well edit: I didn't notice that you already mentioned the other PR, sorry :). But my comment there about supporting geoJSON in other dialects still applies - I think it could be done with very little extra work |
|
Any updates on this? I'm actually interested in using this branch. I found the PR while trying to hack together an almost identical solution. Specifically, anything that would keep this from getting merged? |
|
It's currently being prevented from being merged because it only works in Postgres and the more sensible thing to do is to use WKT to make it work alongside other SQL geometries. I've made a start on it and hope to get it done this weekend. |
|
I'd like to offer my encouragement for this development. It is a very valuable extension of the functionality of Sequelize and I am keen to see it merged. Janmeier makes some great comments in #3641 and to the 'wants' list of mysql and mssql you could add spatialite, which is the spatial enablement of sqlite3. However, even just having the PostGIS functionality is such a major bonus that perhaps it is worth merging now while waiting on the addition of support for other databases. I would advocate keeping the native PostGIS functionality and adding the WKT support in addition rather than seeing compliance with the request for WKT as an alternative. |
|
Any updates on this? |
|
Closed in favor of #3828 |
Hi there,
So we use sequelize internally and required Geometry support to some degree. I started adding it in a few days ago before I realised that someone had already done a little bit of the work [https://github.com//pull/3641]. We were actually moving along the same path (using GeoJSON) and that PR had a few approaches that were better than my own and so I integrated them here.
A couple of things to note, I've had to change one test to run locally. I looked it up and it's a known issue (#2966). I also ran into a few issues with the documentation generation suite but have documented what I've done.
The basics are:
Added support for DataTypes.GEOMETRY(Type, SRID)
This will be stored as a POSTGIS geometry column but the API will always interacts with GeoJSON
Added support for new geo based where lookups:
I've also had to slightly change the
dropTablesfor postgres as this did not work well with the new tests I've introduced (tried to drop POSTGIS views which are vital).Anyway apologies for a slightly overlapping pull request but I thought it better to mention it.