Tag Archives: SQL

“Point-of-Maximal Distance” queries (AKA Variations on a Theme of Nearest-Neighbours)

Nearest neighbour queries (or, for my international readers, nearest-neighbor queries), are a pretty common query pattern used in location-based applications and spatial analysis:- given a set of known locations of restaurants, customers, stations etc.,  “What/where is the nearest X to … Continue reading

Posted in Spatial, SQL Server | Tagged , , , | 2 Comments

SQL Server 2012 – What’s New for Spatial?

So Microsoft launched SQL Server 2012 today, and you can download the SQL 2012 Express edition right now from http://www.microsoft.com/sqlserver/en/us/get-sql-server/try-it.aspx No doubt there will be lots of people writing blog articles about the various new features – AlwaysOn, Column Store … Continue reading

Posted in Spatial, SQL Server | Tagged , , , , | 7 Comments

Drawing Fractals with SQL Server Spatial

I can’t think of any practical purpose for this code, but here’s a recursive SQLCLR procedure to draw a Sierpinski triangle fractal (or, at least, an approximation of one to a given level of detail) in SQL Server just because … Continue reading

Posted in Spatial, SQL Server | Tagged , , , , , | Leave a comment

SQL Spatial Puzzle #1: The Disappearing Square

This is the first in what will (hopefully) be a series of posts demonstrating a few light-hearted uses of SQL Server 2008 spatial functions to solve some common mathematical/logical puzzles. To demonstrate the disappearing square puzzle, first of all create … Continue reading

Posted in Spatial, SQL Server | Tagged , , | Leave a comment