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

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.

TESSELATE and CENTROID package updates

Today (25th February 2015) I uploaded the following changes to the following packages: 1. TESSELATE Reduce complexity of package interface. Removed all Quad_Tree Initialise procedures (Quad_Tree functions internally initialise). All SPACE_KEY functions removed: package now only supports morton key generation. Added new ST_TileGeometry functions that provide greater options for tiling (or generating a regular gridRead More

Generating a Grid (fishnet) of points or polygons for PostGIS

I wrote an article on Gridding a PostGIS Geometry object a while back. I had cause, recently, to use a variation on this for the generation of an array of point objects for a geometry polygon, so I wrote a version that also allows for the generation of a grid of polygons or points dependingRead More

STMorton: Creating a Morton Number Space Key Value for Grid Cells

Introduction NOTE: This article is a copy of the original first written in 2010 from my old website. Space curves are imaginary lines that systematically cover all tiles in an indexed space. The most well known in GIS is the Morton key. The utility of such a number can be seen though its implementing aRead More

Gridding a sdo_geometry line/polygon object (Oracle)

A common question that comes up in the various database forums (PostGIS, SQL Server, Oracle) is how to “grid” a linear or polygonal object. By “grid” one means work out the square pixels (rectangular polygons) that cover or define a vector geometry. Here is some SQL for doing this for Oracle Locator. Single Geometry HereRead More

Gridding a geometry object (PostGIS)

A common question that comes up in the various database forums (PostGIS, SQL Server, Oracle) is how to “grid” a linear or polygonal object. By “grid” one means work out the square pixels (rectangular polygons) that cover or define a vector geometry. Here is some SQL for doing this for PostGIS. Single Geometry The followingRead More

Gridding a geometry or geography object (SQL Server Denali)

A common question that comes up in the various database forums (PostGIS, SQL Server, Oracle) is how to “grid” a linear or polygonal object. By “grid” one means work out the square pixels (rectangular polygons) that cover or define a vector geometry. Here is some SQL for doing this for SQL Server 2008 Denali. DenaliRead More

Creating a Grid of Geographic Tiles

Over the years I have made available functions that generate the tiles of a grid given user input. These have been made available in Oracle, PostGIS and SQL Server Spatial (geometry). Here are the type signatures of these functions: Oracle Object Oracle Package PostGIS SQL Server Geometry Requirement A customer has the requirement to generationRead More