{"id":304219,"date":"2020-05-25T15:01:12","date_gmt":"2020-05-25T15:01:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304219"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304219","title":{"rendered":"\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u043b\u044e\u0434\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f GPS-\u0442\u0440\u0435\u043a\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/503520\/\"><i><b>\u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/km3nA\/\">\u00abPostgreSQL\u00bb<\/a> \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/b><br \/>  <\/i>  <\/p>\n<hr>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u043f\u0430\u043d\u0434\u0435\u043c\u0438\u0438 COVID-19 \u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442 \u0436\u0435\u0441\u0442\u043a\u0438\u0435 \u043c\u0435\u0440\u044b \u043f\u043e \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044e \u0438\u043d\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043b\u044e\u0434\u0435\u0439. \u042d\u0442\u0438 \u043c\u0435\u0440\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u043b\u044e\u0434\u0435\u0439 \u0438 \u0438\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0441 \u0446\u0435\u043b\u044c\u044e \u043e\u0431\u0443\u0437\u0434\u0430\u0442\u044c \u044d\u043f\u0438\u0434\u0435\u043c\u0438\u044e. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 PostGIS \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u043f\u0443\u0442\u0435\u0439 \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u0445 \u043b\u044e\u0434\u0435\u0439 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e-\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0440\u0435\u043a\u043e\u0432.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u043d\u0435 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u044e\u043d\u0438\u043d\u0433\u0435, \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u0441\u0442\u0440\u0435\u043c\u0438\u043c\u0441\u044f \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0430\u0448\u0435\u0439 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f PostgreSQL \u0438 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<a name=\"habracut\"><\/a><\/p>\n<p>  <b>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/b><\/p>\n<ol>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 PostgreSQL.<\/li>\n<li>\u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0442\u0440\u0435\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e QGIS<\/li>\n<li>\u0421\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0442\u0440\u0435\u043a\u043e\u0432 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a.<\/li>\n<li>\u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439 \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u0445 \u043b\u044e\u0434\u0435\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0442\u0440\u0435\u043a\u0438 \u0438 \u0438\u0445 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<p>  \u0422\u0430\u0431\u043b\u0438\u0446\u0430 <i>mobile_tracks<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0439 \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u043a\u0438 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e QGIS.<\/p>\n<p>  \u0422\u0430\u0431\u043b\u0438\u0446\u0430 <i>mobile_points<\/i> \u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u043e\u0447\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u043a\u043e\u0432. \u041e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u0431\u044b\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0442\u0430\u0439\u043c\u0441\u0442\u0430\u043c\u043f\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0422\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0437\u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0412\u0435\u043d\u0435\/\u0410\u0432\u0441\u0442\u0440\u0438\u044f; \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u044b\u0431\u0440\u0430\u043b MGI\/Austria 34 (EPSG \u0440\u0430\u0432\u043d\u044b\u0439 31286) \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0438.<\/p>\n<pre><code class=\"sql\">create table if not exists mobile_tracks (    gid serial not null       constraint mobile_tracks_ok          primary key,    customer_id integer,    geom geometry(LineString,31286),    infected boolean default false );   create index if not exists mobile_tracks_geom_idx    on mobile_tracks using gist (geom);   create unique index if not exists mobile_tracks_customer_id_uindex     on mobile_tracks (customer_id);   create table if not exists mobile_points (    gid serial not null       constraint mobile_points_ok          primary key,    customer_id integer,    geom geometry(Point,31286),    infected boolean,    recorded timestamp );   create index if not exists mobile_points_geom_idx    on mobile_points using gist (geom);<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0422\u0440\u0435\u043a\u0438 \u0438 \u0442\u043e\u0447\u043a\u0438<\/h3>\n<p>  \u041a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432\u043d\u0430\u0447\u0430\u043b\u0435, \u0442\u043e\u0447\u043a\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0440\u0435\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 \u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e QGIS. \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 1 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044b \u0442\u0440\u0435\u043a\u0438 \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 (\u043a\u0440\u0430\u0441\u043d\u044b\u043c ) \u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u0445 (\u0437\u0435\u043b\u0435\u043d\u044b\u043c) \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u0437\u044f\u043b\u0438 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5b\/vz\/4e\/5bvz4eq9yt0js0bj2ncs1v8bmq0.png\"><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. GPS-\u0442\u0440\u0435\u043a\u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u0445 \u0438 \u0438\u043d\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043b\u044e\u0434\u0435\u0439.<\/i><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\u0412\u0441\u0435 \u043b\u044e\u0434\u0438 \u0434\u0432\u0438\u0436\u0443\u0442\u0441\u044f \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e.<\/li>\n<li>\u0422\u0440\u0435\u043a\u0438 \u0432\u0441\u0435\u0445 \u043b\u044e\u0434\u0435\u0439 \u0441\u0442\u0430\u0440\u0442\u0443\u044e\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0434\u043b\u044f \u0442\u0440\u0435\u043a\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e PostGIS ST_Segmentize \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"sql\">with dumpedPoints as (     select (st_dumppoints(st_segmentize(geom, 1))).geom,            ((st_dumppoints(st_segmentize(geom, 1))).path[1]) as path,            customer_id,            infected,            gid     from mobile_tracks),      aggreg as (          select *, now() + interval '1 second' * row_number() over (partition by customer_id order by path) as tstamp          from dumpedPoints) insert into mobile_points(geom, customer_id, infected, recorded) select geom, customer_id, infected, tstamp from aggreg;<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0440\u043e\u0441 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u043e\u0447\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u0440, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0430\u0439\u043c\u0441\u0442\u0430\u043c\u043f\u044b \u043d\u0430 1000 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-o\/8r\/ot\/-o8rot1l2lxuqglqbxaievaa7ja.png\"><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 GPS-\u0442\u043e\u0447\u043a\u0438.<\/i><\/p>\n<h3>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u0435\u043a \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f.<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437. \u0412\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u043b\u0438 \u043d\u0430\u0448 \u0438\u043d\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c?<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430: \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0442\u043e\u0447\u043a\u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u0445 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 2 \u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u0442 \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u043c\u0438 \u0432 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/p>\n<pre><code class=\"sql\">SELECT distinct on (m1.gid) m1.customer_id infectionSourceCust,                             m2.customer_id infectionTargetCust,                             m1.gid,                             m1.recorded,                             m2.gid,                             m2.recorded FROM mobile_points m1          inner join      mobile_points m2 on st_dwithin(m1.geom, m2.geom, 2) where m1.infected = true   and m2.infected = false   and m1.gid &lt; m2.gid AND (m2.recorded &gt;= m1.recorded - interval '1seconds' and        m2.recorded &lt;= m1.recorded + interval '1seconds') order by m1.gid, st_dwithin(m1.geom, m2.geom, 2) asc<\/code><\/pre>\n<p>  \u041d\u0430 3 \u0438 4 \u0440\u0438\u0441\u0443\u043d\u043a\u0430\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0433\u0434\u0435 \u0442\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u043d\u0430\u0448\u0438\u0445 \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u043e\u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u0441\u0438\u043d\u0438\u043c \u0446\u0432\u0435\u0442\u043e\u043c. \u041a\u0430\u043a \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435, \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u0437\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 PostGIS <code>ST_CPAWithin \u0438 ST_ClosestPointOfApproach<\/code> \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u0438 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ww\/c2\/fp\/wwc2fpy7ddauodg3gjofywkrf40.jpeg\"><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. \u0422\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432.<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lz\/2k\/4f\/lz2k4fouh1v-yclpemh2dpr-rxg.png\"><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u0422\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0432 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438.<\/i><\/p>\n<p>  \u0412 \u0446\u0435\u043b\u044f\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043a\u043e\u0433\u0435\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0431\u043b\u0438\u0437\u043e\u0441\u0442\u0438 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f. \u0426\u0435\u043b\u044c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043b\u0433\u043e \u043b\u044e\u0434\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043b\u0438\u0437\u043a\u043e \u0434\u0440\u0443\u0433 \u043a \u0434\u0440\u0443\u0433\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<h4>\u0428\u0430\u0433 1 \u2014 aggregStep1<\/h4>\n<p>  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0434\u043e \u0435\u0435 \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0438\u0446\u044b. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043d\u0430\u0448\u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f, \u0443 \u043d\u0435\u043a\u043e\u0433\u0435\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 1 \u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4h\/7c\/5a\/4h7c5aoeyvjknyonupmmuye8o6q.jpeg\"><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5. \u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 GPS-\u0442\u043e\u0447\u043a\u0430\u043c\u0438.<\/i><\/p>\n<h4>\u0428\u0430\u0433 2 \u2014 aggregStep2.<\/h4>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u043c\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b. <\/p>\n<h4>\u0428\u0430\u0433 3 \u2014 aggregStep3.<\/h4>\n<p>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043c\u044b \u043e\u0442\u043d\u0438\u043c\u0430\u0435\u043c \u043e\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0441\u0442\u0430\u043c\u043f\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3g\/rj\/xg\/3grjxgh9miqzia5jhzrqrq190ig.jpeg\"><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 6. \u041a\u043e\u0433\u0435\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b + \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0433\u043e\/\u0437\u0434\u043e\u0440\u043e\u0432\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/i><\/p>\n<h4>\u0428\u0430\u0433 4<\/h4>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0433\u043e\/\u0437\u0434\u043e\u0440\u043e\u0432\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438, \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e st_makeline \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f lineString (\u0441\u043c. \u0420\u0438\u0441\u0443\u043d\u043e\u043a 7).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ac\/sx\/hh\/acsxhhclrolzdfrtilwaogucg2o.jpeg\"><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 7. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0433\u043e\/\u0437\u0434\u043e\u0440\u043e\u0432\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/i><\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0443\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u043d\u0430\u0448 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u043d\u0430\u0448\u0438\u043c\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c\u0438 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0435\u0449\u0430\u044e\u0449\u0435\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 PostgreSQL \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c MobilityDB, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0441\u043f\u0435\u043a\u0442\u0440\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e-\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. <a href=\"https:\/\/www.cybertec-postgresql.com\/en\/intersecting-tracks-of-individuals-mobilitydb\/\">\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435<\/a>.<\/p>\n<pre><code class=\"sql\">with points as          (              SELECT distinct on (m1.gid) m1.customer_id infectionSourceCust,                                            m2.customer_id infectionTargetCust,                                          m1.gid,                                          m1.geom,                                          m1.recorded\tm1rec,                                          m2.gid,                                          m2.recorded              FROM mobile_points m1                       inner join                   mobile_points m2 on st_dwithin(m1.geom, m2.geom, 2)              where m1.infected = true                and m2.infected = false                and m1.gid &lt; m2.gid AND (m2.recorded &gt;= m1.recorded - interval '1seconds' and                     m2.recorded &lt;= m1.recorded + interval '1seconds') order by m1.gid, m1.recorded), aggregStep1 as ( SELECT *, (m1rec - lag(m1rec, 1) OVER (partition by infectionSourceCust,infectionTargetCust ORDER by m1rec ASC)) as lag from points), aggregStep2 as (SELECT *, SUM(CASE WHEN extract('epoch' from lag) &gt; 1 THEN 1 ELSE 0 END)                  OVER (partition by infectionSourceCust,infectionTargetCust ORDER BY m1rec ASC) AS legSegment           from aggregStep1),      aggregStep3 as (          select *,                 min(m1rec) OVER w   minRec,                 max(m1rec) OVER w   maxRec,                 (max(m1rec) over w) -                 (min(m1rec) OVER w) recDiff          from aggregStep2              window w as (partition by infectionSourceCust,infectionTargetCust,legSegment)      ) select distinct on (infectionsourcecust, infectiontargetcust) infectionsourcecust,                                                               infectiontargetcust,                                                               (extract('epoch' from (recdiff))) passageTime,                                                               st_makeline(geom) OVER (partition by infectionSourceCust,infectionTargetCust,legSegment) from aggregStep3 order by infectionsourcecust, infectiontargetcust, passageTime desc <\/code><\/pre>\n<p>  <\/p>\n<hr>\n<p>  <a href=\"https:\/\/otus.pw\/km3nA\/\">\u0423\u0441\u043f\u0435\u0442\u044c \u043d\u0430 \u043a\u0443\u0440\u0441.<\/a><\/p>\n<hr>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/503520\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/503520\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/503520\/\"><i><b>\u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/km3nA\/\">\u00abPostgreSQL\u00bb<\/a> \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/b><br \/>  <\/i>  <\/p>\n<hr>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u043f\u0430\u043d\u0434\u0435\u043c\u0438\u0438 COVID-19 \u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442 \u0436\u0435\u0441\u0442\u043a\u0438\u0435 \u043c\u0435\u0440\u044b \u043f\u043e \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044e \u0438\u043d\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043b\u044e\u0434\u0435\u0439. \u042d\u0442\u0438 \u043c\u0435\u0440\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u043b\u044e\u0434\u0435\u0439 \u0438 \u0438\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0441 \u0446\u0435\u043b\u044c\u044e \u043e\u0431\u0443\u0437\u0434\u0430\u0442\u044c \u044d\u043f\u0438\u0434\u0435\u043c\u0438\u044e. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 PostGIS \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u043f\u0443\u0442\u0435\u0439 \u0437\u0430\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u0445 \u043b\u044e\u0434\u0435\u0439 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e-\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0440\u0435\u043a\u043e\u0432.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u043d\u0435 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u044e\u043d\u0438\u043d\u0433\u0435, \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u0441\u0442\u0440\u0435\u043c\u0438\u043c\u0441\u044f \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0430\u0448\u0435\u0439 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f PostgreSQL \u0438 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-304219","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304219"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304219\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}