项目场景
国产数据库应用场景
利用geoserver连接支持SM3加密算法的瀚高数据库,发布的SQL视图服务显示异常。
环境说明
- geoserver 2.23.1
- hgdb-see-4.5.8-db43858.aarch64(支持国密SM3)
问题描述
错误内容:java.sql.SQLException: org.postgresql.util.PSQLException: 错误: ST_Intersects: Operation on mixed SRID geometries (MultiPolygon, 4326) != (Polygon, 0)
详细错误内容如下:
Caused by: java.lang.RuntimeException: java.io.IOException
at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:175)
at ...
... 145 more
Caused by: java.io.IOException
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:650)
at ...
... 153 more
Caused by: java.sql.SQLException: org.postgresql.util.PSQLException: 错误: ST_Intersects: Operation on mixed SRID geometries (MultiPolygon, 4326) != (Polygon, 0)
at org.geotools.jdbc.JDBCFeatureReader.runQuery(JDBCFeatureReader.java:282)
at ...
... 155 more
Caused by: org.postgresql.util.PSQLException: 错误: ST_Intersects: Operation on mixed SRID geometries (MultiPolygon, 4326) != (Polygon, 0)
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
at ...
...157more
原因分析
创建的SQL视图中的geom属性的类型和SRID配置错误

解决方案
勾选【Guess geometry type and srid】,然后点击【刷新】,问题解决。

小结
国产化的道路崎岖坎坷啊,只能一点一点的铺平!!
欢迎在评论区分享国产化的经验
