postgresql使用 ST_PointFromText(“POINT()“, 4326)时字段 出现“POINT()“ 不存在SQL 状态: 42703

        错误提示“字段 'POINT(115.8 28.72)' 不存在”通常是因为 SQL 语句中存在语法错误。在 SQL 语句中,ST_PointFromText 函数的参数应该是一个字符串,而直接将 POINT(115.8 28.72) 作为字段名使用,这是不正确的。正确的做法是将点的坐标作为字符串传递给 ST_PointFromText 函数。此外,应该使用单引号 ' 来包围字符串参数,而不是双引号 "

UPDATE point SET point = ST_PointFromText('POINT(115.8 28.72)', 4326) WHERE id = 4;

### SQL: WITH polygon AS (SELECT ST_MakePolygon(ST_GeomFromText(?, 4326)) AS geom) SELECT bus_address, business_scope, cancel_date, city, community, declared_capital_atm, district, dom_code, ent_name, ent_org_code, ent_status, ent_type, ent_type_code, est_date, etl_create_time, etl_data_source, etl_update_time, filing_date, grid, id_num, industry, industry_category, is_delete, safe_cast_to_numeric(lat) AS lat, legal_person, safe_cast_to_numeric(lon) AS lon, operation_period, province, register_address, registered_capital_amt, registered_no, registration_institution, revoke_date, street, uni_credit_code, ent_id FROM ads_ent_base_info_nanshan CROSS JOIN polygon WHERE uni_credit_code LIKE CONCAT(?,'%') AND ST_Within(ST_MakePoint(safe_cast_to_numeric(lon), safe_cast_to_numeric(lat))::geography,polygon.geom::geography) AND ST_Intersects(ST_MakeEnvelope( ST_XMin(polygon.geom), ST_YMin(polygon.geom), ST_XMax(polygon.geom), ST_YMax(polygon.geom), 4326),ST_MakePoint(safe_cast_to_numeric(lon), safe_cast_to_numeric(lat ))) ORDER BY ent_id DESC LIMIT ? OFFSET ? ### Cause: org.postgresql.util.PSQLException: 错误: 函数 st_within(geography, geography) 存在 Hint: 没有匹配指定名称和参数类型的函数. 您也许需要增加明确的类型转换. Position: 1071 ; bad SQL grammar []] with root cause org.postgresql.util.PSQLException: 错误: 函数 st_within(geography, geography) 存在 Hint: 没有匹配指定名称和参数类型的函数. 您也许需要增加明确的类型转换. Position: 1071
09-06
### Error querying database. Cause: org.postgresql.util.PSQLException: 错误: ST_Intersects: Operation on mixed SRID geometries (Polygon, 4326) != (Point, 0) ### The error may exist in URL [jar:nested:/home/palm/dashboard-map-api-0.0.1-SNAPSHOT.jar/!BOOT-INF/classes/!/mapper/AdsEntBaseInfoNanshanMappe r.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: WITH polygon AS (SELECT ST_MakePolygon(ST_GeomFromText(?, 4326)) AS geom) SELECT bus_address, busines s_scope, cancel_date, city, community, declared_capital_atm, district, dom_code, ent_nam e, ent_org_code, ent_status, ent_type, ent_type_code, est_date, etl_create_time, etl_dat a_source, etl_update_time, filing_date, grid, id_num, industry, industry_category, is_de lete, safe_cast_to_numeric(lat) AS lat, legal_person, safe_cast_to_numeric(lon) AS lon, operation_period, province, register_address, registered_capital_amt, registered_no, registration_institution, revoke_da te, street, uni_credit_code, ent_id FROM ads_ent_base_info_nanshan CROSS JOIN polygon WHERE uni_credit _code LIKE CONCAT(?,'%') AND ST_Within(ST_SetSRID(ST_MakePoint(safe_cast_to_numeric(lon), safe_cast_to_n umeric(lat)),4326),polygon.geom) AND ST_Intersects(ST_MakeEnvelope( ST_XMin(polygon.geom), ST_YMin(polygon.geom), ST_XMax(polygon.geom), ST_YMax(polygon.geom), 4326),ST_MakePoint(safe_cast_to_numeric(lon), safe_cast_to_numeric(lat))) ORDER BY ent_id DESC LIMIT ? OFFSET ? ### Cause: org.postgresql.util.PSQLException: 错误: ST_Intersects: Operation on mixed SRID geometries (Polygon, 4326) != (Point, 0) ; uncategorized SQLException; SQL state [XX000]; error code [0]; 错误: ST_Intersects: Operation on mixed SRID geometries (Polygon, 4326) != (Poi nt, 0)] with root cause org.postgresql.util.PSQLException: 错误: ST_Intersects: Operation on mixed SRID geometries (Polygon, 4326) != (Point, 0) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2733)
最新发布
09-06
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值