开发者

SQLEXPRESS: Bounding box from geometry

开发者 https://www.devze.com 2023-02-08 18:50 出处:网络
I need for numeri开发者_JS百科c values added to my view (xmin,ymin,xmax,ymax) number values. The table has geometry as a varbinary(max) value.

I need for numeri开发者_JS百科c values added to my view (xmin,ymin,xmax,ymax) number values. The table has geometry as a varbinary(max) value.

How would i get the bbox values from geometry field?

thanx for any suggestion.


From what I've understood, you can use SUBSTRING() on your varbinary column to extract individual bound values and then cast the result to int (if they are int).

Something like this:

SELECT xmin = CAST(SUBSTRING(bbox, xmin_start_pos, xmin_byte_length) AS int)
FROM ...
0

精彩评论

暂无评论...
验证码 换一张
取 消