Querying Intersection of two geometry columns in Mysql - mysql

I have tables with Geometry (Multipolygon Shape field) in Mysql. I am able to successfully run Area and Centroid. Is there a way in MySql however to query the intersection between two shapes expressed as a percentage of one in the other?
As per comment/request I am pasting in two mutlipoint geometry fields as I cannot figure out how to create a shape based table in sqlfiddle to make that easier, my apologies.
Zip Code 07024:
POLYGON((-73.982967 40.85601, -73.982439 40.856535, -73.982753 40.856696, -73.981338 40.858725, -73.98116 40.858553, -73.98071 40.858127, -73.979611 40.860178, -73.979382 40.860799, -73.978783 40.860699, -73.977687 40.8605, -73.977625 40.861338, -73.976375 40.863927, -73.975979 40.866037, -73.97581 40.86715, -73.97595 40.867368, -73.976498 40.868123, -73.975997 40.868331, -73.975852 40.868393, -73.975695 40.868462, -73.975424 40.868732, -73.975409 40.868767, -73.973501 40.867578, -73.972993 40.867361, -73.969825 40.865568, -73.969308 40.866081, -73.96889 40.866665, -73.967939 40.86767, -73.967224 40.868426, -73.966833 40.868573, -73.966599 40.868801, -73.965903 40.868417, -73.966106 40.868212, -73.965416 40.867819, -73.964641 40.867337, -73.963922 40.866921, -73.963033 40.866334, -73.961553 40.865627, -73.961057 40.865172, -73.959983 40.864747, -73.959338 40.864314, -73.958603 40.864012, -73.957929 40.863618, -73.95707 40.863094, -73.956499 40.862808, -73.955373 40.862408, -73.954582 40.861799, -73.953682 40.861199, -73.948385 40.858471, -73.951755 40.852121, -73.952044 40.851599, -73.952172 40.851368, -73.953482 40.849, -73.953982 40.848, -73.961982 40.8481, -73.96428 40.845936, -73.964416 40.846578, -73.965254 40.846613, -73.965508 40.846873, -73.965588 40.847314, -73.965493 40.847721, -73.965655 40.847583, -73.966297 40.847017, -73.967897 40.847412, -73.968466 40.84673, -73.968146 40.845991, -73.968481 40.845201, -73.969975 40.843707, -73.970303 40.843316, -73.971301 40.84213, -73.971575 40.841806, -73.972478 40.839104, -73.973107 40.835428, -73.973165 40.834416, -73.972952 40.834229, -73.972949 40.834164, -73.972968 40.834096, -73.973174 40.833617, -73.973334 40.832466, -73.973306 40.831923, -73.973267 40.831735, -73.973956 40.831892, -73.974176 40.831515, -73.974314 40.831326, -73.975646 40.828897, -73.976382 40.8276, -73.977731 40.82829, -73.978276 40.828543, -73.979977 40.829541, -73.98278 40.83107, -73.983573 40.831429, -73.983872 40.831592, -73.984742 40.832144, -73.985562 40.832688, -73.986268 40.833146, -73.986988 40.833553, -73.987719 40.83392, -73.988414 40.834306, -73.988761 40.83452, -73.989092 40.834704, -73.989874 40.835095, -73.990621 40.835377, -73.991325 40.835884, -73.991221 40.836037, -73.991102 40.836253, -73.990782 40.836634, -73.990063 40.83715, -73.988368 40.838989, -73.98773 40.839638, -73.987034 40.840345, -73.985915 40.841463, -73.984496 40.84288, -73.982203 40.84517, -73.982909 40.845573, -73.981298 40.847192, -73.981261 40.847214, -73.981144 40.847338, -73.981849 40.847781, -73.982608 40.848169, -73.98345 40.848469, -73.983527 40.848719, -73.984391 40.849063, -73.984835 40.849151, -73.984801 40.849419, -73.984896 40.850679, -73.985459 40.851398, -73.986166 40.850754, -73.98666 40.850301, -73.986718 40.850249, -73.987145 40.850414, -73.987891 40.850822, -73.987985 40.850884, -73.985961 40.853208, -73.984196 40.854911, -73.984091 40.854855, -73.98367 40.85531, -73.98354 40.85544, -73.982967 40.85601))
Fort Lee, NJ:
POLYGON((-73.985961 40.853208, -73.985344 40.853804, -73.984777 40.854344, -73.984228 40.854929, -73.983651 40.85551, -73.983092 40.856083, -73.982599 40.856605, -73.982753 40.856696, -73.981338 40.858725, -73.98116 40.858553, -73.980744 40.858154, -73.98071 40.858127, -73.980363 40.858773, -73.979611 40.860178, -73.979382 40.860799, -73.978783 40.860699, -73.977687 40.8605, -73.977625 40.861338, -73.976375 40.863927, -73.975979 40.866037, -73.97581 40.86715, -73.975695 40.868462, -73.97569 40.868903, -73.975409 40.868767, -73.973501 40.867578, -73.972993 40.867361, -73.970023 40.865686, -73.969825 40.865568, -73.969308 40.866081, -73.96889 40.866665, -73.967939 40.86767, -73.967224 40.868426, -73.966833 40.868573, -73.966106 40.868212, -73.965416 40.867819, -73.964641 40.867337, -73.963922 40.866921, -73.963033 40.866334, -73.962108 40.865929, -73.961553 40.865627, -73.961057 40.865172, -73.959983 40.864747, -73.959338 40.864314, -73.958603 40.864012, -73.957929 40.863618, -73.95707 40.863094, -73.956499 40.862808, -73.955373 40.862408, -73.954582 40.861799, -73.953682 40.861199, -73.948385 40.858471, -73.951755 40.852121, -73.952044 40.851599, -73.952172 40.851368, -73.953482 40.849, -73.953982 40.848, -73.961982 40.8481, -73.96428 40.845936, -73.964416 40.846578, -73.965212 40.846846, -73.96479 40.84776, -73.965493 40.847721, -73.965655 40.847583, -73.96588 40.847401, -73.965979 40.847321, -73.966155 40.847204, -73.966226 40.847134, -73.966286 40.847041, -73.966297 40.847017, -73.966418 40.847051, -73.966735 40.847137, -73.967225 40.847271, -73.967897 40.847412, -73.968193 40.847056, -73.968203 40.847044, -73.968466 40.84673, -73.968146 40.845991, -73.968303 40.845524, -73.968481 40.845201, -73.969975 40.843707, -73.970303 40.843316, -73.971301 40.84213, -73.971575 40.841806, -73.972478 40.839104, -73.973107 40.835428, -73.973165 40.834416, -73.973225 40.834413, -73.973289 40.834392, -73.973332 40.834364, -73.973379 40.834284, -73.973394 40.834221, -73.973391 40.834167, -73.973355 40.833909, -73.973351 40.833778, -73.973398 40.833352, -73.973433 40.833179, -73.973485 40.833009, -73.973814 40.832198, -73.973956 40.831892, -73.97406 40.831701, -73.974176 40.831515, -73.974314 40.831326, -73.975646 40.828897, -73.976382 40.8276, -73.977731 40.82829, -73.978276 40.828543, -73.979977 40.829541, -73.98278 40.83107, -73.983573 40.831429, -73.983872 40.831592, -73.984742 40.832144, -73.985562 40.832688, -73.986268 40.833146, -73.986988 40.833553, -73.987719 40.83392, -73.988414 40.834306, -73.988761 40.83452, -73.989092 40.834704, -73.989874 40.835095, -73.990621 40.835377, -73.991325 40.835884, -73.991221 40.836037, -73.991102 40.836253, -73.990782 40.836634, -73.990707 40.836688, -73.990063 40.83715, -73.988368 40.838989, -73.98773 40.839638, -73.987034 40.840345, -73.985915 40.841463, -73.984496 40.84288, -73.982203 40.84517, -73.981262 40.84611, -73.980579 40.846792, -73.980459 40.846915, -73.981144 40.847338, -73.981849 40.847781, -73.982608 40.848169, -73.98345 40.848469, -73.983527 40.848719, -73.984391 40.849063, -73.984835 40.849151, -73.985717 40.849611, -73.98625 40.850043, -73.986394 40.850027, -73.986431 40.850024, -73.986718 40.850249, -73.987145 40.850414, -73.987891 40.850822, -73.987985 40.850884, -73.985961 40.853208))

Related

How can I find a good fit for my function?

I have a set of data at which I would like to fit a curve to. However, I'm having difficulties with finding the right equation type. I'm guessing it's a type of sigmoidal function.
I have tried several forms, but none of them seem to fit sufficiently, see for an example below. I add here below the corresponding X and Y values. Can anybody help to find the right equation?
Thanks!
154.306913174971 2.17552527747944e-06
145.732177991779 4.26074331981736e-06
166.370948978060 8.44990728111281e-07
150.517102120948 2.92809906966412e-06
157.163631972266 1.73903777214673e-06
147.162254437166 3.80889812291419e-06
141.445524473590 5.96240785836227e-06
156.755956017828 1.79551102284899e-06
168.124397108446 7.36473206473002e-07
147.506481426373 3.70749329689164e-06
153.617020147862 2.29641877855097e-06
139.857839490342 6.75263654856569e-06
131.285677151789 1.32223004762135e-05
134.762266174873 1.00681303143327e-05
144.412374103663 4.72516773633701e-06
174.063972484101 4.62325663454478e-07
167.779875768370 7.56634177420066e-07
156.618068988233 1.81502390434487e-06
129.382033764703 1.53502450678885e-05
118.745229015261 3.53377063903168e-05
96.9898870635171 0.000194484373736861
104.151683563064 0.000110934350737335
128.888483669522 1.59557749766494e-05
148.539707488194 3.41904542308052e-06
131.959323971162 1.25421837144964e-05
137.173765822536 8.33395024805784e-06
164.638748619708 9.67884576233541e-07
165.582099549336 8.98892600093246e-07
167.050169060673 8.01176756387370e-07
164.150998326847 1.00560797335372e-06
146.433071019905 4.03296012557947e-06
115.142472487946 4.68696642147204e-05
89.9493086128373 0.000337735405143162
88.7090121651731 0.000372221684340948
107.176487608802 8.75162247948925e-05
127.484037553561 1.78127654830961e-05
118.261728568230 3.67027675974562e-05
129.754783518810 1.49082028157606e-05
139.234458911013 7.09081179104455e-06
154.315972640625 2.17398082987862e-06
157.315560628531 1.71844922092655e-06
162.352394592683 1.15787317674560e-06
163.989279778695 1.01843733109615e-06
146.251554650299 4.09075560307041e-06
110.311825857028 6.84459947920383e-05
80.7727512729194 0.000693404202377663
75.9424207966391 0.00101258596573592
91.1311328053438 0.000307852128509189
108.713010050155 7.75851628269193e-05
105.499474031618 9.98116886017153e-05
123.388440588245 2.45563188562737e-05
132.091712446916 1.24126948525892e-05
127.849606518660 1.73095506705975e-05
164.154181676993 1.00535706241415e-06
167.806083897651 7.55081302061313e-07
163.862741610407 1.02858981367769e-06
138.339795742471 7.60596248956097e-06
97.5334986103034 0.000186370776214280
70.3169505045316 0.00157379206791766
60.6253292914279 0.00336428084452373
77.6654635723806 0.000884651141250257
71.3560801471594 0.00145067746467471
86.7932738064685 0.000432535469046982
113.488609005989 5.33576311070358e-05
119.463442966807 3.34031354687890e-05
111.144244573250 6.41222702868355e-05
173.039228088078 5.00996570230076e-07
165.559587158751 9.00480318029118e-07
138.160339828954 7.71371587607137e-06
95.3250058392377 0.000221597319419543
60.0333602575150 0.00352407741753751
54.1861685375761 0.00557325930003049
56.4702086397092 0.00465962108130436
52.3767863096953 0.00642256459946467
72.1970515958000 0.00135812749956365
102.799874943762 0.000123335325459509
110.177528614371 6.91703704314211e-05
95.2981218797184 0.000222064813486541
87.9751216314627 0.000394263426618208
155.066796297747 2.04971939701226e-06
132.938522696065 1.16154751292914e-05
96.1737502189897 0.000207333537000684
58.8071337814191 0.00387964079192246
47.2101216092149 0.00962951011815402
30.9153558963626 0.0345421058173638
39.5595017401398 0.0175414113027215
54.8423886982329 0.00529381383030883
86.2828088053633 0.000450194487483558
105.258518064895 0.000101714903385500
92.0892770310503 0.000285576698597029
82.0954508170408 0.000625109401305906
80.3018735340195 0.000719477460861742
83.2275334937708 0.000572025010731471
89.8896960146722 0.000339317346706426
95.9227174065241 0.000211453950903970
109.202461036929 7.46647538942236e-05
83.4140379392978 0.000563722794745074
50.8071382945717 0.00726350297680941
25.6991523787158 0.0519913434238956
22.6460930008800 0.0660496384278436
23.5216194620445 0.0616685475924222
40.4430393609615 0.0163676026283863
69.4438573905442 0.00168527677121324
91.8885348279150 0.000290106129810452
89.7826422647192 0.000342176860351312
78.8647537957364 0.000805272730753958
73.8655459916452 0.00119161989384632
76.2757661871421 0.000986468855880515
82.3912302647755 0.000610782257895265
88.7795618528225 0.000370168835015504
105.534861572445 9.95351917330333e-05
52.1755200000000 0.00652469868940434
36.8181900000000 0.0217465662818659
26.6011939320146 0.0484419510115361
17.8872025708472 0.0959143856622148
10.9388042526714 0.165362646828414
11.6821601192118 0.156002066714000
28.1224470222665 0.0429963472752433
49.0316459631967 0.00834817590092092
75.0830404469518 0.00108315084903152
81.5529651573552 0.000652265786828491
73.9274327458928 0.00118585298489987
65.5629027719636 0.00228452434549348
64.7187388916893 0.00244081462271457
67.2977288028631 0.00199404417691605
70.5111980792474 0.00155000936002892
75.3783119083087 0.00105836780688548
92.5585390518567 0.000275262500536277
98.1540954300663 0.000177521108912031
98.3375743313063 0.000174986112603729
98.2497352073914 0.000176195173885738
104.663061736749 0.000106575287098574
109.117542102396 7.51634398590547e-05
108.153823933222 8.10617174145388e-05
90.7355642522826 0.000317547744790193
88.5230440798946 0.000377687691302878
18.0360000000000 0.0948021176482752
11.1016800000000 0.163264746012734
20.3792723711797 0.0788937985494656
3.43500000000000 0.625493110644288
8.18531090653268 0.205200441552656
11.4233759960098 0.159199055841086
18.4491477007425 0.0917809811192703
32.7635094155509 0.0298833743513859
50.7232823082576 0.00731140667558126
65.6413866673516 0.00227051229402766
64.8303163479215 0.00241955899129544
52.8354254394713 0.00619575752006340
46.6985412695691 0.0100235280747557
43.9206440370906 0.0124621306882324
42.8129000804395 0.0135926682725199
46.3171177375004 0.0103277549616719
59.1375266296231 0.00378045009228973
69.1229585927413 0.00172820805094786
73.7083381422417 0.00120639570743325
78.0871035661738 0.000855889276167131
97.4631478461140 0.000187401412363113
104.259628197866 0.000109999609042267
104.998386181552 0.000103810339259792
87.7480619204905 0.000401343830306894
84.7246290259427 0.000508683185140011
65.7236267260005 0.00225592184084982
139.198864206429 7.11062469141181e-06
104.843124657709 0.000105081529904530
58.6822358015873 0.00391781195252033
5.98700000000000 0.229483757137695
2.43500000000000 0.807782797115697
5.12400000000000 0.335290618171155
5.79670000000000 0.250108682695640
10.7864348987831 0.167349619731113
19.4560847218647 0.0848149060062711
31.9967273337816 0.0317346876853389
44.6314370948013 0.0117867430929653
48.4775904758348 0.00871874643099029
41.4237867231335 0.0151564039535630
33.1363497295100 0.0290226143647540
29.8516130505924 0.0375459621587331
31.4993114934254 0.0329965417032550
37.0637871870000 0.0213318979638735
48.3018142409018 0.00883971440259736
54.7139851506801 0.00534736807418868
58.4657486310524 0.00398486626422182
65.7574179021228 0.00224995405886591
77.5208782918081 0.000894734849429086
95.6237894547783 0.000216467454540721
99.0011314971387 0.000166116669199869
62.8424590748452 0.00282755793942827
42.3517313966277 0.0140930471085023
30.5000000000000 0.0356852981369460
36.5896497196240 0.0221396727349529
38.7880204893743 0.0186349874769151
38.3458106184465 0.0192922930570955
38.3869921600900 0.0192301136889291
12.1224781052608 0.150709286837519
115.959577730509 4.39616546075342e-05
102.642110579109 0.000124870102597256
53.5494336422404 0.00585850050226190
4.89938900000000 0.368084806589385
2.48690000000000 0.799194560400488
5.79476593611392 0.250325939856079
10.6683541325421 0.168905858028150
19.4792652496846 0.0846609269523174
29.5510335903589 0.0384411409093322
32.8945557208097 0.0295779622104205
28.8269528101520 0.0406861994984267
25.1762720034484 0.0541666727128294
29.5014027373441 0.0385909898826065
41.1555090239589 0.0154785227602777
51.6538899969049 0.00679702726860992
58.3808073174849 0.00401148822724458
53.7299960528500 0.00577616170080593
52.6468925310462 0.00628800519664331
61.8853046693850 0.00304787538877360
74.8901312929523 0.00109965489088389
90.5135288727771 0.000323123155755078
79.2713791130561 0.000780009155459333
37.9290543343900 0.0199329714571605
16.3724471699145 0.108007174278639
34.6992351854189 0.0256761036654916
36.4094593179439 0.0224546174733544
35.5000000000000 0.0241139084243252
25.3000000000000 0.0536438476633137
12.3000000000000 0.148626550473379
101.977900433978 0.000131544007185477
73.4204360655747 0.00123393198183242
47.2423186885046 0.00960523656312363
4.17800000000000 0.487158084447669
1.44770000000000 0.935831656094153
6.30694306697059 0.237753047648373
12.5028845850214 0.146281473218524
19.4089666914500 0.0851287561095103
20.5220782874146 0.0780155425361308
19.1911894278829 0.0865945125270047
23.2576891989925 0.0629577288631814
38.1096885983987 0.0196527110917651
61.7890354873692 0.00307096331331580
72.7046757228800 0.00130514514544995
66.6755814643918 0.00209370443942485
52.6300998510614 0.00629628803998617
49.3737580423046 0.00812726853974615
61.9284523433064 0.00303758383377243
77.0107082664668 0.000931242433953682
35.1428477193788 0.0247985691105552
14.0566234577376 0.129507018194262
55.6675537628533 0.00496222509300557
31.9911949534015 0.0317484534741359
7.54670000000000 0.215734389781468
2.35800000000000 0.820246143110866
7.31834058715205 0.219631044589109
10.5406151605977 0.170605686120530
11.0917981059417 0.163391266686859
12.8036590236060 0.142872833188184
23.5169749553856 0.0616910041424241
45.1888332807570 0.0112828192256579
69.0168571749084 0.00174264200120436
72.1004888143667 0.00136844692980075
58.3788116656606 0.00401211583012861
42.1169662161987 0.0143548060912798
38.4344000822303 0.0191587813111026
51.5207652338821 0.00686833006583973
69.3372411542552 0.00169942074199029
34.5349750259292 0.0260088559839011
13.0686196087636 0.139935932930367
35.6565064350946 0.0238198733660525
21.0985677544712 0.0745684175850716
5.93690506586048 0.234769954046308
5.25422886087489 0.317274269833174
8.54857339346618 0.199439537208861
20.7417719692137 0.0766834786080087
44.0498545693610 0.0123365411991028
57.5956001861787 0.00426616240301253
52.4330967138797 0.00639427677050234
38.1246846539885 0.0196296221017754
27.3491427165013 0.0456833769813232
24.6998905825477 0.0562276913562479
33.4388189464445 0.0283425658950303
49.8020399686211 0.00785894107382568
12.9405286019585 0.141348115227119
17.0309293932043 0.102573460731293
11.0038441016125 0.164521695319195
6.21102657774954 0.239547424926689
3.30600000000000 0.650106082326811
0.902500000000000 0.973630398480610
1.46550000000000 0.934202032553452
14.7174388223200 0.122969180359408
28.4821176216434 0.0418010135445005
35.1568893193108 0.0247712878216007
29.4594538092345 0.0387181004650474
20.3934885557517 0.0788059277420974
16.6897070056602 0.105354162950579
16.8992393848384 0.103637829386785
21.8150541844591 0.0704956982026017
33.9686622933175 0.0271894858761093
12.8942645814400 0.141861664135437
5.31797587715638 0.308723935875670
5.99509492367039 0.228639033835369
2.02400000000000 0.869932657633053
12.8831637677010 0.141985164859529
15.3119550056405 0.117369800009821
12.9484273347883 0.141260622155420
9.74307531513170 0.181612285102202
10.4686186518199 0.171571273802511
14.1652251477361 0.128409167636140
20.1650019091914 0.0802301426206960
30.4964980409297 0.0356950957587680
44.6264961727608 0.0117913092052979
12.2585543002453 0.149110212761395
5.15968323188230 0.330280836866953
5.75960940473435 0.254302280610194
5.05200000000000 0.345566901158644
5.35690916464499 0.303588704622129
5.93690506586048 0.234769954046308
5.93690506586048 0.234769954046308
6.39975284461559 0.236029586002151
11.5277643955979 0.157901644511949
20.0173612862576 0.0811640841458747
30.2737040907595 0.0363239797882875
39.5666249585826 0.0175316191041443
46.1814850645097 0.0104381480081872
56.6152659235020 0.00460693644860723
50.8812100559095 0.00722144976187197
10.2480211646121 0.174563995007503
6.22522444390289 0.239280963963967
2.17200000000000 0.848849166925210
6.08194384516291 0.241983661412031
7.40996584727971 0.218059195365965
14.4579764292344 0.125495890722127
22.9950286812900 0.0642674632722842
28.6794459925481 0.0411593869161488
35.6770058820640 0.0237816267197793
34.6650100776606 0.0257450827339442
30.3596284612548 0.0360801377104528
21.4615596363821 0.0724764823006559
14.8538738923666 0.121661015105867
3.50000000000000 0.613093031447497
2.49800000000000 0.797339038326733
5.31758753403477 0.308775489294215
7.65774361043524 0.213864634422704
14.9990017792852 0.120284772741938
19.5269185151008 0.0843452626728737
20.1479757126003 0.0803372959643244
18.2196535041381 0.0934470671161394
15.5782005432482 0.114945562472981
7.97640833558094 0.208588442853977
8.07512104824874 0.206980595660571
9.88332465044348 0.179626548971613
10.2214983311512 0.174927312919569
9.87824594440680 0.179698076088530
8.55095746630339 0.199402267941080
7.32955232283202 0.219438098309888
8.52882042888337 0.199748595564067
8.77814150061791 0.195882555860071
8.31978075623978 0.203048765350009
7.91635653905649 0.209572679483789
4.19966075819978 0.483311564625295
4.42530000000000 0.444155179771007
3.75660000000000 0.564455554938093
8.38047147114645 0.202085045969904
5.96560981600397 0.231728542402306
5.54471724098511 0.279739038320913
4.42210000000000 0.444698185979662
3.67470000000000 0.579898535393030
5.48673956323277 0.286939161052285
5.01302249490035 0.351223287378069
0.950000000000000 0.971215153313286
0.815691055789701 0.977657278639089
0.750000000000000 0.980387352505937
0.500000000000000 0.988541587449508
0.600000000000000 0.985677011577326
2.53600000000000 0.790938556947510
4.84157964922138 0.376872917346871
6.24262589789517 0.238954783328257
11.1346575207735 0.162843234097248
7.73280677934369 0.212609906908824
5.19075234424179 0.325963846419964
17.3199887556118 0.100275346637730
13.3713302619646 0.136654413246417
9.57431518827266 0.184030815561607
30.3116760976761 0.0362160176604821
26.4473202021243 0.0490298039179392
18.6349510221530 0.0904538681412840
11.1942663196016 0.162084086052568
40.4913476739003 0.0163057375517541
32.2535102027946 0.0311022798096939
21.7835875703388 0.0706698023173357
12.9894659603939 0.140806914395135
56.4567425909519 0.00466454239093475
45.6399135621243 0.0108908279545437
33.0165518518083 0.0292964482169379
16.3198368721052 0.108453528738031
3.90500000000000 0.536764324037570
65.9428437088657 0.00221748632590354
63.3360321323981 0.00272024575740834
57.3777838166273 0.00433963096628919
42.6459176185540 0.0137717625655879
24.0029449816352 0.0593850748689063
5.15050000000000 0.331564849610643
75.7341859186769 0.00102925058794945
80.1128381406387 0.000730218412217384
70.1061255544638 0.00160001756107767
44.0637615996939 0.0123230995741544
21.7937804759747 0.0706133581526017
85.1442984138169 0.000492220857633261
95.6379135272310 0.000216227917427577
94.9558501531546 0.000228103613876112
71.8175883335864 0.00139913338970519
42.6157814689909 0.0138043350614287
22.1589590208922 0.0686206142886749
4.29505000000000 0.466549144960540
112.195733480956 5.90488766340447e-05
118.091123100090 3.71969186641526e-05
103.281127243548 0.000118769127239403
73.4521123847273 0.00123087179806608
44.0039082705724 0.0123810542079096
22.9433747877735 0.0645282193522671
11.1219414606448 0.163005639109723
135.064000472658 9.83278360957451e-06
128.874658858924 1.59730760523741e-05
107.238975229749 8.70885831522357e-05
77.2840186472578 0.000911502962542375
47.1338979189531 0.00968722036976871
24.0083107667764 0.0593601013398783
11.1106094766547 0.163150503670796
143.000532780105 5.27815867670455e-06
131.352256127116 1.31534713957140e-05
108.626188214863 7.81150056265159e-05
77.0376906762032 0.000929274797153994
44.7830803144399 0.0116474598920857
21.5529584965590 0.0719590617517615
9.10281531619113 0.190960021465178
137.823040016881 7.92039405598581e-06
120.766856891847 3.01587517385367e-05
96.5704879744579 0.000200984645327945
67.4436800397112 0.00197136009633303
38.1309022064232 0.0196200570741672
16.0141618362189 0.111083663289264
132.732983324596 1.18041421937269e-05
117.112580715478 4.01625055957344e-05
97.8781758340800 0.000181402598526634
79.7546352813535 0.000751013183609921
55.4565787149072 0.00504497441084773
25.9926005450177 0.0508090165689539
8.46530626810550 0.200745598783124
118.193628895298 3.68992231121362e-05
94.8647984040639 0.000229737538221302
70.2018808521699 0.00158805237984796
57.0875016033921 0.00443951233691400
31.0926341997196 0.0340653995143397
10.9255157202700 0.165534992872173
100.500000000000 0.000147701606470484
60.6582672268406 0.00335560546014088
65.7280016965648 0.00225514829621312
57.0829785747662 0.00444108669044321
38.5693253515109 0.0189572107330428
18.6000189742853 0.0907018995099142
7.00934991254385 0.225015850733861
80.6261984059532 0.000701416157150316
64.9259897569028 0.00240148056691755
61.7310030417641 0.00308496545211825
53.9784332716895 0.00566475929034600
50.3735504258976 0.00751462535639661
44.3000000000000 0.0120969915211642
20.5855704790468 0.0776282119535398
4.57400000000000 0.419341002962649
86.3973483621137 0.000446170393805624
64.8372826563307 0.00241823805765465
59.7558562447016 0.00360157848007560
48.7871111993287 0.00850974638512371
62.3074141001959 0.00294867405303013
64.2066272749068 0.00254079309645972
44.4355456467927 0.0119691363268503
20.7067161892120 0.0768944963477998
92.9132387199471 0.000267714277430105
71.2188709882843 0.00146636491351283
57.9920318479809 0.00413562477140768
36.9153019744865 0.0215816467347285
51.3728548203810 0.00694842974239916
70.2142942036301 0.00158650782528743
63.6704618794992 0.00264985860067723
35.4638564127479 0.0241823271393581
13.8091985870070 0.132043407052665
4.95734800000000 0.359415765587999
92.0356996421249 0.000286778623408410
66.5168690449470 0.00211991590965480
58.1220019494259 0.00409370347011465
26.1095195022094 0.0503454653876905
30.6419629424702 0.0352903766989764
54.3925060709663 0.00548383808438570
67.3395494244399 0.00198751776861815
50.4908648242405 0.00744583557962104
25.3787083356148 0.0533138869636654
10.9413546899758 0.165329589380806
3.15930000000000 0.677980723506276
84.0925082418949 0.000534524381510787
65.6549814089402 0.00226809391656112
52.8255236631808 0.00620056853547273
22.3308523660047 0.0677021725403233
18.4715656602152 0.0916198320158549
37.5766383295927 0.0204913143970953
62.6150246892878 0.00287842135051348
65.7073672409378 0.00225879902925787
44.8086121578822 0.0116241714988446
23.1224046440351 0.0636289456458179
11.0231180896166 0.164273309166289
3.53537000000000 0.606352826762644
72.4265000528198 0.00133391796210895
58.2647947619799 0.00404813598956840
44.1837900143889 0.0122076949662190
19.7470837350693 0.0829020585104941
26.6826887825175 0.0481334717467709
54.1714186821135 0.00557970705874641
73.3023274707877 0.00124540943167682
65.6655701948485 0.00226621205516219
43.2481479195769 0.0131367214351077
23.9671102888605 0.0595521269096065
13.9524732559178 0.130568684790958
66.2291974850659 0.00216826432271911
67.1692091340834 0.00201423502486729
35.9818836379744 0.0232199988952597
17.1013879738429 0.102008483745798
17.9033548583105 0.0957930178478541
38.9106089857730 0.0184567682988021
63.1020099987418 0.00277060919849163
72.6258963718997 0.00131323002513129
61.5261860240330 0.00313489620363845
40.6782202282729 0.0160686168122605
25.0151840268643 0.0548550093768112
14.3641470385267 0.126422351899001
57.7896223163089 0.00420176759916532
54.7822040094075 0.00531884840542551
30.7969525368802 0.0348642056809546
16.1188515219495 0.110175771838050
11.5009371290675 0.158234059410279
23.6211244666450 0.0611893919371079
42.2036587227645 0.0142575840588663
58.3957530136542 0.00400679114729627
60.4746844460922 0.00340424531004204
45.3730802105985 0.0111210313226513
29.5339102926540 0.0384927749186653
17.5431182624139 0.0985366683565490
8.61075953644658 0.198469680822241
66.3608476330475 0.00214600278317144
45.8726890114777 0.0106939022459211
30.8597746724118 0.0346929345346124
20.5926000075369 0.0775854471195465
14.0998507855533 0.129068914673886
24.6932910224918 0.0562567876883909
35.9098613307261 0.0233514658012286
40.5721786814209 0.0162027454521891
32.7858199234299 0.0298311563748799
22.9777061031504 0.0643547924262527
15.0798092004655 0.119525237775718
9.07122791855388 0.191433450363434
52.3538022612864 0.00643414669040205
57.8805072356908 0.00417193862085746
40.5398349398436 0.0162438784354768
33.8462594998350 0.0274516288469396
28.5470540090686 0.0415887718466252
15.3573210947961 0.116953145228020
8.71536440401067 0.196848888598533
14.1532407109725 0.128529859596254
19.5485537931163 0.0842023352337335
21.7117935138342 0.0710686487365630
18.1408868384041 0.0940258427925923
13.4338930560729 0.135985860090486
11.1773650310324 0.162298972282371
6.84546227424700 0.227925312696054
2.40000000000000 0.813490312963344
52.0444528909693 0.00659208129530772
55.0129586602541 0.00522350147512033
37.9273598445212 0.0199356193507616
34.4273559664173 0.0262292015443880
31.6003809618924 0.0327361484155887
17.3898448480867 0.0997277376524228
9.74296301370484 0.181613883898276
10.8423684664227 0.166617459471557
59.4287331060380 0.00369512875263730
60.8103807215254 0.00331583024185819
40.4501988089189 0.0163584192303149
36.0366025105692 0.0231206120515096
31.9881502695118 0.0317560318698155
17.3952028255883 0.0996858596154536
69.9749842669977 0.00161655084328113
52.7345941442112 0.00624492386474148
47.9055713695616 0.00911859784694278
39.9554658278358 0.0170052959298811
32.8282678824215 0.0297320583017557
17.2596170653361 0.100751028108114
8.22851597517459 0.204506634966301
84.4659225092295 0.000519104598064849
66.3175378171574 0.00215330096566067
61.3592569994423 0.00317618766745161
40.3192568300672 0.0165271956313528
27.9146891109710 0.0437023251449535
14.4040998313928 0.126027029185427
6.79499281023907 0.228828840037901
77.4910653043309 0.000896828325957076
54.0774214347431 0.00562097266392941
43.5455697766794 0.0128339829686675
21.7088493383454 0.0710850528412608
11.2337839889570 0.161582760476911
19.8278629621002 0.0823787577573956
149.583647695744 3.15039210600060e-06
92.9814287500877 0.000266287051082233
40.8182899182089 0.0158931474824857
31.7670782267558 0.0323111549429379
39.5480460149245 0.0175571708159820
99.8485050790026 0.000155440769094681
46.6224276692476 0.0100835126798416
13.6079077106534 0.134143470375968
28.9308938197572 0.0403560378538071
50.6266841498420 0.00736698120582471
54.6307109655935 0.00538238914437839
37.0467176599567 0.0213604608601606
140.962774688636 6.19236547455093e-06
76.4201933946805 0.000975363386678589
15.3873158464539 0.116678477670851
32.0059975941825 0.0317116346011532
50.6723928566388 0.00734063176935432
47.2990773951234 0.00956259477361423
26.8958630736746 0.0473358094897267
12.7862324313754 0.143068140931842
145.986737370994 4.17656326747772e-06
82.6611991610966 0.000597992172151462
24.4000730831804 0.0575648453781607
37.3129332522890 0.0209193161411852
32.9602066233090 0.0294261339650100
17.4411084471866 0.0993277805626203
0.600000000000000 0.985677011577326
83.4048019911785 0.000564131081198705
38.8434568345855 0.0185541819521631
16.0433260884076 0.110829995479868
25.4093905588080 0.0531858115808315
24.0780244989947 0.0590365915010434
13.6317435327561 0.133893058649082
0.700000000000000 0.982291620857682
0.600000000000000 0.985677011577326
0.500000000000000 0.988541587449508
95.8372778417625 0.000212874939768514
53.4659989367605 0.00589694329119684
17.6194240033628 0.0979490200209608
17.9982504983407 0.0950830699941747
5.04250240325928 0.346939161554136
0.900000000000000 0.973753287814607
0.500000000000000 0.988541587449508
73.6302938907826 0.00121379892524782
34.3031503588560 0.0264858288728638
5.26660728454590 0.315600141190466
5.69392228126526 0.261870324434820
2.20000000000000 0.844687663912349
102.604118635155 0.000125242543623630
49.8329307414562 0.00783993345348739
14.8248536544265 0.121938096363585
26.2440643310547 0.0498172636781713
8.12088584899902 0.206239382555395
29.0443553924561 0.0399986925711634
10.1891927719116 0.175370865979568
31.1829433441162 0.0338250907955999
12.4537124633789 0.146846418287677
27.7944889068604 0.0441160561694436
12.0856180191040 0.151145385359739
22.7137660980225 0.0657001798315868
11.9283523559570 0.153020246987682
21.0641384124756 0.0747699433174583
36.0026893615723 0.0231821588564339
19.6494808197022 0.0835387825426895
21.3486614227295 0.0731207524817773
8.55476284027100 0.199342794464448
17.5718402862549 0.0983150607019039
7.61885070800781 0.214517663022840
0.900000000000000 0.973753287814607
Looking at data with a log plot, the tail seems to be compatible with an exponential decay:
The first peak can really be anything. A Gaussian fits fine, as well as the sigmoid you suggested. Here's a fit using the sigmoid + exponential decay:
import fitwrap as fw
def f(x, A=0.5, x0=5, B=1, t=20):
first_peak = A * (-1/(1 + np.exp(-(x-x0)))+1)
decay = B * np.exp(-x/t)
return first_peak + decay
fw.fit(f, x, y, plot_range_x=(0,200))
fit results:
A: 0.71395 +/- 0.00282 (0.4%) initial:0.5
x0: 3.4017 +/- 0.0126 (0.4%) initial:5
B: 0.33547 +/- 0.0026 (0.8%) initial:1
t: 14.225 +/- 0.116 (0.8%) initial:20

Mysql ST_Contains return wrong result

I am using St_contains to find whether a point is in polygon, but the result seems to be inaccurate. If a point is not in the polygon, St_contains will still return 1.
here is my code
SET #i = ST_GeomFromText
(
'POLYGON((43.120825901794 -79.804519106556,43.121675995356 -79.808262109949,43.122060291437 -79.809953891553,43.122354803231 -79.811250508027,43.122502706668 -79.811978610103,43.122504906903 -79.811986283924,43.122508088955 -79.811996589915,43.122511303346 -79.812006400094,43.122515398461 -79.812018485988,43.122519502329 -79.812029908205,43.122524189401 -79.812042396061,43.122529607259 -79.812055910908,43.122534497156 -79.812067301339,43.122539412616 -79.812078511034,43.122544813239 -79.812089906984,43.122551308513 -79.812103104857,43.122556500525 -79.812113197823,43.122556947646 -79.81211402064,43.122561101914 -79.81212180938,43.122567611947 -79.812133297692,43.12257380731 -79.812143998195,43.122581413338 -79.812156209043,43.122588306761 -79.812166796322,43.122597209243 -79.812179886041,43.122606608303 -79.812192880573,43.122615299471 -79.812204285086,43.122624697158 -79.812215817893,43.122632697612 -79.812225210299,43.122640110139 -79.812233503458,43.122647597468 -79.812241602988,43.122654393768 -79.812248595486,43.122657689796 -79.81225190959,43.122665191582 -79.812259204694,43.122669705582 -79.812263383434,43.122673696679 -79.812267107346,43.122678788478 -79.812271587283,43.122683499255 -79.812275714497,43.122688998725 -79.812280192156,43.122693910958 -79.812284301463,43.122704110012 -79.812292282669,43.122706800281 -79.812294188955,43.122715799598 -79.812300708994,43.122730907194 -79.812312591598,43.122740295329 -79.812321516184,43.122746889145 -79.812328700988,43.122754011258 -79.812337105016,43.122760200793 -79.812345405227,43.122766789948 -79.812355097555,43.12277320192 -79.81236570656,43.12277941111 -79.812377413051,43.122783094344 -79.812385116304,43.122788695772 -79.812398304727,43.122793496059 -79.812411598466,43.122796593147 -79.812421300181,43.122799710508 -79.812432597886,43.122802193416 -79.812443191512,43.122803993055 -79.812452188659,43.122805891151 -79.812463701229,43.122806890277 -79.81247099346,43.122808511891 -79.812488705099,43.122809106538 -79.812503100133,43.122809109847 -79.812515282914,43.122808503102 -79.81253020137,43.122807204003 -79.812545092356,43.122805708405 -79.812556588469,43.122803493502 -79.812569317318,43.122800909017 -79.812581411864,43.122799110463 -79.812588392426,43.122797795926 -79.812593192326,43.122789308453 -79.812618807415,43.122785206163 -79.812630081095,43.122779307318 -79.812647986598,43.122773098226 -79.812668584165,43.122767591602 -79.812690007256,43.122761402516 -79.812718188204,43.12275719202 -79.812741395308,43.122753597693 -79.812765903096,43.122750802611 -79.812793195292,43.122750127663 -79.812802910099,43.122748997299 -79.812819183992,43.122748294917 -79.81283959272,43.12274821248 -79.812861510037,43.122748690312 -79.812882514783,43.122750411098 -79.81291109605,43.122752695783 -79.812933890352,43.122755301773 -79.812954616298,43.122758590734 -79.812975302669,43.122763193312 -79.812998986918,43.12276340289 -79.813000115557,43.122763695683 -79.813001292097,43.122763890121 -79.81300249433,43.122764303539 -79.81300489243,43.122764692381 -79.813007296966,43.122764989888 -79.813008507055,43.122765208902 -79.813009702853,43.122765792147 -79.813013309692,43.122766294518 -79.813015614871,43.122766513532 -79.813016810669,43.122766707928 -79.813018012913,43.122766902374 -79.813019215204,43.122767286494 -79.813021586131,43.122767608576 -79.813022789786,43.122767803022 -79.813023992078,43.122767997417 -79.813025194322,43.122768191856 -79.813026396555,43.122768694226 -79.813028701735,43.122768888629 -79.813029904037,43.122769107643 -79.813031099835,43.122769690888 -79.813034706674,43.122770013004 -79.81303591026,43.122770207408 -79.813037112563,43.122770401846 -79.813038314796,43.122770596249 -79.813039517099,43.122770790644 -79.813040719343,43.122771093897 -79.81304178867,43.1227712883 -79.813042990973,43.122771507314 -79.813044186771,43.12277170176 -79.813045389063,43.122771896155 -79.813046591307,43.122772193661 -79.813047801397,43.122772388099 -79.813049003631,43.12277260712 -79.813050199487,43.122772801515 -79.813051401732,43.122772995918 -79.813052604035,43.122773303885 -79.813053706912,43.122773498288 -79.813054909215,43.122774106142 -79.81305850955,43.122774398926 -79.813059686031,43.122774593372 -79.813060888323,43.122775201183 -79.813064488669,43.122775498731 -79.813065698749,43.12277589799 -79.813067996083,43.122776092393 -79.813069198386,43.122776389898 -79.813070408477,43.122776608911 -79.813071604275,43.122777192189 -79.813075211045,43.122777509557 -79.813076381151,43.122777703994 -79.813077583384,43.122778107974 -79.813079914327,43.122778400766 -79.813081090868,43.12277859516 -79.813082293113,43.122778789606 -79.813083495405,43.122779008619 -79.813084691203,43.122779203013 -79.813085893448,43.122779500519 -79.813087103539,43.122779694964 -79.813088305831,43.122779899828 -79.813089400921,43.122780094222 -79.813090603166,43.122780391727 -79.813091813256,43.122780610749 -79.813093009114,43.12278099958 -79.813095413592,43.122781292372 -79.813096590133,43.122781486766 -79.813097792378,43.122781705787 -79.813098988235,43.122781900224 -79.813100190469,43.122782208155 -79.813101293416,43.122782402593 -79.81310249565,43.122782791432 -79.813104900187,43.122783088937 -79.813106110278,43.12278330795 -79.813107306076,43.122783696746 -79.813109710625,43.12278398958 -79.813110887155,43.122784199114 -79.813112015806,43.122784612572 -79.813114413897,43.122784905355 -79.81311559038,43.122785488597 -79.813119197221,43.12278581072 -79.813120400866,43.122785990965 -79.813121502402,43.122786209977 -79.813122698201,43.122786404379 -79.813123900505,43.122786701919 -79.813125110526,43.122787309735 -79.813128710933,43.122787602518 -79.813129887415,43.122788001826 -79.813132184798,43.122788299331 -79.813133394889,43.122788907182 -79.813136995226,43.122789204686 -79.813138205317,43.12278939908 -79.813139407563,43.122789593525 -79.813140609855,43.122789901447 -79.813141712744,43.122790095892 -79.813142915037,43.122790509298 -79.813145313081,43.122790802089 -79.813146489623,43.122790996482 -79.813147691868,43.122791190927 -79.813148894161,43.122791488432 -79.813150104252,43.122791887688 -79.813152401588,43.122792106708 -79.813153597446,43.122792404204 -79.813154807479,43.122792598649 -79.813156009771,43.122792793042 -79.813157212017,43.122793085833 -79.813158388558,43.122793304845 -79.813159584358,43.122793704109 -79.813161881752,43.122794001657 -79.813163091833,43.122794390443 -79.813165496324,43.122794712566 -79.813166699969,43.122794906968 -79.813167902273,43.122795101404 -79.813169104507,43.122795409334 -79.813170207455,43.122795603771 -79.81317140969,43.122795798172 -79.813172611994,43.122795992608 -79.813173814228,43.122796309966 -79.813174984276,43.122796698803 -79.813177388815,43.122796996308 -79.813178598907,43.12279720117 -79.813179693997,43.122797395614 -79.81318089629,43.122797693118 -79.813182106382,43.12279791213 -79.813183302181,43.122798106523 -79.813184504427,43.122798404027 -79.813185714519,43.122798803291 -79.813188011914,43.122799096116 -79.813189188386,43.122799290517 -79.81319039069,43.122799509528 -79.81319158649,43.122799807032 -79.813192796582,43.122800400731 -79.813196296212,43.122800698235 -79.813197506304,43.122800892628 -79.813198708549,43.122801111648 -79.813199904408,43.122801409152 -79.8132011145,43.122801598874 -79.813202283184,43.122801793266 -79.81320348543,43.122802101239 -79.813204588367,43.122802295632 -79.813205790613,43.122802490068 -79.813206992848,43.122802812147 -79.813208196505,43.122803006591 -79.813209398798,43.122803200984 -79.813210601044,43.122803498487 -79.813211811136,43.122803703349 -79.813212906227,43.122804000853 -79.813214116319,43.122804195289 -79.813215318554,43.122804409543 -79.813216480815,43.12280470709 -79.813217690896,43.122804901491 -79.813218893201,43.122805095883 -79.813220095447,43.122805403856 -79.813221198384,43.122805598248 -79.81322240063,43.122805792692 -79.813223602923,43.122806090187 -79.813224812957,43.122806503599 -79.813227211061,43.122806796389 -79.813228387604,43.122807001251 -79.813229482695,43.122807195686 -79.81323068493,43.122807493189 -79.813231895022,43.122807906601 -79.813234293127,43.122808204104 -79.813235503219,43.12280839854 -79.813236705454,43.122808706469 -79.813237808403,43.122808900905 -79.813239010638,43.122809095305 -79.813240212943,43.122809388086 -79.813241389426,43.122809607105 -79.813242585285,43.122809801541 -79.81324378752,43.12281010947 -79.813244890469,43.122810303905 -79.813246092704,43.122810601409 -79.813247302796,43.122810990244 -79.813249707336,43.122811312323 -79.813250910994,43.122811506758 -79.813252113229,43.122811711576 -79.813253208332,43.122812004409 -79.813254384863,43.122812198801 -79.813255587109,43.122812496304 -79.813256797202,43.122812909715 -79.813259195307,43.122813193103 -79.813260304621,43.122813412079 -79.813261500491,43.122813606514 -79.813262702726,43.122813904017 -79.813263912819,43.122814098409 -79.813265115065,43.122814391241 -79.813266291597,43.122814790494 -79.813268588935,43.122815087997 -79.813269799028,43.122815307016 -79.813270994887,43.122815604519 -79.813272204979,43.122816003772 -79.813274502317,43.122816301274 -79.81327571241,43.122816690109 -79.813278116951,43.122817007509 -79.813279286989,43.122817201909 -79.813280489294,43.122817509872 -79.813281592173,43.122817704272 -79.813282794479,43.122818001775 -79.813284004572,43.122818390601 -79.813286409054,43.122818712723 -79.8132876127,43.122818892965 -79.813288714238,43.122819210372 -79.813289884335,43.122819599207 -79.813292288876,43.122819896709 -79.813293498969,43.122820091101 -79.813294701216,43.122820399073 -79.813295804154,43.122820812474 -79.813298202201,43.122821109977 -79.813299412294,43.12282130442 -79.813300614588,43.1228215972 -79.813301791073,43.122821802061 -79.813302886165,43.12282199646 -79.81330408847,43.122822293963 -79.813305298563,43.122822488397 -79.813306500799,43.122822810475 -79.813307704457,43.12282300491 -79.813308906693,43.122823312838 -79.813310009642,43.122823701672 -79.813312414183,43.122823994452 -79.813313590668,43.122824188895 -79.813314792962,43.122824510965 -79.813315996562,43.122824691258 -79.813317098148,43.122824988752 -79.813318308182,43.122825402161 -79.813320706289,43.122825699663 -79.813321916382,43.122825904524 -79.813323011474,43.122826197312 -79.813324188017,43.122826391746 -79.813325390253,43.122826689248 -79.813326600347,43.122826908258 -79.813327796147,43.12282720576 -79.813329006241,43.122827410621 -79.813330101333,43.12282760502 -79.813331303639,43.122827902522 -79.813332513732,43.122828096956 -79.813333715968,43.122828389744 -79.813334892512,43.122828594604 -79.813335987604,43.122828892106 -79.813337197697,43.122829111116 -79.813338393498,43.122829408618 -79.813339603592,43.122829603009 -79.813340805839,43.122829797451 -79.813342008134,43.122830105371 -79.813343111025,43.122830299813 -79.813344313319,43.122830592593 -79.813345489804,43.122830786992 -79.81334669211,43.122831109104 -79.813347895699,43.122831289354 -79.813348997296,43.122831611466 -79.813350200885,43.122831805865 -79.813351403191,43.122832103367 -79.813352613285,43.122832297801 -79.813353815521,43.122832502661 -79.813354910613,43.122832795449 -79.813356087157,43.122832989839 -79.813357289404,43.122833287341 -79.813358499498,43.12283350635 -79.813359695299,43.122833789703 -79.813360804684,43.122834008712 -79.813362000485,43.122834306214 -79.813363210579,43.122834500656 -79.813364412874,43.122834793435 -79.813365589359,43.122834987834 -79.813366791665,43.122835295797 -79.813367894546,43.122835490195 -79.813369096852,43.122835812307 -79.813370300441,43.122836006706 -79.813371502747,43.122836509067 -79.813373807933,43.12283680189 -79.813374984407,43.122837190679 -79.813377388961,43.12283769304 -79.813379694148,43.122837990585 -79.81338090423,43.122838209551 -79.813382100043,43.122838701493 -79.813384512432,43.122839004742 -79.813385581763,43.122839199133 -79.81338678401,43.122839496634 -79.813387994104,43.122839691075 -79.813389196399,43.122839988568 -79.813390406435,43.122840193436 -79.813391501586,43.122840490929 -79.813392711622,43.122841002725 -79.813395083968,43.122841197124 -79.813396286274,43.122841505086 -79.813397389155,43.122841699485 -79.813398591461,43.122841996986 -79.813399801555,43.122842191419 -79.813401003792,43.122842513495 -79.813402207451,43.122842693779 -79.813403308979,43.12284299128 -79.813404519073,43.122843205575 -79.813405681325,43.122843503076 -79.813406891419,43.122843707936 -79.813407986512,43.122844005437 -79.813409196606,43.122844199827 -79.813410398854,43.122844497328 -79.813411608949,43.12284469176 -79.813412811185,43.122844999688 -79.813413914136,43.122845194121 -79.813415116373,43.122845486908 -79.813416292917,43.122845809028 -79.813417496565,43.122846003417 -79.813418698813,43.122846311388 -79.813419801753,43.122846997711 -79.813423416332,43.122847290498 -79.813424592877,43.12292490524 -79.813778482048,43.123728589986 -79.817340495521,43.123819001797 -79.817730797992,43.125562096479 -79.82526180161,43.126352290224 -79.828680091806,43.126371493927 -79.828764987565,43.127407795926 -79.833244795444,43.129189298146 -79.841079299819,43.129566009762 -79.842707403722,43.128570609264 -79.843119504623,43.127118002929 -79.843724698354,43.126588898469 -79.843943683782,43.119640788552 -79.846975508053,43.116269602609 -79.848427805095,43.115463209268 -79.848823994691,43.113553793286 -79.849683312169,43.113553715867 -79.849683123551,43.111654261814 -79.841693177344,43.111654208955 -79.841692982329,43.110268846789 -79.835610897079,43.110268793917 -79.835610702076,43.109590047052 -79.832624887046,43.109589994225 -79.832624692097,43.108344757178 -79.827081207958,43.108344704287 -79.827081012972,43.107372852097 -79.822761396678,43.107372799197 -79.822761201701,43.106127695209 -79.817279292439,43.104760196603 -79.811320584182,43.106392005228 -79.810637687702,43.111636709371 -79.808422109977,43.114581813649 -79.80715971253,43.117057714176 -79.80609846923,43.117463786158 -79.805924387244,43.118438988571 -79.805514488995,43.12053000068 -79.804635487977,43.120825901794 -79.804519106556))',
4326
);
set #j = ST_GeomFromText('Point(43.6645419 -79.8133914)', 4326);
SELECT ST_Contains(#i, #j)
MySQL Online compiler
and here is the map, which shows the position of point and polygon
polygon & point position in map
I have been searching for a long time and still don't know where the problem is. Please help me to check it out. Thank you in advance.

Unexpected geometry from ST_Buffer

I am trying to buffer a handful of geometries and then run the same buffer as a negative. But am getting unexpected artifacts in the responding geometries.
Running a positive buffer (original geom is orange):
Running a positive and negative buffer (original geom is orange):
I can produce slightly better geometries by running the first buffer with side=left join-mitre but it's still not perfect and the geometry from the second buffer is messed up as a result.
SELECT st_buffer(st_geomfromtext(‘MULTIPOLYGON(((-99.400052685 43.795919295,-99.400064934 43.795917471,-99.400068168 43.795917099,-99.400072016 43.795917004,-99.400082687 43.795916553,-99.400087109 43.795916442,-99.400091512 43.795916534,-99.400102708 43.795917259,-99.400106058 43.795917354,-99.400109425 43.795917222,-99.400122303 43.795917659,-99.400125003 43.795917529,-99.40012833 43.795917182,-99.400140112 43.79591678,-99.400143939 43.795916284,-99.400151102 43.795914317,-99.400154258 43.795913273,-99.400162849 43.79591142,-99.400171678 43.795912113,-99.400173213 43.795911934,-99.400181806 43.795913203,-99.400190937 43.795912274,-99.400191842 43.795912096,-99.400200734 43.795910966,-99.400206629 43.795909874,-99.400219126 43.79590593,-99.400219643 43.795905808,-99.400219939 43.795905767,-99.400236211 43.795907224,-99.400238595 43.795907054,-99.40023996 43.795906474,-99.400241563 43.795905477,-99.400248384 43.795898859,-99.400257453 43.795894191,-99.400260802 43.795894113,-99.400270951 43.795895604,-99.400276405 43.795895518,-99.400280172 43.795894353,-99.400293104 43.795891574,-99.400294617 43.795891058,-99.40029532 43.79589091,-99.40029628 43.795890866,-99.40031001 43.795888446,-99.400314246 43.79588831,-99.400318686 43.795888268,-99.400328433 43.795888006,-99.400333187 43.795887963,-99.400340961 43.795885765,-99.400343233 43.795884967,-99.400352098 43.795883099,-99.400358531 43.795882286,-99.400366054 43.795881201,-99.400371025 43.79588054,-99.40037636 43.79588142,-99.400383229 43.795882428,-99.400389989 43.79588361,-99.400398278 43.795883486,-99.400400626 43.795883492,-99.400408932 43.795883369,-99.400416942 43.795883221,-99.400420381 43.795882834,-99.400427871 43.795882673,-99.400436963 43.795883927,-99.400437741 43.795883925,-99.400446837 43.795886037,-99.400450791 43.795888167,-99.40045281 43.795891014,-99.400456258 43.795897769,-99.400456352 43.79589789,-99.400458802 43.795904716,-99.400461192 43.795908137,-99.400465993 43.795917742,-99.4004662 43.795918263,-99.400466238 43.795918411,-99.40046624 43.795918586,-99.400469054 43.795929966,-99.400469142 43.795932123,-99.400469118 43.795934307,-99.400469016 43.795943781,-99.400468994 43.795945845,-99.400472371 43.795950296,-99.400474576 43.795953504,-99.400480276 43.795959528,-99.400482491 43.795961504,-99.400485252 43.79596483,-99.400490223 43.795969636,-99.400492709 43.795973206,-99.400495874 43.795979292,-99.400496256 43.795981086,-99.40049846 43.795986907,-99.40050068 43.795989566,-99.400502885 43.79599244,-99.400052685 43.795919295)))’), .0002, ‘join=mitre mitre_limit=5.0’)
Just add some 0 and change parameter of st_buffer
Here is example SQL query you can use
> SELECT st_buffer( st_geomfromtext('MULTIPOLYGON(((-99.400052685
> 43.795919295,-99.400064934 43.795917471,-99.400068168 43.795917099,-99.400072016 43.795917004,-99.400082687 43.795916553,-99.400087109 43.795916442,-99.400091512 43.795916534,-99.400102708 43.795917259,-99.400106058 43.795917354,-99.400109425 43.795917222,-99.400122303 43.795917659,-99.400125003 43.795917529,-99.40012833 43.795917182,-99.400140112 43.79591678,-99.400143939 43.795916284,-99.400151102 43.795914317,-99.400154258 43.795913273,-99.400162849 43.79591142,-99.400171678 43.795912113,-99.400173213 43.795911934,-99.400181806 43.795913203,-99.400190937 43.795912274,-99.400191842 43.795912096,-99.400200734 43.795910966,-99.400206629 43.795909874,-99.400219126 43.79590593,-99.400219643 43.795905808,-99.400219939 43.795905767,-99.400236211 43.795907224,-99.400238595 43.795907054,-99.40023996 43.795906474,-99.400241563 43.795905477,-99.400248384 43.795898859,-99.400257453 43.795894191,-99.400260802 43.795894113,-99.400270951 43.795895604,-99.400276405 43.795895518,-99.400280172 43.795894353,-99.400293104 43.795891574,-99.400294617 43.795891058,-99.40029532 43.79589091,-99.40029628 43.795890866,-99.40031001 43.795888446,-99.400314246 43.79588831,-99.400318686 43.795888268,-99.400328433 43.795888006,-99.400333187 43.795887963,-99.400340961 43.795885765,-99.400343233 43.795884967,-99.400352098 43.795883099,-99.400358531 43.795882286,-99.400366054 43.795881201,-99.400371025 43.79588054,-99.40037636 43.79588142,-99.400383229 43.795882428,-99.400389989 43.79588361,-99.400398278 43.795883486,-99.400400626 43.795883492,-99.400408932 43.795883369,-99.400416942 43.795883221,-99.400420381 43.795882834,-99.400427871 43.795882673,-99.400436963 43.795883927,-99.400437741 43.795883925,-99.400446837 43.795886037,-99.400450791 43.795888167,-99.40045281 43.795891014,-99.400456258 43.795897769,-99.400456352 43.79589789,-99.400458802 43.795904716,-99.400461192 43.795908137,-99.400465993 43.795917742,-99.4004662 43.795918263,-99.400466238 43.795918411,-99.40046624 43.795918586,-99.400469054 43.795929966,-99.400469142 43.795932123,-99.400469118 43.795934307,-99.400469016 43.795943781,-99.400468994 43.795945845,-99.400472371 43.795950296,-99.400474576 43.795953504,-99.400480276 43.795959528,-99.400482491 43.795961504,-99.400485252 43.79596483,-99.400490223 43.795969636,-99.400492709 43.795973206,-99.400495874 43.795979292,-99.400496256 43.795981086,-99.40049846 43.795986907,-99.40050068 43.795989566,-99.400502885 43.79599244,-99.400052685 43.795919295)))'),
> 0.00000001,'join=mitre' ) union all SELECT st_geomfromtext('MULTIPOLYGON(((-99.400052685
> 43.795919295,-99.400064934 43.795917471,-99.400068168 43.795917099,-99.400072016 43.795917004,-99.400082687 43.795916553,-99.400087109 43.795916442,-99.400091512 43.795916534,-99.400102708 43.795917259,-99.400106058 43.795917354,-99.400109425 43.795917222,-99.400122303 43.795917659,-99.400125003 43.795917529,-99.40012833 43.795917182,-99.400140112 43.79591678,-99.400143939 43.795916284,-99.400151102 43.795914317,-99.400154258 43.795913273,-99.400162849 43.79591142,-99.400171678 43.795912113,-99.400173213 43.795911934,-99.400181806 43.795913203,-99.400190937 43.795912274,-99.400191842 43.795912096,-99.400200734 43.795910966,-99.400206629 43.795909874,-99.400219126 43.79590593,-99.400219643 43.795905808,-99.400219939 43.795905767,-99.400236211 43.795907224,-99.400238595 43.795907054,-99.40023996 43.795906474,-99.400241563 43.795905477,-99.400248384 43.795898859,-99.400257453 43.795894191,-99.400260802 43.795894113,-99.400270951 43.795895604,-99.400276405 43.795895518,-99.400280172 43.795894353,-99.400293104 43.795891574,-99.400294617 43.795891058,-99.40029532 43.79589091,-99.40029628 43.795890866,-99.40031001 43.795888446,-99.400314246 43.79588831,-99.400318686 43.795888268,-99.400328433 43.795888006,-99.400333187 43.795887963,-99.400340961 43.795885765,-99.400343233 43.795884967,-99.400352098 43.795883099,-99.400358531 43.795882286,-99.400366054 43.795881201,-99.400371025 43.79588054,-99.40037636 43.79588142,-99.400383229 43.795882428,-99.400389989 43.79588361,-99.400398278 43.795883486,-99.400400626 43.795883492,-99.400408932 43.795883369,-99.400416942 43.795883221,-99.400420381 43.795882834,-99.400427871 43.795882673,-99.400436963 43.795883927,-99.400437741 43.795883925,-99.400446837 43.795886037,-99.400450791 43.795888167,-99.40045281 43.795891014,-99.400456258 43.795897769,-99.400456352 43.79589789,-99.400458802 43.795904716,-99.400461192 43.795908137,-99.400465993 43.795917742,-99.4004662 43.795918263,-99.400466238 43.795918411,-99.40046624 43.795918586,-99.400469054 43.795929966,-99.400469142 43.795932123,-99.400469118 43.795934307,-99.400469016 43.795943781,-99.400468994 43.795945845,-99.400472371 43.795950296,-99.400474576 43.795953504,-99.400480276 43.795959528,-99.400482491 43.795961504,-99.400485252 43.79596483,-99.400490223 43.795969636,-99.400492709 43.795973206,-99.400495874 43.795979292,-99.400496256 43.795981086,-99.40049846 43.795986907,-99.40050068 43.795989566,-99.400502885 43.79599244,-99.400052685 43.795919295)))')

How to find ArrayList length after filtered in apache royale

This code snippet is from TDJ List
<j:Card>
<html:H3 text="Jewel List"/>
<j:List id="list" width="200" height="300" dataProvider="{simple}" change="onChange(event)"/>
<j:TextInput width="200">
<j:beads>
<j:TextPrompt prompt="filter list..."/>
<j:SearchFilterForList list="{list}"/>
</j:beads>
</j:TextInput>
<j:Label id="selected" html="{describeItem(list.selectedItem)}"/>
</j:Card>
There is j:SearchFilterForList
What i want to know is when its work (type some text on the filter textbox), how to find filtered list length?
Thankyou
Just use the new "length" property just recently added. Tour de Jewel was updated as well showing the use of this new bead property in the List examples.
<j:Label html="{'list filtered length: ' + filter.length}"/>
<j:TextInput>
<j:beads>
<j:TextPrompt prompt="filter list..."/>
<j:SearchFilterForList id="filter" list="{iconList}"/>
</j:beads>
</j:TextInput>
Notice that the filtering performed by this bead is only visual, and the underlaying dataProvider is not filtered itself. To get a filtered view of the dataProvider you should use ArrayListView API, that is similar to flex ListCollectionView with filterFuncion.

KML polygon only showing up in preview

I have a KML file and made a fusion table out of this.
In this fusion table there are a lot of polygons split one per row.
One of these rows contains following polygon:
<Polygon><outerBoundaryIs><LinearRing><coordinates>4.479382,50.95028 4.479507,50.950126
4.479653,50.949947 4.479828,50.949733 4.479941,50.949767 4.480345,50.94989
4.481543,50.948703 4.481571,50.948675 4.481519,50.94866 4.480786,50.948436
4.480783,50.948441 4.480592,50.948373 4.480443,50.948309 4.480426,50.948301
4.48037,50.948277 4.480279,50.948216 4.4801,50.948037 4.479825,50.948314
4.479676,50.94827 4.479665,50.948267 4.479372,50.948181 4.479354,50.948172
4.479263,50.948147 4.478968,50.948063 4.478968,50.948063 4.479273,50.947683
4.479597,50.947277 4.479316,50.947176 4.479985,50.946633 4.48004,50.946588
4.480702,50.946051 4.481081,50.945742 4.480946,50.945554 4.48053,50.945347
4.480373,50.945268 4.48022,50.94523 4.4797,50.945143 4.479497,50.945419
4.479086,50.945992 4.478416,50.945788 4.478309,50.94586 4.477876,50.946167
4.477888,50.946216 4.478038,50.946882 4.478071,50.946879 4.478114,50.947004
4.477663,50.947448 4.47719,50.947878 4.477133,50.94789 4.476584,50.948023
4.47635,50.948079 4.476282,50.948029 4.476294,50.948017 4.47655,50.947759
4.476747,50.947527 4.476918,50.947186 4.476921,50.94718 4.476921,50.94718
4.476904,50.947161 4.476581,50.947041 4.476363,50.946908 4.476222,50.946787
4.476051,50.946585 4.475605,50.945866 4.47549,50.945572 4.475423,50.945457
4.475364,50.94539 4.474899,50.944991 4.474282,50.944517 4.474209,50.944402
4.474138,50.944215 4.474213,50.944401 4.474226,50.944417 4.474245,50.944438
4.474257,50.944452 4.474373,50.944541 4.474784,50.944855 4.474974,50.94501
4.475605,50.944623 4.475823,50.94449 4.476053,50.944349 4.475823,50.94449
4.475605,50.944623 4.474974,50.94501 4.474994,50.945026 4.475337,50.945314
4.475401,50.945383 4.475425,50.945421 4.475484,50.945511 4.475508,50.945559
4.475722,50.945376 4.475722,50.945376 4.476277,50.944903 4.476722,50.944523
4.476722,50.944523 4.478126,50.944855 4.478927,50.945014 4.479182,50.944685
4.479257,50.944588 4.479497,50.944332 4.479054,50.943961 4.478219,50.943253
4.478219,50.943253 4.477985,50.942901 4.477974,50.942881 4.476116,50.943658
4.475724,50.943821 4.475724,50.943821 4.476116,50.943657 4.477974,50.942881
4.477965,50.942865 4.477951,50.942845 4.477827,50.94266 4.477601,50.942643
4.477213,50.942614 4.476788,50.942583 4.476351,50.94255 4.47554,50.942489
4.475353,50.942474 4.475177,50.942461 4.474992,50.942447 4.47476,50.942429
4.474371,50.942399 4.473767,50.942352 4.473618,50.94234 4.473541,50.942009
4.473515,50.941979 4.473484,50.941955 4.473466,50.941944 4.473466,50.941944
4.473266,50.941818 4.47304,50.941629 4.473026,50.94161 4.472923,50.941475
4.472819,50.941292 4.472751,50.941181 4.472589,50.940971 4.472509,50.940868
4.472509,50.940868 4.472432,50.940768 4.472339,50.940675 4.472162,50.940527
4.472162,50.940527 4.471742,50.940174 4.472401,50.93963 4.472366,50.939611
4.473093,50.93902 4.473464,50.938718 4.472916,50.938515 4.472513,50.938378
4.471592,50.938098 4.471244,50.937995 4.470833,50.937884 4.470064,50.938326
4.4695,50.938656 4.468968,50.938251 4.468085,50.937605 4.46806,50.937586
4.467965,50.937601 4.469422,50.939346 4.469097,50.939508 4.468961,50.939621
4.468698,50.939849 4.468132,50.940302 4.468183,50.940313 4.467443,50.940799
4.467906,50.941071 4.4668,50.941797 4.465734,50.942506 4.465885,50.942631
4.466098,50.942808 4.466295,50.942996 4.466558,50.943223 4.466796,50.943527
4.466924,50.943699 4.468189,50.943182 4.467658,50.942774 4.468189,50.943182
4.468567,50.943476 4.468929,50.943357 4.469033,50.943423 4.469124,50.94348
4.46917,50.943509 4.46958,50.943768 4.46959,50.943779 4.469809,50.943791
4.469926,50.943794 4.470095,50.943798 4.470091,50.943989 4.470367,50.944
4.470357,50.944179 4.470688,50.944282 4.470686,50.944356 4.471413,50.944393
4.471411,50.944426 4.471406,50.94448 4.471395,50.944563 4.471372,50.94472
4.471368,50.94479 4.471362,50.944879 4.470595,50.944846 4.470573,50.945072
4.471246,50.945107 4.471243,50.945132 4.471236,50.945187 4.471232,50.945217
4.471213,50.945361 4.471204,50.945436 4.471201,50.9455 4.470753,50.945483
4.470745,50.945539 4.470412,50.945523 4.470402,50.945614 4.470683,50.945626
4.470564,50.945961 4.471569,50.946406 4.473756,50.947496 4.474915,50.948073
4.475741,50.948419 4.47603,50.948576 4.476021,50.948603 4.475952,50.948722
4.475933,50.948755 4.475864,50.948863 4.475823,50.948991 4.475832,50.949016
4.475875,50.949131 4.475942,50.949248 4.475977,50.949288 4.476035,50.949352
4.476104,50.94943 4.476261,50.94961 4.476317,50.949747 4.476319,50.949765
4.478017,50.950223 4.478046,50.950188 4.478062,50.950177 4.478046,50.950188
4.478017,50.950223 4.477909,50.950351 4.477927,50.950353 4.47804,50.950367
4.478507,50.950432 4.478629,50.950483 4.478683,50.950515 4.479041,50.950728
4.479133,50.950609 4.479267,50.950437 4.479389,50.950282
4.479382,50.95028</coordinates></LinearRing></outerBoundaryIs><innerBoundaryIs>
<LinearRing><coordinates>4.476928,50.949872 4.477174,50.949495 4.47841,50.949804
4.478728,50.94943 4.47841,50.949804 4.477174,50.949495 4.476928,50.949872</coordinates>
</LinearRing></innerBoundaryIs><innerBoundaryIs><LinearRing>
<coordinates>4.476873,50.948207 4.477043,50.948046 4.477209,50.947887
4.477043,50.948046 4.476873,50.948207</coordinates></LinearRing></innerBoundaryIs>
<innerBoundaryIs><LinearRing><coordinates>4.470775,50.939605 4.470675,50.939524
4.470738,50.93956 4.470975,50.939657 4.47112,50.939715 4.47118,50.939738
4.471275,50.939784 4.471383,50.939849 4.471471,50.93992 4.471337,50.939852
4.470992,50.939709 4.470775,50.939605</coordinates></LinearRing></innerBoundaryIs>
<innerBoundaryIs><LinearRing><coordinates>4.469713,50.938817 4.469691,50.938801
4.469771,50.938851 4.469915,50.938942 4.46997,50.938977 4.470004,50.939003
4.469713,50.938817</coordinates></LinearRing></innerBoundaryIs></Polygon>
The problem with this polygon is that is it not showing up on the map?
But when I preview only this polygon it is :/
Does anyone experienced something similar or know a solution for this?
Thanks in advance!
You have some inner polygons that look like lines to me. Removing those might help as well as simplifying the outer boundary. KML with winding direction calculations
Remove the <innerBoundaryIs> tags and it displays for me