Hello! Im quite new to ORS, I’m trying to avoid polygons and it does not seem to work. I have seen other posts and tried the solutions but it does not seem to work for me either. For more information, I am using this on jupyter notebook.
route = ors_client.directions(
trip_dest,
profile="driving-car",
options = {
"avoid_polygons": {
"type": "MultiPolygon",
"coordinates": list_of_coordinates
}
},
preference=None,
format="geojson"
)
Where the list_of_coordinates are:
[
[[[1.3213403233324754, 103.87519215972439], [1.3194098287704257, 103.87685952619799], [1.3177316766348965, 103.87494144045625], [1.3196621699293776, 103.87327407362136], [1.3213403233324754, 103.87519215972439], [1.3213403233324754, 103.87519215972439]]], [[[1.3623043227262701, 103.96153736180973], [1.3603738287925915, 103.96320475597685], [1.358695677240089, 103.96128663837652], [1.3606261698668345, 103.95961924383688], [1.3623043227262701, 103.96153736180973], [1.3623043227262701, 103.96153736180973]]], [[[1.3254093232730881, 103.85890555992869], [1.32347882877257, 103.8605729291152], [1.3218006766941832, 103.85865484025253], [1.3237311699232233, 103.8569874707036], [1.3254093232730881, 103.85890555992869], [1.3254093232730881, 103.85890555992869]]], [[[1.3453543229793488, 103.86032376093914], [1.3434238287832638, 103.8619911435445], [1.3417456769874299, 103.8600730392448], [1.3436761698928708, 103.85840565627157], [1.3453543229793488, 103.86032376093914], [1.3453543229793488, 103.86032376093914]]], [[[1.3299513232065816, 103.86232864220547], [1.3280208287749782, 103.86399601443013], [1.3263426767605775, 103.86207792207237], [1.3282731699163381, 103.86041054948404], [1.3299513232065816, 103.86232864220547], [1.3299513232065816, 103.86232864220547]]], [[[1.2874983238193283, 103.83764986823768], [1.2855678287530894, 103.83931721247184], [1.2838896761488796, 103.83739915231435], [1.2858201699800709, 103.83573180772817], [1.2874983238193283, 103.83764986823768], [1.2874983238193283, 103.83764986823768]]], [[[1.3777293224932086, 103.85892396261148], [1.3757988288012737, 103.86059136742625], [1.3741206774727697, 103.85867323757688], [1.3760511698429483, 103.85700583238537], [1.3777293224932086, 103.85892396261148], [1.3777293224932086, 103.85892396261148]]], [[[1.3904143222995802, 103.85818536327758], [1.3884838288085506, 103.85985277693868], [1.3868056776660842, 103.85793463691252], [1.3887361698231673, 103.8562672228712], [1.3904143222995802, 103.85818536327758], [1.3904143222995802, 103.85818536327758]]], [[[1.3156463234152727, 103.84572839201358], [1.3137158287674477, 103.84739575470486], [1.3120376765522388, 103.84547767331429], [1.313968169937969, 103.84381031026328], [1.3156463234152727, 103.84572839201358], [1.3156463234152727, 103.84572839201358]]], [[[1.3547643228392403, 103.85731536142112], [1.352833828788415, 103.8589827504272], [1.3511556771273057, 103.85706463876411], [1.3530861698784435, 103.85539724938756], [1.3547643228392403, 103.85731536142112], [1.3547643228392403, 103.85731536142112]]], [[[1.4488283213850361, 103.77177966642384], [1.4468978288436598, 103.77344712187094], [1.4452196785791849, 103.77152893377426], [1.4471501697304754, 103.76986147793093], [1.4488283213850361, 103.77177966642384], [1.4488283213850361, 103.77177966642384]]], [[[1.4473583214085126, 103.76846506634308], [1.4454278288427442, 103.7701325207175], [1.4437496785557455, 103.76821433385484], [1.44568016973284, 103.76654687908459], [1.4473583214085126, 103.76846506634308], [1.4473583214085126, 103.76846506634308]]], [[[1.3522823228762904, 103.79115894261867], [1.3503518287870493, 103.79282632993214], [1.348673677090317, 103.79090822021622], [1.3506041698822553, 103.78924083253297], [1.3522823228762904, 103.79115894261867], [1.3522823228762904, 103.79115894261867]]], [[[1.4313933216619412, 103.76943636547121], [1.4294628288329052, 103.77110380826586], [1.4277846783027106, 103.76918563472452], [1.429715169758417, 103.76751819153841], [1.4313933216619412, 103.76943636547121], [1.4313933216619412, 103.76943636547121]]], [[[1.4159463219044726, 103.77129336463685], [1.4140158288235727, 103.77296079635], [1.4123376780605603, 103.77104263555678], [1.4142681697829764, 103.76937520345638], [1.4159463219044726, 103.77129336463685], [1.4159463219044726, 103.77129336463685]]], [[[1.297659323674479, 103.88044002452894], [1.2957288287582027, 103.88210737537969], [1.294050676293479, 103.88018930761046], [1.295981169964944, 103.87852195640491], [1.297659323674479, 103.88044002452894], [1.297659323674479, 103.88044002452894]]], [[[1.2993173236507345, 103.89842725862962], [1.297386828759044, 103.90009461056496], [1.2957086763171812, 103.89817654154803], [1.2976391699624674, 103.89650918925742], [1.2993173236507345, 103.89842725862962], [1.2993173236507345, 103.89842725862962]]], [[[1.2974613236773116, 103.88540840784718], [1.2955308287581022, 103.8870757585685], [1.29385267629065, 103.88515769094818], [1.295783169965239, 103.88349033987211], [1.2974613236773116, 103.88540840784718], [1.2974613236773116, 103.88540840784718]]], [[[1.288904323799353, 103.79645535811838], [1.2869738287537926, 103.79812270326498], [1.2852956761688203, 103.79620464205782], [1.287226169977983, 103.7945372965588], [1.288904323799353, 103.79645535811838], [1.288904323799353, 103.79645535811838]]], [[[1.350502322902819, 103.6351666612024], [1.3485718287860726, 103.6368340473039], [1.3468936770638313, 103.63491593898225], [1.3488241698849857, 103.63324855251145], [1.350502322902819, 103.6351666612024], [1.350502322902819, 103.6351666612024]]], [[[1.3279843232354114, 103.73040536005828], [1.3260538287739332, 103.73207273096594], [1.324375676731796, 103.73015464012326], [1.3263061699193215, 103.72848726885249], [1.3279843232354114, 103.73040536005828], [1.3279843232354114, 103.73040536005828]]], [[[1.335250323128703, 103.65282620748135], [1.3333198287778076, 103.65449358326372], [1.331641676838325, 103.65257548681319], [1.333572169908285, 103.65090811066572], [1.335250323128703, 103.65282620748135], [1.335250323128703, 103.65282620748135]]], [[[1.3011943236238184, 103.7800253587222], [1.2992638287599998, 103.78169271188708], [1.2975856763440514, 103.77977464145569], [1.299516169959662, 103.77810728793503], [1.3011943236238184, 103.7800253587222], [1.3011943236238184, 103.7800253587222]]], [[[1.3233343233033956, 103.75285535982442], [1.3214038287714753, 103.75452272762642], [1.3197256766639271, 103.7526046403565], [1.3216561699263634, 103.75093727219264], [1.3233343233033956, 103.75285535982442], [1.3233343233033956, 103.75285535982442]]], [[[1.349450322918482, 103.63682086114852], [1.3475198287854968, 103.63848824653451], [1.345841677048195, 103.63657013903598], [1.3477721698865983, 103.634902753281], [1.349450322918482, 103.63682086114852], [1.349450322918482, 103.63682086114852]]], [[[1.312034323467611, 103.76450535925954], [1.310103828765571, 103.76617271955999], [1.308425676499991, 103.76425464091984], [1.3103561699434059, 103.76258728026065], [1.312034323467611, 103.76450535925954], [1.312034323467611, 103.76450535925954]]], [[[1.2620823241766606, 103.82401424686952], [1.2601518287406503, 103.82568157478174], [1.258473675792176, 103.82376353340102], [1.260404170017562, 103.82209620514374], [1.2620823241766606, 103.82401424686952], [1.2620823241766606, 103.82401424686952]]], [[[1.327829323237681, 103.90575036005048], [1.3258988287738516, 103.90741773085443], [1.3242206767295301, 103.90549964013105], [1.3261511699195572, 103.90383226896402], [1.327829323237681, 103.90575036005048], [1.327829323237681, 103.90575036005048]]], [[[1.324679323283756, 103.89120465989198], [1.3227488287721842, 103.89287202859117], [1.3210706766835332, 103.89095394028912], [1.323001169924328, 103.88928657122773], [1.324679323283756, 103.89120465989198], [1.324679323283756, 103.89120465989198]]], [[[1.3299763232062145, 103.86864446015872], [1.3280458287749912, 103.87031183240013], [1.3263676767609434, 103.86839374002311], [1.3282981699163, 103.86672636741802], [1.3299763232062145, 103.86864446015872], [1.3299763232062145, 103.86864446015872]]], [[[1.3311383231891631, 103.85834736021738], [1.3292078287756104, 103.86001473323775], [1.3275296767779663, 103.85809663996461], [1.3294601699145365, 103.85642926658025], [1.3311383231891631, 103.85834736021738], [1.3311383231891631, 103.85834736021738]]], [[[1.3283783232296396, 103.82698265571115], [1.3264478287741424, 103.82865002688244], [1.3247696767375574, 103.82673193573648], [1.3267001699187242, 103.82506456420194], [1.3283783232296396, 103.82698265571115], [1.3283783232296396, 103.82698265571115]]], [[[1.3460093229696275, 103.78589536097257], [1.3440788287836196, 103.78756274402203], [1.3424006769971344, 103.78564463921145], [1.3443311698918685, 103.78397725579396], [1.3460093229696275, 103.78589536097257], [1.3460093229696275, 103.78589536097257]]], [[[1.3344953231398178, 103.77040336038714], [1.3325648287774035, 103.77207073566171], [1.330886676827228, 103.77015263979533], [1.3328171699094342, 103.76848526415584], [1.3344953231398178, 103.77040336038714], [1.3344953231398178, 103.77040336038714]]], [[[1.3788513224761532, 103.92959519267016], [1.3769208288019121, 103.93126259826413], [1.375242677489797, 103.92934446751838], [1.3771731698412033, 103.92767706154736], [1.3788513224761532, 103.92959519267016], [1.3788513224761532, 103.92959519267016]]], [[[1.3992923221630085, 103.85413003374742], [1.3973618288137168, 103.85579745364825], [1.3956836778024364, 103.8538793064439], [1.3976141698092488, 103.8522118861604], [1.3992923221630085, 103.85413003374742], [1.3992923221630085, 103.85413003374742]]], [[[1.396467322206561, 103.83487137359761], [1.394536828812066, 103.83653879150862], [1.3928586777589549, 103.83462064659335], [1.3947891698136847, 103.83295322830045], [1.396467322206561, 103.83487137359761], [1.396467322206561, 103.83487137359761]]], [[[1.3965453222053592, 103.81809622360173], [1.394614828812112, 103.81976364156763], [1.3929366777601542, 103.81784549658923], [1.3948671698135624, 103.81617807824142], [1.3965453222053592, 103.81809622360173], [1.3965453222053592, 103.81809622360173]]], [[[1.4145053219269639, 103.80655248455946], [1.4125748288227116, 103.80821991524502], [1.4108966780381056, 103.80630175563395], [1.4128271697852584, 103.80463432456155], [1.4145053219269639, 103.80655248455946], [1.4145053219269639, 103.80655248455946]]]
]
Appreciate the help in advance. Thanks!