Alle punten van polygoon, met hoogte

DECLARE @max INT
SET @max = (SELECT MAX(geom.STNumPoints()) FROM Opmetingen) ;

WITH Sequence(Number) AS
(
  SELECT 1 AS Number
  UNION ALL
  SELECT Number + 1
  FROM Sequence
  WHERE Number < @max
)

SELECT
  l.id
  ,l.Geom.STPointN(nums.number).STX AS PointX
  ,l.Geom.STPointN(nums.number).STY AS PointY
  ,l.Geom.STPointN(nums.number).Z AS PointZ
  FROM [tabelnaam] l, Sequence nums
  WHERE nums.number <= l.Geom.STNumPoints()

 

Categories:

Related Article