运营区边缘计算:区域数据缓存
This commit is contained in:
parent
db2d7734c8
commit
5ef02659e1
@ -52,7 +52,6 @@ public class PolygonTypeHandler implements TypeHandler<Polygon> {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 如果转换失败,直接使用原始值(不带坐标转换)
|
// 如果转换失败,直接使用原始值(不带坐标转换)
|
||||||
System.err.println("坐标转换失败,使用原始值: " + e.getMessage());
|
|
||||||
setPolygonWithoutConversion(ps, i, parameter);
|
setPolygonWithoutConversion(ps, i, parameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,8 +100,7 @@ public class PolygonTypeHandler implements TypeHandler<Polygon> {
|
|||||||
return (Polygon) object;
|
return (Polygon) object;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("转换 Polygon 失败: " + object.getClass().getName() +
|
throw new EbikeException("地图数据转换错误");
|
||||||
", 错误: " + e.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -256,12 +254,9 @@ public class PolygonTypeHandler implements TypeHandler<Polygon> {
|
|||||||
|
|
||||||
Polygon wgs84Polygon = geometryFactory.createPolygon(shell, holes);
|
Polygon wgs84Polygon = geometryFactory.createPolygon(shell, holes);
|
||||||
wgs84Polygon.setSRID(WGS84_SRID);
|
wgs84Polygon.setSRID(WGS84_SRID);
|
||||||
|
|
||||||
System.out.println("GCJ-02 → WGS-84 转换成功,点数: " + wgs84Coordinates.size());
|
|
||||||
return wgs84Polygon;
|
return wgs84Polygon;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("GCJ-02 → WGS-84 坐标系转换错误: " + e.getMessage());
|
|
||||||
// 转换失败时,返回原始多边形但设置正确的 SRID
|
// 转换失败时,返回原始多边形但设置正确的 SRID
|
||||||
gcj02Polygon.setSRID(WGS84_SRID);
|
gcj02Polygon.setSRID(WGS84_SRID);
|
||||||
return gcj02Polygon;
|
return gcj02Polygon;
|
||||||
@ -360,7 +355,6 @@ public class PolygonTypeHandler implements TypeHandler<Polygon> {
|
|||||||
|
|
||||||
ps.setObject(i, pgObject);
|
ps.setObject(i, pgObject);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("设置 Polygon 失败: " + e.getMessage());
|
|
||||||
ps.setNull(i, Types.OTHER);
|
ps.setNull(i, Types.OTHER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user