{"id":587,"date":"2010-11-09T14:49:00","date_gmt":"2010-11-09T14:49:00","guid":{"rendered":"\/blogs\/bobb\/post\/RepostRevision-Updated-serialization-formats-for-SQL-Server-spatial-types.aspx"},"modified":"2013-01-03T23:59:33","modified_gmt":"2013-01-04T07:59:33","slug":"repostrevision-updated-serialization-formats-for-sql-server-spatial-types","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/","title":{"rendered":"Repost\/Revision Updated serialization formats for SQL Server spatial types"},"content":{"rendered":"<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<span style=\"line-height: 115%; font-family: 'Verdana','sans-serif'; color: black; font-size: 8.5pt\">SQL Server Denali CTP1 was released today. I don&rsquo;t want to be the fiftieth person to post the link to the download; reference Ed&#39;s blog posting for the location.<\/span>\n<\/p>\n<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<span style=\"line-height: 115%; font-family: 'Verdana','sans-serif'; color: black; font-size: 8.5pt\">This is a repost (with some corrections now that the CTP is actually out) of a blog posting I did when someone discovered a web location of an updated serialization spec. It attempted to give an overview of where the new spatial types (like circular string and curves)&nbsp;came from and what they mean. I took down the blog posting when the spec &quot;disappeared&quot;. But now that <a href=\"http:\/\/blogs.msdn.com\/b\/edkatibah\/archive\/2010\/11\/09\/new-spatial-features-in-sql-server-code-named-denali-ctp1.aspx\" class=\"broken_link\">Ed Katibah blogged about it<\/a> (be sure to read his <a href=\"http:\/\/sqlcat.com\/sqlcat\/b\/whitepapers\/archive\/2010\/11\/09\/new-spatial-features-in-sql-server-code-named-denali-community-technology-preview-1.aspx\" class=\"broken_link\">excellent whitepaper<\/a>), I guess it&rsquo;s *really* OK now.<\/span>\n<\/p>\n<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\">\n<span style=\"line-height: 115%; font-family: 'Verdana','sans-serif'; color: black; font-size: 8.5pt\">Everyone&#39;s on the lookout for info about features of SQL Server Denali. The docs folks may have given us some insight in the publication of an update of the &quot;Microsoft SQL Server CLR Types Serialization Formats [MS-SSCLRT]&quot; spec. This includes updates that &quot;apply to SQL Server Denali CTP1&quot; according to footnotes in the spec. A message about this spec update was posted on the Technet SQL Server spatial forum. The spec is publically posted<\/span><span style=\"line-height: 115%; font-family: 'Verdana','sans-serif'; color: black; font-size: 8.5pt\">. <\/p>\n<p>Besides a bit indicating &quot;this geography instance is bigger than half a hemisphere&quot;, there&#39;s four new types listed under OpenGIS Types: CircularString, CompoundCurve, CurvePolygon, and FullGlobe. The 1.2 versions of the OGC specs mention the first three. No mention of FullGlobe, that must technically not be a new type. So what are the three remaining types and what are they good for? That&#39;s more interesting than just knowing they exist. The best information I could find comes from the ISO-ANSI SQL\/MM Part 3 spec. <\/p>\n<p>In OGC&#39;s original type hierarchy (I couldn&#39;t find an updated one in their new specs, maybe I didn&#39;t look hard enough), LineString is the only direct subtype of Curve and Line and LinearRing derive from LineString. In SQL\/MM&#39;s type hierarchy LineString, CircularString, and CompoundCurve all directly derive from Curve (an abstract type). So both CircularString and CompoundCurve &quot;is a&quot; Curve, just as LineString is. There is no Line and LinearRing in SQL\/MM spec. In a somewhat similar fashion, Surface is declared as abstract type, CurvePolygon is the direct subtype, and Polygon is a subtype of CurvePolygon. <\/p>\n<p>Back to LineString vs. CircularString vs CompoundCurve. A single segment of a LineString consists of two points connected by a straight line. But a single segment of a CircularString consists of three points that form an arc: start point, end point, and any point on the arc in between. You can have multiple segments; the end point of one segment can be the start point of the next segment. &quot;A combination of linear and circular strings can be modeled using the ST_CompoundCurve type.&quot; (quote from the spec). Ah&#8230;so it would seem to be less work to define an arc as three points than approximate an arc with many small linestrings. More accurate too. That&#39;s (possibly) the goodness. <\/p>\n<p>For CurvePolygon, to relate it to Polygon (which we all know and love) and Surface (the abstract class), from the spec: &quot;Surfaces, as 2-dimensional geometries, are defined in the same way as curves using a sequence of points. The boundary of each surface is a curve, or a set of curves if the surface has any holes in it. The boundary of a surface consists of a set of rings, where each ring is a curve. The type ST_CurvePolygon stands for such a generalized surface, and the subtype ST_Polygon restricts the conditions for the rings of the boundary to linear strings.&quot; <\/p>\n<p>Finnaly there was a question I just had to find the answer to: how then do you define a Circle? According to the new CTP1 docs, you need to define a circle in halves. So something like: declare @g geometry = &#39;COMPOUNDCURVE(CIRCULARSTRING(0 2, 2 0, 4 2), CIRCULARSTRING(4 2, 2 4, 0 2))&#39;; might do the trick.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server Denali CTP1 was released today. I don&rsquo;t want to be the fiftieth person to post the link to the download; reference Ed&#39;s blog posting for the location. This is a repost (with some corrections now that the CTP is actually out) of a blog posting I did when someone discovered a web location [&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-587","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>Repost\/Revision Updated serialization formats for SQL Server 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\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Repost\/Revision Updated serialization formats for SQL Server spatial types - Bob Beauchemin\" \/>\n<meta property=\"og:description\" content=\"SQL Server Denali CTP1 was released today. I don&rsquo;t want to be the fiftieth person to post the link to the download; reference Ed&#039;s blog posting for the location. This is a repost (with some corrections now that the CTP is actually out) of a blog posting I did when someone discovered a web location [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Bob Beauchemin\" \/>\n<meta property=\"article:published_time\" content=\"2010-11-09T14:49: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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/\",\"name\":\"Repost\/Revision Updated serialization formats for SQL Server spatial types - Bob Beauchemin\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\"},\"datePublished\":\"2010-11-09T14:49: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\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-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\":\"Repost\/Revision Updated serialization formats for SQL Server 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":"Repost\/Revision Updated serialization formats for SQL Server 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\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/","og_locale":"en_US","og_type":"article","og_title":"Repost\/Revision Updated serialization formats for SQL Server spatial types - Bob Beauchemin","og_description":"SQL Server Denali CTP1 was released today. I don&rsquo;t want to be the fiftieth person to post the link to the download; reference Ed&#39;s blog posting for the location. This is a repost (with some corrections now that the CTP is actually out) of a blog posting I did when someone discovered a web location [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/","og_site_name":"Bob Beauchemin","article_published_time":"2010-11-09T14:49: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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/","name":"Repost\/Revision Updated serialization formats for SQL Server spatial types - Bob Beauchemin","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website"},"datePublished":"2010-11-09T14:49: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\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-spatial-types\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/repostrevision-updated-serialization-formats-for-sql-server-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":"Repost\/Revision Updated serialization formats for SQL Server 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\/587","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=587"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/587\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/media?parent=587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/categories?post=587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/tags?post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}