{"id":16118,"date":"2022-12-08T06:00:00","date_gmt":"2022-12-07T21:00:00","guid":{"rendered":"https:\/\/www.muscle-hypertrophy.com\/?p=16118"},"modified":"2022-10-14T16:28:37","modified_gmt":"2022-10-14T07:28:37","slug":"%e7%ac%ac12%e7%ab%a0%e3%80%80%e7%a9%ba%e9%96%93%e3%82%aa%e3%83%96%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%82%92%e4%bf%ae%e9%a3%be%e3%81%99%e3%82%8b-begining-spatial-with-sql-server-2008","status":"publish","type":"post","link":"https:\/\/www.muscle-hypertrophy.com\/?p=16118","title":{"rendered":"\u7b2c12\u7ae0\u3000\u7a7a\u9593\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4fee\u98fe\u3059\u308b (Begining Spatial with SQL Server 2008)"},"content":{"rendered":"\n<p>\u3000\u672c\u7ae0\u306b\u304a\u3044\u3066\u306f\uff0c\u4ed6\u306e\u65e2\u5b58\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u4e00\u90e8\u3092\u4fee\u98fe\u3057\u305f\u308a\uff0c\u7d50\u5408\u3057\u305f\u308a\uff0c\u9078\u629e\u3057\u305f\u308a\u3057\u3066 geography \u578b\u3084 geometry \u578b\u306e\u30c7\u30fc\u30bf\u306e\u65b0\u3057\u3044\u30a2\u30a4\u30c6\u30e0\u3092\u751f\u6210\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u308b\u591a\u304f\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u7d39\u4ecb\u3057\u3088\u3046\uff0e\u3053\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u3068\u306f\u7570\u306a\u308a\uff0c\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u5ea7\u6a19\u70b9\u306e\u8868\u73fe\u304b\u3089\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u306e\u30a2\u30a4\u30c6\u30e0\u3092\u4ee3\u308f\u308a\u306b\u751f\u6210\u3059\u308b\u3053\u3068\u3092\u4e86\u627f\u3044\u305f\u3060\u304d\u305f\u3044\uff0e<\/p>\n<p>\u3000\u672c\u7ae0\u3067\u8ad6\u305a\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u3044\u304f\u3064\u304b\uff0c\u4f8b\u3048\u3070 STBuffer(), STConvexHull() \u304a\u3088\u3073 Reduse() \u306f\uff0c\u5358\u4e00\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u52d5\u4f5c\u3059\u308b\uff0e\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\uff0c\u4f8b\u3048\u3070 STIntersection() \u304a\u3088\u3073 STDifference() \u306f\u4e00\u3064\u4ee5\u4e0a\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u4e0a\u3067\u52d5\u4f5c\u3059\u308b\uff0eSQL Server 2008 \u306b\u304a\u3051\u308b\u3059\u3079\u3066\u306e\u7a7a\u9593\u6a5f\u80fd\u6027\u306e\u5834\u5408\u306e\u3088\u3046\u306b\uff0cgeometry \u578b\u304a\u3088\u3073 geography \u578b\u306f\u5229\u7528\u53ef\u80fd\u306a\u30e1\u30bd\u30c3\u30c9\u3084\uff0c\u540c\u3058\u65b9\u6cd5\u3067\u305d\u308c\u3089\u3092\u5b9f\u88c5\u3059\u308b\u540c\u3058\u30bb\u30c3\u30c8\u3092\u3082\u3064\u5fc5\u8981\u306f\u306a\u3044\uff0e\u672c\u7ae0\u3067\u7d39\u4ecb\u3059\u308b\u5404\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\uff0c\u3044\u3064\u3069\u306e\u3088\u3046\u306b\u305d\u308c\u304c\u4f7f\u308f\u308c\u308b\u304b\u3092\u898b\u305b\u3088\u3046\uff0e<\/p>\n<p>\u4ed8\u8a18\u3000\u672c\u7ae0\u3067\u8ad6\u305a\u308b\u30e1\u30bd\u30c3\u30c9\u306f\uff0c\u305d\u308c\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u5143\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u3044\u304b\u306a\u308b\u5909\u5316\u3092\u3082\u4e0e\u3048\u306a\u3044\uff0e\u3080\u3057\u308d\uff0c\u305d\u308c\u3089\u306f\u305d\u308c\u3089\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u8868\u73fe\u3055\u308c\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u4fee\u98fe\u306b\u3088\u308a\u65b0\u3057\u3044\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3059\u308b\uff0e<\/p>\n<p><!--more--><\/p>\n<h3>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6709\u52b9\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u4fdd\u3059\u308b<\/h3>\n<p>\u3000geometry \u578b\u3042\u308b\u3044\u306f geography \u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u751f\u6210\u3057\u305f\u3068\u304d\uff0cSQL Server \u306f\u63d0\u4f9b\u3055\u308c\u308b\u8868\u73fe\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\uff0c\u6b63\u5e38\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3092\u78ba\u4fdd\u3059\u308b\uff0e\u4f8b\u3048\u3070\uff0c\u6b21\u306e\u3088\u3046\u306a\u3044\u304b\u306a\u308b\u4e0d\u6b63\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u3082\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u751f\u6210\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\uff0e<\/p>\n<ul>\n<li>2\u3064\u306e\u70b9\u3088\u308a\u5c11\u306a\u3044 LineStirng<\/li>\n<li>4\u3064\u306e\u70b9\u3088\u308a\u5c11\u306a\u3044 Polygon<\/li>\n<li>\u9589\u3058\u3066\u3044\u306a\u3044\u30ea\u30f3\u30b0\u3092\u542b\u3080 Polygon \uff08\u30ea\u30f3\u30b0\u306e\u958b\u59cb\u70b9\u3068\u7d42\u4e86\u70b9\u304c\u540c\u4e00\u3067\u306a\u3044\u3082\u306e\uff09<\/li>\n<li>\u5916\u90e8\u30ea\u30f3\u30b0\u3068\u4ea4\u5dee\u3059\u308b\u5185\u90e8\u30ea\u30f3\u30b0\u3092\u5b9a\u7fa9\u3057\u305f Polygon<\/li>\n<\/ul>\n<p>\u3000\u3053\u308c\u3089\u306e\u3044\u304b\u306a\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u3082\u751f\u6210\u3057\u3088\u3046\u3068\u3059\u308b\u8a66\u307f\u306f\uff0cSQLCLR \u306b\u304a\u3044\u3066\u4f8b\u5916\u3068\u306a\u308a\uff08SQL Server \u306f geometry \u578b\u3068 geomgraphy \u578b\u306e\u6a5f\u80fd\u6027\u3092\u63d0\u4f9b\u3059\u308b\u305f\u3081\u306b\u4f7f\u3046\uff09\uff0c\u554f\u984c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u3088\u308b\u898f\u5247\u9055\u53cd\u306e\u8a73\u7d30\u3092\u542b\u3080\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u767a\u751f\u3055\u305b\u308b\u3053\u3068\u306b\u306a\u308b\uff0e<\/p>\n<p>\u3000\u5148\u306b\u5217\u6319\u3057\u305f\u3088\u3046\u306a\u4e0d\u6b63\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u306f\u4e0d\u53ef\u80fd\u3067\u3042\u308b\u306b\u3082\u95a2\u308f\u3089\u305a\uff0cOGC \u4ed5\u69d8\u306b\u3088\u308b\u3068\u6709\u52b9\u3067\u306a\u3044\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u4f8b\uff08\u4f8b\u3048\u3070\u305d\u308c\u81ea\u8eab\u3068\u91cd\u8907\u3059\u308b Polygon \u306a\u3069\uff09\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u306a\u304a\u53ef\u80fd\u3067\u3042\u308b\uff0egeometry \u578b\u3092\u4f7f\u3048\u3070\u3053\u308c\u3089\u306e\u7121\u52b9\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u84c4\u7a4d\u3057\u53d6\u5f97\u3059\u308b\u3053\u3068\u306f\u53ef\u80fd\u3060\u304c\uff0c\u305d\u308c\u3089\u306e\u4e0a\u3067\u4ed6\u306e\u3044\u304b\u306a\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u3082\u5b9f\u884c\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\uff0e\u3053\u306e\u3088\u3046\u306b\uff0cOGC \u6a19\u6e96\u3092\u691c\u8a3c\u3057\u306a\u3044\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8b58\u5225\u3067\u304d\u308b\u3053\u3068\uff0c\u5bfe\u51e6\u3059\u308b\u3053\u3068\u306f\u91cd\u8981\u3067\u3042\u308b\uff0e<\/p>\n<p>\u4ed8\u8a18\u3000geometry \u578b\u3067\u7121\u52b9\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u84c4\u7a4d\u3057\u53d6\u5f97\u3059\u308b\u3053\u3068\u306f\u53ef\u80fd\u3060\u304c\uff0c\u305d\u308c\u3089\u306b\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3053\u3068\u306f\u3067\u304d\u306a\u3044\uff0e<\/p>\n<p>\u3000STIsValid() \u306f geometry \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\uff0c\u554f\u984c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7a2e\u985e\u306e OGC \u4ed5\u69d8\u306b\u3088\u308a\u6709\u52b9\u3067\u3042\u308b\u3068\u8981\u6c42\u3055\u308c\u308b\u57fa\u6e96\u306b\u3059\u3079\u3066\u5408\u81f4\u3059\u308b\u304b\u5426\u304b\u3092\u691c\u67fb\u3059\u308b\uff0egeometry \u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u3044\u304b\u306a\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3082\u4f7f\u3046\u305f\u3081\u306b\u306f\uff0cSTIsValid() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306f\uff0c\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u6709\u52b9\u3067\u3042\u308b\u3068\u78ba\u8a8d\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000STIsValid() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<\/ul>\n<p>\u4ed8\u8a18\u3000STIsValid() \u30e1\u30bd\u30c3\u30c9\u306f geometry \u578b\u306b\u5bfe\u3057\u3066\u306e\u307f\u9069\u7528\u3055\u308c\u308b\uff0egeography \u578b\u306e\u3059\u3079\u3066\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306f\u201d\u6709\u52b9\u201d\u3068\u8003\u3048\u3089\u308c\u3066\u3044\u308b\uff0e<\/p>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000STIsValid() \u30e1\u30bd\u30c3\u30c9\u306f\u3044\u304b\u306a\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u8981\u305b\u305a\uff0cgeometry \u578b\u306e\u3044\u304b\u306a\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3082\u305d\u306e\u6709\u52b9\u6027\u3092\u691c\u67fb\u3059\u308b\u305f\u3081\u306b\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instace.STIsValid()<\/pre>\n<p>\u3000\u305d\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\uff0c\u554f\u984c\u306b\u3057\u3066\u3044\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7a2e\u985e\u306e\u6709\u52b9\u306a\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308b\u3068\u306e\u57fa\u6e96\u306b\u5408\u81f4\u3057\u305f\u306a\u3089\uff0cSTIsValid() \u30e1\u30bd\u30c3\u30c9\u306f\u5024 1 \u3092\u8fd4\u3059\uff0e\u305d\u3046\u3067\u306a\u3044\u306a\u3089\u5024 0 \u3092\u8fd4\u3059\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u3000\u6b21\u306e\u4f8b\u306f Polygon \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\uff0c\u3064\u3044\u3067 STIsValid() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u305d\u306e Polygon \u304c\u6709\u52b9\u3067\u3042\u308b\u304b\u5426\u304b\u3092\u6b21\u306e\u3088\u3046\u306b\u691c\u67fb\u3059\u308b\uff0e<\/p>\n<pre>DECLARE @Polygon geometry\nSET @Polygon = geometry::STPolyFromText('POLYGON((0 0, 4 0, 4 3, 2 3, 2 4, 2 3, 0 3, 0 0))', 0)\nSELECT\n  @Polygon AS Shape,\n  @Polygon.STIsValid() AS IsValid<\/pre>\n<p>\u3000SQL Server \u306f\u3053\u306e\u30af\u30a8\u30ea\u3092\u6210\u529f\u88cf\u306b\u5b9f\u884c\u3057\uff0c\u3044\u304b\u306a\u308b\u8b66\u544a\u3084\u30a8\u30e9\u30fc\u3082\u767a\u751f\u3055\u305b\u306a\u3044\uff0e\u3057\u304b\u3057\uff0c STIsValid() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306f\uff0c@Polygon \u3067\u8868\u73fe\u3055\u308c\u308b\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u6709\u52b9\u3067\u306f\u306a\u3044\u3053\u3068\u3092\u793a\u5506\u3057\u3066\u3044\u308b\uff0e<\/p>\n<pre>0<\/pre>\n<p>\u3000\u3053\u306e\u5834\u5408\uff0c\u306a\u305c\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u7121\u52b9\u3067\u3042\u308b\u3068 STIsValid() \u306f\u793a\u3057\u305f\u306e\u3060\u308d\u3046\u304b\uff0e\u3053\u306e\u7591\u554f\u306b\u7b54\u3048\u308b\u305f\u3081\uff0c@Polygon \u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8abf\u3079\u3066 Figure 12-1 \u306b\u793a\u305d\u3046\uff08\u7565\uff09\uff0eSQL Server Management Studio \u3067\u3053\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8996\u899a\u5316\u3059\u308b\u305f\u3081\uff0c\u5148\u8ff0\u3057\u305f\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u5f8c\u306b\u7a7a\u9593\u7d50\u679c\u30bf\u30d6\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u3088\u3046\uff0e<\/p>\n<p>\u3000Polygon \u306e\u30c8\u30c3\u30d7\u306b\uff0c\u5916\u90e8\u30ea\u30f3\u30b0\u306e\u70b9\u306e\u9593\u3092\u901a\u308b\u7dda\u304c\u3042\u308a\uff0c\u81ea\u5206\u81ea\u8eab\u3092\u5f15\u304d\u8fd4\u3055\u306a\u304f\u3066\u306f\u306a\u3089\u306a\u3044\u3053\u3068\u306b\u7559\u610f\u3057\u3088\u3046\uff0e\u3053\u308c\u306f\u201d\u30b9\u30d1\u30a4\u30af\u201d\u3068\u3057\u3066\u77e5\u3089\u308c\u308b\uff0e\u5916\u90e8\u30ea\u30f3\u30b0\u306e\u70b9\u306e\u9593\u306b\u5f15\u304b\u308c\u305f\u7dda\u304c\u81ea\u8eab\u3068\u4ea4\u5dee\u3059\u308b\u305f\u3081\uff0c\u3053\u308c\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u306f\u306a\u304f\uff0c\u3053\u306e\u30ea\u30f3\u30b0\u3067\u5b9a\u7fa9\u3055\u308c\u308b\u3053\u306e Polygon \u306f\u7121\u52b9\u3067\u3042\u308b\uff0e<\/p>\n<p>\u3000SQL Server \u304c @Polygon \u3092\u751f\u6210\u3059\u308b\u306e\u3092\u8a31\u3057\u3066\u3044\u308b\u306b\u3082\u95a2\u308f\u3089\u305a\uff0c\u305d\u308c\u306f OGC \u4ed5\u69d8\u306b\u3088\u308b\u3068\u6709\u52b9\u3067\u306f\u306a\u3044\uff0e\u4eee\u306b @Polygon \u4e0a\u3067\u52d5\u4f5c\u3059\u308b\u3044\u304b\u306a\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3082\u4f7f\u304a\u3046\u3068\u3059\u308b\u3068\uff0c\u4f8b\u3048\u3070 STStartPoint() \u3092\u4f7f\u3063\u3066\u958b\u59cb\u70b9\u3092\u53d6\u5f97\u3057\u3088\u3046\u3068\u3059\u308b\u3068\uff0c<\/p>\n<pre>SELECT @Polygon.STStartPoint()<\/pre>\n<p>\u6b21\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u306b\u306a\u308b\uff0e<\/p>\n<pre>System.Argumentation: 24144: This operation cannnot be completed because the instance is not valid. Use MakeValid to convert the instance to a valid instance. Note that MakeValid may cause the points of a geometry instance to shift slightly.<\/pre>\n<p>\u6ce8\u610f\u3000STIsValid() \u304c 1 \u3092\u8fd4\u3057\u305f\u3068\u3057\u3066\u3082\uff08\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u304c OGC \u6a19\u6e96\u306b\u3088\u308b\u6b63\u3057\u3044\u3053\u3068\u3092\u610f\u5473\u3059\u308b\uff09\uff0c\u305d\u308c\u306f\u305d\u306e geometry \u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u8ad6\u7406\u7684\u306b\u610f\u5473\u3092\u6210\u3059\u3053\u3068\u3092\u5fc5\u305a\u3057\u3082\u610f\u5473\u3057\u306a\u3044\uff0e\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u6709\u52b9\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u751f\u6210\u3059\u308b\u304c\uff0c\u305d\u306e\u5ea7\u6a19\u4f4d\u7f6e\u306f EPSG 4326 \u7a7a\u9593\u53c2\u7167\u7cfb\u306e\u4f7f\u308f\u308c\u308b\u5883\u754c\u306e\u5916\u306b\u98db\u3073\u51fa\u3057\u3066\u3044\u308b\uff0e<\/p>\n<pre>DECLARE @Point geometry = geometry::STPontFromText('POINT(300 200)', 4326)<\/pre>\n<h3>\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u6709\u52b9\u5316\u3059\u308b<\/h3>\n<p>\u3000\u3044\u304b\u306a\u308b geometry \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3082 OGC \u6a19\u6e96\u306b\u3088\u308a\u6709\u52b9\u5316\u3059\u308b\u305f\u3081\u306b\u306f\uff0cMakeValid() \u30e1\u30bd\u30c3\u30c9\u304c\u9069\u7528\u3055\u308c\u308b\uff0e\u3053\u308c\u306f geometry \u578b\u306e\u65b0\u3057\u3044\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\uff0c\u5143\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u6307\u5b9a\u3055\u308c\u305f\u306e\u3068\u540c\u3058\u70b9\u7fa4\u3092\u542b\u3093\u3067\u304a\u308a\uff0c\u4e00\u3064\u4ee5\u4e0a\u306e\u6709\u52b9\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u4f7f\u3063\u3066\u8868\u73fe\u3055\u308c\u308b\uff0e\u3044\u304f\u3064\u304b\u306e\u30b1\u30fc\u30b9\u3067\u306f\uff0cMakeValid() \u306f\u4e00\u3064\u4ee5\u4e0a\u306e\u70b9\u7fa4\u306e\u5ea7\u6a19\u5024\u3092\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u5143\u306e\u4f4d\u7f6e\u304b\u3089\u5c11\u3057\u305a\u3089\u3059\u53ef\u80fd\u6027\u304c\u3042\u308b\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000MakeValid() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000MakeValid() \u95a2\u6570\u306f\u3044\u304b\u306a\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u8981\u305b\u305a\uff0cgeometry \u578b\u306e\u3044\u304b\u306a\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u3082\u6b21\u306e\u3088\u3046\u306b\u547c\u3073\u51fa\u3055\u308c\u308b\uff0e<\/p>\n<pre>Instance.MakeValid()<\/pre>\n<p>\u3000\u7d50\u679c\u306e\u5024\u306f geometry \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308a\uff0cMakeValid() \u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u540c\u3058 SRID \u3092\u4f7f\u3063\u3066\u5b9a\u7fa9\u3055\u308c\uff0cOGC \u6a19\u6e96\u306b\u6e96\u62e0\u3057\u3066\u3044\u308b\uff0e\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306f\u5143\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u70b9\u7fa4\u3092\u3059\u3079\u3066\u6709\u3057\u3066\u3044\u308b\u304c\uff0c\u305d\u306e\u70b9\u7fa4\u3092\u8868\u73fe\u3059\u308b\u305f\u3081\uff0c\u4e00\u3064\u4ee5\u4e0a\u306e\u7570\u306a\u308b\u7a2e\u985e\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u4f7f\u3046\u53ef\u80fd\u6027\u304c\u3042\u308b\uff0e<\/p>\n<p>\u6ce8\u610f\u3000\u540c\u3058\u70b9\u7fa4\u3092\u6709\u52b9\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u306b\u542b\u3080\u305f\u3081\uff0cMakeValid() \u30e1\u30bd\u30c3\u30c9\u3067\u8fd4\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7a2e\u985e\u306f\u63d0\u4f9b\u3055\u308c\u308b\u5143\u306e\u3082\u306e\u3068\u306f\u540c\u3058\u3068\u306f\u9650\u3089\u306a\u3044\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u6b21\u306e\u4f8b\u306f\u4e0d\u6b63\u306a Polyogn \u30b8\u30aa\u30e1\u30c8\u30ea @Invalid \u3092\u751f\u6210\u3057\uff0c\u5916\u90e8\u30ea\u30f3\u30b0\u306b\u30b9\u30d1\u30a4\u30af\u3092\u542b\u3093\u3067\u3044\u308b\uff0e\u3064\u3044\u3067MakeValid() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\uff0c\u540c\u3058\u70b9\u306e\u96c6\u5408\u3092\u8868\u73fe\u3059\u308b\u6709\u52b9\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u306b @Valid \u5909\u6570\u3092\u8a2d\u5b9a\u3059\u308b\uff0e<\/p>\n<pre>DECALRE @Invalid geometry\nSET @Invaid = geometry::STPolyFromText('POLYGON((0 0, 4 0, 4 3, 2 3, 2 4, 2 3, 0 3, 0 0))', 0)\nDECALRE @Valid geometry\nSET @Valid = @Invalid.MakeValid()\nSELECT\n  @Invalid AS Shape,\n  @Invalid.STAsText() AS WKT\nUNION ALL SELECT\n  @Valid AS Shape,\n  @Valid.STAsText() AS WKT<\/pre>\n<p>\u3000MakeValid() \u30e1\u30bd\u30c3\u30c9\u304b\u3089\u53d6\u5f97\u3055\u308c\u305f\u6709\u52b9\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u306e WKT \u8868\u73fe\u306f\u6b21\u306e\u3088\u3046\u3067\u3042\u308b\uff0e<\/p>\n<pre>GEOMETRYCOLLECTION (LINESTRING(2 4, 2 3), POLYGON ((0 0, 4 0, 4 3, 2 3, 0 3, 0 0)))<\/pre>\n<p>\u3000\u30b9\u30d1\u30a4\u30af\u5185\u306b\u542b\u307e\u308c\u308b\u70b9\u3092\u8868\u73fe\u3059\u308b\u305f\u3081\uff0cMakeValid() \u30e1\u30bd\u30c3\u30c9\u306b\u751f\u6210\u3055\u308c\u305f\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306f Geometry Collection \u3067\u3042\u308a\uff0cPolygon \u3068 LineString \u306e\u4e21\u8005\u3092\u542b\u3093\u3067\u3044\u308b\uff0e\u3053\u306e Geometry Collection \u306f\u6709\u52b9\u3067\u3042\u308a\uff0cSTIsValid() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u6b21\u306e\u3088\u3046\u306b\u78ba\u8a8d\u3067\u304d\u308b\uff0e<\/p>\n<pre>SELECT @Valid.STIsValid()<\/pre>\n<p>\u3000\u305d\u306e\u7d50\u679c\u306f @Valid \u304c\u6709\u52b9\u3067\u3042\u308b\u3068\u3044\u3046\u3082\u306e\u3060\u304c\uff0c\u4ee5\u4e0b\u3067\u3042\u308b\uff0e<\/p>\n<pre>1<\/pre>\n<h3>\u7a7a\u9593\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7d50\u5408\u3059\u308b<\/h3>\n<p>\u3000STUnion() \u30e1\u30bd\u30c3\u30c9\u306f2\u3064\u306e geometry \u578b\u3042\u308b\u3044\u306f geography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\uff0c\u7d50\u5408\u3059\u308b\u70b9\u306e\u96c6\u5408\u3092\u542b\u3080\u5358\u4e00\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u751f\u6210\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u308b\uff0e\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306f\u4e21\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u542b\u307e\u308c\u308b\u3059\u3079\u3066\u306e\u70b9\u7fa4\u3092\u8868\u73fe\u3067\u304d\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u6700\u3082\u5358\u7d14\u306a\u3082\u306e\u306b\u306a\u308b\uff0eFigure 12-2 \u306b\u69d8\u3005\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7d44\u307f\u5408\u308f\u305b\u306b STUnion() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u305f\u7d50\u679c\u3092\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<h4>STUnion() \u304a\u3088\u3073\u30ab\u30fc\u30bd\u30eb\u3092\u4f7f\u3063\u3066\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u96c6\u7d04\u3059\u308b<\/h4>\n<p>\u3000STUnion() \u30e1\u30bd\u30c3\u30c9\u306f2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u542b\u307e\u308c\u308b\u70b9\u7fa4\u306e\u548c\u304b\u3089\u751f\u3058\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u751f\u6210\u3059\u308b\uff0e\u305d\u308c\u306f\u30d7\u30e9\u30b9\u6f14\u7b97\u5b50\u3092\u4f7f\u3046\u3053\u3068\u3068\u5927\u96d1\u628a\u306b\u7b49\u4fa1\u3067\u3042\u308b\u3068\u3057\u3066\u8003\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff0e\u8a00\u3044\u63db\u3048\u308b\u3068\uff0cSELECT A.STUnion(B) \u3068\u306f\u975e\u7a7a\u9593\u30c7\u30fc\u30bf\u306b\u304a\u3051\u308b SELECT A + B \u306b\u4f3c\u3066\u3044\u308b\uff0egeometry \u578b\u306a\u3044\u3057 geography \u578b\u30c7\u30fc\u30bf\u306e\u5168\u5217\u306b\u542b\u307e\u308c\u308b\u3059\u3079\u3066\u306e\u8981\u7d20\u306e\u548c\u3092\u4eee\u306b\u5f97\u305f\u3044\u3068\u3057\u305f\u3089\uff1f\u8a00\u3044\u63db\u3048\u308b\u306a\u3089\uff0cSELECT SUM(A) \u3068\u7a7a\u9593\u7684\u306b\u7b49\u4fa1\u306a\u306e\u306f\u4f55\u304b\uff1f<\/p>\n<p>\u3000SQL Server \u306f\u3053\u306e\u3088\u3046\u306a\u7a7a\u9593\u7684\u96c6\u7d04\u306f\u4e00\u5207\u5b9a\u7fa9\u3057\u3066\u3044\u306a\u3044\uff0e\u3057\u304b\u3057\uff0c\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u7a7a\u9593\u30c7\u30fc\u30bf\u306e\u5404\u884c\u306b\u30ab\u30fc\u30bd\u30eb\u3092\u30d5\u30a7\u30c3\u30c1\u3057\u3066\uff0c\u7e70\u308a\u8fd4\u3057\u305d\u308c\u3089\u3092\u6b21\u306e\u30a2\u30a4\u30c6\u30e0\u306b STUnion() \u3067\u7d50\u5408\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u308b\uff0e\u3053\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u793a\u3059\u305f\u3081\uff0c\u30b5\u30f3\u30d7\u30eb\u306e geometry \u578b\u306e3\u3064\u306e\u5217\u3092\u542b\u3080\u30c6\u30fc\u30d6\u30eb\u3092\u307e\u305a\uff0c\u6b21\u306e\u3088\u3046\u306b\u4f5c\u6210\u3059\u308b\uff0e<\/p>\n<pre>DECLARE @GeomTable TABLE (GeomColumn geometry)\nINSERT INTO @GeomTable VALUES\n  (geometry::STPointFromText('POINT(12 9)', 0)),\n  (geometry::STLineFromText('LINESTRING(5 2, 9 4)', 0)),\n  (geometry::STPolyFromText('POLYGON((2 0, 4 3, 5 8, 2 4, 2 0))', 0))<\/pre>\n<p>\u3000@GeomTable \u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5404\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u548c\u304b\u3089\u96c6\u7d04\u3092\u751f\u6210\u3059\u308b\u305f\u3081\uff0c\u30ab\u30fc\u30bd\u30eb\u3092\u4f7f\u3063\u3066\u5404\u500b\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u5909\u6570 @Geom \u306b\u30d5\u30a7\u30c3\u30c1\u3057\uff0c\u4e00\u5ea6\u306b\u4e00\u500b\u305a\u3064\uff0c\u3064\u3044\u3067\u4e8c\u756a\u76ee\u306e\u5909\u6570 @MultiGeom \u306b\u6b21\u306e\u30b3\u30fc\u30c9\u306e\u3088\u3046\u306b\u7d50\u5408\u3055\u308c\u308b\uff0e<\/p>\n<pre>DECLARE @Geom geometry\nDECLARE @MultiGeom geometry = geometry::STGeomFromText('GEOMETRYCOLLECTION EMPTY', 0)\nDECLARE GeomCursor CURSOR FOR SELECT GeomColumn FROM @GeomTable\nOPEN GeomCursor\nFETCH NEXT FROM GeomCursor INTO @Geom\nWHILE @@FETCH_STATUS = 0\nBEGIN\n  SET @MultiGeom = @MultiGeom.STUnion(@Geom)\n  FETCH NEXT FROM GeomCursor INTO @Geom\nEND\nCLOSE GeomCursor\nDEALLOGATE GeomCursor<\/pre>\n<p>\u3000\u7d50\u679c\u3092\u691c\u67fb\u3059\u308b\u305f\u3081\uff0c@MultiGeom \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e WKT \u8868\u73fe\u3092\u9078\u629e\u3057\uff0c\u6b21\u306e\u884c\u3092\u30b3\u30fc\u30c9\u306e\u6587\u672b\u306b\u4ed8\u52a0\u3059\u308b\uff0e<\/p>\n<pre>SELECT @MultiGeom.STAsText()<\/pre>\n<p>\u3000\u7d50\u679c\u306e\u96c6\u7d04\u30b8\u30aa\u30e1\u30c8\u30ea\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3042\u308b\uff0e<\/p>\n<pre>GEOMETRYCOLLECTION (\n  POINT (12 9),\n  LINESTRING (9 4, 5 2),\n  POLYGON ((2 0, 4 3, 5 8, 2 4, 2 0))\n)<\/pre>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000STUnion() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<li>geography \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000STUnion() \u30e1\u30bd\u30c3\u30c9\u306f geometry \u578b\u3042\u308b\u3044\u306f geography \u578b\u306e2\u3064\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u548c\u3092\u751f\u6210\u3059\u308b\u306e\u306b\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instance1.STUnion(Instance2)<\/pre>\n<p>\u3000\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7a2e\u985e\u306f\u4e21\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u70b9\u306e\u96c6\u5408\u3092\u8868\u73fe\u3059\u308b\u3053\u3068\u306e\u3067\u304d\u308b\u6700\u3082\u5358\u7d14\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u306a\u308b\uff0e\u4eee\u306b Instance1 \u3068 Instance2 \u304c\u7570\u306a\u308b\u7a2e\u985e\u306e\u5834\u5408\uff0c\u7d50\u679c\u306e\u7a2e\u985e\u306f Geometry Collection \u3068\u306a\u308b\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u3000\u6b21\u306e\u4f8b\u306f\u30cb\u30e5\u30fc\u30b8\u30fc\u30e9\u30f3\u30c9\u306e\u5317\u5cf6\u3068\u5357\u5cf6\u306e\u5f62\u72b6\u306e\u8fd1\u4f3c\u3092\u8868\u73fe\u3059\u308b2\u3064\u306e\u5358\u7d14\u306a Polygon \u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u751f\u6210\u3059\u308b\uff0e\u3064\u3044\u3067 STUnion() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u9678\u5730\u3092\u8868\u73fe\u3059\u308b MultiPolygon \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3059\u308b\uff0e<\/p>\n<pre>DECLARE @NorthIsland geography\nSET @NorthIsland = geography::STPolyFromText(\n  'POLYGON((175.3 -41.5, 178.3 -37.9, 172.8 -34.6, 175.3 -41.5))',\n  4326)\nDECLARE @SouthIsland geography\nSET @SouthIsland = geography::STPolyFromText(\n  'POLYGON((169.3 -46.6, 174.3 -41.6, 172.5 -40.7, 166.3 -45.8, 169.3 -46.6))',\n  4326)\nDECLARE @NewZealnad geography = @NorthIsland.STUnion(@SouthIsland)\nSELECT\n  @NorthIsland AS Shape,\n  @NorthIsland.STAsText() AS WKT\nUNION ALL SELECT\n  @SouthIsland AS Shape,\n  @SouthIsland.STAsText() AS WKT\nUNION ALL SELECT\n  @NewZealand AS Shape,\n  @NewZealand.STAsText() AS WKT<\/pre>\n<p>\u3000STUnion() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306e WKT \u8868\u73fe\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3042\u308b\uff0e<\/p>\n<pre>NULTIPOLYGON (((174.300000083901 -41.599999939451862, 172.5 -40.7, 166.30000014074497 -45.80000004311343, 169.3 -46.6, 174.30000008390141 -41.599999939451862)), ((178.29999997944242 -37.899999916892376, 172.79999991110731 -34.59999991355131, 175.3 -41.5, 178.29999997944242 -37.899999916892376)))<\/pre>\n<p>\u3000\u3053\u306e\u7d50\u679c\u306b\u542b\u307e\u308c\u308b\u5ea7\u6a19\u306b\u9a5a\u3044\u305f\u306a\u3089\uff0c\u30b5\u30a4\u30c9\u30d0\u30fc\u201d\u6d6e\u52d5\u5c0f\u6570\u70b9\u7a7a\u9593\u30c7\u30fc\u30bf\u306e\u4e0d\u78ba\u5b9f\u6027\u201d\u3092\u5fc5\u305a\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\uff0e<\/p>\n<h3>\u6d6e\u52d5\u5c0f\u6570\u70b9\u7a7a\u9593\u30c7\u30fc\u30bf\u306e\u4e0d\u78ba\u5b9f\u6027<\/h3>\n<p>\u3000STUnion() \u30e1\u30bd\u30c3\u30c9\u306e\u4f8b\u3067\u898b\u305f\u3088\u3046\u306b\uff08\u201d\u7a7a\u9593\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7d50\u5408\u3059\u308b\u201d\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u793a\u3057\u305f\uff09\uff0c\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u6700\u521d\u306e\u70b9\u306e\u5ea7\u6a19\u5024\u304c 174.30000008390 \u304a\u3088\u3073 -41.599999939451862 \u3067\u3042\u3063\u305f\u3053\u3068\u3092\u898b\u3066\u9a5a\u3044\u305f\u304b\u3082\u3057\u308c\u306a\u3044\uff0eSTUnion() \u30e1\u30bd\u30c3\u30c9\u306f2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u542b\u307e\u308c\u308b\u70b9\u306e\u548c\u3092\u751f\u6210\u3059\u308b\u304c\uff0c\u3053\u306e\u70b9\u306f\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u4f7f\u308f\u308c\u305f\u3069\u3061\u3089\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u3082\u542b\u307e\u308c\u3066\u3044\u306a\u3044\uff0ePoint(174.3, -41.6) \u306f\u3057\u304b\u3057\uff0cSTUnion() \u306e\u7d50\u679c\u306f\u306a\u305c\u3053\u308c\u3089\u306e\u5ea7\u6a19\u5024\u306b\u3064\u3044\u3066\u30a8\u30e9\u30fc\u3092\u8d77\u3053\u3055\u306a\u3044\u306e\u304b\uff1f<\/p>\n<p>\u3000\u7a7a\u9593\u30c7\u30fc\u30bf\u578b\u306f\u5ea7\u6a19\u3092\u6d6e\u52d5\u5c0f\u6570\u70b9\u5024\u3067\u84c4\u7a4d\u3059\u308b\u3053\u3068\u3092\u601d\u3044\u51fa\u305d\u3046\uff0e\u6d6e\u52d5\u5c0f\u6570\u70b9\u306e\u8a08\u7b97\u304c\u5b9f\u884c\u3055\u308c\u308b\u3068\u304d\uff0c\u3053\u308c\u3089\u306f\u5f97\u3089\u308c\u305f\u7d50\u679c\u306b\u3064\u3044\u3066\u56fa\u6709\u306e\u4e0d\u6b63\u78ba\u3055\u3067\u3042\u308a\uff0c\u5b9f\u6570\u3092\u6d6e\u52d5\u5c0f\u6570\u70b9\u7cfb\u3067\u306f\u6b63\u78ba\u306b\u8868\u73fe\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u4e8b\u5b9f\u304b\u3089\u3082\u305f\u3089\u3055\u308c\u308b\uff0e\u5341\u9032\u6570 0.1 \u306b\u76f8\u5f53\u3059\u308b\u6b63\u78ba\u306a\u30d0\u30a4\u30ca\u30ea\u6d6e\u52d5\u5c0f\u6570\u70b9\u5024\u306f\uff0c\u4f8b\u3048\u3070\u3060\u304c\uff0c\u6b21\u306e\u3088\u3046\u306b\u7121\u9650\u306b\u5faa\u74b0\u3059\u308b\u30d0\u30a4\u30ca\u30ea\u30b7\u30fc\u30b1\u30f3\u30b9\u3068\u306a\u308b\uff0e11001100110011001100&#8230;<\/p>\n<p>\u3000\u5ea7\u6a19\u5024\u304c\u6d6e\u52d5\u5c0f\u6570\u70b9\u30d0\u30a4\u30ca\u30ea\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u8868\u73fe\u3055\u308c\u308b\u6700\u3082\u8fd1\u3044\u6570\u306b\u4e38\u3081\u3089\u308c\u306d\u3070\u306a\u3089\u306a\u3044\u305f\u3081\uff0c\u7279\u5b9a\u306e\u7a7a\u9593\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\uff0e\u3053\u308c\u306f\u7a7a\u9593\u30c7\u30fc\u30bf\u306b\u7279\u7570\u7684\u306a\u3082\u306e\u3067\u306f\u306a\u304f\uff0c\u6d6e\u52d5\u5c0f\u6570\u70b9\u5024\u3092\u4f7f\u3046\u3044\u304b\u306a\u308b\u8a08\u7b97\u306b\u3082\u9069\u7528\u3055\u308c\u308b\u3053\u3068\u3092\u660e\u8a18\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\uff0e\u6b21\u306e\u4f8b\u3092\u8003\u3048\u3066\u307f\u3088\u3046\uff0e<\/p>\n<pre>DECLARE @coordinate float = 174.3\nDECLARE @a float = 1\nDECLARE @b float = 1.001\nSELECT @coordinate * (@b - @a) * 1000<\/pre>\n<p>\u3000\u6709\u7406\u6570\u3092\u4f7f\u3063\u3066\u8a08\u7b97\u3092\u5b9f\u884c\u3059\u308b\u3068\uff0c\u3053\u306e\u5f0f\u306f 174.3*0.001*1000 \u306b\u7b49\u3057\u304f\uff0c\u5143\u306e\u63d0\u4f9b\u3055\u308c\u305f\u5ea7\u6a19\u5024\u3067\u3042\u308b\uff0c\u7b54\u3048\u306f 174.3 \u306b\u81f3\u308b\u3068\u601d\u3046\u3060\u308d\u3046\uff0e\u3057\u304b\u3057\uff0c\u3053\u306e\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u305f\u3068\u304d\uff0c\u5b9f\u969b\u306b\u5f97\u3089\u308c\u308b\u306e\u306f 174.29999999981 \u3067\u3042\u308a\uff0c\u3053\u308c\u306f\u6d6e\u52d5\u5c0f\u6570\u70b9\u6cd5\u3092\u4f7f\u3063\u3066\u5f97\u3089\u308c\u308b\u6700\u3082\u8fd1\u3044\u8fd1\u4f3c\u3067\u3042\u308b\uff0e<\/p>\n<p>\u3000\u7a7a\u9593\u30c7\u30fc\u30bf\u306e\u64cd\u4f5c\u3092\u5b9f\u884c\u3059\u308b\u3044\u304b\u306a\u308b\u30e1\u30bd\u30c3\u30c9\u3082\uff0c\u3053\u308c\u3089\u306e\u3088\u3046\u306b\u5ea7\u6a19\u5024\u306b\u5fae\u5999\u306a\u5909\u5316\u3092\u3082\u305f\u3089\u3059\uff0e\u3053\u308c\u3089\u306e\u504f\u5dee\u306e\u5927\u304d\u3055\u306f\uff0c\u500b\u5225\u306b\u8003\u3048\u305f\u969b\u306b\u306f\u30c7\u30fc\u30bf\u306e\u3044\u304b\u306a\u308b\u30a2\u30a4\u30c6\u30e0\u306b\u3082\u5b9f\u8cea\u7684\u306b\u8457\u660e\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3053\u3068\u306f\u307b\u307c\u7a00\u3067\u3042\u308b\u304c\uff0c \u5ea7\u6a19\u5024\u306e\u6b63\u78ba\u306a\u8a55\u4fa1\u3068\u6bd4\u8f03\u3092\u8981\u3059\u308b\u3088\u3046\u306a\u3044\u304b\u306a\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8a2d\u8a08\u3059\u308b\u3068\u304d\u306b\u3082\uff0c\u3053\u308c\u306f\u8003\u616e\u3059\u3079\u304d\u91cd\u8981\u306a\u70b9\u3067\u3042\u308b\uff0e<\/p>\n<h3>2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u4ea4\u5dee\u3092\u5b9a\u7fa9\u3059\u308b<\/h3>\n<p>\u30002\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u4ea4\u5dee\u306f\u4e21\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u5171\u901a\u306b\u6301\u3064\u70b9\u304b\u3089\u751f\u6210\u3055\u308c\u308b\uff0e\u4ea4\u5dee\u306b\u3088\u308a\u5b9a\u7fa9\u3055\u308c\u308b\u70b9\u304c\u5358\u4e00\u3067\u4e00\u81f4\u3057\u305f\u9762\u306b\u3042\u308b\u306a\u3089\uff0c\u305d\u306e\u4ea4\u5dee\u306f\u5358\u4e00\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3068\u306a\u308b\uff0e\u3057\u304b\u3057\uff0c\u4ea4\u5dee\u3059\u308b\u70b9\u304c\u5206\u96e2\u3057\u3066\u3044\u308b\u306a\u3089\uff0c\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306f\u591a\u8981\u7d20\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u306a\u308b\uff0eFigure 12-3 \u306b\u7570\u306a\u308b\u7a2e\u985e\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u3067\u751f\u6210\u3055\u308c\u308b\u4ea4\u5dee\u306e\u4f8b\u3092\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<p>\u30002\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u4ea4\u5dee\u306b\u542b\u307e\u308c\u308b\u70b9\u3092\u8868\u73fe\u3059\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306b\u306f\uff0cFigure 12-3 \u306b\u793a\u3059\u3088\u3046\u306b\uff0cSTIntersection() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000STIntersection() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<li>geography \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000STIntersection() \u30e1\u30bd\u30c3\u30c9\u306f geometry \u578b\u3042\u308b\u3044\u306f geography \u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instance1.STintersection(Instance2)<\/pre>\n<p>\u3000\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306f\u540c\u3058\u30c7\u30fc\u30bf\u578b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u306a\u308a\uff0cInstance1 \u304a\u3088\u3073 Instance2 \u306b\u3088\u308a\u5b9a\u7fa9\u3055\u308c\u308b\u306e\u3068\u540c\u3058 SRID \u3092\u4f7f\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u308b\uff0e\u3053\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3088\u308a\u8868\u73fe\u3055\u308c\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7a2e\u985e\u306f\uff0c2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u4ea4\u5dee\u306b\u542b\u307e\u308c\u308b\u3059\u3079\u3066\u306e\u70b9\u3092\u542b\u3080\u3053\u3068\u306e\u3067\u304d\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u3046\u3061\uff0c\u6700\u3082\u5358\u7d14\u306a\u7a2e\u985e\u3068\u306a\u308b\uff0e<\/p>\n<p>\u4ed8\u8a18\u3000STIntersection() \u306f2\u3064\u306e geometry \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u9593\uff0c2\u3064\u306e geography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u9593\u306a\u3089\u4ea4\u5dee\u3092\u6c7a\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304c\uff0cgeometry \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068 geography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u306e\u9593\u3067\u306f\u4ea4\u5dee\u3092\u6c7a\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u3000\u30a2\u30c3\u30d4\u30a2\u8857\u9053\uff08\u3042\u308b\u3044\u306f Via Appia\uff09\u306f\u53e4\u4ee3\u30ed\u30fc\u30de\u306e\u9053\u8def\u3067\u3042\u308a\uff0c\u30ed\u30fc\u30de\u304b\u3089\u30a4\u30bf\u30ea\u30a2\u5357\u6771\u90e8\u306e\u90fd\u5e02 Brindisi \u306b\u81f3\u308b\uff0e\u305d\u308c\u306f\u4e16\u754c\u53f2\u306e\u4e2d\u3067\u6700\u3082\u91cd\u8981\u306a\u9053\u8def\u306e\u4e00\u3064\u3067\u3042\u308b\uff0e\u3068\u3044\u3046\u306e\u306f\uff0c\u30ed\u30fc\u30de\u8ecd\u304c\u7537\u6027\u3092\u8fc5\u901f\u306b\u914d\u5099\u3057\u30a4\u30bf\u30ea\u30a2\u5168\u571f\u306b\u4f9b\u7d66\u3059\u308b\u306e\u306b\u4f7f\u3044\uff0c\u305d\u306e\u7d50\u679c\u7591\u3044\u306a\u304f\u8ecd\u4e8b\u7684\u306a\u6210\u529f\u306b\u8ca2\u732e\u3057\u305f\u304b\u3089\u3067\u3042\u308b\uff0e\u305d\u306e\u7d4c\u8def\u306b\u6cbf\u3063\u3066\uff0c\u30a2\u30c3\u30d4\u30a2\u8857\u9053\u306f\u30dd\u30f3\u30c6\u30a3\u30fc\u30cc\u6e7f\u5730\u3092\u901a\u904e\u3057\uff0c\u305d\u3053\u306f\u6b7b\u306b\u81f3\u308b\u30de\u30e9\u30ea\u30a2\u3092\u5a92\u4ecb\u3059\u308b\u868a\u304c\u306f\u3073\u3053\u3063\u3066\u3044\u305f\uff0e\u6b21\u306e\u4f8b\u306f\u30a2\u30c3\u30d4\u30a2\u8857\u9053\u3092\u8868\u73fe\u3059\u308b LineString \u304a\u3088\u3073\uff0c\u30de\u30e9\u30ea\u30a2\u306e\u306f\u3073\u3053\u308b\u6e7f\u5730\u5e2f\u3092\u8868\u73fe\u3059\u308b Polygon \u3092\u751f\u6210\u3059\u308b\uff0e\u3064\u3044\u3067STIntersection() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\uff0c\u6e7f\u5730\u5e2f\u3068\u4ea4\u5dee\u3059\u308b\u9053\u8def\u306e\u5371\u967a\u306a\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u6c7a\u5b9a\u3059\u308b\uff0e<\/p>\n<pre>DECLARE @Marshes geography\nSET @Marshes = geography::STPolyFromText(\n  'POLYGON((12.94 41.57, 12.71 41.46, 12.91 41.39, 13.13 41.26, 13.31 41.33, 12.94 41.57))',\n  4326)\nDECLARE @ViaApppia geography\nSET @ViaAppia = geography::STLineFromText(\n  'LINESTRING(\n    12.51 41.88, 13.25 41.28, 13.44 41.35, 13.61 41.25, 13.78 41.23, 13.89 41.11,\n    14.22 41.10, 14.47 41.02, 14.79 41.13, 14.99 41.04, 15.48 40.98, 15.82 40.96,\n    17319 40.51, 17.65 40.50, 17.94 40.63)',\n  4326)\nSELECT\n  @ViaAppia AS Shape,\n  @ViaAppia.STAsText() AS WKT\nUNION ALL SELECT\n @Marshes AS Shape,\n  @Marshes.STAsText() AS WKT\nUNION ALL SELECT\n  @ViaAppia.STIntersection(@Marshes) AS Shape,\n  @ViaAppia.STIntersection(@Marshes).STAsText() AS WKT<\/pre>\n<p>\u3000STIntersecion() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306e WKT \u8868\u73fe\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3042\u308b\uff0e<\/p>\n<pre>LINESTRING (13.227901121493 41.298133443052509, 12.911513729116241 41.556421282182363)<\/pre>\n<p>\u3000Figure 12-4 \u306b\u3053\u306e\u4f8b\u3092\u30a4\u30bf\u30ea\u30a2\u306e\u5730\u56f3\u4e0a\u306b\u793a\u3059\uff08\u7565\uff09\uff0eSTIntersection() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306f\u6e7f\u5730\u3092\u8868\u73fe\u3059\u308b Polygon \u3092\u901a\u904e\u3059\u308b LineString \u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3059\u308b\uff0e<\/p>\n<h3>2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u5dee\u5206\u3092\u8b58\u5225\u3059\u308b<\/h3>\n<p>\u3000STDifference() \u30e1\u30bd\u30c3\u30c9\u306f\u4e00\u3064\u306e geometry \u578b\u306a\u3044\u3057 geography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5185\u90e8\u306b\u542b\u307e\u308c\u308b\u304c\u4e8c\u756a\u76ee\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5185\u306b\u306f\u542b\u307e\u308c\u306a\u3044\uff0c\u4e00\u610f\u306e\u70b9\u7fa4\u3092\u5358\u96e2\u3057\u8fd4\u3059\u306e\u306b\u4f7f\u308f\u308c\u308b\uff0eFigure 12-5 \u306b2\u3064\u306e\u69d8\u3005\u306a\u7a2e\u985e\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u3067\u5dee\u5206\u3092\u751f\u6210\u3059\u308b\u306e\u306b STDifference() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u305f\u7d50\u679c\u3092\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000STDifference() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<li>geography \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000STDifference() \u30e1\u30bd\u30c3\u30c9\u306f\u4e00\u3064\u306e geometry \u578b\u3042\u308b\u3044\u306f geography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u3082\u3046\u4e00\u3064\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u306e\u9593\u306e\u5dee\u5206\u3092\u5358\u96e2\u3059\u308b\u306e\u306b\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instance1.STDifference(Instance2)<\/pre>\n<p>\u3000STDifference() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306f geometry \u578b\u306a\u3044\u3057 geography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308a\uff0c\u3059\u3079\u3066\u306e\u70b9\u306f Instance1 \u306b\u542b\u307e\u308c\u308b\u3082\u306e\u3067\uff0cInstance2 \u306b\u542b\u307e\u308c\u308b\u3082\u306e\u3067\u306f\u306a\u304f\uff0c\u63d0\u4f9b\u3055\u308c\u305f\u4e21\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u540c\u3058 SRID \u304a\u3088\u3073\u30c7\u30fc\u30bf\u578b\u3092\u4f7f\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u308b\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u3000\u82f1\u56fd\u6c17\u8c61\u5c40\uff08\u901a\u5e38&#8221;Met Office&#8221; \u3068\u79f0\u3055\u308c\u308b\uff09\u306f 16 \u6a5f\u306e\u30ec\u30fc\u30c0\u30fc\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u64cd\u4f5c\u3057\uff0c\u82f1\u56fd\u5168\u4f53\u306e\u6c17\u8c61\u3092\u7d99\u7d9a\u7684\u306b\u76e3\u8996\u3057\u4e88\u6e2c\u3057\u3066\u3044\u308b\uff0e\u5404\u30ec\u30fc\u30c0\u30fc\u306f\u9ad8\u6027\u80fd\u306e\u964d\u96e8\u91cf\u304a\u3088\u3073\u6c34\u6587\u30c7\u30fc\u30bf\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\uff0c\u305d\u306e\u7bc4\u56f2\u306f 75km \u8fd1\u304f\u306b\u53ca\u3076\uff0e\u3053\u306e\u30ec\u30fc\u30c0\u30fc\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u3088\u308a\u63d0\u4f9b\u3055\u308c\u308b\u30ab\u30d0\u30fc\u7bc4\u56f2\u3092 Figure 12-6 \u306b\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<p>\u3000STDifference() \u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u7528\u6cd5\u3092\u793a\u3059\u305f\u3081\uff0c\u6b21\u306e\u30b3\u30fc\u30c9\u4f8b\u306f\uff0c\u3059\u3079\u3066\u306e\u82f1\u56fd\u6c17\u8c61\u5c40\u306e\u30ec\u30fc\u30c0\u30fc\u306e\u4f4d\u7f6e\u3092\u8868\u73fe\u3059\u308b MultiPoint \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3059\u308b\uff0e\u3064\u3044\u3067 STBuffer() \u3092\u4f7f\u3063\u3066 MultiPolygon \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\uff0cMultiPoint \u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u306e\u5404\u70b9\u3092\u4e2d\u5fc3\u3068\u3057\u305f\u500b\u5225\u306e Polygon \u3092\u542b\u3093\u3067\u304a\u308a\uff0c\u3053\u308c\u306f\u305d\u306e\u30ec\u30fc\u30c0\u30fc\u306e\u30ab\u30d0\u30fc\u3059\u308b\u7bc4\u56f2\u3092\u8868\u73fe\u3057\u305f\u3082\u306e\u3067\u3042\u308b\uff0e\u6700\u5f8c\u306b\uff0cSTDifference() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u30a4\u30ae\u30ea\u30b9\u8af8\u5cf6\u3092\u8868\u73fe\u3059\u308b MultiPolygon \u30b8\u30aa\u30e1\u30c8\u30ea\u3068\u30ec\u30fc\u30c0\u30fc\u306e\u30ab\u30d0\u30fc\u7bc4\u56f2\u3092\u8868\u73fe\u3059\u308b MultiPolygon \u3068\u306e\u9593\u306e\u5dee\u5206\u3092\u8a08\u7b97\u3059\u308b\uff0e<\/p>\n<pre>DECLARE @Rader geography\nSET @Rader = geography::STMPointFromText(\n  'MULTIPOINT(\n    -2.597 52.398, -2.289 53.755, -0.531 51.689, -6.340 54.500, -5.223 50.003,\n    -0.559 53.335, -4.445 51.980, -4.231 55.691, -2.036 57.431, -6.183 58.211,\n    -3.453 50.963, 0.604 51.295, -1.654 51.031, -2.199 49.209, -6.259 53.429,\n    -8.923 52.700)', 4326)\nDECLARE @RaderCoverage geography\nSET @RaderCoverage = @Rader.STBuffer(75000)\nDECLARE @BritishIsls geography\nSET @BritishIsls = geography::STMPolyFromText(\n  'MULTIPOLYGON(\n    ((0.527 52.879, -3.164 56.0197, -1.626 57.631, -4.087 57.654, -2.989 58.582,\n    -5.0977 58.514, -6.504 56.240, -4.746 54.670, -3.516 54.848, -3.252 53.432,\n    -4.614 53.301, -4.922 51.697, -3.12 51.505, -5.625 50.032, 1.626 51.286,\n    0.791 51.423, 1.890 52.291, 1.274 52.959, 0.527 52.879)),\n    ((-6.548 52.123, -5.317 54.518, -7.734 55.276, -9.976 53.354, -9.888 51.369,\n    -6.548 52.123)))', 4326)\nSELECT\n  @BritishIsls AS Shape,\n  @BritishIsls.STAsText() AS WKT\nUNION ALL SELECT\n  @Rader AS Shape,\n  @Rader.STAsText() AS WKT\nUNION ALL SELECT\n  @BritishIsls.STDifference(@RaderCoverage) AS Shape,\n  @BritishIsls.STDifference(@RaderCoverage).STAsText() AS WKT<\/pre>\n<p>\u3000STDifference() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306e MultiPolygon \u306f\uff0c\u82f1\u56fd\u6c17\u8c61\u5c40\u306b\u3088\u308a\u64cd\u4f5c\u3055\u308c\u308b\u30ec\u30fc\u30c0\u30fc\u3067\u30ab\u30d0\u30fc\u3055\u308c\u306a\u3044\u30a4\u30ae\u30ea\u30b9\u8af8\u5cf6\u306e\u9678\u5730\u306e\u30a8\u30ea\u30a2\u3092\u8868\u73fe\u3059\u308b\uff0e\u6b21\u306e WKT \u8868\u73fe\u306e\u3088\u3046\u306b\uff0e<\/p>\n<pre>MULTIPOLYGON (((-0.59313915744618673 50.956746798594949, -0.35419290461396075 50.99445115...<\/pre>\n<h3>2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u5bfe\u79f0\u5dee\u3092\u8a08\u7b97\u3059\u308b<\/h3>\n<p>\u3000STSymDifferece() \u30e1\u30bd\u30c3\u30c9\u306f2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u5bfe\u79f0\u5dee\u3092\u8a08\u7b97\u3059\u308b\uff0e\u3053\u308c\u306f\u30b8\u30aa\u30e1\u30c8\u30ea A \u304b\u30b8\u30aa\u30e1\u30c8\u30ea B \u304b\u306e\u3044\u305a\u308c\u304b\u306b\u5c5e\u3059\u308b\u3059\u3079\u3066\u306e\u70b9\u306e\u96c6\u5408\u3067\u3042\u308a\uff0c\u4e21\u65b9\u306b\u5c5e\u3059\u308b\u70b9\u3067\u306f\u306a\u3044\uff0e\u8a00\u3044\u63db\u3048\u308b\u3068\uff0cSTSymDifference() \u306f2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u7531\u6765\u306e\u70b9\u306e\u4e00\u610f\u306e\u96c6\u5408\u306e\u548c\u3092\u4e0e\u3048\u308b\uff0e<\/p>\n<p>\u4ed8\u8a18\u3000A.STSymDifference(B) \u306f\u8ad6\u7406\u7684\u306b A.STDifference(B).STUnion(B.STDifference(A)) \u3068\u540c\u7fa9\u3067\u3042\u308b\uff0e<\/p>\n<p>\u3000Figure 12-7 \u306b\u7570\u306a\u308b\u7a2e\u985e\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u3044\u304f\u3064\u304b\u306e\u4f8b\u306b STSymDifference() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u5f97\u3089\u308c\u305f\u7d50\u679c\u3092\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000STSymDifference() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<li>geography \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000STSymDifference() \u30e1\u30bd\u30c3\u30c9\u306f geometry \u578b\u306a\u3044\u3057 geography \u578b\u306e2\u3064\u306e\u3044\u304b\u306a\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u9593\u3067\u3082\u5bfe\u79f0\u5dee\u3092\u8a08\u7b97\u3059\u308b\u306e\u306b\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instance1.STSymDifference(Instance2)<\/pre>\n<p>\u3000\u7d50\u679c\u306f2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u5bfe\u79f0\u5dee\u3092\u8868\u73fe\u3059\u308b\u305d\u308c\u3089\u306e\u70b9\u7fa4\u3092\u542b\u3080\u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u3042\u308a\uff0c\u63d0\u4f9b\u3055\u308c\u305f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u540c\u3058\u30c7\u30fc\u30bf\u578b\u3068 SRID \u3092\u4f7f\u3063\u3066\u3044\u308b\uff0e<\/p>\n<p>\u4ed8\u8a18\u3000STSymDifference() \u306f\u5bfe\u79f0\u3067\u3042\u308b\u3086\u3048\u306b\uff0c2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u6bd4\u8f03\u3057\u305f\u3068\u304d\uff0cInstance1 \u3067\u63d0\u4f9b\u3055\u308c\u308b\u3082\u306e\u3068 Instance2 \u3067\u63d0\u4f9b\u3055\u308c\u308b\u3082\u306e\u3068\u306b\u5dee\u304c\u3064\u304b\u306a\u3044\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u30002\u3064\u306e\u7af6\u5408\u3059\u308b\u30ed\u30fc\u30ab\u30eb\u30e9\u30b8\u30aa\u5c40 KWEST \u3068 KEAST \u306e\u3042\u308b\u90fd\u5e02\u306b\u3064\u3044\u3066\u8003\u3048\u3066\u307f\u3088\u3046\uff0e\u305d\u308c\u305e\u308c\u306e\u5c40\u306f\u72ec\u81ea\u306e\u9001\u4fe1\u6a5f\u304b\u3089\u653e\u9001\u3057\u3066\u304a\u308a\uff0c\u90fd\u5e02\u306e\u7570\u306a\u308b\u5730\u57df\u306b\u4f4d\u7f6e\u3059\u308b\uff0eKWEST \u306e\u9001\u4fe1\u6a5f\u306f\u7d4c\u5ea6 -87.88 \u7def\u5ea6 41.86 \u306b\u4f4d\u7f6e\u3057\u3066\u3044\u308b\uff0e\u305d\u308c\u306f 10km \u306e\u7bc4\u56f2\u3067\u653e\u9001\u3057\u3066\u3044\u308b\uff0eKEAST \u306e\u9001\u4fe1\u6a5f\u306f\u7d4c\u5ea6 -87.79 \u7def\u5ea6 41.89 \u306b\u4f4d\u7f6e\u3057\u3066\u304a\u308a\uff0c8km \u306e\u7bc4\u56f2\u3067\u9001\u4fe1\u3059\u308b\uff0e\u5404\u5c40\u306e\u30ab\u30d0\u30fc\u30a8\u30ea\u30a2\u3092 Polygon \u3067\u8868\u73fe\u3057\uff0cSTSymDifference() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u305d\u308c\u3089\u306e\u5bfe\u79f0\u5dee\u3092\u8a08\u7b97\u3059\u308b\u3053\u3068\u306b\u3088\u308a\uff0c\u90fd\u5e02\u306e\u4e2d\u3067\uff0c\u4e21\u65b9\u306e\u5c40\u3067\u306f\u306a\u304f\u3069\u3061\u3089\u304b\u4e00\u5c40\u3057\u304b\u53d7\u4fe1\u3067\u304d\u306a\u3044\u5730\u57df\u3092\u7279\u5b9a\u3067\u304d\u308b\uff0e\u6b21\u306e\u30b3\u30fc\u30c9\u3067\u793a\u3059\uff0e<\/p>\n<pre>DECLARE @KWEST geography, @KEAST geography\nSET @KWEST = geography::Point(41.86, -87.88, 4269).STBuffer(10000)\nSET @KEAST = geography::Point(41.89, -87.79, 4269).STBuffer(8000)\nSELECT\n  @KEAST.STSymDifference(@KWEST) AS Shape,\n  @KEAST.STSymDifference(@KWEST).STAsText() AS WKT<\/pre>\n<p>\u30c1\u30c3\u30d7\u30b9\u3000\u3053\u306e\u4f8b\u306f STBuffer() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\uff0c\u5404\u9001\u4fe1\u6a5f\u3092\u53d7\u4fe1\u3067\u304d\u308b\u5730\u57df @KWEST \u304a\u3088\u3073 @KEAST \u3092\u5b9a\u7fa9\u3059\u308b2\u3064\u306e Point \u306b\u3064\u3044\u3066\u5186\u5f62\u306e Polygon \u3092\u751f\u6210\u3059\u308b\uff0eSTBuffer() \u30e1\u30bd\u30c3\u30c9\u306f\u672c\u7ae0\u3067\u66f4\u306b\u8a73\u3057\u304f\u8ad6\u3058\u308b\uff0e<\/p>\n<p>\u3000STSymDifference() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306f MultiPolygon \u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u3042\u308a\uff0cFigure 12-8 \u306b\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<h3>\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u7c21\u7d20\u5316\u3059\u308b<\/h3>\n<p>\u3000Reduce() \u30e1\u30bd\u30c3\u30c9\u306f\uff0c\u306a\u304a\u305d\u306e\u5168\u4f53\u306e\u5f62\u72b6\u3092\u7dad\u6301\u3057\u3088\u3046\u3068\u8a66\u307f\u306a\u304c\u3089\uff0c\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u5f62\u72b6\u3092\u5b9a\u7fa9\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u308b\u70b9\u306e\u6570\u3092\u6e1b\u3089\u3059\u3053\u3068\u3067\uff0c\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u7c21\u7d20\u5316\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u308b\uff0e\u3053\u308c\u3092\u9054\u6210\u3059\u308b\u305f\u3081\uff0cReduce() \u30e1\u30bd\u30c3\u30c9\u306f Douglas-Peucker \u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u5b9f\u88c5\u3057\u3066\u304a\u308a\uff0c\u3053\u308c\u306f\u6570\u5b66\u7684\u624b\u6cd5\u306b\u3088\u308a\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u3088\u308a\u7c21\u7d20\u306a\u8fd1\u4f3c\u304b\u3089\u8a31\u5bb9\u5185\u306e\u504f\u5dee\u5185\u306b\u3042\u308b\u3059\u3079\u3066\u306e\u70b9\u3092\u53d6\u308a\u9664\u304f\u3082\u306e\u3067\u3042\u308b\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000Reduce() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<li>geography \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000Reduce() \u30e1\u30bd\u30c3\u30c9\u306f geometry \u578b\u3084 geography \u578b\u306e\u3044\u305a\u308c\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u3082\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instance.Reduce(tolerance)<\/pre>\n<p>\u3000\u5358\u4e00\u306e\u30d1\u30e9\u30e1\u30fc\u30bf tolerance \u306f Douglas-Peucker \u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306b\u63d0\u4f9b\u3059\u308b\u8a31\u5bb9\u8aa4\u5dee\u3067\u3042\u308b\uff0e\u3053\u306e\u5024\u306f\uff0c\u5143\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u304b\u3089\u7c21\u7d20\u5316\u3057\u305f\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7d50\u679c\u5185\u306e\u3044\u304b\u306a\u308b\u70b9\u3067\u3082\uff0c\u8a31\u5bb9\u3055\u308c\u308b\u504f\u5dee\u306e\u6700\u5927\u5024\u3092\u8868\u3057\u3066\u3044\u308b\uff0e\u305d\u306e\u8a31\u5bb9\u7bc4\u56f2\u306f\u6b63\u3067\u3042\u308a\uff0c\u6d6e\u52d5\u5c0f\u6570\u70b9\u3067\u3042\u308a\uff0c\u7dda\u5f62\u5358\u4f4d\u3067\u8a08\u6e2c\u3055\u308c\u305f\u3082\u306e\u3067\u306a\u304f\u3066\u306f\u306a\u3089\u306a\u3044\uff0egeography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u305f\u3068\u304d\uff0ctolerance \u306f\uff0c\u305d\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u5b9a\u7fa9\u3055\u308c\u305f SRID \u306b\u95a2\u9023\u3059\u308b sys.spatial_reference_system \u30c6\u30fc\u30d6\u30eb\u306e unit_of_measure \u5217\u306b\u3088\u308a\u5b9a\u7fa9\u3055\u308c\u305f\u5358\u4f4d\u3067\u8a08\u6e2c\u3055\u308c\u305f\u3082\u306e\u3067\u3042\u308b\uff0egeometry \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u305f\u3068\u304d\uff0ctolerance \u306f\uff0c\u305d\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5ea7\u6a19\u3068\u540c\u3058\u6e2c\u5b9a\u5358\u4f4d\u3067\u8a08\u6e2c\u3055\u308c\u308b\uff0e<\/p>\n<p>\u3000\u305d\u306e\u8a31\u5bb9\u7bc4\u56f2\u304c\u5927\u304d\u304f\u306a\u308b\u307b\u3069\uff0cRuduce() \u30e1\u30bd\u30c3\u30c9\u306b\u3088\u308a\u8fd4\u308b\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7c21\u7565\u3055\u306e\u5ea6\u5408\u3044\u306f\u5927\u304d\u304f\u306a\u308b\uff0eFigure 12-9 \u306b\uff0c\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2\u3092\u8868\u3059 Polygon \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067 Reduce() \u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u7528\u3055\u305b\u305f\u5834\u5408\u306b\u7570\u306a\u308b\u8a31\u5bb9\u5ea6\u3092\u63d0\u4f9b\u3057\u305f\u52b9\u679c\u3092\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<p>\u3000Douglas-Peucker \u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u518d\u5e30\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u3042\u308b\uff0e\u6700\u521d\u306e\u30d1\u30b9\u3067\u306f\uff0c\u6700\u521d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u8fd1\u4f3c\u3092\u751f\u6210\u3057\uff0c\u305d\u308c\u306f\u958b\u59cb\u70b9\u3068\u7d42\u4e86\u70b9\u3092\u76f4\u7dda\u3067\u76f4\u63a5\u7d50\u3076\u3053\u3068\u3067\u7c21\u7d20\u5316\u3055\u305b\u3088\u3046\u3068\u3059\u308b\u3082\u306e\u3067\u3042\u308b\uff0e2\u56de\u76ee\u306e\u30d1\u30b9\u3067\u306f\uff0c\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u3044\u304b\u306a\u308b\u70b9\u3067\u3082\uff0c\u3053\u306e\u8fd1\u4f3c\u304b\u3089\u8a31\u5bb9\u8aa4\u5dee\u3088\u308a\u3082\u9060\u304f\u306b\u4f4d\u7f6e\u3059\u308b\u306a\u3089\uff0c\u4e00\u756a\u9060\u3044\u3068\u3053\u308d\u306b\u4f4d\u7f6e\u3059\u308b\u70b9\u3092\u8ffd\u52a0\u3057\uff0c\u3088\u308a\u6d17\u7df4\u3055\u308c\u305f\u8fd1\u4f3c\u3092\u751f\u6210\u3059\u308b\uff0e\u305d\u306e\u5f8c\u306e\u30d1\u30b9\u3067\u306f\uff0c\u3053\u306e\u904e\u7a0b\u3092\u4f55\u5ea6\u3082\u7e70\u308a\u8fd4\u3057\uff0c\u8fd1\u4f3c\u3092\u3055\u3089\u306b\u6d17\u7df4\u3055\u305b\uff0c\u5143\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u306b\u542b\u307e\u308c\u3066\u3044\u305f\u3059\u3079\u3066\u306e\u70b9\u304c\uff0c\u751f\u6210\u3055\u308c\u305f\u8fd1\u4f3c\u304b\u3089\u306e\u8a31\u5bb9\u7bc4\u56f2\u5185\u306b\u53ce\u307e\u308b\u307e\u3067\u7d9a\u3051\u308b\uff0e\u3053\u306e\u70b9\u3067\uff0cReduce() \u30e1\u30bd\u30c3\u30c9\u306f\u6700\u5f8c\u306e\u53cd\u5fa9\u306b\u3088\u308a\u751f\u6210\u3055\u308c\u305f\u8fd1\u4f3c\u3092\u8fd4\u3059\uff0eFigure 12-10 \u306b\uff0cReduce() \u30e1\u30bd\u30c3\u30c9\u306b\u3088\u308a\u4f7f\u308f\u308c\u308b Douglas-Peucker \u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u304c LineString \u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u7c21\u7d20\u5316\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u308b\u306e\u3092\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<p>\u4ed8\u8a18\u3000Point \u304a\u3088\u3073 MultiPoint \u30b8\u30aa\u30e1\u30c8\u30ea\u306f\u7c21\u7d20\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\uff0e\u3053\u308c\u3089\u306e\u7a2e\u985e\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u4f7f\u308f\u308c\u305f\u3068\u304d\uff0cReduce() \u30e1\u30bd\u30c3\u30c9\u306f\u5143\u306e\uff0c\u306a\u3093\u306e\u4fee\u98fe\u3082\u3055\u308c\u3066\u3044\u306a\u3044\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u3000\u6b21\u306e\u4f8b\u306f LineString \u3092\u751f\u6210\u3057\uff0cReduce() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\uff0c\u5143\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u306e\u3044\u304b\u306a\u308b\u70b9\u3082\u504f\u5dee\u304c1\u5358\u4f4d\u4ee5\u5185\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7c21\u7d20\u5316\u3057\u305f\u524a\u6e1b\u3092\u53d6\u5f97\u3059\u308b\uff0e<\/p>\n<pre>DECLARE @LineString geometry\nSET @LineString = geometry::STLineFromText(\n  'LINESTRING(130 33, 131 33.5, 131.5 32.9, 133 32.5, 135 33, 137 32, 138 31, 140 30)', 0)\nSELECT\n  @LineString AS Shape,\n  @LineString.STAsText() AS WKT\nUNION ALL SELECT\n  @LineString.Reduce(1) AS Shape,\n  @LineString.Reduce(1).STAsText() AS KWT<\/pre>\n<p>\u3000Reduce() \u30e1\u30bd\u30c3\u30c9\u304b\u3089\u5f97\u3089\u308c\u305f\u7c21\u7d20\u5316\u3057\u305f\u30b8\u30aa\u30e1\u30c8\u30ea\u306e WKT \u8868\u73fe\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3042\u308b\uff0e<\/p>\n<pre>LINESTRING (130 33, 135 33, 140 30)<\/pre>\n<h3>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5468\u56f2\u306b\u30d0\u30c3\u30d5\u30a1\u30fc\u3092\u751f\u6210\u3059\u308b<\/h3>\n<p>\u3000\u3042\u3089\u3086\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u306f\u4e00\u3064\u4ee5\u4e0a\u306e\u70b9\u3092\u5b9a\u7fa9\u3057\uff0c\u305d\u306e\u5185\u90e8\uff0c\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u3088\u308a\u5360\u3081\u3089\u308c\u308b\u7a7a\u9593\u306e\u9762\u306b\u4f4d\u7f6e\u3059\u308b\uff0e\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u81ea\u8eab\u306e\u5185\u90e8\u306b\u542b\u307e\u308c\u308b\u3053\u308c\u3089\u306e\u70b9\u306b\u52a0\u3048\u3066\uff0c\u7279\u5b9a\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u3059\u3050\u5468\u56f2\u306e\u7a7a\u9593\u306e\u9762\u306b\u4f4d\u7f6e\u3059\u308b\u305d\u308c\u3089\u306e\u70b9\u3092\u8003\u3048\u305f\u304f\u306a\u308b\u591a\u304f\u306e\u5834\u5408\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\uff0e\u305d\u306e\u305f\u3081\u306b\u201d\u30d0\u30c3\u30d5\u30a1\u30fc\u201d\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff0e\u30d0\u30c3\u30d5\u30a1\u30fc\u3068\u306f\u3042\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u4e0e\u3048\u3089\u308c\u305f\u8ddd\u96e2\u4ee5\u5185\u306b\u4f4d\u7f6e\u3059\u308b\u3059\u3079\u3066\u306e\u70b9\u304b\u3089\u306a\u308b\u9762\u306e\u3053\u3068\u3067\u3042\u308b\uff0eFigure 12-11 \u306b\u7570\u306a\u308b\u7a2e\u985e\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u5468\u56f2\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u306e\u5b9a\u7fa9\u306b\u3088\u308a\u751f\u6210\u3055\u308c\u305f\u7d50\u679c\u3092\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<p>\u3000STBuffer() \u30e1\u30bd\u30c3\u30c9\u306f\uff0c\u3042\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4e00\u5b9a\u91cf\u306e\u30d0\u30c3\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u751f\u6210\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u308b\uff0e\u5358\u4e00\u8981\u7d20\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u4f7f\u308f\u308c\u305f\u3068\u304d\uff0c\u4e00\u822c\u306b\u306f Polygon \u3092\u751f\u6210\u3057\uff0c\u305d\u306e\u5916\u5468\u306f\uff0c\u305d\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u4e0e\u3048\u3089\u308c\u305f\u8ddd\u96e2\u4ee5\u5185\u306b\u4f4d\u7f6e\u3059\u308b\u70b9\u3092\u7d50\u3076\u3053\u3068\u3067\u5b9a\u7fa9\u3055\u308c\u308b\uff0e\u591a\u8981\u7d20\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u3092\u751f\u6210\u3059\u308b\u3068\u304d\uff0c\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5185\u306e\u5404\u8981\u7d20\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u306f\u500b\u5225\u306b\u8a08\u7b97\u3055\u308c\uff0c\u500b\u5225\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u3055\u308c\u305f\u30b8\u30aa\u30e1\u30c8\u30ea\u306f\u3059\u3079\u3066\u7d50\u5408\u3055\u308c\u3066\u8fd4\u308b\uff0e\u8a00\u3044\u63db\u3048\u308b\u3068\uff0cSTBuffer() \u306f\u591a\u8981\u7d20\u30b8\u30aa\u30e1\u30c8\u30ea\u5168\u4f53\u306e\u5468\u56f2\u306b\u30d0\u30c3\u30d5\u30a1\u30fc\u3092\u751f\u6210\u3059\u308b\u306e\u3067\u306f\u306a\u304f\uff0c\u500b\u5225\u306e\u8981\u7d20\u306b\u30d0\u30c3\u30d5\u30a1\u30fc\u3092\u751f\u6210\u3059\u308b\uff0e<\/p>\n<p>\u30c1\u30c3\u30d7\u30b9\u3000Point \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b STBuffer() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u304d\uff0c\u4e2d\u5fc3\u304c\u305d\u306e\u70b9\u3067\u3042\u308b\u56fa\u5b9a\u534a\u5f84\u306e Polygon \u3092\u751f\u6210\u3059\u308b\uff0e\u3053\u308c\u306f\u201d\u5186\u5f62\u201d Polygon \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3059\u308b\u65b9\u6cd5\u3068\u3057\u3066\u6709\u7528\u3067\u3042\u308b\uff08\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u5b9f\u969b\u306b\u306f\uff0c\u771f\u5186\u3068\u3044\u3046\u3088\u308a\u5186\u306b\u8fd1\u3044\u591a\u89d2\u5f62\u3092\u751f\u6210\u3059\u308b\uff09\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000STBuffer() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<li>geography \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000STBuffer() \u30e1\u30bd\u30c3\u30c9\u306f\uff0cgeometry \u578b\u3084 geography \u578b\u3044\u305a\u308c\u306e\u3069\u3093\u306a\u7a2e\u985e\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u3082\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instance.STBuffer(distance)<\/pre>\n<p>\u3000STBuffer() \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3076\u3068\u304d\uff0c\u5358\u7cbe\u5ea6\u5c0f\u6570\u70b9\u5024 distance \u3092\u6e21\u3055\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u304c\uff0c\u305d\u308c\u306f\u751f\u6210\u3055\u308c\u308b\u7de9\u885d\u5730\u5e2f\u306e\u534a\u5f84\u3092\u8868\u73fe\u3057\u3066\u3044\u308b\uff0egeography \u578b\u306e\u30a2\u30a4\u30c6\u30e0\u4e0a\u3067\u4f7f\u3046\u3068\u304d\uff0c\u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u5024\u306f\uff0c\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u3070\u308c\u305f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u7a7a\u9593\u53c2\u7167\u306b\u5b9a\u7fa9\u3055\u308c\u305f\u7dda\u5f62\u8a08\u6e2c\u5358\u4f4d\u3067\u7279\u5b9a\u3055\u308c\u308b\uff0e\u4f8b\u3048\u3070\uff0cSRID 4296 \u3067\u5b9a\u7fa9\u3055\u308c\u305f geography \u578b\u306e\u3044\u304b\u306a\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3082\u305d\u306e\u7de9\u885d\u5730\u5e2f\u306e\u534a\u5f84\u306f\uff0c\u30e1\u30fc\u30c8\u30eb\u5358\u4f4d\u3067\u6307\u5b9a\u3055\u308c\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\uff0egeometry \u578b\u306e\u30a2\u30a4\u30c6\u30e0\u4e0a\u3067\u4f7f\u3046\u3068\u304d\u306f\uff0cdistance \u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u305d\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u81ea\u8eab\u306e\u5ea7\u6a19\u5024\u3068\u540c\u3058\u8a08\u6e2c\u5358\u4f4d\u3067\u6307\u5b9a\u3055\u308c\u308b\uff0e<\/p>\n<p>\u30c1\u30c3\u30d7\u30b9\u3000geography \u578b\u306e\u7a7a\u9593\u53c2\u7167\u7cfb\u306e\u7dda\u5f62\u8a08\u6e2c\u5358\u4f4d\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\uff0csys.spatial_reference_system \u30c6\u30fc\u30d6\u30eb\u306e unit_of_measure \u5217\u306e\u5024\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff0e<\/p>\n<p>\u3000STBuffer() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306f geometry \u578b\u3042\u308b\u3044\u306f geography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\uff0c\u30d0\u30c3\u30d5\u30a1\u30fc\u3055\u308c\u305f\u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u90e8\u306b\u542b\u307e\u308c\u308b\u70b9\u3059\u3079\u3066\u3092\u542b\u3093\u3067\u304a\u308a\uff0c\u547c\u3073\u51fa\u3055\u308c\u305f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u540c\u3058 SRID \u3068\u30c7\u30fc\u30bf\u578b\u3092\u4f7f\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u308b\uff0e<\/p>\n<p>\u30c1\u30c3\u30d7\u30b9\u3000STBuffer() \u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3055\u308c\u305f distance \u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u30bc\u30ed\u3088\u308a\u5c0f\u3055\u304b\u3063\u305f\u5834\u5408\u306f\uff0c\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306f\uff0c\u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u90e8\u304b\u3089\u8a18\u8ff0\u3055\u308c\u305f\u8ddd\u96e2\u5185\u306b\u3042\u308b\u70b9\u3092\u53d6\u308a\u9664\u3044\u305f\u3082\u306e\u306b\u306a\u308b\uff0e\u3053\u308c\u306f Polygon \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u201d\u7e2e\u3081\u308b\u201d\u306e\u306b\u6709\u7528\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3042\u308b\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u3000\u30ec\u30b9\u30c8\u30e9\u30f3\u304b\u3089\u8ddd\u96e2 5 km \u4ee5\u5185\u306b\u4f4f\u3080\u3059\u3079\u3066\u306e\u9867\u5ba2\u306b\u7121\u6599\u306e\u30db\u30fc\u30e0\u30c7\u30ea\u30d0\u30ea\u30fc\u30b5\u30fc\u30d3\u30b9\u3092\u63d0\u4f9b\u3059\u308b\u30d4\u30b6\u914d\u9054\u306e\u4ed5\u4e8b\u3092\u7d4c\u55b6\u3057\u3066\u3044\u308b\u3068\u4eee\u5b9a\u3057\u3088\u3046\uff0eSTBuffer() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\uff0c\u9867\u5ba2\u304c\u7121\u6599\u306e\u914d\u9054\u3092\u53d7\u3051\u3089\u308c\u308b\u6a29\u5229\u306e\u3042\u308b\u7bc4\u56f2\u306e Polygon \u30a8\u30ea\u30a2\u3092\u5b9a\u7fa9\u3067\u304d\u308b\uff0e\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3053\u306e\u4f8b\u3092\u793a\u3059\uff0eSRID 4326 \u3092\u4f7f\u3044\uff0c\u5317\u7def 52.6285\u00b0\uff0c\u6771\u7d4c 1.3033\u00b0\u306b\u4f4d\u7f6e\u3059\u308b\u30ec\u30b9\u30c8\u30e9\u30f3\u3092\u793a\u3059 Point \u5468\u56f2\u306b 5km \u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u3092\u751f\u6210\u3059\u308b\uff0e<\/p>\n<pre>DECLARE @Restaurant geography\nSET @restaurant = geography::STGeomFromText('POINT(1.3033 52.6285)', 4326)\nDECLARE @FreeDeliveryZone geography\nSET @FreeDeliveryZone = @Restaurant.STBuffer(5000)\nSELECT\n  @FreeDeliveryZone AS Shape,\n  @FreeDeliveryZone.STAsText() AS WKT<\/pre>\n<p>\u3000\u751f\u6210\u3055\u308c\u308b\u30d0\u30c3\u30d5\u30a1\u30fc\u306e\u534a\u5f84\u3092\u6307\u5b9a\u3059\u308b\u305f\u3081\uff0cSTBuffer() \u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u5024 5000 \u3092\u6e21\u3059\u3053\u3068\u306b\u7559\u610f\u3059\u308b\uff0e@Restaurant \u306f EPSG 4326 \u3092\u4f7f\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u305f Point \u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u3042\u308b\u305f\u3081\uff0c\u3053\u306e\u5024\u306f 5000 \u30e1\u30fc\u30c8\u30eb\u3092\u8868\u3057\u3066\u3044\u308b\uff0e\u6211\u3005\u306e\u95a2\u5fc3\u306e\u3042\u308b\u534a\u5f84 5 km \u306e\u30be\u30fc\u30f3\u3067\u3042\u308b\uff0e\u3053\u306e\u30af\u30a8\u30ea\u306f\u6b21\u306e\u7d50\u679c\u3092\u3082\u305f\u3089\u3059\uff0e<\/p>\n<pre>POLYGON ((1.3556167293586421 52.660220700919041, 1.3529946917604496 52.661744468478474, 1.3502526627452234 52.663188111575948, 1.3473972519095581 52.664548144295793, 1.3444353445937742 52.665821282298751, 1.3413740852330907 52.667004450810637, 1.338220860060046 52.668094792103972, 1.3349832792006679 52.669089672453744, 1.3316691582085762 52.669986688550019, 1.3282864990827781 52.670783673351131, 1.3248434708163777 52.671478701362844, 1.3213483895247364 52.672070093330163, 1.3178096982028111 52.67255642032994, 1.3142359461624735 52.672936507254015, 1.3106357682014877 52.673209435674089, 1.3070178635566267 52.673374546081071, 1.3033909746940029 52.673431439493243, 1.2997638659901609 52.673379978429253, 1.2961453023577951 52.673220287243375, 1.2925440278701135 52.672952751822216, 1.288968744437869 52.672578018643733, 1.2854280905929341 52.672096993200824, 1.2819306204319827 52.671510837793427, 1.2784847827733934 52.670820968694976, 1.2750989005798696 52.670029052699988, 1.2717811506985159 52.669137003061813, 1.2685395439692086 52.668146974830584, 1.2653819057510505 52.667061359603224, 1.2623158569155066 52.665882779698691, 1.2593487953535174 52.664614081773053, 1.2564878780424138 52.663258329890539, 1.2537400037169149 52.661818798067834, 1.2511117961867808 52.660298962310456, 1.2486095883419113 52.658702492160906, 1.2462394068837683 52.657033241779871, 1.244006957820013 52.655295240582817, 1.2419176127571523 52.653492683454978, 1.2399763960238253 52.6516299205694, 1.2381879726551175 52.649711446833045, 1.2365566372659695 52.647741890987319, 1.2350863038394 52.645726004389758, 1.2337804964528121 52.6436686495047, 1.2326423409632212 52.641574788131138, 1.2316745576697177 52.639449469396858, 1.2308794549689732 52.637297817548124, 1.2302589240170334 52.635125019564761, 1.2298144344081114 52.632936312631088, 1.229547030878497 52.630736971492809, 1.2294573310411823 52.628532295731006, 1.2295455241542086 52.626327596983757, 1.22981137092325 52.624128186146294, 1.2302542043364022 52.621939360580818, 1.2308729315266895 52.619766391366383, 1.23166603665534 52.617614510619724, 1.2326315848064839 52.615488898917256, 1.2337672268815609 52.61339467284828, 1.2350702054794132 52.611336872729161, 1.23653736174579 52.6093204505075, 1.2381651431737892 52.6073502578852, 1.239949612334627 52.605431034688365, 1.2418864565160626 52.603567397511519, 1.2439709982438107 52.60176382866301, 1.2461982066593433 52.600024665437424, 1.2485627097256413 52.598354089740241, 1.2510588072306836 52.596756118089083, 1.253680493776699 52.595234586920682, 1.2564214464195493 52.593793159259519, 1.2592750658629581 52.592435299611488, 1.262234483961735 52.591164271314277, 1.2652925802048134 52.589983128751385, 1.2684419987821942 52.58889471006708, 1.2716751661955283 52.587901630399649, 1.2749843093709758 52.587006275648022, 1.2783614742319791 52.586210796786631, 1.2817985446886813 52.585517104741129, 1.2852872619998963 52.584926865837289, 1.2888192444628153 52.584441497833019, 1.2923860073849835 52.584062166543049, 1.2959789832925492 52.583789783063708, 1.2995895423283086 52.5836250016044, 1.3032090127927269 52.58356821793064, 1.306828701780824 52.583619568422129, 1.3104399158676325 52.583778929748263, 1.3140339817948514 52.584045919161653, 1.3176022671112981 52.5844198954089, 1.3211362007198764 52.584899960256813, 1.3246272932839247 52.585484960630346, 1.328067157446118 52.586173491357364, 1.3314475278134195 52.5869638985141, 1.3347602806620593 52.587854283363406, 1.3379974533170556 52.588842506876958, 1.34115126316141 52.589926194830859, 1.3442141262308627 52.591102743463026, 1.3471786753508788 52.592369325679172, 1.3500377777734713 52.59372289779332, 1.3527845522724375 52.595160206787043, 1.3554123856566807 52.596677798070743, 1.3579149486624669 52.59827202372901, 1.3602862111867227 52.599939051230905, 1.36252045682482 52.60167487258493, 1.3646122966777525 52.603475313917357, 1.3665566823951041 52.6053360454517, 1.3683489184218272 52.607252591865823, 1.3699846734185295 52.609220343002576, 1.3714599908267393 52.61123456490882, 1.3727712985524585 52.613290411176919, 1.3739154177432289 52.6153829345618, 1.3748895706359467 52.617507098846559, 1.3756913874547005 52.619657790927945, 1.3763189123400577 52.621829833093749, 1.3767706082934059 52.624017995462282, 1.3770453611222147 52.626217008554825, 1.3771424823743874 52.62842157597062, 1.3770617112522341 52.630626387134313, 1.3768032154989971 52.632826130085178, 1.3763675912533146 52.6350155042774, 1.375755861869473 52.637189233360417, 1.3749694757038224 52.639342077908637, 1.3740103028702542 52.641468848069543, 1.3728806309701878 52.643564416099487, 1.3715831598050774 52.645623728756767, 1.3701209950820072 52.647641819521617, 1.3684976411254988 52.649613820613247, 1.3667169926112084 52.651534974774634, 1.36478332533971 52.65340064679588, 1.3627012860710619 52.655206334747966, 1.3604758814433251 52.656947680899115, 1.3581124660006141 52.658620482286764, 1.3556167293586421 52.660220700919041))<\/pre>\n<p>\u3000\u3053\u308c\u306f\u534a\u5f84 5 km \u306e\u5186\u5f62 Polygon \u306e\u8fd1\u4f3c\u3092\u8868\u3057\u3066\u304a\u308a\uff0c\u30ec\u30b9\u30c8\u30e9\u30f3\u306e\u4f4d\u7f6e\u3092\u4e2d\u5fc3\u3068\u3057\u3066\u3044\u308b\uff0e<\/p>\n<h3>\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u306a\u30d0\u30c3\u30d5\u30a1\u30fc\u3092\u751f\u6210\u3059\u308b<\/h3>\n<p>\u3000\u524d\u306e\u4f8b\u3067\u306f\uff0cPoint \u30b8\u30aa\u30e1\u30c8\u30ea\u5468\u56f2\u306b\u201d\u5186\u5f62\u201d\u306e Polygon \u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306e STBuffer() \u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9\u3092\u898b\u305b\u305f\uff0e\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u542b\u307e\u308c\u308b\u70b9\u306e\u6570&#8230;\u6570\u3048\u308b\u306b\u306f\u591a\u3059\u304e\u308b\uff0e\u5e78\u3044\u306a\u3053\u3068\u306b\uff0c\u6211\u3005\u304c\u305d\u308c\u3092\u6570\u3048\u308b\u5fc5\u8981\u306f\u306a\u3044\uff0eSTNumPoints() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\uff0c\u30b3\u30fc\u30c9\u306e\u6700\u5f8c\u306b\u6b21\u306e\u884c\u3092\u52a0\u3048\u308b\u3053\u3068\u3067\u305d\u306e\u76ee\u7684\u3092\u679c\u305f\u305b\u308b\uff0e<\/p>\n<pre>SELECT @FreeDeliveryZone.STNumPoints()<\/pre>\n<p>\u3000\u7d50\u679c\u306f\u6b21\u306e\u3088\u3046\u3067\u3042\u308b\uff0e<\/p>\n<pre>72<\/pre>\n<p>\u3000STBuffer() \u30e1\u30bd\u30c3\u30c9\u306b\u3088\u308a\u751f\u6210\u3055\u308c\u305f\u30ec\u30b9\u30c8\u30e9\u30f3\u5468\u56f2\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f 72 \u306e\u70b9\u3092\u542b\u3093\u3067\u304a\u308a\uff0c\u6b6371\u89d2\u5f62\u306e\u30dd\u30ea\u30b4\u30f3\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\uff0e\u4eee\u306b\u3044\u304b\u306a\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u3082\u5468\u56f2\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u306e\u7cbe\u5ea6\u3092\u6700\u5927\u9650\u306b\u4fdd\u3061\u305f\u3044\u306a\u3089\uff0c\u3053\u306e Polygon \u5f62\u72b6\u306e\u5b9a\u7fa9\u3092\u305d\u306e\u307e\u307e\u306b\u3057\u3066\u304a\u3051\u3070\u3088\u3044\uff0e\u3057\u304b\u3057\uff0c\u7279\u5b9a\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3068\u3063\u3066\u3053\u306e\u4f8b\u3067\u306f\uff0c\u7121\u6599\u306e\u30d4\u30b6\u914d\u9054\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3060\u304c\uff0c\u304a\u305d\u3089\u304f\u305d\u308c\u307b\u3069\u306e\u7cbe\u5ea6\u306f\u5fc5\u8981\u306a\u3044\u3060\u308d\u3046\uff0e\u8907\u96d1\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u6f14\u7b97\u306b\u306f\uff0c\u305d\u308c\u3088\u308a\u5c11\u306a\u3044\u70b9\u306e\u5b9a\u7fa9\u3067\u5b9f\u884c\u3059\u308b\u3088\u308a\u3082\u591a\u304f\u306e\u8a08\u7b97\u8cc7\u6e90\u3092\u8981\u3057\uff0c\u3053\u306e\u4f8b\u3067\u898b\u305f\u3088\u3046\u306b\uff0c\u70b9\u6570\u306e\u5c11\u306a\u3044\u201d\u5186\u5f62\u201d Polygon \u304b\u3089\u7121\u6599\u914d\u9054\u30be\u30fc\u30f3\u306e\u5341\u5206\u306a\u7cbe\u5ea6\u3092\u5f97\u3089\u308c\u308b\uff0e\u3088\u308a\u7c21\u7d20\u306a Polygon \u3092\u751f\u6210\u3059\u308b\u305f\u3081\uff0c\u4ee3\u308f\u308a\u306b\u62e1\u5f35\u30e1\u30bd\u30c3\u30c9 BufferWithTolerance() \u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000BufferWithTolerance() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<li>geography \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u3000BufferWithTolerance() \u30e1\u30bd\u30c3\u30c9\u306f geometry \u578b\u3084 geography \u578b\u306e\u3044\u304b\u306a\u308b\u30a2\u30a4\u30c6\u30e0\u3067\u3082\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instance.BufferWithTolerance(distance, tolerance, relative)<\/pre>\n<p>\u3000\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e3\u3064\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u5fc5\u8981\u3068\u3059\u308b\uff0e<\/p>\n<ul>\n<li>distance \u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u6d6e\u52d5\u5c0f\u6570\u70b9\u5024\u3067\uff0c\u751f\u6210\u3055\u308c\u308b\u30d0\u30c3\u30d5\u30a1\u30fc\u306e\u534a\u5f84\u3092\u5b9a\u7fa9\u3057\u3066\u304a\u308a\uff0cgeography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306a\u3089\u7a7a\u9593\u53c2\u7167\u7cfb\u306e\u7dda\u5f62\u8a08\u6e2c\u5358\u4f4d\u3092\u4f7f\u3063\u3066\u8a08\u6e2c\u3055\u308c\uff0cgeometry \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306a\u3089\u5ea7\u6a19\u5024\u3068\u540c\u3058\u8a08\u6e2c\u5358\u4f4d\u3092\u4f7f\u3063\u3066\u8a08\u6e2c\u3055\u308c\u308b\uff0e\u3053\u308c\u306f STBuffer() \u30e1\u30bd\u30c3\u30c9\u304c distance \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8981\u6c42\u3059\u308b\u306e\u3068\u540c\u3058\u3067\u3042\u308b\uff0e<\/li>\n<li>tolerance \u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u6d6e\u52d5\u5c0f\u6570\u70b9\u5024\u3067\uff0cSTBuffer() \u306b\u3088\u308a\u8a08\u7b97\u3055\u308c\u308b\u201d\u771f\u306e\u201d\u30d0\u30c3\u30d5\u30a1\u30fc\u8ddd\u96e2\u3068\uff0cBufferWithTolerance() \u30e1\u30bd\u30c3\u30c9\u306b\u3088\u308a\u8fd4\u308b\u30d0\u30c3\u30d5\u30a1\u30fc\u306e\u7c21\u7d20\u306a\u8fd1\u4f3c\u3068\u306e\u9593\u306e\u6700\u5927\u306e\u504f\u5dee\u3092\u6307\u5b9a\u3059\u308b\uff0ePoint \u5468\u8fba\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u3092\u751f\u6210\u3059\u308b\u4f8b\u3067\u306f\uff0c\u3053\u308c\u306fBufferWithTolerance() \u306b\u3088\u308a\u751f\u6210\u3055\u308c\u305f\u30d0\u30c3\u30d5\u30a1\u30fc\u304c\uff0cPoint \u5468\u8fba\u306e\u771f\u5186\u306b\u3069\u308c\u3060\u3051\u8fd1\u3044\u304b\u3092\u8868\u3057\u3066\u3044\u308b\uff0etolerance \u306e\u5024\u304c\u5c0f\u3055\u3044\u307b\u3069\uff0c\u7d50\u679c\u306e Polygon \u30d0\u30c3\u30d5\u30a1\u30fc\u306f\u5b9f\u969b\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u306b\u4f3c\u3066\u304f\u308b\u304c\uff0c\u3088\u308a\u8907\u96d1\u306b\u306a\u308b\uff0e<\/li>\n<li>relative \u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u30d3\u30c3\u30c8\u5024\u3067\u3042\u308a\uff0c\u63d0\u4f9b\u3055\u308c\u305f\u30d0\u30c3\u30d5\u30a1\u30fc\u306e tolerance \u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u76f8\u5bfe\u5024\u304b\u7d76\u5bfe\u5024\u304b\u3092\u6307\u5b9a\u3059\u308b\uff0erelative \u304c\u201d\u771f\u201d\uff08\u3042\u308b\u3044\u306f 1\uff09\u306a\u3089\uff0c\u30d0\u30c3\u30d5\u30a1\u30fc\u306e tolerance \u306f\u554f\u984c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u62e1\u5f35\u306f\u76f8\u5bfe\u7684\u3068\u6c7a\u5b9a\u3055\u308c\u308b\uff0egeometry \u578b\u306e\u5834\u5408\uff0c\u3053\u308c\u306f\uff0c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5883\u754c\u30dc\u30c3\u30af\u30b9\u306e\u76f4\u5f84\u3068 tolerace \u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u7a4d\u304b\u3089\u8a08\u7b97\u3055\u308c\u308b\u3053\u3068\u3092\u610f\u5473\u3059\u308b\uff0egeography \u578b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5834\u5408\uff08\u5883\u754c\u30dc\u30c3\u30af\u30b9\u306f\u9069\u7528\u3055\u308c\u306a\u3044\uff09\uff0c\u76f8\u5bfe\u7684 tolerance \u306f\u4ee3\u308f\u308a\u306b tolerance \u30d1\u30e9\u30e1\u30fc\u30bf\u3068\uff0c\u7a7a\u9593\u53c2\u7167\u7cfb\u306e\u53c2\u7167\u6955\u5186\u4f53\u306e\u8d64\u9053\u534a\u5f84\u3092\u639b\u3051\u7b97\u3057\u305f\u89d2\u5ea6\u3068\u306e\u7a4d\u3092\u8a08\u7b97\u3059\u308b\uff0erelative \u304c\u201d\u507d\u201d\uff08\u3042\u308b\u3044\u306f 0\uff09\u306a\u3089\uff0ctolerance \u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u5024\u306f\u7d76\u5bfe\u5024\u3068\u3057\u3066\u6271\u308f\u308c\uff0c\u751f\u6210\u3055\u308c\u308b\u30d0\u30c3\u30d5\u30a1\u30fc\u5185\u3067\u6700\u5927\u8a31\u5bb9\u5ea6\u306e\u504f\u5dee\u3068\u3057\u3066\u5747\u4e00\u306b\u9069\u7528\u3055\u308c\u308b\uff0e<\/li>\n<\/ul>\n<p>\u3000tolerance \u30d1\u30e9\u30e1\u30fc\u30bf\u3068 relative \u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4e00\u7dd2\u306b\u7528\u3044\u3089\u308c\uff0cBufferWithTolerance() \u306b\u3088\u308a\u751f\u6210\u3055\u308c\u308b\u3088\u308a\u7c21\u7d20\u306a\u30d0\u30c3\u30d5\u30a1\u30fc\u304c\uff0cSTBuffer() \u306b\u3088\u308a\u751f\u6210\u3055\u308c\u308b\u201d\u771f\u201d\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u304b\u3089\u504f\u5dee\u3059\u308b\u3053\u3068\u306b\u3088\u308b\u8a31\u5bb9\u7bc4\u56f2\u306e\u53d7\u3051\u5165\u308c\u3089\u308c\u308b\u30ec\u30d9\u30eb\u3092\u5b9a\u7fa9\u3059\u308b\uff0e\u8a31\u5bb9\u7bc4\u56f2\u3088\u308a\u5927\u304d\u304f\u9038\u8131\u3059\u308b\u70b9\u3060\u3051\u304c\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306b\u542b\u307e\u308c\u308b\uff0eBufferWithTolerance() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u9069\u5207\u306a\u8a31\u5bb9\u5024\u3092\u6c7a\u5b9a\u3059\u308b\u3068\u304d\uff0c\u8a31\u5bb9\u5024\u3092\u5927\u304d\u304f\u3059\u308b\u3068\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u3088\u308a\u7c21\u7d20\u306b\u306a\u308b\u3053\u3068\uff0c\u7d50\u679c\u306e\u7cbe\u5ea6\u304c\u3088\u308a\u5931\u308f\u308c\u308b\u3053\u3068\u3092\u899a\u3048\u3066\u304a\u3053\u3046\uff0e\u8a31\u5bb9\u5024\u304c\u4f4e\u3044\u307b\u3069\u3088\u308a\u8907\u96d1\u306b\u306a\u308b\u304c\u3088\u308a\u6b63\u78ba\u306a\u30d0\u30c3\u30d5\u30a1\u30fc\u306b\u306a\u308b\uff0e<\/p>\n<p>\u30c1\u30c3\u30d7\u30b9\u3000STBuffer() \u30e1\u30bd\u30c3\u30c9\u304b\u3089\u5f97\u3089\u308c\u308b\u7d50\u679c\u306f BufferWithTolerance() \u306b tolerace = 0.001 \u304a\u3088\u3073 relative = &#8216;false&#8217; \u3092\u6e21\u3057\u305f\u3068\u304d\u3068\u540c\u3058\u306b\u306a\u308b\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u3000STBuffer() \u306e\u4f8b\u304b\u3089\u306e\u7121\u6599\u914d\u9054\u30a8\u30ea\u30a2\u3092 BufferWithTolerance() \u30e1\u30bd\u30c3\u30c9\u3092\u4ee3\u308f\u308a\u306b\u4f7f\u3063\u3066\u518d\u8a08\u7b97\u3057\u3066\u307f\u3088\u3046\uff0e\u540c\u3058\u304f\u30ec\u30b9\u30c8\u30e9\u30f3\u5468\u56f2\u306e 5 km \u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u534a\u5f84\u3092\u7dad\u6301\u3057\uff0c\u4eca\u5ea6\u306f\u8a31\u5bb9\u5024\u306b\u7d76\u5bfe\u5024\u306e 250 m \u3092\u6307\u5b9a\u3059\u308b\uff0e\u3053\u306e\u8a31\u5bb9\u7bc4\u56f2\u5185\u306b\u504f\u5dee\u3059\u308b\u201d\u771f\u201d\u306e\u30d0\u30c3\u30d5\u30a1\u30fc\u304b\u3089\u306e\u3044\u304b\u306a\u308b\u70b9\u3082\u7d50\u679c\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u306b\u306f\u542b\u307e\u308c\u308b\u3053\u3068\u306f\u306a\u3044\uff0e<\/p>\n<pre>DECLARE @Restaurant geography\nSET @Restaurant = geography::STGeomFromText('POINT(1.3033 52.6285)', 4326)\nDECLARE @FreeDeliveryZone geography\nSET @FreeDeliveryZone = @Restaurant.BufferWithTolerance(5000, 250, 'false')\nSELECT\n  @FreeDeliveryZone AS Shape,\n  @FreeDeliveryZone.STAsText() AS WKT<\/pre>\n<p>\u3000BufferWithTolerance() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u306f\u6b21\u306e WKT \u8868\u73fe\u3067\u793a\u3059\u3068\u304a\u308a\u3067\u3042\u308b\uff0e<\/p>\n<pre>POLYGON ((1.3556167293586421 52.660220700919041, 1.3502526627452234 52.663188111575948, 1.3444353445937742 52.665821282298751, 1.338220860060046 52.668094792103972, 1.3316691582085762 52.669986688550019, 1.3248434708163777 52.671478701362844, 1.3178096982028111 52.67255642032994, 1.3106357682014877 52.673209435674089, 1.3033909746940029 52.673431439493243, 1.2961453023577951 52.673220287243375, 1.288968744437869 52.672578018643733, 1.2819306204319827 52.671510837793427, 1.2750989005798696 52.670029052699988, 1.2685395439692086 52.668146974830584, 1.2623158569155066 52.665882779698691, 1.2564878780424138 52.663258329890539, 1.2511117961867808 52.660298962310456, 1.2462394068837683 52.657033241779871, 1.2419176127571523 52.653492683454978, 1.2381879726551175 52.649711446833045, 1.2350863038394 52.645726004389758, 1.2326423409632212 52.641574788131138, 1.2308794549689732 52.637297817548124, 1.2298144344081114 52.632936312631088, 1.2294573310411823 52.628532295731006, 1.22981137092325 52.624128186146294, 1.2308729315266895 52.619766391366383, 1.2326315848064839 52.615488898917256, 1.2350702054794132 52.611336872729161, 1.2381651431737892 52.6073502578852, 1.2418864565160626 52.603567397511519, 1.2461982066593433 52.600024665437424, 1.2510588072306836 52.596756118089083, 1.2564214464195493 52.593793159259519, 1.262234483961735 52.591164271314277, 1.2684419987821942 52.58889471006708, 1.2749843093709758 52.587006275648022, 1.2817985446886813 52.585517104741129, 1.2888192444628153 52.584441497833019, 1.2959789832925492 52.583789783063708, 1.3032090127927269 52.58356821793064, 1.3104399158676325 52.583778929748263, 1.3176022671112981 52.5844198954089, 1.3246272932839247 52.585484960630346, 1.3314475278134195 52.5869638985141, 1.3379974533170556 52.588842506876958, 1.3442141262308627 52.591102743463026, 1.3500377777734713 52.59372289779332, 1.3554123856566807 52.596677798070743, 1.3602862111867227 52.599939051230905, 1.3646122966777525 52.603475313917357, 1.3683489184218272 52.607252591865823, 1.3714599908267393 52.61123456490882, 1.3739154177432289 52.6153829345618, 1.3756913874547005 52.619657790927945, 1.3767706082934059 52.624017995462282, 1.3771424823743874 52.62842157597062, 1.3768032154989971 52.632826130085178, 1.375755861869473 52.637189233360417, 1.3740103028702542 52.641468848069543, 1.3715831598050774 52.645623728756767, 1.3684976411254988 52.649613820613247, 1.36478332533971 52.65340064679588, 1.3604758814433251 52.656947680899115, 1.3556167293586421 52.660220700919041))<\/pre>\n<p>\u3000BufferWithTolerance() \u3092\u4f7f\u3063\u3066\u751f\u6210\u3057\u305f Polygon \u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u542b\u3080\u70b9\u306f\uff0c\u524d\u56de STBuffer() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u751f\u6210\u3057\u305f\u3082\u306e\u3088\u308a\u3082\u5c11\u306a\u3044\u3053\u3068\u304c WKT \u8868\u73fe\u304b\u3089\u660e\u3089\u304b\u3067\u3042\u308b\uff0eSTNumPoints() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\uff0cBufferWithTolerance() \u3092\u4f7f\u3063\u3066\u751f\u6210\u3057\u305f\u3053\u306e\u3088\u308a\u7c21\u7d20\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u5b9f\u969b\u306b 11 \u306e\u70b9\u3092\u6709\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\uff0c\u305d\u308c\u306f\u6b63\u5341\u89d2\u5f62\u3068\u5b9a\u7fa9\u3067\u304d\u308b\uff0e\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u6211\u3005\u304c\u95a2\u5fc3\u3092\u6301\u3064\u5186\u5f62\u306e\u30be\u30fc\u30f3\u306e\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306a\u8fd1\u4f3c\u3092\u3082\u63d0\u4f9b\u3057\u3066\u304a\u308a\uff0c\u3088\u308a\u7c21\u7d20\u306a\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u64cd\u4f5c\u3059\u308b\u3044\u304b\u306a\u308b\u30e1\u30bd\u30c3\u30c9\u3082\u3088\u308a\u52b9\u7387\u7684\u306b\u5b9f\u884c\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u3092\u6709\u3057\u3066\u3044\u308b\uff0e<\/p>\n<p>\u3000figure 12-12 \u306bSTBuffer() \u304a\u3088\u3073 BufferWithTolerance() \u30e1\u30bd\u30c3\u30c9\u306e\u7d50\u679c\u3092\u6bd4\u8f03\u3059\u308b\uff08\u7565\uff09\uff0e<\/p>\n<h3>\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u51f8\u5305\u3092\u751f\u6210\u3059\u308b<\/h3>\n<p>\u3000STConvexHull() \u30e1\u30bd\u30c3\u30c9\u306f\uff0c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5185\u306e\u3059\u3079\u3066\u306e\u70b9\u3092\u542b\u3093\u3060\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u6700\u5c0f\u306e\u51f8\u9762\u3092\u8fd4\u3059\uff0e\u51f8\u9762\u30b8\u30aa\u30e1\u30c8\u30ea\u306f\u305d\u306e\u5185\u89d2\u304c 180\u00b0 \u3088\u308a\u5927\u304d\u306a\u3082\u306e\u306f\u306a\u3044\u3082\u306e\u3067\u3042\u308a\uff0c\u3086\u3048\u306b\u8fba\u304c\u5185\u5074\u306b\u66f2\u304c\u3063\u305f\u308a\u5727\u75d5\u3092\u542b\u3080\u3053\u3068\u306f\u6c7a\u3057\u3066\u306a\u3044\uff0eFigure 12-13 \u306b\u69d8\u3005\u306a\u7a2e\u985e\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u51f8\u5305\u3092\u793a\u3059\uff08\u7565\uff09\uff0e<\/p>\n<p>\u30c1\u30c3\u30d7\u30b9\u3000\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u51f8\u5305\u306e\u8996\u899a\u5316\u3092\u52a9\u3051\u308b\u305f\u3081\uff0c\u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u306e\u70b9\u7fa4\u3059\u3079\u3066\u306e\u5916\u5468\u3092\u4f38\u5c55\u3059\u308b\u5f3e\u6027\u30d0\u30f3\u30c9\u3092\u8003\u3048\u3066\u307f\u3088\u3046\uff0e\u5f3e\u6027\u30d0\u30f3\u30c9\u304c\u89e3\u653e\u3055\u308c\u305f\u3068\u304d\uff0c\u305d\u306e\u623b\u308b\u5f62\u304c\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u51f8\u5305\u3092\u8868\u3057\u3066\u3044\u308b\uff0e<\/p>\n<h4>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b<\/h4>\n<p>\u3000STConvexHull() \u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<ul>\n<li>geometry \u578b<\/li>\n<\/ul>\n<h4>\u4f7f\u7528\u6cd5<\/h4>\n<p>\u00a0STConvexHull() \u30e1\u30bd\u30c3\u30c9\u306f geometry \u578b\u306e\u3044\u304b\u306a\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4e0a\u3067\u3082\u6b21\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\uff0e<\/p>\n<pre>Instance.STConvexHull()<\/pre>\n<p>\u3000STConvex() \u306b\u3088\u308a\u8fd4\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7a2e\u985e\u306f\uff0c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5185\u306b\u542b\u307e\u308c\u308b\u3059\u3079\u3066\u306e\u70b9\u3092\u542b\u3080\u6700\u5c0f\u306e\u51f8\u9762\u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u3042\u308b\uff0e\u5358\u4e00\u306e Point \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u4f7f\u3063\u305f\u5834\u5408\uff0c\u305d\u306e\u51f8\u5305\u306f\u305d\u306e Point \u81ea\u8eab\u306b\u306a\u308b\uff0e\u76f4\u7dda\u72b6\u306b\u4e26\u3076 Point \u306e\u30b7\u30ea\u30fc\u30ba\u3084 LineString \u306b\u5bfe\u3057\u3066\u4f7f\u3063\u305f\u5834\u5408\uff0c\u305d\u306e\u51f8\u5305\u306f LineString \u306b\u306a\u308b\uff0e\u305d\u306e\u4ed6\u306e\u5834\u5408\uff0c\u305d\u306e\u51f8\u5305\u306f Polygon \u306b\u306a\u308b\uff0e<\/p>\n<h4>\u4f8b<\/h4>\n<p>\u3000\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u51f8\u5305\u3092\u751f\u6210\u3057\u89e3\u6790\u3059\u308b\u3053\u3068\u306f\uff0c\u5730\u7403\u4e0a\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5730\u7406\u7684\u306a\u5e83\u304c\u308a\u3092\u8abf\u3079\u308b\u306e\u306b\u6709\u7528\u3067\u3042\u308b\uff0e\u3053\u308c\u3092\u793a\u3059\u305f\u3081\uff0c\u6b21\u306e\u4f8b\u306f H5N1 \u30a6\u30a4\u30eb\u30b9\uff08\u4e00\u822c\u306b\u201d\u9ce5\u30a4\u30f3\u30d5\u30eb\u30a8\u30f3\u30b6\u201d\u3068\u3057\u3066\u77e5\u3089\u308c\u308b\uff09\u306e\u75c7\u4f8b\u306e\u5831\u544a\u3055\u308c\u305f\u5e83\u304c\u308a\u3092\u8868\u73fe\u3059\u308b\u51f8\u5305\u3092\u751f\u6210\u3059\u308b\uff0e<\/p>\n<p>\u3000\u3053\u306e\u4f8b\u3067\u306f\uff0c@H5N1 \u306f MultiPoint \u30b8\u30aa\u30e1\u30c8\u30ea\u3067\u3042\u308a\uff0c\u30d2\u30c8\u306b H5N1 \u30a6\u30a4\u30eb\u30b9\u304c\u8a18\u9332\u3055\u308c\u305f\u75c7\u4f8b\u306e\u5404\u4f4d\u7f6e\u306e\u70b9\u3092\u542b\u3093\u3067\u304a\u308a\uff0c\u4e16\u754c\u4fdd\u5065\u6a5f\u95a2\u304c 2003 \u5e74 9 \u6708\u304b\u3089 2004 \u5e74 12 \u6708\u306e\u9593\u306b\u5831\u544a\u3057\u305f\u3082\u306e\u3067\u3042\u308b\uff0e\u3064\u3044\u3067 geometry \u578b\u306e STConvexHull() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\uff0c\u3053\u306e\u75be\u60a3\u306e\u5e83\u304c\u308a\u5168\u4f53\u3092\u8a18\u8ff0\u3059\u308b MultiPoint \u30b8\u30aa\u30e1\u30c8\u30ea\u5185\u306e\u5404\u70b9\u3092\u5305\u56f2\u3059\u308b\u51f8\u5305 Polygon \u3092\u751f\u6210\u3059\u308b\uff0e<\/p>\n<pre>DECLARE @H5N1 geometry\nSET @H5N1 = geometry::STMPointFromText(\n  'MULTIPOINT(\n105.968 20.541, 105.877 21.124, 106.208 20.28,  101.803 16.009, 99.688 16.015,\n 99.055 14.593,  99.055 14.583,  102.519 16.215, 100.914 15.074, 102.117 14.957,\n100.527 14.341,  99.699 17.248,  99.898 14.608,  99.898 14.608,  99.898 14.608,\n 99.898 14.608, 100.524 17.75,  106.107 21.11,  106.91 11.753,  107.182 11.051,\n105.646 20.957, 105.857 21.124, 105.867 21.124, 105.827 21.124, 105.847 21.144,\n105.847 21.134, 106.617 10.871, 106.617 10.851, 106.637 10.851, 106.617 10.861,\n106.627 10.851, 106.617 10.881, 108.094 11.77, 108.094 11.75,  108.081 11.505,\n108.094 11.76,  105.899 9.546,  106.162 11.414, 106.382 20.534, 106.352 20.504,\n106.342 20.504, 106.382 20.524, 106.382 20.504, 105.34 20.041,  105.34 20.051,\n104.977 22.765, 105.646 20.977, 105.646 20.937, 99.688 16.015,  100.389 13.927,\n101.147 16.269, 101.78 13.905,  99.704 17.601,  105.604 10.654, 105.817 21.124,\n106.162 11.404, 106.362 20.504)', 4326)\nSELECT\n  @H5N1 AS Shape\nUNION ALL SELECT\n  @H5N1.STConvexHull() AS Shape<\/pre>\n<p>\u3000STConvexHull() \u30e1\u30bd\u30c3\u30c9\u304a\u3088\u3073\u751f\u6210\u3055\u308c\u305f MultiPoint @H5N1 \u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u7d50\u679c\u306e\u51f8\u9762 Polygon \u3092 Figure 12-14 \u306b\u793a\u3057\uff08\u7565\uff09\uff0c\u5f71\u97ff\u3092\u53d7\u3051\u308b\u30a8\u30ea\u30a2\u3092\u5730\u56f3\u4e0a\u306b\u30aa\u30fc\u30d0\u30fc\u30ec\u30a4\u3057\u3066\u3044\u308b\uff0e<\/p>\n<p>\u3000\u4e00\u3064\u8208\u5473\u6df1\u3044\u4e8b\u5b9f\u3092\u8a18\u8f09\u3057\u3066\u304a\u304f\u3068\uff0c\u3053\u306e\u30c7\u30fc\u30bf\u306e\u8868\u73fe\u3059\u308b\u671f\u9593\uff082003 \u5e74 9 \u6708\u304b\u3089 2004 \u5e74 12 \u6708\u306b\u304b\u3051\u3066\uff09\uff0cH5N1 \u306e\u500b\u5225\u306e\u75c7\u4f8b\u306f\u30bf\u30a4\u3068\u30d9\u30c8\u30ca\u30e0\u3067\u3057\u304b\u5831\u544a\u3055\u308c\u306a\u304b\u3063\u305f\uff0e\u3057\u304b\u3057\uff0c\u305d\u308c\u3089\u306e\u75c7\u4f8b\u306e\u898b\u3064\u304b\u3063\u305f\u70b9\u3092\u5305\u56f2\u3059\u308b\u51f8\u5305\u306f\u30e9\u30aa\u30b9\u3068\u30ab\u30f3\u30dc\u30b8\u30a2\u306e\u5927\u534a\u3092\u30ab\u30d0\u30fc\u3057\u3066\u304a\u308a\uff0c\u75be\u60a3\u306e\u62e1\u5927\u3057\u3066\u3044\u304f\u5730\u57df\u5185\u306b\u4f4d\u7f6e\u3057\u3066\u3044\u308b\u3053\u3068\uff0c\u305d\u3057\u3066\u75be\u60a3\u306b\u66b4\u9732\u3059\u308b\u8457\u660e\u306a\u30ea\u30b9\u30af\u306b\u3055\u3089\u3055\u308c\u3066\u3044\u305f\u3053\u3068\u3092\u793a\u5506\u3057\u3066\u3044\u308b\uff0e\u4e8b\u5b9f\uff0c2005 \u5e74 1 \u6708 21 \u65e5\uff0c\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u6700\u5f8c\u306e\u8a18\u9332\u306e\u4e00\u30f6\u6708\u4ee5\u5185\u306b\uff0c\u30ab\u30f3\u30dc\u30b8\u30a2\u3067\u30d2\u30c8\u3078\u306e H5N1 \u306e\u6700\u521d\u306e\u611f\u67d3\u4f8b\u304c\u5831\u544a\u3055\u308c\u305f\uff0e<\/p>\n<h3>\u8981\u7d04<\/h3>\n<p>\u3000\u672c\u7ae0\u3067\u306f\uff0c\u65e2\u5b58\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u7d50\u5408\u3057\u305f\u308a\u5dee\u5206\u3092\u53d6\u3063\u305f\u308a\u4fee\u98fe\u3057\u305f\u308a\u3059\u308b\u305f\u3081\u306e SQL Server 2008 \u306e\u63d0\u4f9b\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u7d39\u4ecb\u3057\u305f\uff0eTable 12-1 \u306b\u672c\u7ae0\u3067\u7d39\u4ecb\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u306e\u8981\u7d04\u3092\u793a\u3059\uff0e<\/p>\n<table><caption>Table 12-1. \u7a7a\u9593\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4fee\u98fe\u3059\u308b\u30e1\u30bd\u30c3\u30c9<\/caption>\n<tbody>\n<tr>\n<th>\u30e1\u30bd\u30c3\u30c9<\/th>\n<th>\u8a18\u8ff0<\/th>\n<th>geometry\u578b<\/th>\n<th>geography\u578b<\/th>\n<\/tr>\n<tr>\n<td>MakeValid()<\/td>\n<td>\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u4fee\u98fe\u3057\u3066\u6709\u52b9\u306b\u306a\u308b\u3088\u3046\u78ba\u4fdd\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<tr>\n<td>STUnion()<\/td>\n<td>2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u548c\u96c6\u5408\u3092\u5b9a\u7fa9\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u25cf<\/td>\n<\/tr>\n<tr>\n<td>STIntersection()<\/td>\n<td>2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u4ea4\u5dee\u3092\u5b9a\u7fa9\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u25cf<\/td>\n<\/tr>\n<tr>\n<td>STDifference()<\/td>\n<td>2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u5dee\u5206\u3092\u8868\u73fe\u3059\u308b\u70b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5b9a\u7fa9\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u25cf<\/td>\n<\/tr>\n<tr>\n<td>STSymDifference()<\/td>\n<td>2\u3064\u306e\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u5bfe\u79f0\u5dee\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5b9a\u7fa9\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u25cf<\/td>\n<\/tr>\n<tr>\n<td>Reduce()<\/td>\n<td>Polygon \u3084 LineString \u306e\u7c21\u7d20\u5316\u3057\u305f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5b9a\u7fa9\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u25cf<\/td>\n<\/tr>\n<tr>\n<td>STBuffer()<\/td>\n<td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7de9\u885d\u5730\u5e2f\u3092\u8868\u73fe\u3059\u308b Polygon \u3084 MultiPolygon \u3092\u5b9a\u7fa9\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u25cf<\/td>\n<\/tr>\n<tr>\n<td>BufferWithTolerance()<\/td>\n<td>\u4e0e\u3048\u3089\u308c\u305f\u8a31\u5bb9\u7bc4\u56f2\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7de9\u885d\u5730\u5e2f\u3092\u8868\u73fe\u3059\u308b Polygon \u3084 MultiPolygon \u3092\u5b9a\u7fa9\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u25cf<\/td>\n<\/tr>\n<tr>\n<td>STConvexHull()<\/td>\n<td>\u30b8\u30aa\u30e1\u30c8\u30ea\u306e\u51f8\u5305\u3092\u8868\u73fe\u3059\u308b Polygon \u3092\u751f\u6210\u3059\u308b<\/td>\n<td>\u25cf<\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u672c\u7ae0\u306b\u304a\u3044\u3066\u306f\uff0c\u4ed6\u306e\u65e2\u5b58\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u4e00\u90e8\u3092\u4fee\u98fe\u3057\u305f\u308a\uff0c\u7d50\u5408\u3057\u305f\u308a\uff0c\u9078\u629e\u3057\u305f\u308a\u3057\u3066 geography \u578b\u3084 geometry \u578b\u306e\u30c7\u30fc\u30bf\u306e\u65b0\u3057\u3044\u30a2\u30a4\u30c6\u30e0\u3092\u751f\u6210\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u308b\u591a\u304f\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u7d39\u4ecb\u3057\u3088\u3046\uff0e\u3053\u308c\u3089\u306e\u30e1\u30bd &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.muscle-hypertrophy.com\/?p=16118\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u7b2c12\u7ae0\u3000\u7a7a\u9593\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4fee\u98fe\u3059\u308b (Begining Spatial with SQL Server 2008)&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":15391,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[11223,8404,7752,3562,7587,7724,8413,6746,7262,7264,7465,7872,8326,4569,7727,4672,4657,2740,12113,2750,7448,12056,12055,5292,7460,5479,11941,691,7816,2796,7772,7230,12530,4405,2783,4581,9582,11583,462,7483,973,7717,6958,5887,4552,964,7238,6542,5518,4445,5039,2205,7496,7247,4874,7318,4503,8088,12534,3588,5178,7735,5419,7245,3939,7187,7152,11322,12533,3527,254,11903,4251,3592,2408,5807,7884,7865,7742,7511,7543,7194,7181,4953,3677,2782,682,7750,7918,7117,4960,2445,4029,7826,3433,7317,7338,11909,7221,2834,603,4717,4437,7542,3429],"class_list":["post-16118","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-begin","tag-close","tag-declare","tag-end","tag-geography","tag-geometry","tag-insert-into","tag-into","tag-multipoint","tag-multipolygon","tag-ogc","tag-open","tag-point","tag-polygon","tag-select","tag-set","tag-sql-server","tag-sql-server-2008","tag-sql-server-management-studio","tag-srid","tag-stlinefromtext","tag-stpolyfromtext","tag-table","tag-unit_of_measure","tag-values-2","tag-while","tag-691","tag-7816","tag-2796","tag-7772","tag-7230","tag-12530","tag-4405","tag-2783","tag-4581","tag-9582","tag-11583","tag-462","tag-7483","tag-973","tag-7717","tag-6958","tag-5887","tag-4552","tag-964","tag-7238","tag-6542","tag-5518","tag-4445","tag-5039","tag-2205","tag-7496","tag-7247","tag-4874","tag-7318","tag-4503","tag-8088","tag-12534","tag-3588","tag-5178","tag-7735","tag-5419","tag-7245","tag-3939","tag-7187","tag-7152","tag-11322","tag-12533","tag-3527","tag-254","tag-11903","tag-4251","tag-3592","tag-2408","tag-5807","tag-7884","tag-7865","tag-7742","tag-7511","tag-7543","tag-7194","tag-7181","tag-4953","tag-3677","tag-2782","tag-682","tag-7750","tag-7918","tag-7117","tag-4960","tag-2445","tag-4029","tag-7826","tag-3433","tag-7317","tag-7338","tag-11909","tag-7221","tag-2834","tag-603","tag-4717","tag-4437","tag-7542","tag-3429"],"_links":{"self":[{"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/posts\/16118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16118"}],"version-history":[{"count":72,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/posts\/16118\/revisions"}],"predecessor-version":[{"id":16797,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/posts\/16118\/revisions\/16797"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=\/wp\/v2\/media\/15391"}],"wp:attachment":[{"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.muscle-hypertrophy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}