我试图在Sequelize中有一个几何列的表中插入一行.js ORM.
进行转换的PostGIS存储过程是
ST_MakePoint( longitude, latitude, altitude )
要插入一行,我使用sequelize模型.创建函数
models.Data.create({
location: "ST_MakePoint("+request.params.lon+", "+request.params.lat+", "+request.params.alt+")", // PSUEDO code, How can I call this function?
speed: request.params.spd,
azimuth: request.params.azi,
accuracy: request.params.acc
});
现在我想做的是,当我插入行时,让字段location
返回"ST_MakePoint("+request.params.lon+", "+request.params.lat+", "+request.params.alt+")"
的结果.
我该怎么做?