执行插入geometry数据到数据库中,报错如下:
Geometry SRID (0) does not match column SRID (3857)
需要设置SRID:
String wktPoint = "POINT(" + intersection.getX() + " " + intersection.getY() + " " + intersection.getZ() + ")";
Geometry geometry = GeoUtils.geomFromWkt(wktPoint);
geometry.setSRID(3857);
report.setGeom(geometry);
reportMapper.insert(report);
本文介绍了如何在将几何数据插入数据库时遇到的SRID不匹配问题,通过设置几何对象的SRID为3857并提供了解决步骤:创建WKT字符串、转换为Geometry对象、设置SRID,最后成功插入报告到数据库。
1981

被折叠的 条评论
为什么被折叠?



