1. postgis多边形查询相交LineString并切割相交范围内
table.shape 是postgis的Geometry的lineString
传入的参数shape是wkt格式的pologon
select st_intersection(shape,st_geofromewkt('${shape}')) from table where
st_intersects(shape,st_geofromewkt('${shape}'))
2. 路牌坐标切割道路行点
路牌坐标一般道路行点外,如果要计算路牌的影响范围就需要切割道路行点。
第一步计算路牌坐标在道路行点上投影的位置。
select st_linelocatepoint(shape,st_geomfromewkt('${shape}')) from table where id =#{id}
第二步切割道路
select st_locatebetween(st_addmeasure(shape,0,1),#{measureStart},#{measureEnd}) from table where id=#{id}
https://help.aliyun.com/zh/rds/apsaradb-rds-for-postgresql/st-addmeasure