Skip to content

Instantly share code, notes, and snippets.

@lydonchandra
Created February 12, 2020 03:57
Show Gist options
  • Save lydonchandra/ec47a612671a30e73267e38ffe5930ab to your computer and use it in GitHub Desktop.
Save lydonchandra/ec47a612671a30e73267e38ffe5930ab to your computer and use it in GitHub Desktop.
with points as (
select * from (
select st_makepoint(1799,2397,53) as point3d
union
select st_makepoint(1804,2395,53) as point3d
union
select st_makepoint(1807,2397,53) as point3d
union
select st_makepoint(1780,2402,53) as point3d
) as seed
),
centerPoint as (
select ST_MakePoint(1799.981885455967,2397.705825900566,53.75868018825518) as centerPoint
)
select * from points, centerPoint,
ST_3DDistance( points.point3d, centerPoint.centerPoint ) as distance;
@lydonchandra
Copy link
Author

"01010000800000000000D09B400000000000C4A2400000000000804A40" "01010000802F876173ED1F9C40342F036269BBA240ED56B26E1CE14A40" 20.4521703787075
"010100008000000000003C9C400000000000BAA2400000000000804A40" "01010000802F876173ED1F9C40342F036269BBA240ED56B26E1CE14A40" 7.09420309711597
"010100008000000000001C9C400000000000BAA2400000000000804A40" "01010000802F876173ED1F9C40342F036269BBA240ED56B26E1CE14A40" 1.42754505308951
"01010000800000000000309C400000000000B6A2400000000000804A40" "01010000802F876173ED1F9C40342F036269BBA240ED56B26E1CE14A40" 4.90329826965443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment