from matplotlib import pyplot as plt
from matplotlib import colormaps
from matplotlib.path import Path
from matplotlib.patches import PathPatch

import numpy as np
import geopandas as gpd
from shapely.wkt import loads
import cartagen as c4

lines = [
    loads('LineString (2459440.67929520783945918 6791611.68829361163079739, 2459461.48577152658253908 6791651.54963274113833904, 2459473.81507815746590495 6791666.09981536958366632, 2459495.52569979056715965 6791681.19816064275801182, 2459519.93750710459426045 6791688.92256504204124212, 2459546.06810071505606174 6791691.31178444437682629, 2459572.0657761488109827 6791689.32013384532183409, 2459594.10153172723948956 6791683.9297901438549161, 2459647.15732508013024926 6791666.22894053813070059, 2459675.30849418183788657 6791661.63895189389586449, 2459713.79502788465470076 6791665.44363944325596094, 2459757.74071742221713066 6791679.67826433479785919, 2459835.31351499259471893 6791719.5904786316677928, 2459937.3149596662260592 6791783.20646081026643515, 2459957.4727204367518425 6791799.62154494412243366, 2459980.3320505409501493 6791822.73392680194228888, 2460008.73509172396734357 6791862.23366802465170622, 2460020.17562218708917499 6791870.29480804689228535, 2460029.63618400739505887 6791871.92063434980809689, 2460070.8362882798537612 6791855.43556938972324133, 2460137.55294574191793799 6791819.94710129499435425, 2460311.596013393253088 6791720.24061395600438118, 2460333.11591076804324985 6791717.63596916850656271, 2460507.17433289019390941 6791750.21861570328474045, 2460537.34358859248459339 6791750.61461227387189865, 2460558.73315715510398149 6791744.40389445330947638, 2460570.17468881094828248 6791734.31904665660113096, 2460581.42236698418855667 6791717.96895493939518929, 2460750.91781987948343158 6791440.98996150214225054, 2460767.83044093381613493 6791426.18136229459196329, 2460825.92072643293067813 6791384.40577519964426756, 2461172.62960954010486603 6791071.79117763228714466, 2461182.29050580225884914 6791057.82245734520256519, 2461150.97452273406088352 6790926.9268284197896719, 2461121.36653309967368841 6790784.3028221195563674, 2461051.52915672678500414 6790473.76475678291171789, 2461048.74829890113323927 6790441.47955569159239531, 2461051.00146792456507683 6790428.15903065539896488, 2461055.17708704294636846 6790419.13525037374347448, 2461307.4173445706255734 6790226.91630895715206861, 2461455.03342237463220954 6790211.88452494144439697, 2461487.50527056585997343 6790193.42738751415163279, 2461516.13861407712101936 6790162.88635605107992887, 2461587.1533814799040556 6790074.09850280918180943, 2461591.22108065150678158 6790069.0158523665741086, 2461603.28377944603562355 6790042.40067447815090418, 2461628.31784908846020699 6789921.64138718321919441, 2461634.93289048736914992 6789903.31617049686610699, 2461644.6596345636062324 6789886.43456546124070883, 2461688.43824503943324089 6789834.28790227137506008, 2461730.163251927588135 6789793.51258569862693548, 2461769.27423609141260386 6789764.65827248990535736, 2461827.94365061307325959 6789730.23219382297247648, 2461852.64036440383642912 6789722.4200329864397645, 2461923.63928095111623406 6789717.66580413561314344, 2462168.3768081646412611 6789655.46210785862058401, 2462223.30566486623138189 6789651.64584146719425917, 2462280.64958696626126766 6789661.84306936711072922, 2462306.45067357178777456 6789659.99783613719046116, 2462331.27532845130190253 6789652.63127454090863466, 2462384.56986810779199004 6789629.01359210070222616, 2462409.07115483749657869 6789620.60930611472576857, 2462514.75548135815188289 6789605.43680470250546932, 2462624.46511923288926482 6789577.01674253679811954, 2462685.16189643973484635 6789554.46933614928275347, 2462794.67482494236901402 6789498.33626685943454504, 2462840.42536762310191989 6789467.63786949962377548, 2462961.15329981874674559 6789380.23661233764141798, 2462994.38501035142689943 6789360.07550590764731169, 2463044.58613610174506903 6789339.32252279482781887, 2463132.75277552846819162 6789267.51725598052144051, 2463172.90317817684262991 6789230.1122110765427351, 2463212.35122700082138181 6789182.68952151760458946, 2463251.40371696278452873 6789122.96705845929682255, 2463259.50811332324519753 6789101.63351981993764639, 2463266.52576931146904826 6789073.15044269245117903, 2463276.13521562609821558 6789002.37194403819739819, 2463274.92482608929276466 6788966.66848392598330975, 2463264.05029314337298274 6788913.3197061475366354, 2463219.69954412104561925 6788865.78349534794688225, 2463183.50003872346132994 6788838.36999867483973503, 2462969.21685629710555077 6788731.04496034327894449, 2462918.90832022251561284 6788701.45085682347416878, 2462874.6643675728701055 6788663.53083535376936197, 2462826.13943059230223298 6788615.68477531149983406, 2462804.64026067033410072 6788590.76774146221578121, 2462794.25726621737703681 6788571.02756388392299414, 2462792.0653946571983397 6788554.80372242629528046, 2462793.91624694271013141 6788538.29265655111521482, 2462799.22342647332698107 6788523.14312541671097279, 2462809.81442562118172646 6788506.39202004484832287, 2462891.56583119044080377 6788414.37318756990134716, 2462989.19504067068919539 6788310.24612198676913977, 2463068.95144490245729685 6788233.6997319059446454, 2463322.00836181826889515 6788209.39663138147443533, 2463353.49109030002728105 6788200.10749122127890587, 2463364.12834122125059366 6788193.1281830221414566, 2463380.59168789116665721 6788177.63061074167490005, 2463405.93771040672436357 6788143.42628787830471992, 2463415.36891236854717135 6788123.04254166968166828, 2463490.29599699936807156 6787950.23956310376524925, 2463513.19829967897385359 6787907.44890133664011955, 2463539.15919669810682535 6787878.47806420549750328, 2463596.55560203129425645 6787848.20002615731209517, 2463617.67849037842825055 6787840.01283477526158094, 2463642.88680061465129256 6787833.08294331189244986, 2463704.7315686889924109 6787823.02732573822140694, 2463723.9074803558178246 6787820.26642353180795908, 2463853.06219802238047123 6787810.90501171536743641, 2463908.66118599753826857 6787801.29400460422039032, 2463940.44499873463064432 6787795.12360523641109467, 2463959.45743573410436511 6787791.65067857783287764, 2463990.57699359674006701 6787782.53485786821693182, 2464030.27029112027958035 6787767.70920614711940289, 2464044.52586139505729079 6787760.10057281889021397, 2464057.08385519310832024 6787750.13028100412338972, 2464073.15765837207436562 6787733.72749079111963511, 2464084.91682005999609828 6787718.14660541526973248, 2464096.79832212161272764 6787695.22879662923514843, 2464105.69044432882219553 6787667.1478115813806653, 2464144.56613675178959966 6787479.46749724727123976, 2464161.46142565552145243 6787413.76870497036725283, 2464172.39793890947476029 6787390.26380501128733158, 2464194.01191415591165423 6787353.74012083373963833, 2464236.32352835079655051 6787290.17620095890015364)'), 
    loads('LineString (2459692.08026398019865155 6789428.79466401692479849, 2459716.18479695310816169 6789374.83002235274761915, 2459734.47997754439711571 6789352.00304303038865328, 2459759.54120649909600616 6789331.66201143525540829, 2459800.29401924787089229 6789311.42605256661772728, 2459833.71514197252690792 6789298.67307038698345423, 2459864.73665989004075527 6789289.50930774305015802, 2459929.01110705314204097 6789281.36696397047489882, 2460067.15295888157561421 6789246.33164042141288519, 2460159.81793693825602531 6789230.3929959163069725, 2460217.87867371691390872 6789224.50032423343509436, 2460266.19176414189860225 6789223.65876515582203865, 2460311.3494346309453249 6789227.66639750730246305, 2460381.97228881902992725 6789238.6460608309134841, 2460493.4232786213979125 6789259.18698956072330475, 2460610.53311725286766887 6789284.71446588914841413, 2460730.94999117264524102 6789328.72414372581988573, 2460794.90841858228668571 6789339.88924675807356834, 2460846.51273795403540134 6789344.15018501877784729, 2460878.60033412277698517 6789340.47651690524071455, 2460903.72648113127797842 6789333.63740267977118492, 2460915.63654102943837643 6789328.17297464329749346, 2460932.78464210918173194 6789313.55067839380353689, 2460971.73667232692241669 6789274.34137848950922489, 2461002.02713150018826127 6789249.69680206850171089, 2461023.3990844446234405 6789234.59731684159487486, 2461043.13620255421847105 6789223.65357459802180529, 2461091.82753853918984532 6789206.78076854348182678, 2461168.37134384596720338 6789191.68797081802040339, 2461265.39397674426436424 6789185.22838328313082457, 2461310.36501725995913148 6789178.5550736328586936, 2461350.59754995163530111 6789166.29564163740724325, 2461381.14254342904314399 6789148.11686721723526716, 2461408.82982863392680883 6789125.42267443798482418, 2461508.19046123279258609 6789032.91187251545488834, 2461548.54523830907419324 6788995.40751798264682293, 2462139.57677861163392663 6788431.75900372583419085, 2462183.51787997130304575 6788393.44457090646028519, 2462274.21658497070893645 6788320.00781893637031317, 2462323.94588800892233849 6788312.14341992139816284, 2462369.25548739265650511 6788315.52700468339025974, 2462388.56759416684508324 6788314.82586890552192926, 2462921.14553122315555811 6788255.94201309606432915, 2463068.95144490245729685 6788233.6997319059446454)'), 
    loads('LineString (2459372.49106207769364119 6787299.43690733052790165, 2459400.85279302066192031 6787302.74445221107453108, 2459474.33894758345559239 6787315.47977398335933685, 2459532.83443806366994977 6787322.17479560896754265, 2459562.31279778899624944 6787324.03708007000386715, 2459587.86342977499589324 6787322.1617543138563633, 2459633.7140357093885541 6787308.8355900477617979, 2459796.755495335906744 6787235.26927313487976789, 2459864.97785922372713685 6787197.36331601161509752, 2459897.04450474306941032 6787182.3792759720236063, 2459927.91679689520969987 6787173.56649596150964499, 2460096.83599806763231754 6787137.93954472988843918, 2460145.46582016162574291 6787137.81696076225489378, 2460164.57595643820241094 6787135.16069560218602419, 2460196.03060815623030066 6787127.02387972176074982, 2460226.42382459575310349 6787115.85221610590815544, 2460258.93464466463774443 6787101.03747689258307219, 2460287.00214099744334817 6787084.87923259939998388, 2460378.26143926195800304 6787017.16278207954019308, 2460410.44712475128471851 6786995.65919925551861525, 2460456.99163494538515806 6786969.71281938161700964, 2460490.97228689910843968 6786958.1972914207726717, 2460506.58026922820135951 6786956.98731875047087669, 2460731.29665325861424208 6787005.02892779000103474, 2460790.85108810150995851 6787029.51769810635596514, 2460891.72752544097602367 6787082.17232644371688366, 2460935.89636998483911157 6787102.48293286375701427, 2460981.83942486718297005 6787119.1116663608700037, 2461019.73303487664088607 6787126.07304961606860161, 2461058.58619484212249517 6787127.91393229644745588, 2461110.57194667356088758 6787126.50744784437119961, 2461213.34817671170458198 6787116.98575624451041222, 2461342.93789980234578252 6787095.94813020899891853, 2461365.34614278469234705 6787093.23072043620049953, 2461417.21068047778680921 6787093.42073457315564156, 2461455.77924834424629807 6787098.3886041697114706, 2461533.92556249583140016 6787119.67959155980497599, 2461595.40862356266006827 6787139.99538664426654577, 2461625.08060346357524395 6787152.68543391115963459, 2461699.83606364578008652 6787191.66006064973771572, 2461748.36111236969009042 6787209.6539866030216217, 2461800.9223968330770731 6787226.28682200610637665, 2461952.00098260305821896 6787262.50671255681663752, 2462463.83935287175700068 6787380.94653479382395744, 2462679.17680600425228477 6787407.29631377756595612, 2462747.99499073112383485 6787426.15730543620884418, 2462773.31695237709209323 6787430.79811702016741037, 2462857.50538998609408736 6787432.81326840445399284, 2463092.76347169000655413 6787457.08318567555397749, 2463192.41974565200507641 6787463.18147189728915691, 2463381.77535698423162103 6787465.78479627706110477, 2463471.99297529133036733 6787474.67523976229131222, 2463523.77801578072831035 6787477.20031244028359652, 2463578.65122884372249246 6787473.75719075929373503, 2463639.16182765178382397 6787461.43823106121271849, 2463681.33711926639080048 6787445.3268234608694911, 2463760.96592277986928821 6787400.90657317172735929, 2463796.25673683639615774 6787385.35148652549833059, 2463836.72643495816737413 6787375.04111182596534491, 2463923.63084818841889501 6787362.05552109237760305, 2464087.87167752487584949 6787332.41710502933710814, 2464168.43352443305775523 6787308.06419429276138544, 2464236.32352835079655051 6787290.17620095890015364, 2464272.74636904057115316 6787232.03305351361632347, 2464292.09700463945046067 6787206.23195574432611465, 2464339.25256017548963428 6787156.732216976583004, 2464379.88170693954452872 6787124.50220449920743704, 2464485.7594668110832572 6787062.41576257906854153, 2464658.57924438873305917 6786972.79916502349078655, 2464852.03604891011491418 6786888.21961512416601181, 2464881.6348369331099093 6786879.17715894989669323, 2464981.25907253194600344 6786867.34599742479622364, 2465046.68122305069118738 6786848.59442676790058613, 2465081.7019734657369554 6786842.96504321042448282, 2465146.48559360625222325 6786840.72157459147274494, 2465269.42010631738230586 6786844.67657395079731941, 2465305.06023152964189649 6786843.02406898327171803, 2465334.00903444737195969 6786839.38328682724386454, 2465362.29147701431065798 6786832.91080539952963591, 2465396.02998435776680708 6786821.17895759362727404, 2465502.73750742524862289 6786774.27237179316580296, 2465605.00745896715670824 6786755.68977096118032932, 2465634.13116210186854005 6786754.57154325488954782, 2465672.99629178643226624 6786756.08356957323849201, 2465734.05794135900214314 6786763.08072766475379467, 2465811.86284160241484642 6786785.40538411121815443, 2465859.53489593463018537 6786789.10501957032829523, 2465896.89926155097782612 6786788.5125300195068121, 2465920.38251729076728225 6786785.23355908133089542, 2465948.23145231790840626 6786776.5759794432669878, 2466008.32624233840033412 6786744.86678956262767315, 2466128.22484823875129223 6786677.43879139702767134, 2466181.88015931705012918 6786654.73305104859173298, 2466251.06557539664208889 6786637.8706371309235692, 2466334.73512227367609739 6786629.43443554360419512, 2466382.22960762027651072 6786617.70554121024906635, 2466425.89052781229838729 6786598.27702722046524286, 2466478.27368737990036607 6786567.36956082563847303, 2466604.78368698805570602 6786467.30233101267367601, 2466645.22125448938459158 6786440.58298057410866022, 2466688.46014526020735502 6786418.18838455248624086, 2466750.97742483904585242 6786391.44493397790938616, 2466815.1395890605635941 6786368.75364640355110168, 2466904.47778397658839822 6786344.60891666822135448, 2467089.10993514209985733 6786296.52928278315812349, 2467117.86725585302338004 6786285.32407670840620995, 2467195.87114938907325268 6786252.15501758363097906, 2467243.12984509207308292 6786231.01940449979156256, 2467288.62287274561822414 6786206.20229245163500309, 2467364.89123131008818746 6786157.08335519302636385, 2467404.13503327453508973 6786134.44090486411005259, 2467461.90639834618195891 6786105.00305768474936485, 2467515.62410319736227393 6786082.22399599198251963, 2467540.50485040340572596 6786074.595806491561234, 2467562.6826448324136436 6786070.57440182194113731, 2467688.8018006170168519 6786064.90743029024451971, 2467782.64522830583155155 6786053.95360243041068316, 2467808.46452154032886028 6786062.12473327480256557, 2467840.74389493186026812 6786064.06352906115353107, 2467872.5326874814927578 6786058.2277810825034976, 2467976.05721685430034995 6786031.74256401881575584, 2468005.2120079449377954 6786029.26748867146670818, 2468031.09438596898689866 6786031.0295096468180418, 2468081.80218726443126798 6786041.90312357526272535, 2468127.45225758291780949 6786058.29240385163575411, 2468175.56793682370334864 6786085.29295426793396473, 2468196.4626731276512146 6786105.3854057602584362, 2468213.05823970353230834 6786115.8744487538933754, 2468227.80849524959921837 6786122.22694489546120167, 2468249.69142057560384274 6786128.05121786706149578, 2468275.46968496032059193 6786131.98552758898586035, 2468314.70521556865423918 6786134.89527324959635735, 2468337.41459171753376722 6786133.86836979631334543, 2468364.69960128236562014 6786125.77650466188788414, 2468396.03337864624336362 6786107.96868592873215675, 2468429.98005184112116694 6786082.82259025052189827, 2468498.56537379557266831 6786023.29722889047116041, 2468528.22282354440540075 6786002.73883892223238945, 2468551.6266341395676136 6785991.69340122863650322, 2468589.24735607020556927 6785984.42882954142987728, 2468683.23189981374889612 6785976.3020110260695219, 2468725.04653182625770569 6785969.82094832044094801, 2468753.44036597432568669 6785963.13938828743994236, 2468797.79917343286797404 6785944.25088505446910858, 2468894.81574493693187833 6785891.70546270720660686, 2468928.46292948443442583 6785879.83100776560604572, 2468950.7986593022942543 6785876.56719994451850653, 2469021.89063897263258696 6785871.36886392626911402, 2469087.02841159328818321 6785851.96042568050324917, 2469103.00415788032114506 6785850.43177642393857241, 2469151.71637508599087596 6785850.83649340365082026, 2469180.15457559423521161 6785845.1127246031537652, 2469258.53318585129454732 6785824.5368632273748517, 2469284.44431363232433796 6785824.30472724698483944, 2469300.35946332849562168 6785822.14977522846311331, 2469330.24246268067508936 6785818.90300407353788614, 2469346.0144191812723875 6785803.51430347096174955, 2469353.29689098289236426 6785797.23162110615521669, 2469451.6957559990696609 6785685.22854538541287184, 2469485.49690603418275714 6785650.02863326855003834, 2469509.50491117080673575 6785628.10918447282165289, 2469527.63644343707710505 6785614.73536487761884928, 2469555.31859845807775855 6785598.33485736511647701, 2469647.88408684358000755 6785554.73771657235920429, 2469864.73204787774011493 6785526.37820359878242016, 2469892.59204226359724998 6785519.07455859612673521)'),
    loads('LineString (2465101.41016018576920033 6784761.68074970599263906, 2464790.66067680530250072 6784929.63872427120804787, 2464694.79742351127788424 6784984.03039006516337395, 2464621.17054663598537445 6785030.51181334350258112, 2464589.26190123427659273 6785057.85813910700380802, 2464545.50355314183980227 6785106.20214056596159935, 2464515.01503210142254829 6785148.2088356725871563, 2464477.54890746157616377 6785216.52632956486195326, 2464443.81363971065729856 6785290.15660971868783236, 2464427.08954744972288609 6785355.50899400748312473, 2464426.65723732952028513 6785363.26628949120640755, 2464424.97332849958911538 6785396.11932679452002048, 2464438.47264275047928095 6785473.91619603708386421, 2464452.18188091972842813 6785503.18703251704573631, 2464506.13751514675095677 6785592.38373450096696615, 2464514.22972286259755492 6785620.54112188052386045, 2464515.73316522315144539 6785646.36645309627056122, 2464510.8680385765619576 6785661.87849756982177496, 2464501.5892259618267417 6785675.49970279075205326, 2464420.92676637787371874 6785750.51631114725023508, 2464387.36880252044647932 6785785.86744406539946795, 2464364.81943182274699211 6785813.33256345521658659, 2464354.78889834647998214 6785829.99950212426483631, 2464344.10184971103444695 6785853.76543870195746422, 2464328.10471476707607508 6785903.14349642861634493, 2464326.16332611814141273 6786086.50032796338200569, 2464330.26872376818209887 6786126.7786115501075983, 2464339.87317157909274101 6786137.58464738540351391, 2464359.30971805658191442 6786148.22142433375120163, 2464403.3266075630672276 6786168.7634594077244401, 2464442.49782679136842489 6786184.3931070240214467, 2464513.75916692288592458 6786205.89420164562761784, 2464586.47847912227734923 6786222.18641510233283043, 2464640.8946762727573514 6786229.74839503038674593, 2464705.6219185134395957 6786233.70054063014686108, 2464747.66223323345184326 6786234.20798885263502598, 2464838.31472492124885321 6786231.45195372030138969, 2464880.31336675118654966 6786232.68556705862283707, 2464928.65993784461170435 6786238.19042817503213882, 2464976.13689864566549659 6786248.22269933018833399, 2465027.96252692863345146 6786266.85666365921497345, 2465138.27314212499186397 6786328.36062125954777002, 2465185.83836327586323023 6786348.87807120010256767, 2465256.49208713602274656 6786379.20332599617540836, 2465268.81113701313734055 6786382.4606084581464529, 2465304.41707957908511162 6786386.59687024727463722, 2465338.29865627130493522 6786398.28129755891859531, 2465356.50308308936655521 6786411.30102511588484049, 2465377.58691144268959761 6786431.69261905178427696, 2465396.93312542559579015 6786453.6363620525225997, 2465406.62093460978940129 6786470.63435706589370966, 2465413.0704715782776475 6786489.15985589660704136, 2465416.17570965131744742 6786504.99007994588464499, 2465502.73750742524862289 6786774.27237179316580296)'), 
    loads('LineString (2465551.20500457007437944 6784683.27500566001981497, 2465575.8464989154599607 6784676.92481790389865637, 2465732.47078761924058199 6784641.04813013877719641, 2465837.43669446744024754 6784629.99471539352089167, 2465943.34130093222483993 6784612.65761860832571983, 2466024.40305851027369499 6784604.06703502871096134, 2466222.97819681232795119 6784584.07126824557781219, 2466232.35633498663082719 6784586.63952864985913038, 2466247.72326236916705966 6784598.91313789691776037, 2466258.7845921702682972 6784615.16148888785392046, 2466428.71866096882149577 6784948.19058109726756811, 2466436.39929356053471565 6784953.44636910036206245, 2466448.46165862586349249 6784952.8050597719848156, 2466557.24527655309066176 6784923.83139963075518608, 2466573.78915828932076693 6784921.20907615497708321, 2466586.42062705010175705 6784922.75750427413731813, 2466965.65778897283598781 6785100.0716108838096261, 2466988.42105505848303437 6785112.82037758361548185, 2467005.42516778921708465 6785126.77122036926448345, 2467019.30141687579452991 6785143.93447669874876738, 2467031.18293558061122894 6785163.36290285643190145, 2467059.97460969351232052 6785232.11990607716143131, 2467121.37931778887286782 6785681.89043485280126333, 2467126.90000616712495685 6785713.87262910231947899, 2467136.77895183162763715 6785734.29419897403568029, 2467179.26117662573233247 6785795.65080291405320168, 2467198.25862574437633157 6785818.19243888836354017, 2467213.31610010610893369 6785830.58604852203279734, 2467306.37965508038178086 6785865.45477654878050089, 2467392.7575826458632946 6785903.71399699430912733, 2467782.64522830583155155 6786053.95360243041068316)'), 
    loads('LineString (2467100.90101010585203767 6784829.91497059259563684, 2467482.67393507575616241 6784683.07096364628523588, 2467487.19630492245778441 6784678.44759537093341351, 2467486.91544729564338923 6784675.18775097746402025, 2467477.46093949675559998 6784653.15127879288047552, 2467476.17974826041609049 6784644.88065414689481258, 2467485.10709732258692384 6784640.03512680344283581, 2467520.46572079742327332 6784644.12152503617107868, 2467603.24562970781698823 6784660.83198261726647615, 2467730.40853609377518296 6784708.62033457402139902, 2467786.15437261899933219 6784725.48889082670211792, 2467824.25784124946221709 6784733.03881267085671425, 2467894.79238561308011413 6784742.5500388415530324, 2468028.20006359275430441 6784747.00472924951463938, 2468059.54170463839545846 6784751.60028392262756824, 2468077.50926835834980011 6784758.31674734223634005, 2468096.68479391233995557 6784771.68094111606478691, 2468117.3524540513753891 6784792.65812048781663179, 2468132.50806761300191283 6784813.41742601990699768, 2468171.00111909629777074 6784873.96865847054868937, 2468230.62055826047435403 6784945.73393029719591141, 2468252.39812781708315015 6784965.13963115867227316, 2468292.89397072326391935 6784985.62862733099609613, 2468309.14273301651701331 6784996.12451503798365593, 2468358.59169194428250194 6785038.03323901444673538, 2468369.04796066088601947 6785054.5954426284879446, 2468369.75051796808838844 6785067.45755031146109104, 2468375.36633756756782532 6785078.89088838454335928, 2468392.03693567495793104 6785106.91686444263905287, 2468407.41395454201847315 6785127.7798541747033596, 2468423.20223192870616913 6785144.06892834790050983, 2468445.97196284448727965 6785162.47010178584605455, 2468510.65225541917607188 6785201.58712622243911028, 2468532.92816609144210815 6785219.15181855577975512, 2468543.11175711872056127 6785234.61870602518320084, 2468546.61845929827541113 6785279.18387959431856871, 2468712.86792066227644682 6785195.1902363570407033, 2468760.40845117857679725 6785176.26073094084858894, 2468781.57913596276193857 6785170.4348198315128684, 2468822.63816309114918113 6785171.14343509450554848, 2468876.78366976464167237 6785177.12134174909442663, 2469045.3697667783126235 6785194.96289203967899084, 2469171.4181729955598712 6785205.2587002394720912, 2469187.24966365098953247 6785211.17220858298242092, 2469647.88408684358000755 6785554.73771657235920429)'), 
    loads('LineString (2468972.032120356336236 6788969.28451008349657059, 2468996.92506082961335778 6788946.47064386215060949, 2469018.57705878186970949 6788922.62442867457866669, 2469121.42594428407028317 6788792.97445359919220209, 2469138.76023039547726512 6788765.41184954345226288, 2469143.97880636109039187 6788750.17158007528632879, 2469146.32583263656124473 6788730.64905465859919786, 2469139.37113408138975501 6788669.37870926316827536, 2469140.98522000666707754 6788636.86356337275356054, 2469147.48716366151347756 6788611.87256887834519148, 2469172.89896957017481327 6788552.09437346737831831, 2469178.16194006660953164 6788529.8926677443087101, 2469181.07479785336181521 6788500.60472309496253729, 2469180.88261286541819572 6788484.18836053274571896, 2469177.69568013167008758 6788468.57210616488009691, 2469148.48109118407592177 6788410.4859031094238162, 2469134.3531828667037189 6788360.41131437383592129, 2469130.971528893802315 6788321.77562944125384092, 2469132.25041826860979199 6788230.78509199153631926, 2469127.39940079441294074 6788201.97184650041162968, 2469102.30239794123917818 6788131.68066197447478771, 2469080.13496342627331614 6788077.645555030554533, 2469011.71250747982412577 6787927.61878836527466774, 2469177.06904746498912573 6787570.43479149136692286, 2469139.46060002641752362 6787509.62958468683063984, 2469051.34454007539898157 6787313.84787294361740351, 2468944.7683279262855649 6787101.23644088581204414, 2468893.68407189147546887 6786995.32135743647813797, 2468857.77912604063749313 6786904.76457530632615089, 2468831.40766277583315969 6786828.15672873053699732, 2468818.51180505426600575 6786754.64112649764865637, 2468801.9858407317660749 6786708.80904137808829546, 2468799.48605419043451548 6786673.45860255789011717, 2468802.49455482279881835 6786610.27687340043485165, 2468816.95191583642736077 6786569.01179573126137257, 2468841.15039961459115148 6786515.43932619132101536, 2468854.39881818275898695 6786493.02316623833030462, 2468868.23514770483598113 6786475.0381883317604661, 2468904.44863473623991013 6786437.96555585134774446, 2468980.16010951669886708 6786377.53911835048347712, 2469058.73005071841180325 6786309.88608481548726559, 2469141.88343483349308372 6786227.93974119890481234, 2469205.94918201956897974 6786159.35271664336323738, 2469213.95390117447823286 6786141.48396665789186954, 2469224.42276800004765391 6786108.92970328778028488, 2469226.6510872533544898 6786102.97836566157639027, 2469264.17963771941140294 6785958.5423578517511487, 2469283.14107597572728992 6785910.34729316551238298, 2469330.24246268067508936 6785818.90300407353788614)'), 
]

network = gpd.GeoDataFrame(geometry=lines)
planar = c4.make_planar(network)
plines = [ x['geometry'] for x in planar.to_dict('records') ]
cmap = colormaps['tab20']

fig = plt.figure(1, (12, 12))

#############################################################

sub1 = fig.add_subplot(211)
sub1.set_aspect('equal')
sub1.set_title("a) original network", pad=10, family='sans-serif')
sub1.axes.get_xaxis().set_visible(False)
sub1.axes.get_yaxis().set_visible(False)

c1 = cmap(np.linspace(0, 1, len(lines)))

for i, c in enumerate(c1):
    p = lines[i]
    path = Path(np.asarray(p.coords)[:, :2])
    sub1.add_patch(PathPatch(path, facecolor="none", edgecolor=c, linewidth=1))

sub1.autoscale_view()

#############################################################

sub2 = fig.add_subplot(212)
sub2.set_aspect('equal')
sub2.set_title("b) planar network", pad=10, family='sans-serif')
sub2.axes.get_xaxis().set_visible(False)
sub2.axes.get_yaxis().set_visible(False)

c2 = cmap(np.linspace(0, 1, len(plines)))

for i, c in enumerate(c2):
    p = plines[i]
    path = Path(np.asarray(p.coords)[:, :2])
    sub2.add_patch(PathPatch(path, facecolor="none", edgecolor=c, linewidth=1))

sub2.autoscale_view()

plt.show()