Pseudo Array Implementation for SQL Server Spatial (Part 2)

Introduction Data Structure + Base Function Accessors and Setters Four functions are declared for processing geometry or geography data within the array. These are “wrappers” over _STArray. Examples Declare @array xml select ‘Empty Array’ as test, [dbo].[STNumArray](@array) as arraySize; test arraySize Empty Array 0 Set @array = [dbo].[_STArray](@array,1,’insert’,geometry::Point(1,2,0).STAsBinary(),0); select ‘Insert into Empty ‘ as test,Read More

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

Overlaying Polygons in SQL Server Spatial

Introduction The OGC operators for geometry processing only support two polygon inputs. Additionally the Microsoft aggregate operators only include geometry union processing geometry::UnionAggregate and not overlay processing etc. UnionAggregate returns for all input polygons as the single Union (see above) does. Concept: Resolving all overlapping areas, without dissolving boundaries, is called “planar enforcing”. Planar enforcementRead More

Oracle Spatial Mapping and Map Rendering Performance Tips

Comment: This article was written about 10 years ago. Most of what is written is still relevant though the comments about disk usage and access do not apply if SSD is being used. Introduction There are lots of things one can do to improve performance in mapping environments because of a lot of the visualisationRead More

Space Filling Curve Functions For TSQL

Introduction Warning: This article is long mainly because it includes the source code of the Hilbert, Morton and Peano key/curves. I would assert that space filling curves have always been overlooked in their use within GIS. Their existence was/is rarely taught at Universities, though at least in my day. Perhaps today it is different (butRead More

Bing Maps Tile System Functions for TSQL

This blog presents functions for Bing Maps Tile System for TSQL. This support includes converting Latitude/Longitude pairs to Bing Maps QuadKeys. The source for the functions is over at the Mircosoft site – an article by James Schwartz. They are donated to the public domain. Some tests include: I hope this is of use toRead More

Geocoding Points Against a Grid of Cells/Tiles With/out Spatial Operators

This article shows how to geocode points objects against grid cells without using spatial operators. The article also shows how to use space curve values such as generated by a Morton key algorithm as grid cell ids and thus geocodes.