How to do it...

In the preceding recipe, we created temporary tables to store original data, as well as tables containing MaPIR information to be queried later by users. The following steps allow other users to access those tables:

  1. First, create the table supermarkets to store the information extracted from the dataset, and the table supermarkets_mapir to store the MaPIR-related information for each supermarket register. Execute the following command:
      CREATE TABLE chp12.supermarkets (        sup_id serial,        the_geom geometry(Point,4326),        latitude numeric,        longitude numeric,        PRIMARY KEY (sup_id)      );      CREATE TABLE chp12.supermarkets_mapir (        sup_id int REFERENCES chp12.supermarkets (sup_id),        cellid int,        levelid int      );
  1. Now, create a trigger function ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.