Postgis | ST_Intersects:在混合SRID几何形状上的操作(点,0)!=(Multipolygon,24379)SQL状态:XX000
我在PostGIS中有多边形几何 GEOM ,我想检查一下点“点(77.2135569,28.6248447)”,以检查它是否相交。
选择ST_Intersects('点(28.6248447 77.2135569)'::几何,GEOM,GEOM)
。
获取以下错误:
错误:st_intersects:在混合SRID几何形状上操作(point,0)!=(Multipolygon,24379)SQL状态:XX000
postgis版本: postgis =“ 3.1.5 v2.4.3--3--3--3--3-- 95-GC6A5796“ [扩展] pgsql =“ 140” geos =“ 3.9.2-CAPI-1.14.3” proj =“ 8.1.1” gdal =“ gdal =” gdal 3.3.3,发行了2021/10/10/25“ 25” libxml =“ libxml =” 2.9.11“ libjson =“ 0.15” libprotobuf =“ 1.4.0” wagyu =“ 0.5.0(内部)”栅格
I have Polygon Geometry geom in the PostGIS, which I want to check with a point "POINT(77.2135569,28.6248447)", to check whether it intersect or not.
SELECT ST_Intersects('POINT(28.6248447 77.2135569)'::geometry, geom) FROM public.tablename
Here geom is the column name with data type as Geometry.
Getting the following error:
Error: ST_Intersects: Operation on mixed SRID geometries (Point, 0) != (MultiPolygon, 24379) SQL state: XX000
POSTGIS Version: POSTGIS="3.1.5 v2.4.3-95-gc6a5796" [EXTENSION] PGSQL="140" GEOS="3.9.2-CAPI-1.14.3" PROJ="8.1.1" GDAL="GDAL 3.3.3, released 2021/10/25" LIBXML="2.9.11" LIBJSON="0.15" LIBPROTOBUF="1.4.0" WAGYU="0.5.0 (Internal)" RASTER
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须声明这一点的投影。
您可以将其添加到文本中:
选择'srid = 4326; point(1 1)'::几何;
或您可以使用函数
select st_setsrid('point(1 1)' ::几何,4326);
,或者您可以使用参数和srid创建点:
选择ST_POINT(1,1,4326);
也就是说,您的观点似乎是在LAT中 - 长(可能4326)与多边形投影不同(24379),因此您仍然必须对其进行转换:
You must declare the projection of the point.
You can add it to the text:
select 'SRID=4326;POINT(1 1)'::geometry;
or you can use a function
select st_SetSRID('POINT(1 1)'::geometry,4326);
or you can create the point with parameters and SRID:
select st_point(1,1,4326);
That being said, your point seems to be in lat-longs (likely 4326) which is different from the polygon projection (24379), so you would still have to transform it: