SpatialDB Advisor
|
Current PostGIS Blog Articles
|
This article is about applying spatial and host database processing to solving a specific, and real, customer requirement: to visualise a communications pit and its contents on a map as a concept called a “Butterfly”. Introduction: The “whole” is more powerful than the “part”Databases are not just great for managing data models, they are also great for creating different representations of one or more piece of data in such a way as to be consumed by multiple clients. Additionally, one of the main strengths of a database is its universality: its data and services are made available to all client applications as long as they can connect and have permissions to query/view data. This is not to take anything away from the middle tier application where one can implement abstracted data manipulation and publication via web services; but this article is about the processing and representation of data within the database (data tier). The Main Objects: Paths, Pits, Ports, Lids and Ducts.This article is about how a pit and and its ports are spatially represented in a Duct and Fibre database that holds communications assets for a customer. Our main exposure to telecommunications assets is simply the fact that we walk over them every day in the pavements of our cities. We know that some sort of pipes, wires and other “secret business” resides below each lid. If you look more closely inside the pit you will see that the cables enter and leave the pit via holes in the walls (or floor) called ports which connect the pit to ducts (eg PVC or galvanized pipes) that carry the cable. Pits generally come in standard sizes; they don’t have to be square or rectangular, they can be round. The answer before the description For those of us too busy to read detailed descriptions, the following pictures shows how we represent a pit and its ports through a construct called a Butterfly. The images have been captured using the new pgAdmin 4.x’s spatial viewer and also qGIS.
If you want to know how we create this object, keep reading. Database Objects The only linear object (LineString) in the database is a path which can be thought of as a trench into which all manner of assets are buried. Pits A pit is an in-ground container for accessing fibre optic cables and other assets. 1. A (topological node) point on a path line (the gray line in the image above) defining the centre of the pit (the light blue point in the image above); Lids Lids are just that: the lids covering a pit which we walk on without thinking! Ducts Ducts can be thought of as PVC pipes that cables run though when in the ground. Ports Ports are the entry point of ducts (and hence cables) into pits. Ports are not hard spatial objects involved in a physical spatial topology with ducts and other ports. This is done as follows. The ports in the walls of the pits are defined via linear referencing principles:
Visualisation The pit polygon is drawn (from hard geometry in Pit table): see black line in the image below. Port LRS observations are used in a Materialized View to create visualisation objects (squares/circles). The flaps are created separately and dynamically using the pit metadata (width/depth/length) and exposed to applications via another Materialized View. The result is as follows: I hope this is of interest to someone. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]()
![]() Article Navigation: Previous |
Comment