CheckRadii: Identifying Tight Radius Curves sections within LineString geometry data

Sometimes it is a data quality requirement for linear data (roads, pipelines, transmission lines) that curves within the lines must have a radius greater than a particular amount. Recently a customer asked me to write some TSQL functions to help them run data quality checks over linear data loaded into a SQL Server 2008 geometryRead More

RandomSearchByExtent: Random Search Procedure (2008 Spatial)

I have had the need, over the years, to produce statistics that helped me decide how effective a change to a property of a spatial table or index might be. For example, with SQL Server 2008’s Spatial Index, for most sites, setting the right properties to get the best performance is a trial and errorRead More

COGO: Converting (Google Earth) Formatted Longitude/Latitude points to decimal degrees (SQL Server)

In an article on Oracle I described how to convert Google Earth textual representations of a longitude or latitude value to its decimal equivalent. Here is a version that will work with SQL Server 2008/2012 Spatial. And here are a few examples. Result DD -43.0138888888889 43.5126388888889 147.841833333333 -65.1701666666667 I hope this is of use toRead More

COGO: Convert Degrees, Minutes and Seconds values to Decimal Degrees

Sometimes data is provided to spatial databases via spreadsheets or other database tables in the form of degrees, minutes and seconds values. For example, data may come like this: Degree Minute Seconds 45 30 30.0 Which then need converting to a single decimal degree floating point value for use as an ordinate in a spatialRead More

COGO: DD2DMS Formatting a latitude/longitude decimal degree value

Many years ago I had need to annotate the lines of a cadastral (land titles) polygon with the bearing and distance of each line. The bearings and distances need to be computed from the boundary of each land parcel. The annotation had to be formatted as DD^MM’SS.SS”. This was achieved with a function called DD2DMSRead More

COGO: Compute number of vertices required to stroke circle or circular arc

In working with circles or arc segments one needs to be able to do more than just calculate chordlengths, arclengths or arc2chord separations. For example, in order to be able to convert circles and arcs to vertex-stroked polygons and vice versa one needs to be able to compute the number of vertices to place betweenRead More

COGO: Compute arc length subtended by angle centre of circle

In working with circles (and circular arcs) in spatial data one must be able to compute the length of an arc defined by an angle subtended at the centre of a circle. In particular this is important for converting circles to vertex-stroked polygons and vice versa. Here is an encoding of the calculation of theRead More