COGO: Converting Decimal Degrees to Degrees Minutes and Seconds – and back again (PostGIS)

It is useful to have functions for converting from individual degrees, minutes and seconds to a single decimal degree value and back again. Here are some useful plPgSql functions. DMS2DD Firstly, a function to convert individual degrees, minutes and seconds values to a single decimal degree value. Now for some examples…. Result: dms2dd -44.1805555555556 Result:Read More

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