Sample data and scripts using Microsoft spatial SQL
SQLPL
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CalculateBuffer.sql
CalculateCentroid.sql
CalculateDistance.sql
CalculateExtent.sql
CalculateLines.sql
CheckInvalidGeom.sql
CorrectPointOrder.sql
FixInvalid.sql
GeomContains.sql
GeomDifference.sql
GeomIntersect.sql
GeomUnion.sql
LICENSE
MultiPointtoLine.sql
MultiPointtoLineFast.sql
README.md
UnionAggregate.sql
UsingSpatialIndex.sql

README.md

SpatialSQLfortheGeographer

Sample data and scripts using Microsoft spatial SQL. Code developed using SQL Server 2008 R2, but everything still works as of April 2016 up through Microsoft SQL Server 2014. Any suggestions or improvements are welcome. UPDATE, this should all still work as of July 2018, but some of the links in the blog postings are going to technical pages that are no longer supported. I will eventually get the links updated, but no promises!

All scripts and tables used here are based on the GEOMETRY data type

Data used in scripts and tutorials can be downloaded here (it's a 28mb zip). All data originally downloaded from Natural Earth's awesome website

A number of tutorials are available from benjaminspaulding.com

Part 1 - Welcome to Spatial SQL

Part 2 - Basic Spatial SQL Scripts

Part 3 - More Basic Spatial SQL Scripts

Part 4 - Mulit-Point to Line Example