Добро пожаловать в форум, Guest  >>   Войти | Регистрация | Поиск | Правила | В избранное | Подписаться
Все форумы / Microsoft SQL Server Новый топик    Ответить
 Time bound  [new]
oosmaan
Member

Откуда:
Сообщений: 1
Hi everyone,

Recently I discovered spatial objects - it turned out to be a very convenient thing.
I just haven't found a way to bind spatial data to temporal data.

for example
DECLARE @p GEOGRAPHY
, @l GEOGRAPHY
, @gi GEOGRAPHY

The SET @p = GEOGRAPHY :: the Parse ( 'the POLYGON ((23.102405322446394 49.5931649741033,23.101418269528914 49.59310933769719,23.10051704729991 49.59299806469463,23.099444163693953 49.59277551792789,23.098199618711043 49.59288679143817,23.09802795733409 49.59344315518183,23.09772754992442 49.594138600936795,23.09802795733409 49.594639315740295,23.09952999438243 49.594945305589576,23.100602877988386 49.59569636344419,23.102190745725203 49.59580763029083,23.102662814511824 49.5948618540029,23.102190745725203 49.594416776462275,23.10227657641368 49.59380478821195,23.102405322446394 49.5931649741033)) ' ). ReorientObject ()
SET @l = GEOGRAPHY :: STGeomFromText ('LINESTRING (23.09425140704112 49.596280511557 1601881195, 23.094895137204695 49.59500093990138 1601881225, 23.095925105466414 49.593971694859974 1601881255, 23.097126735105086 49.59324842859344 1601881285, 23.09802795733409 49.59285897308441 1601881315, 23.098628772153425 49.593888241607345 1601881345, 23.099572909726668 49.593888241607345 1601881375, 23.100388301267195 49.593888241607345 1601881405, 23.10104678358035 49.59337882594847 1601881435, 23.101705265893507 49.59303631481794 1601881465, 23.102593077077437 49.59318583773922 1601881495, 23.103596223249006 49.59326233766124 1601881525 , 23.104315055264998 49.59363788099276 1601881555, 23.104808581723738 49.593776970381754 1601881585) ' , 4326 )

SET @gi = @l . STIntersection ( @p )


here @p is a polygon, @l is a line (added Z hoping to store time there), @gi is a line entering a polygon.
in reality, these are the coordinates of the tracker.
The task is to find out the time of entry / exit from the control zone.
While all this is done by individually processing all coordinates - in the zone / not in the zone, and the time is calculated.

It seemed to me that it would be much easier to count everything if the points in the linestring were immediately time-bound, so I shoved unixtime into Z, hoping that @ l.STIntersection (@p) would return the intersection with Z coordinates to me, but it's fine.

Hence the question - how to get the point number @ l.STIntersection (@p) .STStartPoint () in the @l object?

Or maybe someone has other ideas on this?
I will be very grateful for your help.
2 май 21, 14:04    [22317454]     Ответить | Цитировать Сообщить модератору
 Re: Time bound  [new]
Гавриленко Сергей Алексеевич
Member

Откуда: Moscow
Сообщений: 37232
Модератор: Какая-то лажа. Еще было тут: https://www.sql.ru/forum/1329684/linestring-s-privyazkoy-ko-vremeni
2 май 21, 14:19    [22317462]     Ответить | Цитировать Сообщить модератору
Все форумы / Microsoft SQL Server Ответить