I am trying to insert a row in a table that has a geometry column in Sequelize.js ORM. I have latitude, longitude and altitude and need to convert it to a point first so I can Insert it as a geometry.
The PostGIS stored procedure that does the converting is
ST_MakePoint( longitude, latitude, altitude )
To Insert a row I am using the sequelize model.create function
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
});
Now what I want to do Is make the field location
have the returned result of "ST_MakePoint("+request.params.lon+", "+request.params.lat+", "+request.params.alt+")"
when I insert the row.
How can I do that?