Overview of Views

Overview of Views

Summary: 

This article covers the concept of Hub Views and how they relate to the source table of data. 
If you are not familiar with Postgres views, then we would recommend having a read of this article, but as part of the Hub implementation we will work with customers to populate Channel views. Don't panic! 

What is a Hub Channel View?

In our overview article on Hub you would have seen the basic concept of the Hub architecture. Demonstrating where data from Postgres is passed into an API and displayed on the Hub page. 

Channel Views are a means to craft a source table, such as Planning Applications, into a neater and more content rich form of that data. Views allow users to construct a table of data that could join various columns from a source table together into a single column, or being in multiple tables of data together, into a single table. 


Example View

The below is an example view as a SQL statement for the Planning Application Channel, and is based on the source data coming from IDOX Development Control. In this instance the source tables is called development_control_polygons in a schema called datastore_uniform. 

  1. CREATE OR REPLACE VIEW gx_hub.planning_apps_latest_view AS

  2. SELECT refval AS pln_refval,

  3. keyval AS pln_keyval,

  4. regexp_replace(address::text, '[\n\r]+'::text, ' '::text, 'g'::text) AS pln_address,

  5. regexp_replace(description::text, '[\n\r]+'::text, ' '::text, 'g'::text) AS pln_proposal,

  6. concat('https://mappington-dc/online-applications/applicationDetails.do?keyVal=', keyval, '&activeTab=summary') AS pln_link,

  7. concat(' Reference number ', refval, ' is the application number. ') AS pln_additional,

  8. geom

  9. FROM datastore_uniform.development_control_polygons a

  10. WHERE datemodified >= (now() - '40 days'::interval);







    • Related Articles

    • Hub Overview

      Hub is a fully hosted web application that gives residents access to property specific information, access to download Open-Data and the ability to find interactive maps quickly. Fully responsive and accessibility compliant, Hub is built on the ...
    • Creating Hub Maps links

      Populating the Source table: To published a new link on the Hub Maps page you need to update the gx_hub.open_maps source table. There are various ways to do this either through Dbeaver, PG-Admin or QGIS. Please contact your Account Manager to discuss ...
    • Creating Hub Open Data feeds

      Populating the Source table: To published a new Open-Data set to the Hub Open-Data pages you need to update the gx_hub.open_data source table. There are various ways to do this either through Dbeaver, PG-Admin or QGIS. Please contact your Account ...
    • Details of change

      August 2024: Hub webpages: Greater ability to customise Headings and Sub-Headings Ability to customise breadcrumbs and Quick Links Hub Channels: Addition of TPO, Heritage and Environment Channels Hub APIs: Addition of new APIs for TPO (TPO channel), ...
    • Before you begin

      Prerequisites: Postgres/PostGIS: For customers to use Hub they are required to have a PostGIS (PG) instance, running at a minimum of version 16. If a customer is hosting the PG instance themselves then Geoxphere will require additional admin rights ...