Sequelize在多边形中找到一个点_ Sequelize Node.js Postgres

时间:2019-08-08 11:47:51

标签: node.js postgresql sequelize.js

我的项目中有这个架构。

An error occurred when executing the SQL command:
SELECT COUNT(*) -(SELECT COUNT(*)
                 FROM (SELECT DISTINCT * FROM <schema>.vw_z_a_base))
FROM <schema>.vw_z_a_base

[Amazon](500310) Invalid operation: Not implemented
Details: 
 -----------------------------------------------
  error:  Not implemented
  code:      1001
  context:   'value' - Ill formed PARAM_EXEC in expression
  query:     41412011
  location:  pg_utils.cpp:1710
  process:   padbmaster [pid=22726]
  -----------------------------------------------;
1 statement failed.

那么我的模型中可以有一个几何字段吗?我需要一个传递点坐标时返回相关区域的查询。

根据这个问题: Sequelize WHERE sequelize.fn(...) AND something='something' ordering issue

我写一个查询示例:

module.exports = (sequelize, DataTypes) => {
  const Area = sequelize.define('DistrictArea', {
    name: { type: DataTypes.STRING, unique: true },
    area_number: { type: DataTypes.INTEGER, unique: true },
    polygon_shape: DataTypes.GEOMETRY('POLYGON')
  }, {});
  DistrictArea.associate = function (models) {
  };
  return DistrictArea;

我不知道这是否是正确的查询。我从数据库中收到此错误:

  

未捕获的错误{DatabaseError [SequelizeDatabaseError]:   混合的SRID几何形状

0 个答案:

没有答案