Morton Key Function for PostgreSQL/PostGIS
In my article on the creation and use of a space keys for the spatial sorting of spatial data, I show how to implement a Morton key for PostgreSQL/PostGIS pl/pgSQL. The function is as follows: Now, let’s test it with some simple SQL: Results I hope this is of use to someone.