Morteza Shahriari Nia
Morteza Shahriari Nia

Reputation: 1452

Nodejs ORM for Postgers spatial indexes (like PostGIS)

Postgres is the DB of choice due to its spatial indexing goodness (top-k-closest-points) using PostGIS or other gists. Looks like Node.js ORMs do not directly support spatial indexing, so which one requires the least amount of hacking for this? Sequelize and node-orm-2 seem to demand some hacking to get it working. Any suggestions?

Upvotes: 2

Views: 1657

Answers (1)

Evan Siroky
Evan Siroky

Reputation: 9418

As of sequelize 3.4.0, Geometry support has been added for postgres. You can use the GEOMETRY datatype in the model definition:

sequelize.define("point", {
  geom: DataTypes.GEOMETRY
});

Upvotes: 2

Related Questions