{"id":563,"date":"2011-02-07T14:37:00","date_gmt":"2011-02-07T14:37:00","guid":{"rendered":"\/blogs\/bobb\/post\/Visualizing-the-new-Denali-curve-spatial-types.aspx"},"modified":"2013-01-03T23:59:33","modified_gmt":"2013-01-04T07:59:33","slug":"visualizing-the-new-denali-curve-spatial-types","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/","title":{"rendered":"Visualizing the new Denali curve spatial types"},"content":{"rendered":"<p>\nI&#39;d been fretting over the lack of a true <a href=\"http:\/\/3.209.169.194\/blogs\/bobb\/new-curve-types-in-sql-server-denali-are-now-in-ogc-spec\/\" class=\"broken_link\">visualizer<\/a> for the new circularstring and compoundcurve spatial types in SQL Server Denali. I&#39;d installed SSMS from SQL Server 2008 R2, and although it works just fine for Denali spatial types (even though the binary format has changed since 2008\/R2), trying to use it with either of the new &quot;curve&quot; types produces an empty graph pane. Because of this lack of visualization, I also wondered how these types&nbsp;would ever&nbsp;work with map websites\/controls that only support Points, LineStrings, and Polygons.\n<\/p>\n<p>\nSilly me. When I mentioned this to Ed Katibah (aka <a href=\"http:\/\/blogs.msdn.com\/b\/edkatibah\/\" class=\"broken_link\">Spatial Ed<\/a>), he pointed out that this was exactly&nbsp;the purpose of STCurveToLine(). I thought this method would only produce LineStrings that had as many vertices as the curve, resulting in a &quot;square&quot; rendition of a circle, for example. But no&#8230; this routine &quot;densifies&quot; the linestring, resulting in a linestring with more points, that really looks like a curve\/circle. Nice! If this doesn&#39;t look circular enough (or is too many points) you can always use CurveToLineWithTolerance() instead of STCurveToLine(). Thanks, Ed! Here&#39;s a short example:\n<\/p>\n<p>\ndeclare @g geometry = &#39;CIRCULARSTRING(0 2, 2 0, 4 2, 2 4, 0 2)&#39; &#8212; here&#39;s a circle<br \/>\nselect @g.STIsValid() &#8212; ensure it&#39;s valid<br \/>\nselect @g.STNumPoints() &#8212; 5 points in the definition\n<\/p>\n<p>\n&#8212; show in the SSMS 2008\/R2 &quot;spatial results tab&quot;<br \/>\nselect @g.STCurveToLine()<br \/>\nselect @g.CurveToLineWithTolerance(0.01,0)\n<\/p>\n<p>\n&#8212; circle densification<br \/>\nselect @g.STCurveToLine().STNumPoints(), &#8212; 65 points<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;@g.CurveToLineWithTolerance(0.01,0).STNumPoints() &#8212; 33 points\n<\/p>\n<p>\n@bobbeauch<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#39;d been fretting over the lack of a true visualizer for the new circularstring and compoundcurve spatial types in SQL Server Denali. I&#39;d installed SSMS from SQL Server 2008 R2, and although it works just fine for Denali spatial types (even though the binary format has changed since 2008\/R2), trying to use it with either [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,36],"tags":[],"class_list":["post-563","post","type-post","status-publish","format-standard","hentry","category-sql-server-2012","category-sql-server-spatial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Visualizing the new Denali curve spatial types - Bob Beauchemin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Visualizing the new Denali curve spatial types - Bob Beauchemin\" \/>\n<meta property=\"og:description\" content=\"I&#039;d been fretting over the lack of a true visualizer for the new circularstring and compoundcurve spatial types in SQL Server Denali. I&#039;d installed SSMS from SQL Server 2008 R2, and although it works just fine for Denali spatial types (even though the binary format has changed since 2008\/R2), trying to use it with either [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Bob Beauchemin\" \/>\n<meta property=\"article:published_time\" content=\"2011-02-07T14:37:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-01-04T07:59:33+00:00\" \/>\n<meta name=\"author\" content=\"Bob Beauchemin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bob Beauchemin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/\",\"name\":\"Visualizing the new Denali curve spatial types - Bob Beauchemin\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\"},\"datePublished\":\"2011-02-07T14:37:00+00:00\",\"dateModified\":\"2013-01-04T07:59:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server 2012\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-server-2012\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Visualizing the new Denali curve spatial types\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\",\"name\":\"Bob Beauchemin\",\"description\":\"SQL Server Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\",\"name\":\"Bob Beauchemin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"caption\":\"Bob Beauchemin\"},\"sameAs\":[\"http:\/www.sqlskills.com\/blogs\/bobb\/\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Visualizing the new Denali curve spatial types - Bob Beauchemin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/","og_locale":"en_US","og_type":"article","og_title":"Visualizing the new Denali curve spatial types - Bob Beauchemin","og_description":"I&#39;d been fretting over the lack of a true visualizer for the new circularstring and compoundcurve spatial types in SQL Server Denali. I&#39;d installed SSMS from SQL Server 2008 R2, and although it works just fine for Denali spatial types (even though the binary format has changed since 2008\/R2), trying to use it with either [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/","og_site_name":"Bob Beauchemin","article_published_time":"2011-02-07T14:37:00+00:00","article_modified_time":"2013-01-04T07:59:33+00:00","author":"Bob Beauchemin","twitter_misc":{"Written by":"Bob Beauchemin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/","name":"Visualizing the new Denali curve spatial types - Bob Beauchemin","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website"},"datePublished":"2011-02-07T14:37:00+00:00","dateModified":"2013-01-04T07:59:33+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/visualizing-the-new-denali-curve-spatial-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/"},{"@type":"ListItem","position":2,"name":"SQL Server 2012","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-server-2012\/"},{"@type":"ListItem","position":3,"name":"Visualizing the new Denali curve spatial types"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/","name":"Bob Beauchemin","description":"SQL Server Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e","name":"Bob Beauchemin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","caption":"Bob Beauchemin"},"sameAs":["http:\/www.sqlskills.com\/blogs\/bobb\/"],"url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/comments?post=563"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/563\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/media?parent=563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/categories?post=563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/tags?post=563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}