1. 1. Introduction
    1. 1.1 OGC Standards
      1. Introduction to OGC
      1. 1.1.1 Web Mapping Service
        1. Introduction to WMS
        2. WMS Examples
      1. 1.1.2 Web Feature Service
        1. Introduction to WFS
        2. WFS Examples
      1. 1.1.3 Web Coverage Service
        1. Introduction to WCS
        2. WCS Examples
      1. 1.1.4 Web Processing Service
        1. Introduction to WPS
        2. WPS Examples
    1. 1.2 CAAML
      1. Introduction to CAAML
    1. 1.3 INSPIRE
      1. Introduction to INSPIRE
  1. 2. Standards in action
    1. 2.1 Prepare data and toolkit
      1. Data and geospatial tools
      2. Start the environment
      1. 2.1.1 Manage the data
        1. Load Data
        2. Clean Data
      1. 2.1.2 Design the CAAML schema
        1. CAAML model design
        2. Populate Region
    1. 2.2 Build CAAML with GeoAvalanche
      1. Configure the application schema for CAAML
      2. Push the configuration to GeoAvalanche
      3. Query our Region features
  1. 3. Main Chapter
    1. Lesson Six

Populate Region

Import the records to the caaml_Region table

Given that the schema for a region is defined with a polygon and its center point we are going to use the power of PostGIS spatial functions to create it.

The query to populate the table for the Italian regions from Aineva is the following:

INSERT into public."caaml_Region"(fid, "name", "ID", outline, center_point, "description")
SELECT id, nome, mnz, shape, ST_centroid(shape), nome from public.mnz
# update region_subtype
UPDATE public."caaml_Region" SET region_subtype = 'ForecastRegion'

We have also updated the field region_subtype with the value ForecastRegion which seems to be the default used from EAWS.

Visualize the resultset from PGAdmin4

The tool PGAdmin4 has embedded a geometry visualizer which can be used to have a quick preview of the layer on a map.

Let's run the trivial query for the whole

select * from public."caaml_Region"

and then click on the eye icon of both the geometry columns

outline

outline region

center_point

centerpoint region