Tag Archives: SQL Server

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

Cleaning up artefacts created by Reduce()

The Reduce() method simplifies geography or geometry instances by removing vertices. Depending on the situation, this can sometimes cause a Polygon instance to collapse in on itself, degenerating into a LineString, or even a single Point. For example, in the … Continue reading

Posted in Spatial, SQL Server | Tagged , | 1 Comment

Updating a SQL Server Table with Nearest Neighbours (Optimised for SQL Server 2012 / SQL Azure)

So I’ve been trying to think of some examples that make use of the Garmin POI data from my last post. Seeing as POI data naturally lends itself to nearest-neighbour queries, I thought I’d write a little about those. The … Continue reading

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

Load Garmin POI data to SQL Server

I’m always looking out for interesting new sources of spatial data to provide examples for use in my books and presentations. Microsoft’s own MSDN documentation demonstrates SQL Server spatial methods only using abstract geometries, such as SET @h = geometry::STGeomFromText(‘POINT(10 … Continue reading

Posted in Spatial, SQL Server | Tagged , | 1 Comment