Skip to content

Instantly share code, notes, and snippets.

@sahilkashyap64
Created January 23, 2023 14:21
Show Gist options
  • Save sahilkashyap64/74309d46d0462ffaaf6ad85a56e1696b to your computer and use it in GitHub Desktop.
Save sahilkashyap64/74309d46d0462ffaaf6ad85a56e1696b to your computer and use it in GitHub Desktop.
turf-sandbox snippet
// simply return a valid GeoJSON and it will be rendered on the map
var REGION_CAR_DELIVERY = turf.polygon([[
[ -118.2472203, 34.0805791 ],
[ -118.2458824, 34.0831055 ],
[ -118.2441979, 34.0848758 ],
[ -118.241408, 34.0872652 ],
[ -118.2399476, 34.0900534 ],
[ -118.2407174, 34.0913652 ],
[ -118.2430294, 34.0937757 ],
[ -118.2455076, 34.0964647 ],
[ -118.2473742, 34.098147 ],
[ -118.2499918, 34.099735 ],
[ -118.2511072, 34.1022006 ],
[ -118.2538532, 34.1047867 ],
[ -118.2563638, 34.1059056 ],
[ -118.2587886, 34.1047512 ],
[ -118.2611274, 34.1063858 ],
[ -118.2639168, 34.1074963 ],
[ -118.2715988, 34.1092462 ],
[ -118.2723353, 34.1067844 ],
[ -118.2733722, 34.1039318 ],
[ -118.2733861, 34.1007138 ],
[ -118.2741862, 34.0984711 ],
[ -118.2757004, 34.0969707 ],
[ -118.2769356, 34.095808 ],
[ -118.2784283, 34.0956404 ],
[ -118.2803837, 34.0925686 ],
[ -118.2816952, 34.0923754 ],
[ -118.2838676, 34.0909938 ],
[ -118.2866835, 34.0909627 ],
[ -118.2863629, 34.0763988 ],
[ -118.3092141, 34.0763366 ],
[ -118.309257, 34.0690671 ],
[ -118.3090853, 34.0616725 ],
[ -118.3090639, 34.0445877 ],
[ -118.3090639, 34.0328238 ],
[ -118.300395, 34.0327039 ],
[ -118.3002233, 34.0253299 ],
[ -118.3002019, 34.010817 ],
[ -118.2801818, 34.0110838 ],
[ -118.2713198, 34.0109949 ],
[ -118.2679724, 34.0111194 ],
[ -118.263123, 34.0110305 ],
[ -118.2610631, 34.0109415 ],
[ -118.2564926, 34.010906 ],
[ -118.2565355, 34.011155 ],
[ -118.2521152, 34.0112439 ],
[ -118.2518901, 34.0143742 ],
[ -118.2461714, 34.0217731 ],
[ -118.2429957, 34.0206182 ],
[ -118.2381785, 34.0194311 ],
[ -118.2352495, 34.0187774 ],
[ -118.2299387, 34.0187104 ],
[ -118.2286995, 34.0184633 ],
[ -118.2278869, 34.0173438 ],
[ -118.2263231, 34.0172379 ],
[ -118.2253145, 34.017149 ],
[ -118.2247353, 34.0172734 ],
[ -118.2237911, 34.0172557 ],
[ -118.2241021, 34.0200389 ],
[ -118.224778, 34.023 ],
[ -118.2254969, 34.0261212 ],
[ -118.2261514, 34.0286911 ],
[ -118.224349, 34.029189 ],
[ -118.2230937, 34.0299625 ],
[ -118.2221388, 34.0315007 ],
[ -118.2212376, 34.03303 ],
[ -118.2209802, 34.0340168 ],
[ -118.2215166, 34.0356304 ],
[ -118.2208514, 34.0434676 ],
[ -118.2208299, 34.0456012 ],
[ -118.2212805, 34.0479303 ],
[ -118.2226323, 34.0504993 ],
[ -118.2235014, 34.0518549 ],
[ -118.2245636, 34.0525527 ],
[ -118.2248211, 34.0529438 ],
[ -118.226366, 34.0532283 ],
[ -118.2261514, 34.0540639 ],
[ -118.2255721, 34.0544016 ],
[ -118.2318378, 34.0566506 ],
[ -118.2318162, 34.0578861 ],
[ -118.2321381, 34.0588104 ],
[ -118.2335437, 34.0602237 ],
[ -118.2351316, 34.0613791 ],
[ -118.2341337, 34.0626501 ],
[ -118.229617, 34.0623257 ],
[ -118.2166458, 34.0622858 ],
[ -118.2168603, 34.0659565 ],
[ -118.2189564, 34.0660043 ],
[ -118.2223399, 34.0670831 ],
[ -118.2252548, 34.0677557 ],
[ -118.2252267, 34.0692787 ],
[ -118.2252234, 34.0704757 ],
[ -118.2261733, 34.0715947 ],
[ -118.2276167, 34.069923 ],
[ -118.2291516, 34.0688371 ],
[ -118.2312987, 34.0675274 ],
[ -118.2344329, 34.0655776 ],
[ -118.2349062, 34.0655476 ],
[ -118.2353085, 34.0655876 ],
[ -118.2348713, 34.0676917 ],
[ -118.2319222, 34.0697525 ],
[ -118.2299649, 34.0711072 ],
[ -118.2280638, 34.0715421 ],
[ -118.2289878, 34.0723598 ],
[ -118.2294505, 34.0722442 ],
[ -118.2307515, 34.0751414 ],
[ -118.2315889, 34.0770905 ],
[ -118.2320611, 34.0776577 ],
[ -118.2327264, 34.0779406 ],
[ -118.2340142, 34.0785241 ],
[ -118.2355603, 34.079312 ],
[ -118.2357819, 34.0791635 ],
[ -118.2358533, 34.0788373 ],
[ -118.2358029, 34.0783625 ],
[ -118.2358202, 34.0779996 ],
[ -118.2359173, 34.0777937 ],
[ -118.2361754, 34.0763792 ],
[ -118.2341167, 34.0745099 ],
[ -118.2337328, 34.0737395 ],
[ -118.2357162, 34.07144 ],
[ -118.2377278, 34.0694048 ],
[ -118.2380175, 34.0689249 ],
[ -118.2387738, 34.0687338 ],
[ -118.2392983, 34.0684394 ],
[ -118.2398119, 34.0682961 ],
[ -118.2408928, 34.0685871 ],
[ -118.2413863, 34.0679917 ],
[ -118.2413649, 34.0674318 ],
[ -118.2433176, 34.0688715 ],
[ -118.2440257, 34.0697426 ],
[ -118.2456993, 34.0708801 ],
[ -118.2470512, 34.072693 ],
[ -118.2465093, 34.0742038 ],
[ -118.2451977, 34.0751903 ],
[ -118.2447135, 34.075648 ],
[ -118.2448731, 34.0760345 ],
[ -118.2431674, 34.0780073 ],
[ -118.2439561, 34.0790349 ],
[ -118.2472203, 34.0805791 ]
]],
{name:"REGION_CAR_DELIVERY",stroke: 'red', fill: '#0FF', 'fill-opacity': 0.2, 'stroke-width': 6});
var SILVERLAKE_CAR_DELIVERY = turf.polygon([[
[ -118.2949674, 34.0822308 ],
[ -118.2874143, 34.0789074 ],
[ -118.2754194, 34.0760015 ],
[ -118.2673406, 34.0748107 ],
[ -118.2609033, 34.0769346 ],
[ -118.2522236, 34.0794405 ],
[ -118.2510676, 34.0820642 ],
[ -118.2498285, 34.0847166 ],
[ -118.2438738, 34.0936952 ],
[ -118.2467626, 34.0970415 ],
[ -118.2499948, 34.1001034 ],
[ -118.2515465, 34.1012148 ],
[ -118.2542404, 34.1042525 ],
[ -118.2671746, 34.1112433 ],
[ -118.2692075, 34.113828 ],
[ -118.2719337, 34.1169177 ],
[ -118.2744073, 34.1199694 ],
[ -118.2781258, 34.1196127 ],
[ -118.2919768, 34.1178672 ],
[ -118.3063896, 34.1138026 ],
[ -118.3093492, 34.1077944 ],
[ -118.3088977, 34.0993168 ],
[ -118.308672, 34.0946515 ],
[ -118.3089883, 34.0918924 ],
[ -118.3091465, 34.0887358 ],
[ -118.3090049, 34.0835355 ],
[ -118.3046911, 34.0836056 ],
[ -118.3015323, 34.083569 ],
[ -118.2982233, 34.0833724 ],
[ -118.2949674, 34.0822308 ]
]],
{name:"SILVERLAKE_CAR_DELIVERY",stroke: 'blue', fill: '#0FF', 'fill-opacity': 0.2, 'stroke-width': 6});
return turf.featureCollection([REGION_CAR_DELIVERY,SILVERLAKE_CAR_DELIVERY]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment