{"id":308261,"date":"2020-08-10T15:00:54","date_gmt":"2020-08-10T15:00:54","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=308261"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=308261","title":{"rendered":"\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0433\u0440\u0430\u0444\u043e\u0432 \u0434\u043b\u044f \u0433\u0435\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430"},"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\/post\/514526\/\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. <\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044c \u0442\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0432 \u041d\u0430\u0443\u043a\u0430\u0445 \u043e \u0417\u0435\u043c\u043b\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, \u0432 \u0413\u0438\u0434\u0440\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u041a\u0430\u0440\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0434\u043e\u0442\u043e\u043a\u043e\u0432 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0433\u0435\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b QGIS.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"vvedenie\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u0430\u0436\u043d\u044b\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u043c \u0433\u0438\u0434\u0440\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u0437\u044b\u0441\u043a\u0430\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0442\u0443\u0440\u043d\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f, \u043d\u043e \u0438 \u043a\u0430\u043c\u0435\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0433\u0438\u0434\u0440\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0413\u0418\u0421 (\u0433\u0435\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c). \u041e\u0434\u043d\u0430\u043a\u043e, \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0433\u0438\u0434\u0440\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u043e \u0432 \u0432\u0438\u0434\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441. <\/p>\n<p>  <\/p>\n<p>\u0412\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0438 \u0433\u0438\u0434\u0440\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u0433\u0440\u0430\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043e\u0434\u043e\u0442\u043e\u043a\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u043f\u0440\u0438\u043d\u044f\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431: \u0440\u0435\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0441\u043f\u043b\u043e\u0448\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0435\u0439 \u0441 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u043c (\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0432 \u0440\u0435\u043a\u0443 \u043f\u0440\u0438\u0442\u043e\u043a\u043e\u0432) \u0443\u0442\u043e\u043b\u0449\u0435\u043d\u0438\u0435\u043c \u043e\u0442 \u0438\u0441\u0442\u043e\u043a\u0430 \u043a \u0443\u0441\u0442\u044c\u044e. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043b\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0441\u0442\u043e\u043a\u0430. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432\u0430\u0436\u043d\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u0430 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0434\u043e\u0442\u043e\u043a\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c (\u0420\u0438\u0441. 1):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ni\/cl\/kp\/niclkpxhm5gz7io9p3j-1k6qbew.png\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0417\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0434\u043e\u0442\u043e\u043a\u043e\u0432, \u0446\u0438\u0444\u0440\u0430\u043c\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0443 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0442\u043e\u043a\u043e\u0432<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0443 \u0440\u0435\u043a\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e \u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a. <\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0413\u0418\u0421, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a ArcGIS \u0438\u043b\u0438 \u0435\u0433\u043e open-source \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442 QGIS, \u0438\u043c\u0435\u044e\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u043a \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0438, \u043a\u0430\u043a \u043d\u0430\u043c \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439. \u0422\u0430\u043a, \u0440\u0435\u0434\u043a\u043e \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438 \u0432 \u0413\u0418\u0421 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u0435\u0437 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0435\u043b\u044c\u0435\u0444\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c, \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u043e\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u0441\u043b\u043e\u0438 \u0441 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u044c\u044e \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0447\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u043e\u0441\u043d\u043e\u0432 \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 (OpenStreetMap, Natural Earth, \u0412\u0421\u0415\u0413\u0415\u0418). <\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u0435\u0440\u044f\u0435\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u043e\u0434\u043e\u0441\u0431\u043e\u0440\u043d\u044b\u0439 \u0431\u0430\u0441\u0441\u0435\u0439\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0442\u044b\u0441\u044f\u0447 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u2014 \u0432 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0430 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u0431\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u043e\u0432. \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0433\u0435\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b QGIS \u2014 &quot;Lines Ranking&quot;. \u041a\u043e\u0434 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 QGIS, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/ChrisLisbon\/QGIS_LinesRankingPlugin\" rel=\"nofollow\">GitHub<\/a>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0432\u0435\u0440\u0441\u0438\u044f QGIS &gt;= 3.14, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Python \u2014 networkx \u0438 pandas. <\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 (Line, MultiLine). \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043b\u043e\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u043c\u0438. <\/p>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043f\u043e\u043b\u0435 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u201cfid\u201d. \u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u044b\u0432\u043e\u0432 \u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u0430 GRASS \u2014 v.clean \u2014 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u044b\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u0430 (Start Point Coordinates), \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u044c\u044f \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0430 \u0441 \u043a\u0430\u0440\u0442\u044b, \u0438\u0437 \u0444\u0430\u0439\u043b\u0430, \u043b\u0438\u0431\u043e \u0438\u0437 \u0441\u043b\u043e\u044f, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0432 QGIS. \u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u043c, \u0432 \u0440\u0430\u0441\u0447\u0435\u0442 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u043a \u0442\u043e\u0447\u043a\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (\u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0433\u0440\u0430\u0444\u0430). <\/p>\n<p>  <\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0443 \u0440\u0435\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e \u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0442\u043e\u043a\u043e\u0432, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0442\u043e\u043a\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u0434\u0430\u043b\u044c\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u043e\u0442 \u0443\u0441\u0442\u044c\u044f. <\/p>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"opisanie-algoritma\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u0439 \u0413\u0418\u0421 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445: \u0440\u0430\u0441\u0442\u0440\u043e\u0432\u043e\u043c \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c. \u0420\u0430\u0441\u0442\u0440 \u2014 \u044d\u0442\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0430, \u0433\u0434\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0438\u043a\u0441\u0435\u043b\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u0412 \u0440\u0430\u0441\u0442\u0440\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432 \u041d\u0430\u0443\u043a\u0430\u0445 \u043e \u0417\u0435\u043c\u043b\u0435 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u0432\u044b\u0435 \u0441\u043d\u0438\u043c\u043a\u0438, \u043f\u043e\u043b\u044f \u0440\u0435\u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0441\u043b\u043e\u0438 \u0438\u0437 \u043a\u043b\u0438\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0434\u0440. \u0412\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0442\u043e\u0447\u043a\u0438, \u043b\u0438\u043d\u0438\u0438 \u0438 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u044b. \u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u0412\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0434 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. <\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u2014 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0442 \u0443\u0441\u0442\u044c\u044f \u0440\u0435\u043a\u0438 \u0438 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0442\u043e\u043a\u043e\u0432. <\/p>\n<p>  <\/p>\n<h3 id=\"predobrabotka-vhodnyh-dannyh\">\u041f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  <\/p>\n<p>\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d\u0430. \u041f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\/\u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0413\u0418\u0421, \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0438 \u0442.\u0434. \u041f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f \u0441\u043b\u043e\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0442.\u0435. \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u044b\u0432\u043e\u0432 (\u0420\u0438\u0441. 2), \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439, \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439 \u0438 \u0442.\u043f. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/08\/-j\/89\/08-j895tamy-hwuuxvr4nt9mj9k.png\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u041d\u0430\u0440\u0443\u0448\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u044b\u043c \u044d\u0442\u0430\u043f\u043e\u043c \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432: \u201c\u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u044c\u201c \u0443\u0437\u043b\u044b, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u044b\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u043f\u0430\u043d\u0435\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 QGIS \u2013 \u201c\u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438\u201d (fixgeometries \u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439) \u0438 v.clean (\u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 GRASS). <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430, \u0441\u043b\u043e\u0439 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u0442\u043e\u0447\u043a\u0430\u0445 \u0441\u043e\u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0439. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0438\u0436\u0435 (\u0420\u0438\u0441. 3). <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ei\/d8\/ln\/eid8lnk41akl447hsh8ud7qkoic.png\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. \u0420\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 QGIS &quot;\u0420\u0430\u0437\u0431\u0438\u0442\u044c \u043b\u0438\u043d\u0438\u044f\u043c\u0438&quot; (splitwithlines \u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439) \u043c\u044b \u0434\u0435\u043b\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u043d\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 QGIS \u043c\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u0437\u0430\u043d\u043e\u0441\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043b\u043e\u044f (\u0420\u0438\u0441. 4). \u0414\u043b\u0438\u043d\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u041f\u0440\u043e\u0435\u043a\u0442 -&gt; \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 -&gt; \u041e\u0431\u0449\u0438\u0435 -&gt; \u042d\u043b\u043b\u0438\u043f\u0441\u043e\u0438\u0434). <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4r\/fm\/8t\/4rfm8tg7zrzcclqoyhkrvvhpt4q.png\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u0420\u0430\u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 &quot;\u041f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0438\u0439&quot; (lineintersections \u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439) \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u0433\u0434\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0437\u0430\u043d\u0435\u0441\u0435\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432. \u0422\u0430\u043a\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438. <\/p>\n<p>  <\/p>\n<p>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u044d\u0442\u0430\u043f\u044b \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 (\u0420\u0438\u0441. 5).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/s8\/9n\/xc\/s89nxcbbojurrpi6ebro4ebezss.png\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 5. \u042d\u0442\u0430\u043f\u044b \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0432 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0430 <\/p>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0433\u0440\u0430\u0444 \u043a\u0430\u043a \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 networkx. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u0440\u0435\u043a\u0438 \u2014 \u044d\u0442\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0433\u0440\u0430\u0444\u0430, \u0435\u0441\u043b\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 (\u0438\u043c\u0435\u044e\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f), \u0442\u043e \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u0435\u0441\u0442\u044c \u0440\u0435\u0431\u0440\u0430. <\/p>\n<p>  <\/p>\n<h3 id=\"algoritm-ranzhirovaniya-lineynyh-obektov\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0433\u0440\u0430\u0444 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d, \u043d\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0438\u0437 \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434 (\u0442\u043e\u0447\u043a\u0430 \u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0440\u0435\u043a\u0438 \u0432 \u0432\u043e\u0434\u043e\u0435\u043c). \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0451 &quot;\u0432\u043f\u0430\u0434\u0430\u044e\u0442&quot; \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (\u0432\u0435\u0440\u0448\u0438\u043d\u044b). \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439: <\/p>\n<p>  <\/p>\n<ol>\n<li>\u0420\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d \u0433\u0440\u0430\u0444\u0430 \u043f\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0441 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;rank&quot; (\u043c\u0435\u0440\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430) \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;offspring&quot; (\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438); <\/li>\n<li>\u041e\u0431\u0445\u043e\u0434 \u0433\u0440\u0430\u0444\u0430 \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e \u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043e\u0434\u043e\u0442\u043e\u043a\u043e\u0432 &quot;value&quot; \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;distance&quot; (\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u043e\u0442 \u0443\u0441\u0442\u044c\u044f \u0432 \u043c\u0435\u0442\u0440\u0430\u0445). <\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041e\u0431\u0430 \u044d\u0442\u0430\u043f\u0430 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043b\u043e\u043a\u043e\u0432, \u043e\u0434\u043d\u0430\u043a\u043e, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u044d\u0442\u0430\u043f\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. <\/p>\n<p>  <\/p>\n<h4 id=\"prisvaivanie-atributov-rank-i-offspring\">\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 &quot;rank&quot; \u0438 &quot;offspring&quot;<\/h4>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u044d\u0442\u0430\u043f\u0443 \u043e\u0431\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0430 \u2014 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d \u043f\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0439. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;rank&quot; \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u0431\u0445\u043e\u0434\u0430 \u0432 \u0448\u0438\u0440\u0438\u043d\u0443. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b, \u043c\u044b \u0431\u044b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u043e\u0442\u0434\u0430\u043b\u044f\u043b\u0438\u0441\u044c \u0432\u0441\u0435 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435, \u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c, \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043b\u0438 \u0431\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442. \u041d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 (\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043d\u0438\u0436\u0435) <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3n\/os\/ux\/3nosuxt9rzjsjsrgeqmy7h_tkz0.gif\"><\/p>\n<p>  <\/p>\n<p>\u0418 \u043a\u0430\u043a\u043e\u0439 \u0440\u0430\u043d\u0433 \u043d\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0443? \u0412\u043e\u043e\u0431\u0449\u0435, \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043d\u043e \u043c\u044b \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u043e\u0434\u043d\u0443 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445. <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u043c\u043e\u0436\u043d\u043e \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u043d\u0433\u0438 \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (\u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0440\u0435\u043a\u0438), \u0438 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u0443\u0436\u0435 \u043d\u0430 \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439 (\u0420\u0438\u0441. 6). <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l4\/pq\/7k\/l4pq7k0ntudmltmp6tdvykrmc3q.png\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 6. \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u043f\u0443\u0442\u0435\u043c \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u043f\u043e\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0432 \u0433\u0440\u0430\u0444\u0435 <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u0434\u0433\u0440\u0430\u0444\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043c\u044b\u043a\u0430\u0442\u044c \u043a \u043e\u043f\u043e\u0440\u043d\u043e\u043c\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 1 \u0440\u0435\u0431\u0440\u043e, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0431\u0440\u0430 \u2014 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f. <\/p>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u043a\u0430\u043a \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442? \u2014 \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u0432 \u0433\u0440\u0430\u0444\u0435, \u043e\u0434\u043d\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0439, \u2014 \u043e\u043f\u043e\u0440\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 (\u0441\u043a\u043e\u0440\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u0430\u044f \u0440\u0435\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0439, \u043d\u043e \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u043f\u043e\u0440\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c). \u0422\u0430\u043a\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 A* (A-star), \u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u043c \u0433\u0440\u0430\u0444\u0435, \u0430 \u043d\u0430 \u0440\u0435\u0431\u0440\u0430\u0445 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u0435\u0441\u043e\u0432 \u043d\u0435\u0442. \u041d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0435\u0441\u0430 \u0440\u0435\u0431\u0440\u0430\u043c \u0433\u0440\u0430\u0444\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u043b\u0438\u043d \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 (\u043c\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u0438\u0445 \u0440\u0430\u043d\u0435\u0435). <\/p>\n<p>  <\/p>\n<p>1) \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0441\u043e\u0432 \u0440\u0435\u0431\u0440\u0430\u043c \u0433\u0440\u0430\u0444\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432. \u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c \u044d\u0442\u0430\u043f\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u0438 \u0432 \u0433\u0440\u0430\u0444\u0435. \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u0433\u0440\u0430\u0444\u0443 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0448\u0438\u0440\u0438\u043d\u0443. \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u043e\u043c (\u0420\u0438\u0441. 7)<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rm\/bw\/ek\/rmbwekcql-i-h3kfhskpyiu8qjw.png\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 7. \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0441\u043e\u0432 \u0440\u0435\u0431\u0440\u0430\u043c \u0433\u0440\u0430\u0444\u0430 <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u0436\u0434\u0430\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u0433\u0440\u0430\u0444\u0430 \u0438\u043c\u0435\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 &quot;length&quot;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u043a\u0438 \u0432 \u043c\u0435\u0442\u0440\u0430\u0445. \u041c\u044b \u0436\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0441 \u0432\u0435\u0440\u0448\u0438\u043d \u0433\u0440\u0430\u0444\u0430 \u043d\u0430 \u0440\u0435\u0431\u0440\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0431\u0445\u043e\u0434 \u0433\u0440\u0430\u0444\u0430 \u0432 \u0448\u0438\u0440\u0438\u043d\u0443 \u0438\u0437 \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b. <\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">distance_attr<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>Input:<\/p>\n<p>  <\/p>\n<ul>\n<li>G \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0433\u0440\u0430\u0444<\/li>\n<li>start \u2014 \u0432\u0435\u0440\u0448\u0438\u043d\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434<\/li>\n<li>dataframe \u2014 pandas \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 2 \u0441\u0442\u043e\u043b\u0431\u0446\u0430: id_field (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\/\u0432\u0435\u0440\u0448\u0438\u043d\u044b) \u0438 &#8216;length&#8217; (\u0434\u043b\u0438\u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430)<\/li>\n<li>id_field \u2014 \u043f\u043e\u043b\u0435 \u0432 dataframe, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u0430<\/li>\n<li>main_id \u2014 \u0438\u043d\u0434\u0435\u043a\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0440\u0435\u043a\u0430 \u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e = None)<\/li>\n<\/ul>\n<p>  <\/p>\n<p>Output:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u0433\u0440\u0430\u0444\u0435 \u0440\u0435\u0431\u0440\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0441\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u0430 1, \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u0441 \u043d\u0435\u0439 \u0443\u0437\u043b\u044b \u0433\u0440\u0430\u0444\u0430: 2 \u0438 3, \u0433\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &#8216;length&#8217; \u0434\u043b\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 1 \u2014 10, 2 \u2014 15, 3 \u2014 20. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0431\u0440\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: (1, 2) \u0438 (2, 1) \u2014 15; (1, 3) \u0438 (3, 1) \u2014 20 \u0438 \u0442.\u0434.<\/li>\n<li>last_vertex \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0432 \u0433\u0440\u0430\u0444\u0435 (\u0434\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u043f\u0443\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0430\u043c\u044b\u043c\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438)<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"python\"># Function for assigning weights to graph edges def distance_attr(G, start, dataframe, id_field, main_id = None):      # List of all vertexes that can be reached from the start vertex using BFS     vert_list = list(nx.bfs_successors(G, source=start))     # One of the most remote vertices in the graph (this will be necessary for A*)     last_vertex = vert_list[-1][-1][0]      for component in vert_list:         vertex = component[0]  # The vertex where we are at this iteration         neighbors = component[1]  # Vertices that are neighboring (which we haven't visited yet)          dist_vertex = int(dataframe['length'][dataframe[id_field] == vertex])         # Assign the segment length value as a vertex attribute         attrs = {vertex: {'component' : 1, 'size' : dist_vertex}}         nx.set_node_attributes(G, attrs)          for n in neighbors:                # If the main index value is not set             if main_id == None:                 # Assign weights to the edges of the graph                 # The length of the section in meters (int)                 dist_n = int(dataframe['length'][dataframe[id_field] == n])                # Otherwise we are dealing with a complex composite index             else:                 # If the vertex we are at is part of the main river                 if vertex.split(':')[0] == main_id:                     # And at the same time, the vertex that we &quot;look&quot; at from the vertex &quot;vertex&quot; also, then                     if n.split(':')[0] == main_id:                         # The weight value must be zero                         dist_n = 0                     else:                         dist_n = int(dataframe['length'][dataframe[id_field] == n])                 else:                     dist_n = int(dataframe['length'][dataframe[id_field] == n])             attrs = {(vertex, n): {'weight': dist_n},                      (n, vertex): {'weight': dist_n}}             nx.set_edge_attributes(G, attrs)                  # Assign attributes to the nodes of the graph             attrs = {n: {'component' : 1, 'size' : dist_n}}             nx.set_node_attributes(G, attrs)          # Look at the surroundings of the vertex where we are located         offspring = list(nx.bfs_successors(G, source = vertex, depth_limit = 1))          offspring = offspring[0][1]         # If the weight value was not assigned, we assign it         for n in offspring:              if len(G.get_edge_data(vertex, n)) == 0:                  ##############################                 # Assigning weights to edges #                 ##############################                 if main_id == None:                     dist_n = int(dataframe['length'][dataframe[id_field] == n])                    else:                     if vertex.split(':')[0] == main_id:                         if n.split(':')[0] == main_id:                             dist_n = 0                         else:                             dist_n = int(dataframe['length'][dataframe[id_field] == n])                     else:                         dist_n = int(dataframe['length'][dataframe[id_field] == n])                 attrs = {(vertex, n): {'weight': dist_n},                          (n, vertex): {'weight': dist_n}}                 nx.set_edge_attributes(G, attrs)                 ##############################                 # Assigning weights to edges #                 ##############################              elif len(G.get_edge_data(n, vertex)) == 0:                  ##############################                 # Assigning weights to edges #                 ##############################                 if main_id == None:                     dist_n = int(dataframe['length'][dataframe[id_field] == n])                    else:                     if vertex.split(':')[0] == main_id:                         if n.split(':')[0] == main_id:                             dist_n = 0                         else:                             dist_n = int(dataframe['length'][dataframe[id_field] == n])                     else:                         dist_n = int(dataframe['length'][dataframe[id_field] == n])                 attrs = {(vertex, n): {'weight': dist_n},                          (n, vertex): {'weight': dist_n}}                 nx.set_edge_attributes(G, attrs)                     ##############################                 # Assigning weights to edges #                 ##############################      for vertex in list(G.nodes()):         # If the graph is incompletely connected, then we delete the elements that we can't get to         if G.nodes[vertex].get('component') == None:             G.remove_node(vertex)         else:             pass         return(last_vertex)      # The application of the algorithm last_vertex = distance_attr(G, '7126:23', dataframe, id_field = 'id', main_id = '7126')<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>2) A* (\u0410-star) \u043f\u043e\u0438\u0441\u043a \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u043f\u0443\u0442\u0438 \u043d\u0430 \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u043c \u0433\u0440\u0430\u0444\u0435 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0439 \u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d (\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438). \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0430\u043c\u044b\u043c\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u0432 \u0433\u0440\u0430\u0444\u0435 \u043c\u044b \u043d\u0430\u0437\u043e\u0432\u0435\u043c &quot;\u043e\u043f\u043e\u0440\u043d\u044b\u043c&quot;; <\/p>\n<p>  <\/p>\n<p>3) \u0420\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u0432 \u043e\u043f\u043e\u0440\u043d\u043e\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0435. \u0412\u0435\u0440\u0448\u0438\u043d\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u0431\u0445\u043e\u0434, \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u043d\u0433\u0430 1, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u2014 2, \u0434\u0430\u043b\u0435\u0435 \u2014 3 \u0438 \u0442.\u0434. <\/p>\n<p>  <\/p>\n<p>4) \u0418\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u0433\u0440\u0430\u0444\u0430 \u0441 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u0445 \u043e\u043f\u043e\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0441 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0435\u0439 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u0434\u0433\u0440\u0430\u0444\u043e\u0432. \u0415\u0441\u043b\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0435\u0442\u0432\u0435\u0439 \u0433\u0440\u0430\u0444\u0430 \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u043e\u043f\u043e\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430, \u0442\u043e \u0440\u0435\u0431\u0440\u0430, \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0433\u0440\u0430\u0444 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u043f\u043e\u0440\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438, \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f. <\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0438\u0436\u0435<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">rank_set<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>Input:<\/p>\n<p>  <\/p>\n<ul>\n<li>G \u2014 \u0433\u0440\u0430\u0444 \u0441 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0441\u0430\u043c\u0438 \u043d\u0430 \u0440\u0435\u0431\u0440\u0430\u0445<\/li>\n<li>start \u2014 \u0432\u0435\u0440\u0448\u0438\u043d\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434<\/li>\n<li>last_vertex \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0432 \u0433\u0440\u0430\u0444\u0435<\/li>\n<\/ul>\n<p>  <\/p>\n<p>Output:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041a\u0430\u0436\u0434\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0433\u0440\u0430\u0444\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0440\u0430\u043d\u0433\u0430 \u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u0420\u0430\u043d\u0433 1 \u0438\u043c\u0435\u0435\u0442 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0440\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0438\u043c \u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u0420\u0430\u043d\u0433 2 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u0442\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0440\u0430\u043d\u0433\u0430 1. \u0420\u0430\u043d\u0433 3 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u0442\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0440\u0430\u043d\u0433\u0430 2 \u0438 \u0442.\u0434. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0433\u0440\u0430\u0444\u0430 \u0438\u043c\u0435\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &#8216;rank&#8217;, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b &#8216;offspring&#8217;. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &#8216;offspring&#8217; \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a &#8216;\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438&#8217;.<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"python\"># Function for assigning 'rank' and 'offspring' attributes to graph vertices def rank_set(G, start, last_vertex):      # Traversing a graph with attribute assignment     # G           --- graph as a networkx object     # vertex      --- vertex from which the graph search begins     # kernel_path --- list of vertexes that are part of the main path that the search is being built from     def bfs_attributes(G, vertex, kernel_path):          # Creating a copy of the graph         G_copy = G.copy()          # Deleting all edges that are associated with the reference vertexes         for kernel_vertex in kernel_path:             # Leaving the reference vertex from which we start the crawl             if kernel_vertex == vertex:                 pass             else:                 # For all other vertexes, we delete edges                 kernel_n = list(nx.bfs_successors(G_copy, source = kernel_vertex, depth_limit = 1))                    kernel_n = kernel_n[0][1]                 for i in kernel_n:                     try:                         G_copy.remove_edge(i, kernel_vertex)                     except Exception:                         pass          # The obtained subgraph is isolated from all reference vertices, except the one          # from which the search begins at this iteration                            # Breadth-first search         all_neighbors = list(nx.bfs_successors(G_copy, source = vertex))              # Attention!                                          # Labels are not assigned on an isolated subgraph, but on the source graph           for component in all_neighbors:             v = component[0] # The vertex where we are at this iteration             neighbors = component[1] # Vertices that are neighboring (which we haven't visited yet)              # Value of the 'rank' attribute in the considering vertex             att = G.nodes[v].get('rank')             if att != None:                 # The value of the attribute to be assigned to neighboring vertices                 att_number = att + 1              # We look at all the closest first offspring             first_n = list(nx.bfs_successors(G, source = v, depth_limit = 1))                first_n = first_n[0][1]              # Assigning ranks to vertices             for i in first_n:                  # If the neighboring vertex is the main node in this iteration, then skip it                 # vertex - the reference point from which we started the search                 if i == vertex:                     pass                  else:                     current_i_rank = G.nodes[i].get('rank')                     # If the rank value has not yet been assigned, then assign it                     if current_i_rank == None:                         attrs = {i: {'rank': att_number}}                         nx.set_node_attributes(G, attrs)                     # If the rank in this node is already assigned                     else:                         # The algorithm either &quot;looks back&quot; at vertices that it has already visited                         # In this case we don't do anything                         # Either the algorithm &quot;came up&quot; to the main path (kernel path) in the graph                         if any(i == bearing_v for bearing_v in kernel_path):                             G.remove_edge(v, i)                         else:                             pass              # Additional &quot;search&quot;             for neighbor in neighbors:                 # We look at all the closest first offspring                 first_n = list(nx.bfs_successors(G, source = neighbor, depth_limit = 1))                    first_n = first_n[0][1]                  for i in first_n:                      # If the neighboring vertex is the main node in this iteration, then skip it                     # vertex - the reference point from which we started the search                     if i == vertex:                         pass                      else:                         # The algorithm either &quot;looks back&quot; at vertices that it has already visited                         # In this case we don't do anything                         # Either the algorithm &quot;came up&quot; to the main path (kernel path) in the graph                         if any(i == bearing_v for bearing_v in kernel_path):                             G.remove_edge(neighbor, i)                         else:                             pass                     # Finding the shortest path A* - building a route around which we will build the next searchs     a_path = list(nx.astar_path(G, source = start, target = last_vertex, weight = 'weight'))      ##############################     #   Route validation block   #     ##############################     true_a_path = []     for index, V in enumerate(a_path):         if index == 0:             true_a_path.append(V)         elif index == (len(a_path) - 1):             true_a_path.append(V)         else:             # Previous and next vertices for the reference path (a_path)             V_prev = a_path[index - 1]             V_next = a_path[index + 1]              # Which vertexes are adjacent to this one             V_prev_neighborhood = list(nx.bfs_successors(G, source = V_prev, depth_limit = 1))              V_prev_neighborhood = V_prev_neighborhood[0][1]             V_next_neighborhood = list(nx.bfs_successors(G, source = V_next, depth_limit = 1))             V_next_neighborhood = V_next_neighborhood[0][1]              # If the next and previous vertices are connected to each other without an intermediary             # in the form of vertex V, then vertex V is excluded from the reference path             if any(V_next == VPREV for VPREV in V_prev_neighborhood):                 if any(V_prev == VNEXT for VNEXT in V_next_neighborhood):                     pass                 else:                     true_a_path.append(V)             else:                 true_a_path.append(V)     ##############################     #   Route validation block   #     ##############################      # Verification completed     a_path = true_a_path          RANK = 1     for v in a_path:         # Assign the attribute rank value - 1 to the starting vertex. The further away, the greater the value         attrs = {v: {'rank' : RANK}}         nx.set_node_attributes(G, attrs)          RANK += 1      # The main route is ready, then we will iteratively move from each node     for index, vertex in enumerate(a_path):         # Starting vertex         if index == 0:             next_vertex = a_path[index + 1]              # Disconnect vertices             G.remove_edge(vertex, next_vertex)              # Subgraph BFS block             bfs_attributes(G, vertex = vertex, kernel_path = a_path)                    # Connect vertices back             G.add_edge(vertex, next_vertex)          # Finishing vertex         elif index == (len(a_path) - 1):             prev_vertex = a_path[index - 1]              # Disconnect vertices             G.remove_edge(prev_vertex, vertex)              # Subgraph BFS block             bfs_attributes(G, vertex = vertex, kernel_path = a_path)              # Connect vertices back             G.add_edge(prev_vertex, vertex)          # Vertices that are not the first or last in the reference path         else:             prev_vertex = a_path[index - 1]             next_vertex = a_path[index + 1]              # Disconnect vertices              # Previous with current vertex             try:                 G.remove_edge(prev_vertex, vertex)             except Exception:                 pass             # Current with next vertex             try:                 G.remove_edge(vertex, next_vertex)             except Exception:                 pass              # Subgraph BFS block             bfs_attributes(G, vertex = vertex, kernel_path = a_path)              # Connect vertices back             try:                 G.add_edge(prev_vertex, vertex)                 G.add_edge(vertex, next_vertex)             except Exception:                 pass      # Attribute assignment block - number of descendants      vert_list = list(nx.bfs_successors(G, source = start))      for component in vert_list:         vertex = component[0] # The vertex where we are at this iteration         neighbors = component[1] # Vertices that are neighboring (which we haven't visited yet)          # Adding an attribute - the number of descendants of this vertex         n_offspring = len(neighbors)         attrs = {vertex: {'offspring' : n_offspring}}         nx.set_node_attributes(G, attrs)<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dx\/7w\/gg\/dx7wgglbnxm_z3hh0q1g2e_xkog.gif\"><\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043f\u043e\u0440\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0440\u0435\u043a\u0443 \u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u0442\u043e\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0439. \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u043c\u0435\u0440\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f\u043c. <\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u043a \u0432 &quot;\u0441\u043b\u043e\u0436\u043d\u044b\u0445&quot; \u043c\u0435\u0441\u0442\u0430\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0443\u0441\u0442\u044c\u0435, \u0433\u0434\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0443\u043a\u0430\u0432\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u0445\u043e\u0434\u044f\u0442 \u043e\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0440\u0435\u043a\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c, \u043d\u0430\u0431\u0438\u0440\u0430\u044f \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u0442\u043e\u043a\u0438, \u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0440\u0435\u043a\u0443 \u0441\u043d\u043e\u0432\u0430. <\/p>\n<p>  <\/p>\n<h4 id=\"prisvaivanie-atributov-value-i-distance\">\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 &quot;value&quot; \u0438 &quot;distance&quot;<\/h4>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430 \u0433\u0440\u0430\u0444\u0435 \u0432\u0441\u0435\u043c \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 &quot;rank&quot; \u0438 &quot;offspring&quot;. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u0435\u0441\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443. <\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u0433\u0440\u0430\u0444\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432, \u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0438 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u0442\u043e\u043a \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043d\u0435 \u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &quot;value&quot; \u2014 1. \u0417\u0430\u0442\u0435\u043c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043c\u043a\u0438 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &quot;value&quot;, \u0440\u0430\u0432\u043d\u043e\u043c\u0443 1, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f &quot;value&quot; \u0443 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 (\u0440\u0430\u043d\u0433 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430 1 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0440\u0430\u043d\u0433 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b) \u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043a\u0430\u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432\u0435\u0440\u0448\u0438\u043d\u044b &quot;value&quot;. \u0417\u0430\u0442\u0435\u043c, \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u043d\u0433\u043e\u0432 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0433\u0440\u0430\u0444\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435. <\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">iter_set_values<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>Input:<\/p>\n<p>  <\/p>\n<ul>\n<li>G \u2014 \u0433\u0440\u0430\u0444 \u0441 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 &#8216;rank&#8217; \u0438 &#8216;offspring&#8217;<\/li>\n<li>start \u2014 \u0432\u0435\u0440\u0448\u0438\u043d\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434<\/li>\n<\/ul>\n<p>  <\/p>\n<p>Output:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041a\u0430\u0436\u0434\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0433\u0440\u0430\u0444\u0430 G \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &#8216;value&#8217;. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a &#8216;\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e \u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0442\u043e\u043a\u043e\u0432 \u0432 \u0434\u0430\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438&#8217;. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 &#8216;distance&#8217;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0443\u0441\u0442\u044c\u044f \u0440\u0435\u043a\u0438 \u0438\u0437 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"python\"># Function for determining the order of river segments similar to the Shreve method # In addition, the &quot;distance&quot; attribute is assigned def set_values(G, start, considering_rank, vert_list):       # For each vertex in the list     for vertex in vert_list:          # If value has already been assigned, then skip it         if G.nodes[vertex].get('value') == 1:             pass         else:                                 # Defining descendants             offspring = list(nx.bfs_successors(G, source = vertex, depth_limit = 1))              # We use only the nearest neighbors to this vertex (first descendants)             offspring = offspring[0][1]              # The cycle of determining the values at the vertices of a descendant             last_values = []             for child in offspring:                 # We only need descendants whose rank value is greater than that of the vertex                 if G.nodes[child].get('rank') &gt; considering_rank:                     if G.nodes[child].get('value') != None:                         last_values.append(G.nodes[child].get('value'))                     else:                         pass                 else:                     pass              last_values = np.array(last_values)             sum_values = np.sum(last_values)              # If the amount is not equal to 0, the attribute is assigned             if sum_values != 0:                 attrs = {vertex: {'value' : sum_values}}                 nx.set_node_attributes(G, attrs)             else:                 pass  # Function for iteratively assigning the value attribute def iter_set_values(G, start):      # Vertices and corresponding attribute values     ranks_list = []     vertices_list = []     offspring_list = []     for vertex in list(G.nodes()):         ranks_list.append(G.nodes[vertex].get('rank'))         vertices_list.append(vertex)         att_offspring = G.nodes[vertex].get('offspring')          if att_offspring == None:             offspring_list.append(0)          else:             offspring_list.append(att_offspring)      # Largest rank value in a graph     max_rank = max(ranks_list)      # Creating pandas dataframe     df = pd.DataFrame({'ranks': ranks_list,                        'vertices': vertices_list,                        'offspring': offspring_list})      # We assign value = 1 to all vertices of the graph that have no offspring     value_1_list = list(df['vertices'][df['offspring'] == 0])     for vertex in value_1_list:         attrs = {vertex: {'value' : 1}}         nx.set_node_attributes(G, attrs)       # For each rank, we begin to assign attributes     for considering_rank in range(max_rank, 0, -1):          # List of vertices of suitable rank         vert_list = list(df['vertices'][df['ranks'] == considering_rank])         set_values(G, start, considering_rank, vert_list)       # Assigning the &quot;distance&quot; attribute to the graph vertices     # List of all vertexes that can be reached from the start vertex using BFS     vert_list = list(nx.bfs_successors(G, source = start))     for component in vert_list:         vertex = component[0] # The vertex where we are at this iteration         neighbors = component[1] # Vertices that are neighboring (which we haven't visited yet)          # If we are at the closing vertex         if vertex == start:             # Length of this segment             att_vertex_size = G.nodes[vertex].get('size')             # Adding the value of the distance attribute             attrs = {vertex: {'distance' : att_vertex_size}}             nx.set_node_attributes(G, attrs)         else:             pass          vertex_distance = G.nodes[vertex].get('distance')                 # For each neighbor, we assign an attribute         for i in neighbors:                         # Adding the value of the distance attribute             i_size = G.nodes[i].get('size')             attrs = {i: {'distance' : (vertex_distance + i_size)}}             nx.set_node_attributes(G, attrs) <\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6z\/qj\/7k\/6zqj7k4gfqd7gixiu5rofmla38w.gif\"><\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c \u0433\u0440\u0430\u0444\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;value&quot;, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;distance&quot;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0442 \u0443\u0441\u0442\u044c\u044f \u043d\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0433\u043e, \u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432 \u043c\u0435\u0442\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0443\u0441\u0442\u044c\u044f \u0440\u0435\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 8. \u0423\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;rank&quot; \u0438 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0442\u043e\u043a\u043e\u0432 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;value&quot;. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_3\/n5\/ak\/_3n5ak8jnlzyqccebctbrrgwdyc.png\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 8. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 (\u0434\u0430\u043d\u043d\u044b\u0435 OpenStreetMap, \u0423\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;rank&quot;, \u0421\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0442\u043e\u043a\u043e\u0432- \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;value&quot;) <\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u0438 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0440\u0435\u043b\u044c\u0435\u0444\u0435 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u0440\u0435\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043c\u044b\u043a\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 (\u043c\u0435\u0441\u0442\u043e \u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u043a\u0438 \u0432 \u0432\u043e\u0434\u043e\u0435\u043c), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u043e\u0439. <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0443\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0440\u0435\u0447\u043d\u043e\u0433\u043e \u0431\u0430\u0441\u0441\u0435\u0439\u043d\u0430. <\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u0434\u043b\u044f QGIS \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u043e\u0439 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0439. \u0412\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c, \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. <\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u0430\u0448\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0430\u0448\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. <\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c: <\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/ChrisLisbon\/QGIS_LinesRankingPlugin\" rel=\"nofollow\">https:\/\/github.com\/ChrisLisbon\/QGIS_LinesRankingPlugin<\/a> <\/li>\n<\/ul>\n<p>  <\/p>\n<p><em>\u041d\u0430\u0434 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0438 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 <a href=\"mailto:mik_sar@mail.ru\">\u041c\u0438\u0445\u0430\u0438\u043b \u0421\u0430\u0440\u0430\u0444\u0430\u043d\u043e\u0432<\/a>, <a href=\"mailto:yulashka.htm@yandex.ru\">\u042e\u043b\u0438\u044f \u0411\u043e\u0440\u0438\u0441\u043e\u0432\u0430<\/a>.<\/em><\/p>\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\/post\/514526\/\"> https:\/\/habr.com\/ru\/post\/514526\/<\/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\/post\/514526\/\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. <\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044c \u0442\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0432 \u041d\u0430\u0443\u043a\u0430\u0445 \u043e \u0417\u0435\u043c\u043b\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, \u0432 \u0413\u0438\u0434\u0440\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u041a\u0430\u0440\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0434\u043e\u0442\u043e\u043a\u043e\u0432 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0433\u0435\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b QGIS.<\/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-308261","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308261","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=308261"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308261\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}