When using geometry datatype, SQL Server hangs

tmb3ates  于 2023-02-21  发布在  SQL Server
关注(0)|答案(1)|浏览(125)

I want to compare a trip driven by devices by zones defined in our system. It works correct for 99% of the trips but some crash of SQL Server.

For instance this one:

DECLARE @string nvarchar(max) = ('LINESTRING(55.5104 24.9205,55.5104 24.9205,55.5105 24.9205,55.5105 24.9204,55.5105 24.9204,55.5105 24.9203,55.5104 24.9201,55.5049 24.9143,55.505 24.9144,55.5049 24.9143,55.4981 24.9072,55.4975 24.9069,55.4968 24.9067,55.4961 24.9066,55.4952 24.9066,55.4944 24.9069,55.494 24.9072,55.4934 24.9076,55.4929 24.9083,55.4927 24.9088,55.4926 24.9096,55.4926 24.9096,55.4926 24.9101,55.4928 24.9108,55.4931 24.9114,55.4936 24.9119,55.4936 24.9119,55.4938 24.9121,55.4951 24.9128,55.4948 24.9126,55.4949 24.9127,55.4967 24.9136,55.51 24.9203,55.5103 24.9204,55.5104 24.9203,55.5104 24.9203,55.5104 24.9202,55.51 24.9197,55.5039 24.9133,55.5039 24.9133,55.5039 24.9133,55.5004 24.9096,55.4982 24.9073,55.4976 24.907,55.4967 24.9067,55.496 24.9066,55.4954 24.9066,55.4944 24.9069,55.4939 24.9072,55.4932 24.9079,55.4929 24.9085,55.4927 24.9091,55.4926 24.9097,55.4927 24.9104,55.4929 24.911,55.4933 24.9115,55.494 24.9122,55.5069 24.9187,55.5091 24.9198,55.5093 24.9199,55.5094 24.9198,55.5094 24.9198,55.5094 24.9197,55.5093 24.9195,55.509 24.9193,55.509 24.9192,55.509 24.9192,55.509 24.9192,55.5089 24.9193,55.509 24.9194,55.5105 24.9203,55.5107 24.9204,55.5107 24.9204,55.5107 24.9204,55.5107 24.9204,55.5107 24.9204,55.5106 24.9205,55.5104 24.9204,55.5098 24.9201,55.4945 24.9124,55.4937 24.9119,55.4932 24.9113,55.4928 24.9106,55.4926 24.9099,55.4927 24.9091,55.4929 24.9084,55.4933 24.9078,55.4939 24.9073,55.4945 24.9069,55.4952 24.9067,55.4959 24.9066,55.4966 24.9067,55.4973 24.9069,55.4979 24.9072,55.4987 24.9079,55.5046 24.914,55.5101 24.9198,55.5104 24.9202,55.5105 24.9203,55.5105 24.9203,55.5105 24.9204,55.5105 24.9205,55.5104 24.9205,55.5103 24.9205,55.5102 24.9204,55.5102 24.9204,55.5048 24.9177,55.4936 24.9119,55.4933 24.9115,55.493 24.9111,55.4926 24.9101,55.4926 24.9096,55.4927 24.9089,55.493 24.9082,55.4935 24.9076,55.494 24.9072,55.4949 24.9068,55.4954 24.9066,55.4963 24.9066,55.4971 24.9068,55.4978 24.9072,55.4985 24.9077,55.5104 24.9202,55.5104 24.9202,55.5104 24.9203,55.5104 24.9203,55.5104 24.9204,55.5103 24.9204,55.5097 24.9201,55.5086 24.9196,55.5021 24.9163,55.495 24.9126,55.4947 24.9124,55.4944 24.9123,55.4942 24.9122,55.4938 24.912,55.4933 24.9115,55.493 24.911,55.4927 24.9103,55.4927 24.9095,55.4928 24.9087,55.4933 24.9079,55.4939 24.9073,55.4948 24.9069,55.4957 24.9066,55.4966 24.9067,55.4974 24.9069,55.4981 24.9073,55.5091 24.9188,55.5101 24.9199,55.5101 24.92,55.51 24.92,55.51 24.92,55.5099 24.9201,55.5097 24.92,55.5095 24.92,55.4957 24.9131,55.4939 24.9122,55.4933 24.9117,55.493 24.9112,55.4927 24.9106,55.4926 24.9099,55.4926 24.9091,55.4929 24.9084,55.4932 24.9079,55.4938 24.9073,55.4943 24.907,55.4951 24.9067,55.496 24.9066,55.4966 24.9067,55.4973 24.9069,55.4981 24.9073,55.5032 24.9126,55.5105 24.9203,55.5105 24.9203,55.5106 24.9204,55.5106 24.9204,55.5105 24.9204,55.5104 24.9205,55.5103 24.9205,55.5101 24.9204,55.497 24.9138,55.4938 24.9121,55.4932 24.9115,55.4929 24.911,55.4926 24.9104,55.4925 24.9098,55.4926 24.9092,55.4927 24.9087,55.4931 24.9081,55.4936 24.9074,55.494 24.9072,55.4947 24.9068,55.4954 24.9066,55.496 24.9066,55.4967 24.9067,55.4974 24.9069,55.4982 24.9074,55.5046 24.9141,55.5046 24.9141,55.5046 24.9141,55.5046 24.9141,55.5048 24.9143,55.5104 24.9203,55.5105 24.9205,55.5104 24.9205,55.5104 24.9205,55.5103 24.9205,55.5045 24.9175,55.4938 24.9119,55.4931 24.9112,55.4927 24.9104,55.4926 24.9094,55.4928 24.9085,55.4934 24.9078,55.4941 24.9072,55.4949 24.9068,55.4959 24.9067,55.4968 24.9068,55.4977 24.9071,55.4984 24.9077,55.509 24.9188,55.5099 24.9198,55.5103 24.9202,55.5103 24.9203,55.5103 24.9203,55.5103 24.9203,55.5102 24.9204,55.5101 24.9204,55.51 24.9204,55.4976 24.9141,55.4937 24.912,55.4933 24.9116,55.4929 24.9109,55.4926 24.9102,55.4926 24.9097,55.4927 24.9089,55.493 24.9082,55.4934 24.9077,55.4939 24.9073,55.4946 24.9069,55.4952 24.9067,55.4958 24.9066,55.4966 24.9067,55.4974 24.9069,55.498 24.9073,55.4985 24.9077,55.506 24.9155,55.5104 24.9202,55.5105 24.9203,55.5105 24.9203,55.5105 24.9204,55.5104 24.9204,55.5104 24.9204,55.5103 24.9204,55.5102 24.9204,55.5096 24.9202,55.4968 24.9137,55.4937 24.912,55.4933 24.9115,55.4929 24.911,55.4927 24.9101,55.4926 24.9096,55.4927 24.9089,55.493 24.9083,55.4933 24.9078,55.4938 24.9073,55.4944 24.907,55.4954 24.9067,55.496 24.9066,55.4966 24.9067,55.4974 24.9069,55.498 24.9073,55.4988 24.908,55.5009 24.9102,55.5068 24.9164,55.5102 24.92,55.5106 24.9205,55.5106 24.9205,55.5105 24.9205,55.5104 24.9205,55.5103 24.9205,55.4957 24.9131,55.4938 24.912,55.4933 24.9116,55.4929 24.911,55.4927 24.9105,55.4926 24.9098,55.4926 24.9092,55.4928 24.9086,55.4931 24.908,55.4936 24.9075,55.4941 24.9071,55.4948 24.9068,55.4955 24.9066,55.4962 24.9066,55.497 24.9067,55.4976 24.907,55.4985 24.9076,55.5061 24.9157,55.5103 24.9201,55.5103 24.9201,55.5104 24.9201,55.5104 24.9202,55.5105 24.9203,55.5104 24.9203,55.5104 24.9204,55.5103 24.9204,55.5103 24.9204,55.5091 24.9199,55.4938 24.9121,55.4933 24.9115,55.4929 24.9109,55.4926 24.9102,55.4926 24.9093,55.4928 24.9086,55.4932 24.9079,55.4937 24.9074,55.4937 24.9073,55.4941 24.9071,55.495 24.9068,55.4958 24.9066,55.4967 24.9067,55.4973 24.9069,55.4979 24.9072,55.4985 24.9076,55.5082 24.9178,55.5104 24.9203,55.5105 24.9203,55.5105 24.9203,55.5104 24.9204,55.5104 24.9204,55.5103 24.9205,55.5103 24.9204,55.5101 24.9204,55.51 24.9203,55.5098 24.9202,55.4937 24.9119,55.4932 24.9114,55.4928 24.9108,55.4927 24.9101,55.4926 24.9094,55.4927 24.9088,55.493 24.9082,55.4937 24.9074,55.4943 24.907,55.4949 24.9068,55.4955 24.9066,55.4964 24.9066,55.497 24.9068,55.4979 24.9072,55.4986 24.9077,55.507 24.9166,55.5104 24.9201,55.5105 24.9203,55.5105 24.9203,55.5104 24.9204,55.5104 24.9204,55.5103 24.9204,55.51 24.9203,55.4956 24.913,55.4939 24.9121,55.4932 24.9115,55.4929 24.9109,55.4927 24.9103,55.4926 24.9097,55.4927 24.9089,55.493 24.9083,55.4934 24.9077,55.4941 24.9071,55.4946 24.9069,55.4954 24.9067,55.4962 24.9066,55.4971 24.9068,55.4977 24.907,55.4982 24.9074,55.5056 24.9151,55.5099 24.9197,55.51 24.9198,55.51 24.9198,55.5099 24.9199,55.5098 24.9199,55.5097 24.9199,55.5096 24.9198,55.5095 24.9197,55.5086 24.919,55.5086 24.9189,55.5086 24.9189,55.5087 24.9189,55.5087 24.9189,55.5097 24.9199,55.51 24.92,55.5103 24.9202,55.5105 24.9203,55.5105 24.9204,55.5105 24.9204,55.5105 24.9205,55.5105 24.9205,55.5104 24.9205,55.5103 24.9205,55.5001 24.9153,55.5001 24.9153,55.4938 24.912,55.4932 24.9114,55.4928 24.9106,55.4927 24.9098,55.4928 24.909,55.4931 24.9082,55.4937 24.9075,55.4945 24.907,55.4954 24.9067,55.4964 24.9067,55.4973 24.9069,55.4981 24.9073,55.51 24.9197,55.5104 24.9201,55.5105 24.9202,55.5105 24.9203,55.5105 24.9204,55.5105 24.9204,55.5105 24.9205,55.5104 24.9205,55.5103 24.9205,55.4966 24.9136,55.4938 24.9121,55.4931 24.9114,55.4928 24.9109,55.4926 24.9101,55.4926 24.9095,55.4928 24.9087,55.493 24.9082,55.4935 24.9076,55.4941 24.9071,55.4948 24.9068,55.4956 24.9066,55.4961 24.9066,55.497 24.9068,55.4976 24.907,55.4982 24.9073,55.5051 24.9146,55.5099 24.9197,55.5099 24.9198,55.5099 24.9199,55.5098 24.9199,55.5097 24.9199,55.509 24.9193,55.5084 24.9188,55.5083 24.9187,55.5083 24.9188,55.5082 24.9188,55.5081 24.9188,55.5081 24.9188,55.508 24.9188,55.508 24.9188,55.5079 24.9189,55.5078 24.9189,55.5075 24.9187,55.5072 24.9186,55.5071 24.9186,55.507 24.9186,55.507 24.9187,55.5069 24.9187,55.5069 24.9187,55.5064 24.9185,55.4937 24.9119,55.4931 24.9112,55.4928 24.9107,55.4927 24.9101,55.4927 24.9093,55.4929 24.9085,55.4932 24.9081,55.4937 24.9075,55.4944 24.907,55.4952 24.9067,55.496 24.9066,55.4968 24.9068,55.4976 24.907,55.4983 24.9075,55.5075 24.9171,55.5101 24.9198,55.5101 24.9199,55.5101 24.9199,55.5101 24.92,55.51 24.92,55.5094 24.9199,55.4954 24.913,55.494 24.9121,55.4936 24.9117,55.4935 24.9116,55.4935 24.9116,55.4935 24.9116,55.4932 24.9114,55.493 24.9111,55.4928 24.9107,55.4927 24.9102,55.4927 24.9095,55.4929 24.9087,55.4933 24.908,55.4938 24.9074,55.4945 24.907,55.4953 24.9067,55.4961 24.9067,55.4969 24.9068,55.4976 24.9071,55.4983 24.9075,55.5093 24.9189,55.5106 24.9203,55.5106 24.9204,55.5106 24.9204,55.5105 24.9204,55.5104 24.9205,55.5103 24.9205,55.4963 24.9134,55.4938 24.9121,55.4933 24.9116,55.4929 24.9111,55.4927 24.9104,55.4926 24.9099,55.4927 24.909,55.4929 24.9084,55.4933 24.9078,55.4939 24.9073,55.4945 24.9069,55.4952 24.9067,55.4961 24.9066,55.4968 24.9067,55.4973 24.9069,55.4981 24.9073,55.4987 24.9079,55.5069 24.9165,55.5085 24.9182,55.5085 24.9182,55.51 24.9197,55.5101 24.9198,55.5101 24.9199,55.5101 24.92,55.51 24.9201,55.5099 24.9201,55.5098 24.9202,55.5097 24.9201,55.5094 24.92,55.4937 24.9119,55.4932 24.9114,55.4928 24.9107,55.4927 24.9103,55.4926 24.9096,55.4927 24.909,55.493 24.9083,55.4935 24.9077,55.4941 24.9072,55.4948 24.9068,55.4955 24.9067,55.4962 24.9067,55.4971 24.9068,55.4976 24.907,55.4982 24.9074,55.505 24.9146,55.5105 24.9203,55.5105 24.9203,55.5105 24.9204,55.5105 24.9205,55.5104 24.9205,55.5104 24.9205,55.5102 24.9204,55.5058 24.9182,55.4982 24.9143,55.4937 24.912,55.4933 24.9116,55.493 24.9111,55.4927 24.9102,55.4926 24.9096,55.4927 24.9091,55.493 24.9083,55.4935 24.9076,55.494 24.9072,55.4948 24.9069,55.4956 24.9067,55.4964 24.9067,55.4972 24.9068,55.4976 24.907,55.4982 24.9074,55.4998 24.909,55.4997 24.9089,55.4997 24.9089,55.4997 24.9089,55.5085 24.9181,55.5101 24.9198,55.5103 24.9201,55.5104 24.9202,55.5104 24.9202,55.5104 24.9203,55.5104 24.9203,55.5103 24.9203,55.5103 24.9204,55.5102 24.9204,55.51 24.9203,55.4978 24.9141,55.4938 24.912,55.4934 24.9116,55.4929 24.9109,55.4927 24.9104,55.4926 24.9097,55.4927 24.9089,55.4929 24.9084,55.4933 24.9079,55.4939 24.9073,55.4946 24.9069,55.4951 24.9067,55.4958 24.9066,55.4965 24.9067,55.4974 24.9069,55.498 24.9072,55.4986 24.9077,55.5063 24.9158,55.51 24.9198,55.5103 24.92,55.5103 24.9201,55.5103 24.9201,55.5103 24.9202,55.5102 24.9203,55.5102 24.9203,55.5101 24.9203,55.5099 24.9203,55.4971 24.9138,55.4938 24.912,55.4934 24.9117,55.493 24.911,55.4927 24.9105,55.4926 24.9098,55.4927 24.9092,55.4929 24.9086,55.4932 24.908,55.4937 24.9074,55.4941 24.9071,55.4948 24.9068,55.4956 24.9066,55.4964 24.9066,55.497 24.9067,55.4977 24.9071,55.4983 24.9074,55.5052 24.9146,55.5065 24.916,55.5106 24.9204,55.5107 24.9204,55.5106 24.9205,55.5106 24.9205,55.5105 24.9205,55.5104 24.9205,55.5104 24.9205,55.4973 24.9139,55.4937 24.912,55.4932 24.9114,55.4929 24.9108,55.4927 24.9102,55.4926 24.9097,55.4928 24.9089,55.493 24.9084,55.4933 24.9079,55.4938 24.9074,55.4943 24.907,55.4951 24.9067,55.4957 24.9066,55.4965 24.9067,55.4972 24.9068,55.4978 24.9071,55.4984 24.9075,55.5048 24.9144,55.5061 24.9157,55.5061 24.9157,55.5103 24.92,55.5104 24.9201,55.5104 24.9202,55.5104 24.9203,55.5103 24.9203,55.5102 24.9204,55.5102 24.9203,55.4946 24.9125,55.4936 24.9117,55.4931 24.9111,55.4928 24.9103,55.4927 24.9095,55.4928 24.9088,55.4932 24.9081,55.4938 24.9074,55.4944 24.907,55.4952 24.9067,55.4959 24.9066,55.4966 24.9067,55.4974 24.9069,55.498 24.9073,55.5055 24.9151,55.5105 24.9203,55.5104 24.9204,55.5103 24.9204,55.5101 24.9204,55.498 24.9143,55.4939 24.9121,55.4932 24.9115,55.4928 24.9108,55.4927 24.9102,55.4926 24.9095,55.4927 24.909,55.4929 24.9084,55.4932 24.9079,55.4937 24.9074,55.4943 24.907,55.4949 24.9068,55.4956 24.9066,55.4964 24.9066,55.4971 24.9068,55.4977 24.907,55.4983 24.9075,55.5058 24.9153,55.5108 24.9206,55.5116 24.921,55.5119 24.9212,55.512 24.9213,55.5121 24.9215,55.5121 24.9216,55.512 24.9217,55.5117 24.922,55.5116 24.9219,55.511 24.9217,55.5109 24.9217,55.5108 24.9218,55.5107 24.9218,55.5106 24.922,55.5107 24.9218,55.5108 24.9218,55.5108 24.9217,55.5107 24.9215,55.5104 24.9211,55.5097 24.9205,55.5096 24.9205,55.5095 24.9205,55.5094 24.9205,55.5094 24.9207,55.5091 24.921,55.5089 24.9211,55.5089 24.9211,55.5089 24.9211,55.5091 24.9211,55.5092 24.9211,55.5092 24.9211,55.5093 24.9207,55.5094 24.9206,55.5094 24.9206,55.5094 24.9205,55.5092 24.9204,55.5077 24.9195,55.5077 24.9195,55.5076 24.9196,55.5077 24.9196,55.509 24.9202,55.509 24.9202,55.509 24.9202,55.5109 24.9214,55.5111 24.9216,55.5111 24.9216,55.5108 24.9218,55.5107 24.9219,55.5106 24.9219,55.5106 24.9218,55.5107 24.9217,55.5108 24.9217,55.5108 24.9217,55.5109 24.9217,55.5117 24.9219,55.5118 24.9219,55.5119 24.9219,55.512 24.9219,55.512 24.9218,55.5121 24.9217,55.5121 24.9215,55.512 24.9212,55.5119 24.9212,55.5118 24.9211,55.5106 24.9206,55.5105 24.9206,55.5105 24.9206,55.5105 24.9206,55.5105 24.9205,55.5105 24.9204,55.5105 24.9204,55.5106 24.9205,55.5108 24.9206,55.5109 24.9207,55.5113 24.9209,55.5119 24.9212,55.512 24.9212,55.512 24.9213,55.5121 24.9215,55.5121 24.9215,55.5122 24.9216,55.5122 24.9216,55.5124 24.9215,55.5125 24.9214,55.5126 24.9213,55.5127 24.9213,55.5127 24.9213,55.5127 24.9213,55.5127 24.9214,55.5127 24.9214,55.5127 24.9214,55.5126 24.9214,55.5126 24.9213,55.5126 24.9212,55.5125 24.9211,55.5125 24.9212,55.5125 24.9212,55.5125 24.9213,55.5125 24.9214,55.5124 24.9215,55.5117 24.9219,55.5116 24.9219,55.5115 24.9219,55.5111 24.9217,55.5104 24.9212,55.5102 24.9211,55.5102 24.9211,55.5102 24.9211,55.5102 24.921,55.5102 24.9209,55.5101 24.9208,55.5101 24.9208,55.5098 24.9206,55.4964 24.9138,55.4946 24.9129,55.4941 24.9128,55.4938 24.9126,55.4937 24.9126,55.4937 24.9126,55.4937 24.9126,55.4936 24.9126,55.4935 24.9123,55.4934 24.9122,55.4934 24.9121,55.4933 24.912,55.4931 24.9119,55.493 24.9119,55.4929 24.9119,55.4928 24.9119,55.4925 24.9124,55.4924 24.9124,55.4922 24.9124,55.4921 24.9125,55.492 24.9125,55.4906 24.9147,55.4906 24.9148,55.4906 24.9149,55.4922 24.9157,55.4922 24.9158,55.4908 24.9179,55.4907 24.9179,55.4906 24.9179,55.4899 24.9176,55.4898 24.9176,55.4897 24.9177,55.4889 24.919,55.4888 24.919,55.4887 24.919,55.4887 24.919,55.4879 24.9185,55.4879 24.9184,55.4879 24.9183,55.488 24.9181,55.4886 24.9172,55.4887 24.9171,55.4888 24.9171,55.4894 24.9173,55.4906 24.9179,55.4907 24.9179,55.4908 24.9179,55.4922 24.9158,55.4921 24.9157,55.4906 24.9148,55.4906 24.9148,55.4906 24.9147,55.492 24.9125,55.4921 24.9124,55.4922 24.9124,55.4924 24.9124,55.4925 24.9124,55.4926 24.9123,55.4929 24.9118,55.4929 24.9117,55.4923 24.91,55.4923 24.9094,55.4924 24.9088,55.4926 24.9082,55.4932 24.9075,55.4937 24.907,55.4945 24.9066,55.4951 24.9064,55.4958 24.9063,55.4965 24.9063,55.4975 24.9066,55.4982 24.907,55.499 24.9077,55.5109 24.9203,55.5112 24.9206,55.5113 24.9207,55.5114 24.9207,55.5117 24.9207,55.5119 24.9206,55.5121 24.9206,55.5123 24.9207,55.5124 24.9207,55.513 24.9212,55.513 24.9213,55.513 24.9215,55.5129 24.9215,55.5128 24.9216,55.5127 24.9216,55.5126 24.9216,55.5125 24.9215,55.5126 24.9214,55.5126 24.9214,55.5127 24.9213,55.5127 24.9213,55.5127 24.9212,55.5127 24.9212,55.5127 24.9212,55.5127 24.9212,55.5127 24.9212,55.5127 24.9212,55.5126 24.9212,55.5125 24.9212,55.5125 24.9214,55.5125 24.9214,55.5124 24.9214,55.5123 24.9214,55.5108 24.9207,55.5106 24.9206,55.5106 24.9206,55.5106 24.9206,55.5107 24.9206,55.5109 24.9207,55.511 24.9208,55.512 24.9213,55.5121 24.9213,55.5121 24.9214,55.5121 24.9215,55.5119 24.9217,55.5118 24.9218,55.5118 24.9218,55.5117 24.9217,55.5117 24.9217,55.5116 24.9216,55.5117 24.9215,55.5117 24.9214,55.5119 24.9213,55.5119 24.9212,55.5119 24.9212,55.511 24.9208,55.5074 24.917,55.498 24.9073,55.4975 24.907,55.4968 24.9068,55.4966 24.9067,55.4955 24.9067,55.4947 24.9069,55.4938 24.9073,55.4934 24.9077,55.4931 24.9081,55.4927 24.9089,55.4926 24.9095,55.4926 24.9101,55.4929 24.9109,55.4933 24.9116,55.494 24.9122,55.5032 24.9168,55.5042 24.9173,55.5044 24.9175,55.5119 24.9212,55.512 24.9213,55.512 24.9215,55.512 24.9216,55.5118 24.9219,55.5117 24.9219,55.5116 24.9219,55.511 24.9215,55.5097 24.9207,55.5096 24.9207,55.5094 24.9207,55.5093 24.9207,55.5093 24.9208,55.5092 24.921,55.5092 24.921,55.5092 24.9211,55.5092 24.9211,55.5092 24.9211,55.5092 24.9211,55.509 24.9212,55.509 24.9211,55.509 24.9211,55.509 24.921,55.5093 24.9208,55.5094 24.9207,55.5096 24.9207,55.5097 24.9207,55.5106 24.9213,55.511 24.9217,55.5112 24.9221,55.5112 24.9222,55.5112 24.9223,55.5026 24.9357,55.495 24.9475,55.495 24.9476,55.4951 24.9477,55.4954 24.948,55.4972 24.9496,55.4973 24.9498,55.4973 24.9499,55.4965 24.9512,55.4965 24.9514,55.4966 24.9514,55.4967 24.9515,55.497 24.9518,55.5001 24.9535,55.5003 24.9536,55.5006 24.9536,55.5007 24.9535,55.5009 24.9534,55.501 24.9534,55.501 24.9535,55.5009 24.9536,55.5005 24.9536,55.5003 24.9536,55.5 24.9536,55.4995 24.9534,55.4993 24.9534,55.4991 24.9533,55.4978 24.9525,55.4977 24.9525,55.4976 24.9526,55.4902 24.9642,55.4895 24.9676,55.4895 24.9678,55.4894 24.9679,55.4893 24.968,55.4885 24.969,55.4883 24.9692,55.4881 24.9693,55.4861 24.9694,55.4859 24.9695,55.4791 24.9789,55.4789 24.979,55.4788 24.9789,55.4769 24.9778,55.4766 24.9775,55.4766 24.9773,55.4767 24.9769,55.4769 24.9765,55.477 24.9764,55.477 24.9764)')`

`

When using SELECT geometry::STGeomFromText(@string, 4326); it throws a memory error when going to the geography tab.

When doing SELECT geometry::STGeomFromText(@string, 4326).MakeValid(); it crashes the SQL Server engine for 3-5 minutes.

I tried everything to work around this but I'm kinda stuck.

I want to have some sort of way to make sure it does not crash processing and make it work.

Live some servers are on SQL Server 2008R2 and issue still seems to be there on SQL Server 2019

pgky5nke

pgky5nke1#

CREATE FUNCTION [dbo].UDF_CreateList(@SplitOn  char(1), @List varchar(MAX))
RETURNS TABLE
AS
RETURN 
(
SELECT
    ROW_NUMBER() OVER(ORDER BY number) AS RowNumber
        ,LTRIM(RTRIM(SUBSTRING(ListValue, number+1, CHARINDEX(@SplitOn, ListValue, number+1)-number - 1))) AS ListValue
    FROM (
             SELECT @SplitOn + @List + @SplitOn AS ListValue
         ) AS InnerQuery
        INNER JOIN master.dbo.spt_values n ON n.Number < LEN(InnerQuery.ListValue)
    WHERE SUBSTRING(ListValue, number, 1) = @SplitOn
    AND n.type = 'P'
);

CREATE FUNCTION [dbo].[UDF_CreateGeometryFromString](@Tripstring VARCHAR(max))
RETURNS GEOMETRY
AS
  BEGIN
      DECLARE @g GEOMETRY = geometry::STGeomFromText(@Tripstring, 4326);
      IF @g.STIsValid() = 1
        BEGIN
            RETURN @g.MakeValid();
        END
      ELSE
        BEGIN
            SET @Tripstring = Replace(@Tripstring, 'LINESTRING(', '');
            SET @Tripstring = Replace(@Tripstring, ')', '');
            DECLARE @Temp TABLE
              (
                 id        INT IDENTITY(1, 1) PRIMARY KEY,
                 ListValue NVARCHAR(100)
              );
            DECLARE @TempMultiline TABLE
              (
                 id        INT IDENTITY(1, 1) PRIMARY KEY,
                 ListValue NVARCHAR(100)
              );
            INSERT INTO @Temp
                        (ListValue)
            SELECT ListValue
            FROM   dbo.Udf_createlist(',', @Tripstring);
            DECLARE @resultCount INT = (SELECT Count(*)
               FROM   @Temp);
            IF ( @resultCount < 2 )
              BEGIN
                  RETURN NULL;
              END
            DECLARE @return NVARCHAR(MAX) = Cast(@resultCount AS NVARCHAR(MAX));
            INSERT INTO @TempMultiline
                        (ListValue)
            SELECT '(' + t1.ListValue + ',' + t2.ListValue + ')'
            FROM   (SELECT id,
                           ListValue,
                           Row_number()
                             OVER(
                               ORDER BY id) AS Inc
                    FROM   @Temp) t1
                   LEFT JOIN (SELECT id,
                                     ListValue,
                                     Row_number()
                                       OVER(
                                         ORDER BY id) - 1 AS Inc
                              FROM   @Temp) t2
                          ON t2.Inc = t1.Inc
            DECLARE @multilinestring NVARCHAR(max) = 'MULTILINESTRING' + '('
              + Substring((SELECT ',' + ListValue FROM @TempMultiline FOR XML PATH('')), 2, 9999) + ')';
            DECLARE @g4 GEOMETRY = geometry::STGeomFromText(@multilinestring, 4326).MakeValid();
            RETURN @g4;
        END
      RETURN NULL;
  END 

DECLARE @string nvarchar(max) = ('LINESTRING(55.5104 24.9205,55.5104 24.9205,55.5105 24.9205,55.5105 24.9204,55.5105 24.9204,55.5105 24.9203,55.5104 24.9201,55.5049 24.9143,55.505 24.9144,55.5049 24.9143,55.4981 24.9072,55.4975 24.9069,55.4968 24.9067,55.4961 24.9066,55.4952 24.9066,55.4944 24.9069,55.494 24.9072,55.4934 24.9076,55.4929 24.9083,55.4927 24.9088,55.4926 24.9096,55.4926 24.9096,55.4926 24.9101,55.4928 24.9108,55.4931 24.9114,55.4936 24.9119,55.4936 24.9119,55.4938 24.9121,55.4951 24.9128,55.4948 24.9126,55.4949 24.9127,55.4967 24.9136,55.51 24.9203,55.5103 24.9204,55.5104 24.9203,55.5104 24.9203,55.5104 24.9202,55.51 24.9197,55.5039 24.9133,55.5039 24.9133,55.5039 24.9133,55.5004 24.9096,55.4982 24.9073,55.4976 24.907,55.4967 24.9067,55.496 24.9066,55.4954 24.9066,55.4944 24.9069,55.4939 24.9072,55.4932 24.9079,55.4929 24.9085,55.4927 24.9091,55.4926 24.9097,55.4927 24.9104,55.4929 24.911,55.4933 24.9115,55.494 24.9122,55.5069 24.9187,55.5091 24.9198,55.5093 24.9199,55.5094 24.9198,55.5094 24.9198,55.5094 24.9197,55.5093 24.9195,55.509 24.9193,55.509 24.9192,55.509 24.9192,55.509 24.9192,55.5089 24.9193,55.509 24.9194,55.5105 24.9203,55.5107 24.9204,55.5107 24.9204,55.5107 24.9204,55.5107 24.9204,55.5107 24.9204,55.5106 24.9205,55.5104 24.9204,55.5098 24.9201,55.4945 24.9124,55.4937 24.9119,55.4932 24.9113,55.4928 24.9106,55.4926 24.9099,55.4927 24.9091,55.4929 24.9084,55.4933 24.9078,55.4939 24.9073,55.4945 24.9069,55.4952 24.9067,55.4959 24.9066,55.4966 24.9067,55.4973 24.9069,55.4979 24.9072,55.4987 24.9079,55.5046 24.914,55.5101 24.9198,55.5104 24.9202,55.5105 24.9203,55.5105 24.9203,55.5105 24.9204,55.5105 24.9205,55.5104 24.9205,55.5103 24.9205,55.5102 24.9204,55.5102 24.9204,55.5048 24.9177,55.4936 24.9119,55.4933 24.9115,55.493 24.9111,55.4926 24.9101,55.4926 24.9096,55.4927 24.9089,55.493 24.9082,55.4935 24.9076,55.494 24.9072,55.4949 24.9068,55.4954 24.9066,55.4963 24.9066,55.4971 24.9068,55.4978 24.9072,55.4985 24.9077,55.5104 24.9202,55.5104 24.9202,55.5104 24.9203,55.5104 24.9203,55.5104 24.9204,55.5103 24.9204,55.5097 24.9201,55.5086 24.9196,55.5021 24.9163,55.495 24.9126,55.4947 24.9124,55.4944 24.9123,55.4942 24.9122,55.4938 24.912,55.4933 24.9115,55.493 24.911,55.4927 24.9103,55.4927 24.9095,55.4928 24.9087,55.4933 24.9079,55.4939 24.9073,55.4948 24.9069,55.4957 24.9066,55.4966 24.9067,55.4974 24.9069,55.4981 24.9073,55.5091 24.9188,55.5101 24.9199,55.5101 24.92,55.51 24.92,55.51 24.92,55.5099 24.9201,55.5097 24.92,55.5095 24.92,55.4957 24.9131,55.4939 24.9122,55.4933 24.9117,55.493 24.9112,55.4927 24.9106,55.4926 24.9099,55.4926 24.9091,55.4929 24.9084,55.4932 24.9079,55.4938 24.9073,55.4943 24.907,55.4951 24.9067,55.496 24.9066,55.4966 24.9067,55.4973 24.9069,55.4981 24.9073,55.5032 24.9126,55.5105 24.9203,55.5105 24.9203,55.5106 24.9204,55.5106 24.9204,55.5105 24.9204,55.5104 24.9205,55.5103 24.9205,55.5101 24.9204,55.497 24.9138,55.4938 24.9121,55.4932 24.9115,55.4929 24.911,55.4926 24.9104,55.4925 24.9098,55.4926 24.9092,55.4927 24.9087,55.4931 24.9081,55.4936 24.9074,55.494 24.9072,55.4947 24.9068,55.4954 24.9066,55.496 24.9066,55.4967 24.9067,55.4974 24.9069,55.4982 24.9074,55.5046 24.9141,55.5046 24.9141,55.5046 24.9141,55.5046 24.9141,55.5048 24.9143,55.5104 24.9203,55.5105 24.9205,55.5104 24.9205,55.5104 24.9205,55.5103 24.9205,55.5045 24.9175,55.4938 24.9119,55.4931 24.9112,55.4927 24.9104,55.4926 24.9094,55.4928 24.9085,55.4934 24.9078,55.4941 24.9072,55.4949 24.9068,55.4959 24.9067,55.4968 24.9068,55.4977 24.9071,55.4984 24.9077,55.509 24.9188,55.5099 24.9198,55.5103 24.9202,55.5103 24.9203,55.5103 24.9203,55.5103 24.9203,55.5102 24.9204,55.5101 24.9204,55.51 24.9204,55.4976 24.9141,55.4937 24.912,55.4933 24.9116,55.4929 24.9109,55.4926 24.9102,55.4926 24.9097,55.4927 24.9089,55.493 24.9082,55.4934 24.9077,55.4939 24.9073,55.4946 24.9069,55.4952 24.9067,55.4958 24.9066,55.4966 24.9067,55.4974 24.9069,55.498 24.9073,55.4985 24.9077,55.506 24.9155,55.5104 24.9202,55.5105 24.9203,55.5105 24.9203,55.5105 24.9204,55.5104 24.9204,55.5104 24.9204,55.5103 24.9204,55.5102 24.9204,55.5096 24.9202,55.4968 24.9137,55.4937 24.912,55.4933 24.9115,55.4929 24.911,55.4927 24.9101,55.4926 24.9096,55.4927 24.9089,55.493 24.9083,55.4933 24.9078,55.4938 24.9073,55.4944 24.907,55.4954 24.9067,55.496 24.9066,55.4966 24.9067,55.4974 24.9069,55.498 24.9073,55.4988 24.908,55.5009 24.9102,55.5068 24.9164,55.5102 24.92,55.5106 24.9205,55.5106 24.9205,55.5105 24.9205,55.5104 24.9205,55.5103 24.9205,55.4957 24.9131,55.4938 24.912,55.4933 24.9116,55.4929 24.911,55.4927 24.9105,55.4926 24.9098,55.4926 24.9092,55.4928 24.9086,55.4931 24.908,55.4936 24.9075,55.4941 24.9071,55.4948 24.9068,55.4955 24.9066,55.4962 24.9066,55.497 24.9067,55.4976 24.907,55.4985 24.9076,55.5061 24.9157,55.5103 24.9201,55.5103 24.9201,55.5104 24.9201,55.5104 24.9202,55.5105 24.9203,55.5104 24.9203,55.5104 24.9204,55.5103 24.9204,55.5103 24.9204,55.5091 24.9199,55.4938 24.9121,55.4933 24.9115,55.4929 24.9109,55.4926 24.9102,55.4926 24.9093,55.4928 24.9086,55.4932 24.9079,55.4937 24.9074,55.4937 24.9073,55.4941 24.9071,55.495 24.9068,55.4958 24.9066,55.4967 24.9067,55.4973 24.9069,55.4979 24.9072,55.4985 24.9076,55.5082 24.9178,55.5104 24.9203,55.5105 24.9203,55.5105 24.9203,55.5104 24.9204,55.5104 24.9204,55.5103 24.9205,55.5103 24.9204,55.5101 24.9204,55.51 24.9203,55.5098 24.9202,55.4937 24.9119,55.4932 24.9114,55.4928 24.9108,55.4927 24.9101,55.4926 24.9094,55.4927 24.9088,55.493 24.9082,55.4937 24.9074,55.4943 24.907,55.4949 24.9068,55.4955 24.9066,55.4964 24.9066,55.497 24.9068,55.4979 24.9072,55.4986 24.9077,55.507 24.9166,55.5104 24.9201,55.5105 24.9203,55.5105 24.9203,55.5104 24.9204,55.5104 24.9204,55.5103 24.9204,55.51 24.9203,55.4956 24.913,55.4939 24.9121,55.4932 24.9115,55.4929 24.9109,55.4927 24.9103,55.4926 24.9097,55.4927 24.9089,55.493 24.9083,55.4934 24.9077,55.4941 24.9071,55.4946 24.9069,55.4954 24.9067,55.4962 24.9066,55.4971 24.9068,55.4977 24.907,55.4982 24.9074,55.5056 24.9151,55.5099 24.9197,55.51 24.9198,55.51 24.9198,55.5099 24.9199,55.5098 24.9199,55.5097 24.9199,55.5096 24.9198,55.5095 24.9197,55.5086 24.919,55.5086 24.9189,55.5086 24.9189,55.5087 24.9189,55.5087 24.9189,55.5097 24.9199,55.51 24.92,55.5103 24.9202,55.5105 24.9203,55.5105 24.9204,55.5105 24.9204,55.5105 24.9205,55.5105 24.9205,55.5104 24.9205,55.5103 24.9205,55.5001 24.9153,55.5001 24.9153,55.4938 24.912,55.4932 24.9114,55.4928 24.9106,55.4927 24.9098,55.4928 24.909,55.4931 24.9082,55.4937 24.9075,55.4945 24.907,55.4954 24.9067,55.4964 24.9067,55.4973 24.9069,55.4981 24.9073,55.51 24.9197,55.5104 24.9201,55.5105 24.9202,55.5105 24.9203,55.5105 24.9204,55.5105 24.9204,55.5105 24.9205,55.5104 24.9205,55.5103 24.9205,55.4966 24.9136,55.4938 24.9121,55.4931 24.9114,55.4928 24.9109,55.4926 24.9101,55.4926 24.9095,55.4928 24.9087,55.493 24.9082,55.4935 24.9076,55.4941 24.9071,55.4948 24.9068,55.4956 24.9066,55.4961 24.9066,55.497 24.9068,55.4976 24.907,55.4982 24.9073,55.5051 24.9146,55.5099 24.9197,55.5099 24.9198,55.5099 24.9199,55.5098 24.9199,55.5097 24.9199,55.509 24.9193,55.5084 24.9188,55.5083 24.9187,55.5083 24.9188,55.5082 24.9188,55.5081 24.9188,55.5081 24.9188,55.508 24.9188,55.508 24.9188,55.5079 24.9189,55.5078 24.9189,55.5075 24.9187,55.5072 24.9186,55.5071 24.9186,55.507 24.9186,55.507 24.9187,55.5069 24.9187,55.5069 24.9187,55.5064 24.9185,55.4937 24.9119,55.4931 24.9112,55.4928 24.9107,55.4927 24.9101,55.4927 24.9093,55.4929 24.9085,55.4932 24.9081,55.4937 24.9075,55.4944 24.907,55.4952 24.9067,55.496 24.9066,55.4968 24.9068,55.4976 24.907,55.4983 24.9075,55.5075 24.9171,55.5101 24.9198,55.5101 24.9199,55.5101 24.9199,55.5101 24.92,55.51 24.92,55.5094 24.9199,55.4954 24.913,55.494 24.9121,55.4936 24.9117,55.4935 24.9116,55.4935 24.9116,55.4935 24.9116,55.4932 24.9114,55.493 24.9111,55.4928 24.9107,55.4927 24.9102,55.4927 24.9095,55.4929 24.9087,55.4933 24.908,55.4938 24.9074,55.4945 24.907,55.4953 24.9067,55.4961 24.9067,55.4969 24.9068,55.4976 24.9071,55.4983 24.9075,55.5093 24.9189,55.5106 24.9203,55.5106 24.9204,55.5106 24.9204,55.5105 24.9204,55.5104 24.9205,55.5103 24.9205,55.4963 24.9134,55.4938 24.9121,55.4933 24.9116,55.4929 24.9111,55.4927 24.9104,55.4926 24.9099,55.4927 24.909,55.4929 24.9084,55.4933 24.9078,55.4939 24.9073,55.4945 24.9069,55.4952 24.9067,55.4961 24.9066,55.4968 24.9067,55.4973 24.9069,55.4981 24.9073,55.4987 24.9079,55.5069 24.9165,55.5085 24.9182,55.5085 24.9182,55.51 24.9197,55.5101 24.9198,55.5101 24.9199,55.5101 24.92,55.51 24.9201,55.5099 24.9201,55.5098 24.9202,55.5097 24.9201,55.5094 24.92,55.4937 24.9119,55.4932 24.9114,55.4928 24.9107,55.4927 24.9103,55.4926 24.9096,55.4927 24.909,55.493 24.9083,55.4935 24.9077,55.4941 24.9072,55.4948 24.9068,55.4955 24.9067,55.4962 24.9067,55.4971 24.9068,55.4976 24.907,55.4982 24.9074,55.505 24.9146,55.5105 24.9203,55.5105 24.9203,55.5105 24.9204,55.5105 24.9205,55.5104 24.9205,55.5104 24.9205,55.5102 24.9204,55.5058 24.9182,55.4982 24.9143,55.4937 24.912,55.4933 24.9116,55.493 24.9111,55.4927 24.9102,55.4926 24.9096,55.4927 24.9091,55.493 24.9083,55.4935 24.9076,55.494 24.9072,55.4948 24.9069,55.4956 24.9067,55.4964 24.9067,55.4972 24.9068,55.4976 24.907,55.4982 24.9074,55.4998 24.909,55.4997 24.9089,55.4997 24.9089,55.4997 24.9089,55.5085 24.9181,55.5101 24.9198,55.5103 24.9201,55.5104 24.9202,55.5104 24.9202,55.5104 24.9203,55.5104 24.9203,55.5103 24.9203,55.5103 24.9204,55.5102 24.9204,55.51 24.9203,55.4978 24.9141,55.4938 24.912,55.4934 24.9116,55.4929 24.9109,55.4927 24.9104,55.4926 24.9097,55.4927 24.9089,55.4929 24.9084,55.4933 24.9079,55.4939 24.9073,55.4946 24.9069,55.4951 24.9067,55.4958 24.9066,55.4965 24.9067,55.4974 24.9069,55.498 24.9072,55.4986 24.9077,55.5063 24.9158,55.51 24.9198,55.5103 24.92,55.5103 24.9201,55.5103 24.9201,55.5103 24.9202,55.5102 24.9203,55.5102 24.9203,55.5101 24.9203,55.5099 24.9203,55.4971 24.9138,55.4938 24.912,55.4934 24.9117,55.493 24.911,55.4927 24.9105,55.4926 24.9098,55.4927 24.9092,55.4929 24.9086,55.4932 24.908,55.4937 24.9074,55.4941 24.9071,55.4948 24.9068,55.4956 24.9066,55.4964 24.9066,55.497 24.9067,55.4977 24.9071,55.4983 24.9074,55.5052 24.9146,55.5065 24.916,55.5106 24.9204,55.5107 24.9204,55.5106 24.9205,55.5106 24.9205,55.5105 24.9205,55.5104 24.9205,55.5104 24.9205,55.4973 24.9139,55.4937 24.912,55.4932 24.9114,55.4929 24.9108,55.4927 24.9102,55.4926 24.9097,55.4928 24.9089,55.493 24.9084,55.4933 24.9079,55.4938 24.9074,55.4943 24.907,55.4951 24.9067,55.4957 24.9066,55.4965 24.9067,55.4972 24.9068,55.4978 24.9071,55.4984 24.9075,55.5048 24.9144,55.5061 24.9157,55.5061 24.9157,55.5103 24.92,55.5104 24.9201,55.5104 24.9202,55.5104 24.9203,55.5103 24.9203,55.5102 24.9204,55.5102 24.9203,55.4946 24.9125,55.4936 24.9117,55.4931 24.9111,55.4928 24.9103,55.4927 24.9095,55.4928 24.9088,55.4932 24.9081,55.4938 24.9074,55.4944 24.907,55.4952 24.9067,55.4959 24.9066,55.4966 24.9067,55.4974 24.9069,55.498 24.9073,55.5055 24.9151,55.5105 24.9203,55.5104 24.9204,55.5103 24.9204,55.5101 24.9204,55.498 24.9143,55.4939 24.9121,55.4932 24.9115,55.4928 24.9108,55.4927 24.9102,55.4926 24.9095,55.4927 24.909,55.4929 24.9084,55.4932 24.9079,55.4937 24.9074,55.4943 24.907,55.4949 24.9068,55.4956 24.9066,55.4964 24.9066,55.4971 24.9068,55.4977 24.907,55.4983 24.9075,55.5058 24.9153,55.5108 24.9206,55.5116 24.921,55.5119 24.9212,55.512 24.9213,55.5121 24.9215,55.5121 24.9216,55.512 24.9217,55.5117 24.922,55.5116 24.9219,55.511 24.9217,55.5109 24.9217,55.5108 24.9218,55.5107 24.9218,55.5106 24.922,55.5107 24.9218,55.5108 24.9218,55.5108 24.9217,55.5107 24.9215,55.5104 24.9211,55.5097 24.9205,55.5096 24.9205,55.5095 24.9205,55.5094 24.9205,55.5094 24.9207,55.5091 24.921,55.5089 24.9211,55.5089 24.9211,55.5089 24.9211,55.5091 24.9211,55.5092 24.9211,55.5092 24.9211,55.5093 24.9207,55.5094 24.9206,55.5094 24.9206,55.5094 24.9205,55.5092 24.9204,55.5077 24.9195,55.5077 24.9195,55.5076 24.9196,55.5077 24.9196,55.509 24.9202,55.509 24.9202,55.509 24.9202,55.5109 24.9214,55.5111 24.9216,55.5111 24.9216,55.5108 24.9218,55.5107 24.9219,55.5106 24.9219,55.5106 24.9218,55.5107 24.9217,55.5108 24.9217,55.5108 24.9217,55.5109 24.9217,55.5117 24.9219,55.5118 24.9219,55.5119 24.9219,55.512 24.9219,55.512 24.9218,55.5121 24.9217,55.5121 24.9215,55.512 24.9212,55.5119 24.9212,55.5118 24.9211,55.5106 24.9206,55.5105 24.9206,55.5105 24.9206,55.5105 24.9206,55.5105 24.9205,55.5105 24.9204,55.5105 24.9204,55.5106 24.9205,55.5108 24.9206,55.5109 24.9207,55.5113 24.9209,55.5119 24.9212,55.512 24.9212,55.512 24.9213,55.5121 24.9215,55.5121 24.9215,55.5122 24.9216,55.5122 24.9216,55.5124 24.9215,55.5125 24.9214,55.5126 24.9213,55.5127 24.9213,55.5127 24.9213,55.5127 24.9213,55.5127 24.9214,55.5127 24.9214,55.5127 24.9214,55.5126 24.9214,55.5126 24.9213,55.5126 24.9212,55.5125 24.9211,55.5125 24.9212,55.5125 24.9212,55.5125 24.9213,55.5125 24.9214,55.5124 24.9215,55.5117 24.9219,55.5116 24.9219,55.5115 24.9219,55.5111 24.9217,55.5104 24.9212,55.5102 24.9211,55.5102 24.9211,55.5102 24.9211,55.5102 24.921,55.5102 24.9209,55.5101 24.9208,55.5101 24.9208,55.5098 24.9206,55.4964 24.9138,55.4946 24.9129,55.4941 24.9128,55.4938 24.9126,55.4937 24.9126,55.4937 24.9126,55.4937 24.9126,55.4936 24.9126,55.4935 24.9123,55.4934 24.9122,55.4934 24.9121,55.4933 24.912,55.4931 24.9119,55.493 24.9119,55.4929 24.9119,55.4928 24.9119,55.4925 24.9124,55.4924 24.9124,55.4922 24.9124,55.4921 24.9125,55.492 24.9125,55.4906 24.9147,55.4906 24.9148,55.4906 24.9149,55.4922 24.9157,55.4922 24.9158,55.4908 24.9179,55.4907 24.9179,55.4906 24.9179,55.4899 24.9176,55.4898 24.9176,55.4897 24.9177,55.4889 24.919,55.4888 24.919,55.4887 24.919,55.4887 24.919,55.4879 24.9185,55.4879 24.9184,55.4879 24.9183,55.488 24.9181,55.4886 24.9172,55.4887 24.9171,55.4888 24.9171,55.4894 24.9173,55.4906 24.9179,55.4907 24.9179,55.4908 24.9179,55.4922 24.9158,55.4921 24.9157,55.4906 24.9148,55.4906 24.9148,55.4906 24.9147,55.492 24.9125,55.4921 24.9124,55.4922 24.9124,55.4924 24.9124,55.4925 24.9124,55.4926 24.9123,55.4929 24.9118,55.4929 24.9117,55.4923 24.91,55.4923 24.9094,55.4924 24.9088,55.4926 24.9082,55.4932 24.9075,55.4937 24.907,55.4945 24.9066,55.4951 24.9064,55.4958 24.9063,55.4965 24.9063,55.4975 24.9066,55.4982 24.907,55.499 24.9077,55.5109 24.9203,55.5112 24.9206,55.5113 24.9207,55.5114 24.9207,55.5117 24.9207,55.5119 24.9206,55.5121 24.9206,55.5123 24.9207,55.5124 24.9207,55.513 24.9212,55.513 24.9213,55.513 24.9215,55.5129 24.9215,55.5128 24.9216,55.5127 24.9216,55.5126 24.9216,55.5125 24.9215,55.5126 24.9214,55.5126 24.9214,55.5127 24.9213,55.5127 24.9213,55.5127 24.9212,55.5127 24.9212,55.5127 24.9212,55.5127 24.9212,55.5127 24.9212,55.5127 24.9212,55.5126 24.9212,55.5125 24.9212,55.5125 24.9214,55.5125 24.9214,55.5124 24.9214,55.5123 24.9214,55.5108 24.9207,55.5106 24.9206,55.5106 24.9206,55.5106 24.9206,55.5107 24.9206,55.5109 24.9207,55.511 24.9208,55.512 24.9213,55.5121 24.9213,55.5121 24.9214,55.5121 24.9215,55.5119 24.9217,55.5118 24.9218,55.5118 24.9218,55.5117 24.9217,55.5117 24.9217,55.5116 24.9216,55.5117 24.9215,55.5117 24.9214,55.5119 24.9213,55.5119 24.9212,55.5119 24.9212,55.511 24.9208,55.5074 24.917,55.498 24.9073,55.4975 24.907,55.4968 24.9068,55.4966 24.9067,55.4955 24.9067,55.4947 24.9069,55.4938 24.9073,55.4934 24.9077,55.4931 24.9081,55.4927 24.9089,55.4926 24.9095,55.4926 24.9101,55.4929 24.9109,55.4933 24.9116,55.494 24.9122,55.5032 24.9168,55.5042 24.9173,55.5044 24.9175,55.5119 24.9212,55.512 24.9213,55.512 24.9215,55.512 24.9216,55.5118 24.9219,55.5117 24.9219,55.5116 24.9219,55.511 24.9215,55.5097 24.9207,55.5096 24.9207,55.5094 24.9207,55.5093 24.9207,55.5093 24.9208,55.5092 24.921,55.5092 24.921,55.5092 24.9211,55.5092 24.9211,55.5092 24.9211,55.5092 24.9211,55.509 24.9212,55.509 24.9211,55.509 24.9211,55.509 24.921,55.5093 24.9208,55.5094 24.9207,55.5096 24.9207,55.5097 24.9207,55.5106 24.9213,55.511 24.9217,55.5112 24.9221,55.5112 24.9222,55.5112 24.9223,55.5026 24.9357,55.495 24.9475,55.495 24.9476,55.4951 24.9477,55.4954 24.948,55.4972 24.9496,55.4973 24.9498,55.4973 24.9499,55.4965 24.9512,55.4965 24.9514,55.4966 24.9514,55.4967 24.9515,55.497 24.9518,55.5001 24.9535,55.5003 24.9536,55.5006 24.9536,55.5007 24.9535,55.5009 24.9534,55.501 24.9534,55.501 24.9535,55.5009 24.9536,55.5005 24.9536,55.5003 24.9536,55.5 24.9536,55.4995 24.9534,55.4993 24.9534,55.4991 24.9533,55.4978 24.9525,55.4977 24.9525,55.4976 24.9526,55.4902 24.9642,55.4895 24.9676,55.4895 24.9678,55.4894 24.9679,55.4893 24.968,55.4885 24.969,55.4883 24.9692,55.4881 24.9693,55.4861 24.9694,55.4859 24.9695,55.4791 24.9789,55.4789 24.979,55.4788 24.9789,55.4769 24.9778,55.4766 24.9775,55.4766 24.9773,55.4767 24.9769,55.4769 24.9765,55.477 24.9764,55.477 24.9764)')

SELECT dbo.UDF_CreateGeometryFromString(@string);

相关问题