COGO: Finding centre and radius of a curve defined by three points (PostGIS)

Recently I had need to convert a PL/SQL Oracle Spatial function I created years ago called FindCircle to SQL Server 2008 for use in another project. That function was original work already released to the public domain as part of my free COGO package for Oracle. Here is that function for SQL Server. Note thatRead 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

Implementing Point-based Costs in pgRouting

Implementing Point-based Costs in pgRouting pgRouting is a great tool but it does have certain limitations. One limitation is that one cannot have costs at specific nodes. All costs have to be edge based. Discussion on Node/Edge Costs in pgModeler For example, suppose a network has a stop valve between two pipes. Normally the stopRead More

Spatially Extending Database Management and Development Tools: GeoRaptor, DBeaver, pgAdmin and SSMS

“Imitation is the Greatest Form of Flattery” Before I talk about SSMS, pgAdmin and DBeaver spatial visualisation solutions, some history about the first spatial tool that extended a (non-GIS) database management and development tool: GeoRaptor. GeoRaptor History Many years ago a visionary programmer added spatial capabilities to SQL Developer 0.9, calling his extension GeoRaptor (theRead More

Vectorization: Exploding a linestring or polygon into individual vectors in PostGIS

I find having a vectorising function in my database kit-bag almost indispensable in my work. I have written and revised my Oracle PL/SQL functions that do this many times over the years and so, when I first started using PostGIS, I decided to learn how to program in PL/pgSQL by implementing something familiar: a GetVector()Read More

How to apply spatial constraints to PostGIS tables

This article was written before TypeMod was introduced eg Geometry(Polygon,28355) As I have pointed out in other blog articles, spatial data quality should not engender either/or solutions when building business applications. That is, if I can only create points for parcel centroids that fall within land parcels, then I don’t just build the rule inRead More