Create geography polyline(s) from points for many features in same table in T-SQL

57 Views Asked by At

A similar question has been asked here:

Create geography polyline from points in T-SQL

I have a table schema that looks like this:

CREATE TABLE [dbo].[LongAndLats](
[Longitude] [float] NULL,
[Latitude] [float] NULL,
[SortOrder] [bigint] NULL,
[SensorID] [bigint] NULL,
)

Sample data looks like this:

enter image description here

How can I convert these points into a geography polyline for each SensorID using TSQL (so that I would have a SensorID/Polyline record for each SensorID)?

0

There are 0 best solutions below