SQLEXPRESS: Bounding box from geometry

567 views Asked by At

I need for numeric 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.

1

There are 1 answers

0
Andriy M On BEST ANSWER

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 ...