3

Using MS SQL Server 2019 and running the following query results in the COMException displayed below.

     DECLARE @Geom1 AS GEOMETRY
     DECLARE @Geom2 AS GEOMETRY

     SET @Geom1 = GEOMETRY::STGeomFromText('POLYGON ((-93.118525999999974 35.351212000000032, -93.119130999999982 35.351231000000041, -93.119453999999962 35.35124200000007, -93.120948999999939 35.351215000000025, -93.121279363999975 35.351150716000063, -93.122974648999957 35.351194128000031, -93.123173300999952 35.343987666000032, -93.127598610999939 35.344058074000031, -93.12774899599998 35.336117218000027, -93.127701999999942 35.33609400000006, -93.127228000999992 35.335992001000079, -93.127121999999986 35.335970001000078, -93.126350000999992 35.335813001000076, -93.12575899999996 35.335769002000063, -93.125475999999935 35.33579300100007, -93.125381999999945 35.335802000000058, -93.125134000999935 35.335802001000047, -93.124885998999957 35.335786000000041, -93.124217998999939 35.335667002000037, -93.122765999999956 35.335409001000073, -93.12264799999997 35.335372001000053, -93.12253500099996 35.33532400100006, -93.122427999999957 35.335254000000077, -93.12234700099998 35.335164000000077, -93.12230999999997 35.33511100100003, -93.121921999999984 35.33455500000008, -93.121768000999964 35.334388001000036, -93.121623998999951 35.334281002000068, -93.12148099999996 35.334199001000059, -93.120887999999979 35.333859001000064, -93.12054999999998 35.333690001000036, -93.120194999999967 35.333544001000064, -93.120067999999947 35.333488001000035, -93.119958498999949 35.333414001000051, -93.119838999999956 35.333316001000071, -93.119803999999988 35.333283001000041, -93.119537999999977 35.333032001000049, -93.119387999999958 35.332891001000064, -93.119366999999954 35.332871001000058, -93.118911999999966 35.332499000000041, -93.118753000999959 35.332370001000072, -93.118699000999982 35.332287001000054, -93.118674000999988 35.332195002000049, -93.118684998999981 35.332091000000048, -93.118847999999957 35.331486000000041, -93.118939999999952 35.331193000000042, -93.118991000999983 35.331033001000037, -93.119032999999945 35.330900000000042, -93.119052999999951 35.330805001000044, -93.119061999999985 35.330668001000049, -93.119044999999971 35.330583000000047, -93.11903499999994 35.330531002000043, -93.118972999999983 35.330403000000047, -93.118864999999971 35.330258000000072, -93.118733999999961 35.330042001000038, -93.118634000999975 35.329815000000053, -93.118618999999967 35.329731002000074, -93.118594999999971 35.32958700000006, -93.118596000999958 35.329413001000034, -93.118692999999951 35.328982001000043, -93.118759998999963 35.328760000000045, -93.118778499999962 35.328638000000069, -93.118875999999943 35.32847600100007, -93.119060999999988 35.328333001000033, -93.119149999999991 35.328215002000036, -93.119177999999977 35.328092001000073, -93.119144998999957 35.327953001000026, -93.11915399999998 35.326431002000049, -93.119158999999968 35.325642001000062, -93.119159998999976 35.325392001000068, -93.119160000999955 35.325243001000047, -93.119159998999976 35.324046001000056, -93.119161000999952 35.323648000000048, -93.119164000999945 35.32332000200006, -93.119169000999989 35.322926001000042, -93.119199999999978 35.322340001000043, -93.119217999999989 35.322014000000024, -93.119662999999946 35.322035001000074, -93.120386998999948 35.32204100000007, -93.122256999999991 35.322059001000071, -93.123007000999962 35.322072001000038, -93.123896000999991 35.322096001000034, -93.123978999999963 35.322099001000026, -93.124196000999973 35.322104001000071, -93.125065998999958 35.322124001000077, -93.125662999999975 35.322130002000051, -93.127110998999967 35.322145000000035, -93.127456999999936 35.322146001000078, -93.128054999999961 35.322149000000024, -93.128082000999939 35.321416001000046, -93.128108999999938 35.320709001000068, -93.128151999999943 35.320028001000026, -93.128160999999977 35.319687001000034, -93.128170000999944 35.319357001000071, -93.128176999999937 35.319219002000068, -93.12821299999996 35.318540000000041, -93.128219000999991 35.318488002000038, -93.128211999999962 35.31838300000004, -93.128223999999989 35.318148000000065, -93.128280999999959 35.317131002000053, -93.12829099999999 35.316959001000043, -93.128303999999957 35.316792002000057, -93.128315999999984 35.316560001000028, -93.128339499999981 35.316332501000034, -93.128382999999985 35.316088001000026, -93.128452000999971 35.315948001000038, -93.128552999999954 35.315821000000028, -93.128680999999972 35.315712001000065, -93.129165499999942 35.315325501000075, -93.129330999999979 35.315131001000054, -93.12940599999996 35.314964002000067, -93.129076998999949 35.31493800100003, -93.128895999999941 35.315004001000034, -93.128881998999987 35.315235002000065, -93.128848000999938 35.315252000000044, -93.128123998999968 35.315356001000055, -93.127808998999967 35.315235002000065, -93.127386999999942 35.315097001000026, -93.127084999999965 35.315047002000028, -93.126675999999975 35.315124001000072, -93.126453998999978 35.315113001000043, -93.125885000999972 35.314915001000031, -93.125174999999956 35.314854000000025, -93.124577999999985 35.31483200100007, -93.124416999999937 35.314816001000054, -93.124402999999973 35.314777000000049, -93.124288998999987 35.314645001000031, -93.124054999999942 35.314612001000057, -93.123766000999979 35.314453001000061, -93.123532998999963 35.314460001000043, -93.12341700099995 35.314464000000044, -93.123195998999961 35.31452500000006, -93.123041998999952 35.314679001000059, -93.122961000999965 35.314734001000033, -93.12278699899997 35.314756001000035, -93.122451999999953 35.314767001000064, -93.122256999999991 35.314866002000031, -93.122136999999952 35.314883001000055, -93.121949000999962 35.314916002000075, -93.121579999999938 35.315037000000075, -93.120949999999937 35.315274000000045, -93.12059499999998 35.315510000000074, -93.120292999999947 35.315813002000027, -93.119937999999991 35.316121001000056, -93.119689999999991 35.316280001000052, -93.119608999999969 35.316253002000053, -93.119374999999991 35.316110001000027, -93.119273999999962 35.316088000000036, -93.119226999999967 35.316110000000037, -93.11907999999994 35.31637900000004, -93.118931998999983 35.316451001000075, -93.118690999999956 35.31664900100003, -93.11832900099995 35.316693001000033, -93.11814099999998 35.316754001000049, -93.118026999999984 35.316754001000049, -93.117992999999956 35.316715001000034, -93.117898999999966 35.316479001000062, -93.117858999999953 35.31645700100006, -93.117831998999975 35.316407001000073, -93.11770500099999 35.316254001000061, -93.117564000999948 35.316171002000033, -93.117321999999945 35.316122001000053, -93.117031999999938 35.316135002000067, -93.116691998999954 35.31615000100004, -93.116543999999976 35.316084002000025, -93.11642999899999 35.315968001000044, -93.11627600099996 35.315891001000068, -93.115933999999982 35.315831001000049, -93.115363999999943 35.31585300100005, -93.115123000999972 35.315815000000043, -93.11489499999999 35.315848001000063, -93.114659999999958 35.31605200000007, -93.114304999999945 35.316024000000027, -93.113854999999944 35.315964002000044, -93.113646999999958 35.315904000000046, -93.11341299999998 35.31589800100005, -93.113386000999981 35.315931001000024, -93.113338999999939 35.316030001000058, -93.113331999999957 35.316118001000063, -93.113299000999973 35.316212001000054, -93.113325999999972 35.316354000000047, -93.11331899999999 35.316442002000031, -93.113265000999945 35.316475000000025, -93.113197998999965 35.316486000000054, -93.113144998999985 35.316470002000074, -93.112788999999964 35.316448001000026, -93.112675000999957 35.316410001000065, -93.11258799999996 35.316349001000049, -93.11239999999998 35.316300001000059, -93.112238999999988 35.316294000000028, -93.111963999999944 35.31627300100007, -93.111474999999984 35.316031000000066, -93.111205999999981 35.315861000000041, -93.110871000999964 35.31559100100003, -93.110796999999991 35.315564001000041, -93.110502000999986 35.315295001000038, -93.110326998999938 35.315086002000044, -93.110200000999953 35.315003000000047, -93.109675999999979 35.314778001000036, -93.10939499999995 35.314542001000063, -93.109239998999954 35.314295001000062, -93.109139998999979 35.314185002000045, -93.10886499999998 35.314069001000064, -93.108736999999962 35.313987002000033, -93.108616000999973 35.313806001000046, -93.108495999999946 35.313784001000045, -93.108395000999963 35.313800001000061, -93.108233998999935 35.313938002000043, -93.108079999999973 35.313932001000069, -93.107878998999979 35.313811000000044, -93.107589999999959 35.313454001000025, -93.107547998999962 35.313430001000029, -93.107395999999937 35.313344001000075, -93.107153998999991 35.31332800000007, -93.106959998999969 35.313246000000049, -93.106784999999945 35.313246001000039, -93.106509999999957 35.313284001000056, -93.106322999999975 35.313257001000068, -93.10627599899999 35.313218001000052, -93.106281998999975 35.313097001000074, -93.106235000999959 35.313064001000043, -93.106021000999988 35.313032001000067, -93.105624999999975 35.313065000000051, -93.104800000999944 35.313197001000049, -93.104538999999988 35.313285001000054, -93.104357999999991 35.313334002000033, -93.104209998999977 35.313362002000076, -93.10387499999996 35.313329002000046, -93.103646998999977 35.313230001000079, -93.103344998999944 35.313082001000055, -93.103015999999968 35.313016000000061, -93.102687999999944 35.313005002000068, -93.10244599899994 35.313071001000026, -93.102271998999981 35.313181000000043, -93.102036999999939 35.313264002000039, -93.101634999999987 35.313220000000058, -93.101564999999937 35.313229002000071, -93.101566999999989 35.31312900000006, -93.101575999999966 35.312831002000053, -93.101578998999969 35.312732001000029, -93.101586000999987 35.31159400100006, -93.101587998999946 35.311440001000051, -93.101618999999971 35.310314001000052, -93.101632999999936 35.309648000000038, -93.101656998999943 35.308505001000071, -93.101668998999969 35.308267000000058, -93.101673000999938 35.308184002000075, -93.101706000999968 35.307514001000072, -93.101753999999971 35.307050000000061, -93.101532129999953 35.307058667000035, -93.101454015999991 35.309477934000029, -93.101361993999944 35.312693013000057, -93.101345027999969 35.313290041000073, -93.10131593899996 35.31431096700004, -93.101261962999956 35.315753997000058, -93.101233971999989 35.316510003000076, -93.101205915999969 35.31659595800005, -93.101289969999982 35.317746993000071, -93.101511051999978 35.32140697300008, -93.101465984999948 35.321968046000052, -93.101182034999965 35.325508971000033, -93.10102905399998 35.327416995000078, -93.100951021999947 35.332266013000037, -93.100888997999959 35.336101960000065, -93.100887926999974 35.336213952000037, -93.100852058999976 35.338520062000043, -93.100783075999971 35.343051036000077, -93.100764761999983 35.344226915000036, -93.100924999999961 35.344253000000037, -93.101538999999946 35.344348000000025, -93.101977000999966 35.344487000000072, -93.102723999999967 35.344838000000038, -93.103296999999941 35.345112000000029, -93.103740999999957 35.345204000000024, -93.104637999999966 35.345378000000039, -93.105231999999944 35.345520000000079, -93.106120999999973 35.345737000000042, -93.106849999999952 35.345982000000049, -93.107546999999954 35.346242000000075, -93.107881999999961 35.346326000000033, -93.107875999999976 35.346461000000033, -93.107558999999981 35.34688600000004, -93.10730099999995 35.347193000000061, -93.106938999999954 35.347481500000072, -93.106631999999991 35.347807000000046, -93.106246999999939 35.348142000000053, -93.106210999999973 35.348146000000042, -93.106172999999956 35.348182000000065, -93.106129999999951 35.348222000000078, -93.106085999999948 35.348259000000041, -93.106041999999945 35.348296000000062, -93.10599499999995 35.348336000000074, -93.105942999999968 35.348380001000066, -93.105888999999991 35.348428000000069, -93.105830999999966 35.348479000000054, -93.105768999999952 35.348534000000029, -93.105701999999951 35.348596000000043, -93.105550999999991 35.348734000000036, -93.105466999999976 35.348810000000071, -93.105383999999958 35.348891000000037, -93.105226999999957 35.349059000000068, -93.105155999999965 35.349142999000037, -93.105086999999969 35.349229000000037, -93.104954999999961 35.34939200000008, -93.104890999999952 35.349472000000048, -93.104862000999958 35.349508000000071, -93.104828999999938 35.349553000000071, -93.104704000999959 35.34971100000007, -93.104642999999953 35.349793000000034, -93.104577999999947 35.349872000000062, -93.104446998999947 35.350036000000046, -93.104381999999987 35.350116000000071, -93.104318999999975 35.350194000000045, -93.104289998999946 35.350230000000067, -93.104206999999974 35.350340000000074, -93.104156000999978 35.350410000000068, -93.104113999999981 35.350481000000059, -93.104066999999986 35.350550000000055, -93.104032999999959 35.350620000000049, -93.104006999999967 35.350685000000055, -93.103988000999948 35.350748000000067, -93.103984999999966 35.350817000000063, -93.103982998999982 35.350857000000076, -93.104026000999966 35.350857000000076, -93.104135999999983 35.350857000000076, -93.104202999999984 35.350860000000068, -93.104270999999983 35.350863000000061, -93.104344000999959 35.350871000000041, -93.104419999999948 35.350877000000025, -93.104493999999988 35.350879000000077, -93.104665999999952 35.350867000000051, -93.104768999999976 35.350869000000046, -93.104884999999967 35.350870000000043, -93.105007999999941 35.350877000000025, -93.105270999999959 35.350876000000028, -93.105398999999977 35.350880000000075, -93.105654999999956 35.350884000000065, -93.105778999999984 35.350887000000057, -93.106033999999966 35.350885000000062, -93.106291999999939 35.350889001000041, -93.106421999999952 35.350891000000047, -93.106556999999952 35.350889000000052, -93.10682799999995 35.350879000000077, -93.106974999999977 35.350884000000065, -93.107115999999962 35.350884000000065, -93.107393999999942 35.350876000000028, -93.107544999999959 35.350883000000067, -93.107831998999984 35.35088600000006, -93.107974999999954 35.350887000000057, -93.108265999999958 35.350891000000047, -93.108412999999985 35.350892000000044, -93.108709998999984 35.350895000000037, -93.108859999999936 35.350897000000032, -93.109013999999945 35.350887000000057, -93.109684999999956 35.350891000000047, -93.109946999999977 35.350889000000052, -93.111908999999969 35.350967000000026, -93.112205999999958 35.350979000000052, -93.114702999999963 35.35107800000003, -93.116156999999987 35.351135001000046, -93.116307000999939 35.351141000000041, -93.118525999999974 35.351212000000032))',4326)
     SET @Geom2 = GEOMETRY::STGeomFromText('POLYGON ((-93.129457999999943 35.31480300000004, -93.129469999999969 35.314763000000028, -93.128175999999939 35.314789000000076, -93.126602000999981 35.314821000000052, -93.126598999999942 35.314738000000034, -93.126589999999965 35.314395000000047, -93.126543998999978 35.312514000000078, -93.12654299999997 35.312440000000038, -93.126537999999982 35.312222000000077, -93.126531998999951 35.312003000000061, -93.126512999999989 35.311221000000046, -93.12620899999996 35.311215000000061, -93.125994999999989 35.311212000000069, -93.125297999999987 35.311179000000038, -93.124995000999945 35.311166000000071, -93.124743999999964 35.311049000000025, -93.124286999999981 35.311025000000029, -93.123996999999974 35.31100500000008, -93.12370999999996 35.310963000000072, -93.123076999999967 35.310815000000048, -93.122465000999966 35.310672000000068, -93.121273999999971 35.310329000000024, -93.121221999999989 35.310313000000065, -93.121180999999979 35.310302000000036, -93.121062999999936 35.310287000000073, -93.121009999999956 35.310281000000032, -93.120752999999979 35.310248000000058, -93.120595999999978 35.310229000000049, -93.120305999999971 35.310190000000034, -93.119982998999944 35.310146000000032, -93.119794999999954 35.310111000000063, -93.119736999999986 35.310085000000072, -93.119625999999982 35.310035000000028, -93.119553999999937 35.30994000000004, -93.119510999999989 35.309834000000023, -93.119498999999962 35.309723000000076, -93.119497999999965 35.309660000000065, -93.119497999999965 35.308781000000067, -93.119500999999957 35.308661000000029, -93.119511999999986 35.308249000000046, -93.119519999999966 35.308118000000036, -93.119515999999976 35.308071000000041, -93.119510998999942 35.307987000000026, -93.11943999999994 35.307876000000078, -93.119338999999968 35.307699000000071, -93.11925599999995 35.307627000000025, -93.119204999999965 35.307582000000025, -93.119172999999989 35.307561000000078, -93.119093999999961 35.307510000000036, -93.118907999999976 35.307389000000057, -93.118819998999982 35.307332000000031, -93.118705999999975 35.307409000000064, -93.118590999999981 35.307436000000052, -93.118262999999956 35.307453000000066, -93.118248999999992 35.307452000000069, -93.116505999999958 35.307412000000056, -93.116455999999971 35.307410000000061, -93.115858999999944 35.307395000000042, -93.115704999999991 35.307390000000055, -93.114596999999947 35.307372000000043, -93.112472999999966 35.30733900000007, -93.110984999999971 35.307300000000055, -93.110813999999948 35.307295000000067, -93.110262999999975 35.307279000000051, -93.109553998999957 35.307258000000047, -93.108280999999977 35.307220000000029, -93.107993999999962 35.30720800000006, -93.106389999999976 35.307147000000043, -93.104921999999988 35.307100000000048, -93.103507999999977 35.307074000000057, -93.103313999999955 35.307071000000064, -93.101753999999971 35.307050000000061, -93.101705999999979 35.307514000000026, -93.101672999999948 35.30818400000004, -93.101669000999948 35.308267000000058, -93.101656999999989 35.308505000000025, -93.101632999999936 35.309648000000038, -93.101618999999971 35.310314000000062, -93.101587999999936 35.311440000000061, -93.101586000999987 35.311594000000071, -93.101578999999958 35.31273200000004, -93.101575999999966 35.312831000000074, -93.101566999999989 35.31312900000006, -93.101564999999937 35.313229000000035, -93.101634999999987 35.313220000000058, -93.102036999999939 35.313264000000061, -93.102271999999971 35.313181000000043, -93.102445999999986 35.313071000000036, -93.102687999999944 35.313005000000032, -93.103015999999968 35.313016000000061, -93.10334499999999 35.313082000000065, -93.103646999999967 35.313230000000033, -93.10387499999996 35.313329000000067, -93.104209998999977 35.313362000000041, -93.104357999999991 35.313334000000054, -93.104538999999988 35.313285000000064, -93.104799998999965 35.313197000000059, -93.105624999999975 35.313065000000051, -93.106020999999942 35.313032000000078, -93.10623499899998 35.313064000000054, -93.106282000999954 35.313097000000027, -93.10627599899999 35.313218000000063, -93.106322999999975 35.313257000000078, -93.106509999999957 35.313284000000067, -93.106784999999945 35.313246000000049, -93.106959999999958 35.313246000000049, -93.10715399999998 35.31332800000007, -93.107395999999937 35.313344000000029, -93.107547999999952 35.313430000000039, -93.107589999999959 35.313454000000036, -93.107878999999969 35.313811000000044, -93.108079999999973 35.313932000000079, -93.108233999999982 35.313938000000064, -93.108394999999973 35.313800000000072, -93.108495999999946 35.313784000000055, -93.108615999999984 35.313806000000056, -93.108736999999962 35.313987000000054, -93.10886499999998 35.314069000000075, -93.109139999999968 35.314185000000066, -93.109239999999943 35.314295000000072, -93.10939499999995 35.314542000000074, -93.109675999999979 35.314778000000047, -93.110199999999963 35.315003000000047, -93.110326999999984 35.315086000000065, -93.11050199999994 35.315295000000049, -93.110796999999991 35.315564000000052, -93.110870999999975 35.31559100000004, -93.111205999999981 35.315861000000041, -93.111474999999984 35.316031000000066, -93.111963999999944 35.316273000000024, -93.112238999999988 35.316294000000028, -93.11239999999998 35.316300000000069, -93.11258799999996 35.316349000000059, -93.112674999999967 35.316410000000076, -93.112788999999964 35.316448000000037, -93.113144999999975 35.316470000000038, -93.113197999999954 35.316486000000054, -93.113264999999956 35.316475000000025, -93.11331899999999 35.316442000000052, -93.113325999999972 35.316354000000047, -93.113298999999984 35.316212000000064, -93.113331999999957 35.316118000000074, -93.113338999999939 35.316030000000069, -93.113385999999991 35.315931000000035, -93.11341299999998 35.315898000000061, -93.113646999999958 35.315904000000046, -93.113854999999944 35.315964000000065, -93.114304999999945 35.316024000000027, -93.114659999999958 35.31605200000007, -93.11489499999999 35.315848000000074, -93.115122999999983 35.315815000000043, -93.115363999999943 35.315853000000061, -93.115933998999935 35.31583100000006, -93.116275999999971 35.315891000000079, -93.116430000999969 35.315968000000055, -93.116543999999976 35.316084000000046, -93.116691999999944 35.31615000000005, -93.117031999999938 35.316135000000031, -93.117321999999945 35.316122000000064, -93.117563999999959 35.316171000000054, -93.117704999999944 35.316254000000072, -93.117831998999975 35.316407000000027, -93.117858999999953 35.316457000000071, -93.117898999999966 35.316479000000072, -93.117992999999956 35.316715000000045, -93.118026999999984 35.31675400000006, -93.11814099999998 35.31675400000006, -93.11832899999996 35.316693000000043, -93.118690999999956 35.316649000000041, -93.118931999999973 35.316451000000029, -93.11907999999994 35.31637900000004, -93.119226999999967 35.316110000000037, -93.119273999999962 35.316088000000036, -93.119374999999991 35.316110000000037, -93.119608999999969 35.316253000000074, -93.119689999999991 35.316280000000063, -93.119937999999991 35.316121000000066, -93.120292999999947 35.315813000000048, -93.12059499999998 35.315510000000074, -93.120949999999937 35.315274000000045, -93.121579999999938 35.315037000000075, -93.121949000999962 35.314916000000039, -93.122136999999952 35.314883000000066, -93.122256999999991 35.314866000000052, -93.122451999999953 35.314767000000074, -93.122787000999949 35.314756000000045, -93.122960999999975 35.314734000000044, -93.123041999999941 35.314679000000069, -93.12319599999995 35.31452500000006, -93.12341700099995 35.314464000000044, -93.123533000999942 35.314460000000054, -93.123765999999989 35.314453000000071, -93.124054999999942 35.314612000000068, -93.124288999999976 35.314645000000041, -93.124402999999973 35.314777000000049, -93.124416999999937 35.314816000000064, -93.124577999999985 35.314832000000024, -93.125174999999956 35.314854000000025, -93.125884999999982 35.314915000000042, -93.126453999999967 35.315113000000053, -93.126675999999975 35.315124000000026, -93.127084999999965 35.31504700000005, -93.127386999999942 35.315097000000037, -93.127808999999957 35.31523500000003, -93.128123998999968 35.315356000000065, -93.128847999999948 35.315252000000044, -93.128881999999976 35.31523500000003, -93.128895999999941 35.315004000000044, -93.129076999999938 35.314938000000041, -93.12940599999996 35.314964000000032, -93.129426999999964 35.314918000000034, -93.129457999999943 35.31480300000004))',4326)

     SELECT @Geom1.STIntersection(@Geom2)

    Msg 6522, Level 16, State 1, Line 37
A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry": 
System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
System.Runtime.InteropServices.COMException: 
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.SqlServer.Types.GLNativeMethods.ThrowExceptionForHr(GL_HResult errorCode)
   at Microsoft.SqlServer.Types.GLNativeMethods.Combine(CombineMode combineMode, GeoData g1, GeoData g2)
   at Microsoft.SqlServer.Types.SqlGeometry.STIntersection(SqlGeometry other)

I have seen similar questions elsewhere but no answers to why this is occurring. Playing with the reduce function or a negative buffer can work around the problem, but I'm running stats on millions of polygons (some very large) where changing the original polygons' area may not provide the desirable results.

It may also be worth noting that STOverlaps and STIntersects are both true for the geometries in the query. STTouches is false. Adding MakeValid to each geometry makes no difference.

If I at least understood WHY it was occurring, perhaps I could filter out only the offending polygons. Hopefully by providing an exact example someone can provide us some insight into why this is happening or how to prevent it.

UPDATE: We tested the same query in a 2016 instance (completely different network) and received the same error.

4
  • This seems more like something which should be taken to Microsoft.
    – Vince
    Sep 15, 2021 at 21:04
  • @Vince, I lean that way myself, but I wanted to probe the community first to make sure I wasn't missing something. This also gives me a place to report back in case I do hear something from MS at a later date.
    – CarteTon
    Sep 15, 2021 at 22:39
  • For whatever it is worth I am able to replicate this issue from your query in MSSQL Server 13.0.5888.11. I know this isn't particularly helpful but is it necessary for your analysis to have coordinates accurate to the 14th decimal? As noted in the venerable webcomic xkcd, you are between 'check out this sand grain' and 'built a database to track individual atoms'. xkcd.com/2170
    – psl
    Sep 15, 2021 at 22:49
  • @psl, Ha! Yes, it seems overly precise, but suffice it to say that it would likely cause more problems than it would solve if we changed it. I also think there is sometimes a confusion about precision of the .STAsText() WKT (as is this case) and the size of the binary behind the scenes... and the example looks like floating point with a true precision of only around 6 or so decimal places before you get the typical floating point detritus. Either way, it is (hopefully) outside the scope of this question :-) Would be a great pub conversation though!
    – CarteTon
    Sep 15, 2021 at 23:19

1 Answer 1

0

perhaps I could filter out only the offending polygons.

Have you considered wrapping STIntersection in a Try/Catch?

I also recommend reconsidering the justification for running analysis on coordinates that have an impossible degree of accuracy. If there is no logical need for 14-15 degrees then why retain that information, especially if it appears to be corrupting the process? I reduced the scale of these coordinates and the query ran fine. You've already tried this, so you know, but it is worth stating again. Here is some python if you want to quickly generate new coordinates based on strings.

coord1 = "-93.118525999999974 35.351212000000032, -93.119130999999982 35.351231000000041"
newList = []
coords = coord1.split(' ')
for coord in coords:
    if coord[len(coord)-1 ] == ',':
        newList.append( coord[0:9] + ',')
    else:
        newList.append( coord[0:9] )
        
' '.join(newList)
1
  • It doesn't make any sense for us to do so. And this would be a workaround rather than a solution and not a good "fix" in a production environment. It would prevent (not fix) this particular example, but we have no way of knowing if it would prevent others. We are seeing this with multiple geometries that don't get "fixed" with the same level of simplification, so it would just be a shot in the dark and crossing of fingers. Again, hoping someone can point to a cause or confirm the suspicion that it is just a bug to take to MS.
    – CarteTon
    Sep 16, 2021 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.