У меня есть следующий мультиполигон для Бельгии:
MULTIPOLYGON(((2.912 50.704,2.79 50.726,2.724 50.811,2.599 50.849,2.59 50.919,2.633 50.946,2.541 51.094,3.186 51.363,3.363 51.373,3.376 51.278,3.427 51.245,3.528 51.246,3.515 51.287,3.59 51.306,3.886 51.2,4.166 51.293,4.241 51.353,4.217 51.374,4.431 51.364,4.379 51.447,4.476 51.478,4.548 51.473,4.535 51.423,4.641 51.422,4.779 51.505,4.842 51.481,4.842 51.422,4.771 51.415,4.921 51.394,5.005 51.444,5.039 51.487,5.105 51.431,5.071 51.393,5.134 51.316,5.242 51.305,5.238 51.261,5.516 51.295,5.561 51.222,5.856 51.145,5.721 50.961,5.758 50.951,5.644 50.871,5.699 50.806,5.683 50.755,5.777 50.783,6.119 50.72,6.184 50.648,6.196 50.659,6.184 50.646,6.167 50.644,6.182 50.624,6.273 50.63,6.178 50.542,6.226 50.494,6.351 50.488,6.378 50.44,6.343 50.38,6.408 50.335,6.176 50.235,6.193 50.182,6.138 50.13,6.102 50.171,5.964 50.173,5.819 50.013,5.836 49.979,5.775 49.961,5.736 49.897,5.784 49.873,5.739 49.834,5.887 49.709,5.873 49.574,5.472 49.497,5.429 49.595,5.312 49.611,5.332 49.655,5.269 49.696,5.164 49.693,4.996 49.8,4.852 49.793,4.89 49.909,4.79 49.969,4.878 50.153,4.823 50.169,4.702 50.095,4.693 49.995,4.446 49.937,4.197 49.955,4.136 50.02,4.231 50.074,4.199 50.134,4.127 50.136,4.208 50.273,4.135 50.257,4.024 50.359,3.747 50.351,3.71 50.303,3.608 50.497,3.289 50.526,3.261 50.701,3.15 50.79,2.955 50.754,2.912 50.704)),((6.17 50.662,6.192 50.664,6.193 50.663,6.17 50.662)),((6.193 50.663,6.195 50.663,6.196 50.66,6.193 50.663)),((6.196 50.66,6.196 50.659,6.196 50.659,6.196 50.66)),((6.184 50.646,6.188 50.641,6.187 50.641,6.184 50.646)),((6.188 50.641,6.22 50.641,6.189 50.639,6.188 50.641)),((6.22 50.641,6.223 50.643,6.221 50.641,6.22 50.641)),((6.223 50.643,6.23 50.649,6.232 50.648,6.223 50.643)),((6.232 50.648,6.232 50.649,6.245 50.641,6.232 50.648)),((6.245 50.641,6.245 50.641,6.253 50.641,6.246 50.64,6.245 50.641)),((6.253 50.641,6.264 50.643,6.265 50.642,6.253 50.641)),((6.265 50.642,6.266 50.642,6.272 50.632,6.265 50.642)),((6.272 50.632,6.274 50.63,6.273 50.63,6.272 50.632)),((4.934 51.409,4.936 51.405,4.928 51.405,4.927 51.408,4.934 51.409)),((4.939 51.437,4.936 51.429,4.915 51.435,4.923 51.447,4.939 51.437)),((4.952 51.453,4.94 51.445,4.933 51.45,4.952 51.453)))
и следующий полигон для Англии
POLYGON((1.526125 50.88697,0.9007918 50.55335,-6.142681 49.57808,-7.101192 49.72816,-5.428146 51.44456,-4.500063 51.46522,-3.293929 51.34336,-2.994565 51.45915,-2.788091 51.52965,-2.719481 51.54518,-2.713575 51.57049,-2.704804 51.58333,-2.668785 51.59595,-2.665146 51.61616,-2.659697 51.6221,-2.671398 51.63315,-2.670434 51.64329,-2.682792 51.64528,-2.67314 51.65818,-2.683977 51.65753,-2.68937 51.66356,-2.684438 51.67151,-2.660776 51.67405,-2.674276 51.67878,-2.67214 51.69228,-2.686547 51.69945,-2.684017 51.70599,-2.671535 51.7054,-2.681848 51.71246,-2.690536 51.73034,-2.674763 51.73822,-2.666144 51.75354,-2.683372 51.76825,-2.675516 51.79411,-2.681589 51.80283,-2.673949 51.81158,-2.661969 51.81314,-2.66076 51.83073,-2.68322 51.83484,-2.685992 51.83023,-2.693576 51.8308,-2.698279 51.84078,-2.710287 51.83606,-2.72142 51.84351,-2.726144 51.8375,-2.739837 51.83377,-2.780447 51.86281,-2.78129 51.86994,-2.774753 51.87854,-2.80334 51.88783,-2.822619 51.90229,-2.838221 51.90382,-2.842787 51.9135,-2.864172 51.9117,-2.866076 51.91878,-2.856288 51.92136,-2.87097 51.92393,-2.877205 51.93035,-2.885189 51.93099,-2.890877 51.92265,-2.903166 51.92193,-2.951395 51.90337,-2.974742 51.90317,-2.977993 51.9241,-2.999669 51.92032,-3.008683 51.92367,-3.014763 51.9425,-3.070734 51.98213,-3.089435 52.01205,-3.101991 52.02161,-3.09014 52.04068,-3.128659 52.07715,-3.122142 52.08919,-3.125305 52.10465,-3.108515 52.10769,-3.110077 52.11652,-3.137955 52.12054,-3.144551 52.12643,-3.143654 52.13168,-3.136733 52.14077,-3.094513 52.14718,-3.075806 52.15711,-3.0827 52.15992,-3.098842 52.15173,-3.124899 52.16171,-3.123747 52.16934,-3.099736 52.1826,-3.104363 52.20379,-3.08087 52.21432,-3.074916 52.22692,-3.075825 52.23763,-3.047811 52.24164,-3.052595 52.24507,-3.046827 52.25602,-3.006274 52.26696,-2.967549 52.26477,-2.965983 52.27083,-2.993295 52.26994,-3.015854 52.27864,-3.014367 52.28939,-3.004093 52.30164,-3.006872 52.31126,-3.00336 52.32364,-2.970044 52.33218,-2.959374 52.34603,-2.974762 52.35139,-3.039195 52.34136,-3.061608 52.34537,-3.094699 52.36034,-3.112169 52.37417,-3.156309 52.38509,-3.164255 52.39109,-3.162882 52.39718,-3.181372 52.40704,-3.220828 52.41818,-3.232993 52.42886,-3.238821 52.4421,-3.234042 52.45522,-3.198086 52.4784,-3.181054 52.47667,-3.142436 52.49424,-3.111559 52.50182,-3.0372 52.50356,-3.039668 52.51377,-3.033866 52.52604,-3.005504 52.5232,-3.007847 52.53002,-2.998977 52.55104,-3.003478 52.56607,-3.014392 52.5724,-3.035477 52.56889,-3.058523 52.55276,-3.083365 52.5485,-3.087558 52.5456,-3.078497 52.53835,-3.085038 52.53153,-3.135816 52.52535,-3.139228 52.53598,-3.116495 52.54307,-3.139921 52.57158,-3.143064 52.58562,-3.118895 52.58944,-3.092994 52.60159,-3.095795 52.61131,-3.068545 52.63312,-3.083229 52.63685,-3.085962 52.64226,-3.055428 52.65074,-3.05265 52.66416,-3.046617 52.67005,-3.049269 52.69287,-3.036145 52.69591,-3.025089 52.70895,-3.028065 52.71728,-3.022312 52.72703,-3.000282 52.72344,-2.977149 52.72971,-2.9746 52.71852,-2.964884 52.71799,-2.972881 52.73227,-2.991555 52.73078,-2.9991 52.73449,-2.998892 52.74116,-3.023721 52.74961,-3.023873 52.75464,-3.014237 52.75952,-3.018104 52.7637,-3.03525 52.761,-3.039838 52.76613,-3.053709 52.7659,-3.056027 52.77035,-3.061705 52.76611,-3.06769 52.77026,-3.072516 52.76665,-3.081017 52.7689,-3.083135 52.77459,-3.091688 52.77664,-3.094637 52.78733,-3.088668 52.79287,-3.104324 52.78966,-3.117659 52.78064,-3.160451 52.79122,-3.17136 52.80736,-3.170632 52.82048,-3.157984 52.83343,-3.156238 52.84158,-3.165862 52.84844,-3.133328 52.86661,-3.154995 52.8772,-3.149542 52.89334,-3.120002 52.89782,-3.11261 52.91985,-3.098092 52.93344,-3.076674 52.92854,-3.036348 52.93221,-3.01156 52.95853,-2.983806 52.96197,-2.974715 52.97179,-2.957646 52.95303,-2.930047 52.94145,-2.908796 52.94433,-2.899164 52.95229,-2.887023 52.9546,-2.88148 52.94862,-2.838642 52.94417,-2.835727 52.9346,-2.810959 52.91677,-2.798155 52.89857,-2.756616 52.92715,-2.729177 52.9293,-2.730246 52.96407,-2.738283 52.96997,-2.731951 52.98138,-2.760908 52.9836,-2.76736 52.99129,-2.788965 52.99238,-2.79114 52.98817,-2.803534 52.9866,-2.837476 52.99451,-2.847185 53.01589,-2.852524 53.01413,-2.86369 53.02147,-2.859547 53.03538,-2.872507 53.04335,-2.869637 53.05354,-2.875457 53.05874,-2.871754 53.06737,-2.87877 53.06621,-2.88415 53.07274,-2.880745 53.08058,-2.904745 53.09086,-2.901823 53.09969,-2.895443 53.10203,-2.89416 53.11114,-2.885409 53.11747,-2.903644 53.10881,-2.944668 53.1188,-2.949187 53.12492,-2.965596 53.13029,-2.979661 53.14641,-2.985481 53.14492,-2.997261 53.15203,-2.991037 53.16034,-2.943693 53.16869,-2.923554 53.17875,-2.92481 53.18734,-2.951243 53.20879,-3.02656 53.24552,-3.091751 53.25622,-3.167201 53.3081,-3.697038 53.56788,-4.116841 54.52617,-3.398762 54.96136,-3.296958 54.96626,-3.260233 54.96284,-3.199897 54.96632,-3.150894 54.95253,-3.120971 54.97596,-3.07451 54.97142,-3.074122 54.98336,-3.060613 54.9889,-3.049427 55.00016,-3.052257 55.01054,-3.042398 55.02458,-3.035711 55.02665,-3.032999 55.03562,-3.055626 55.04525,-3.052661 55.05526,-3.027488 55.05827,-2.96025 55.05259,-2.944456 55.06107,-2.945404 55.06834,-2.940354 55.07257,-2.927035 55.07345,-2.915565 55.08183,-2.898709 55.0805,-2.895339 55.09005,-2.88886 55.09082,-2.886786 55.09792,-2.876364 55.09985,-2.872763 55.10857,-2.853829 55.11138,-2.842971 55.12495,-2.830967 55.12602,-2.835858 55.13348,-2.826917 55.14095,-2.787129 55.14466,-2.733677 55.17007,-2.70538 55.17587,-2.668399 55.22412,-2.637974 55.22581,-2.635765 55.24094,-2.629581 55.24809,-2.648444 55.25729,-2.648894 55.26215,-2.629787 55.26475,-2.630564 55.26976,-2.610997 55.28567,-2.57659 55.29898,-2.561012 55.31255,-2.560363 55.32052,-2.52143 55.32581,-2.492481 55.35298,-2.475927 55.35769,-2.414746 55.36191,-2.400644 55.35698,-2.396556 55.35094,-2.381501 55.35211,-2.344405 55.36789,-2.348705 55.37475,-2.336889 55.38104,-2.338431 55.3909,-2.347887 55.39987,-2.336987 55.40482,-2.338316 55.40953,-2.333707 55.41259,-2.315527 55.41029,-2.298031 55.41744,-2.295701 55.42321,-2.26153 55.43578,-2.232611 55.432,-2.205554 55.44101,-2.196718 55.44697,-2.191482 55.46352,-2.174406 55.46916,-2.203539 55.47324,-2.209298 55.48101,-2.205845 55.48816,-2.23158 55.5083,-2.227897 55.52279,-2.236025 55.52857,-2.237388 55.54621,-2.24365 55.55355,-2.290733 55.578,-2.295369 55.58548,-2.291563 55.60003,-2.308851 55.60855,-2.3189 55.61941,-2.311861 55.62542,-2.328929 55.62448,-2.338431 55.63029,-2.337765 55.63575,-2.328848 55.63878,-2.326526 55.6456,-2.304461 55.65015,-2.236402 55.64353,-2.248839 55.64775,-2.250525 55.654,-2.220146 55.66676,-2.220769 55.67803,-2.185741 55.70407,-2.172833 55.70756,-2.179694 55.71505,-2.178392 55.72118,-2.15222 55.72567,-2.15236 55.73665,-2.145011 55.74218,-2.121986 55.74061,-2.117777 55.74974,-2.10918 55.75072,-2.112516 55.75716,-2.109451 55.76216,-2.089147 55.76551,-2.091515 55.78718,-2.087811 55.79552,-2.046979 55.808,-1.971566 55.8473,-1.800863 55.89366,-1.472307 56.06997,2.249944 52.93852,1.888707 51.20211,1.890273 51.19812,1.526125 50.88697))
Обе эти геометрии хранятся в таблице местоположений.Теперь у меня есть следующий запрос, чтобы проверить, находится ли Бельгия в Англии в качестве теста:
SELECT t2.name
FROM locations t1
INNER JOIN locations t2 ON ST_Contains(t1.geom, t2.geom)
WHERE t1.name = 'England' AND t2.name = 'Belgium'
Но я получаю следующую ошибку:
Invalid GIS data provided to function st_within
Что не так смультиполигон.Обратите внимание, что геометрия мультиполигона была создана из строки геойсона.Обе геометрии имеют SRID 4326