Theil-Sen estimated median change in rain normalised soil moisture 2001-2016, Indonesia

Map: Theil-Sen estimated median change in rain normalised soil moisture 2001-2016, Indonesia

Projection system setup:
Part 2 setup_processes

Introduction

When you work with Karttur’s GeoImagine Framework you must have a predefined geographic region linking to an also predefined projection system. In the previous post you updated the Framework postgres database to include the projection system “sweref” (the Swedish national grid). The definition, however, only included the name and EPSG code of the projection. Plus a database schema with empty tables where all the spatial data belonging to this system will be registered. In this post you will run three different Framework processes for completing the definition of the projection system, add a default region and a user project based on the new projection system:

  • DefineCustomSystem [for defining the boundary and tiling of the new projection system]
  • DefaultRegionFromCoords [for defining a default region that exactly matches the system boundary]
  • ManageDefRegProj [for defining a user project and tract that matches the default region and system boundary]

The three processes are accessible from the Framework module setup_processes.

Prerequisites

You must have updated the database to include the projection system as prescribed in the previous post.

Process chain

The Framework processes that are required for preparing the new projection system are compiled in the command file sweref_setup_20220122.txt:

\## Define the SWEREF tile/project systems
sweref_system-define_v090.json

\## Define SWEREF default region
sweref_defaultregion_v090.json

\## Define SWEREF user project
sweref_user+project_v090.json

DefineCustomSystem

The Framework process DefineCustomSystem defines the boundary and tiling of a projection system. For the Swedish national projection grid, SWEREF99, I defined the boundary and tiling following the default map sheet system (see post on accessing open data from Lantmäteriet, the Swedish mapping, cadastral and land registration authority): sweref_system-define_v090.json.

Boundary of the sweref projection system compared with Sweden national terrestrial and maritime boundaries.

DefaultRegionFromCoords

To access the complete region covered by the projection system (sweref) I added a default region, also called sweref, that exactly matches the boundaries of the projection system. The default region is defined using the same projection (EPSG) as the system: sweref_defaultregion_v090.json

When registered in the database the geographic corners in longitude and latitude are automatically calculated and added. You can inspect the new default region directly in the postgres database with the query:

SELECT * FROM system.regions WHERE regionid='sweref';

ManageDefRegProj

To access the new projection system and its default region a Framework user must create a project that includes a tract that is defined from the default region (sweref in this example). I defined the new project using the system default user, karttur, and then called the new project karttur-sweref. Then I also called the new tract karttur-sweref: sweref_user+project_v090.json.

If you want to check out that the project was added to the database, use the query:

SELECT * FROM userlocale.userprojects WHERE projid = 'karttur-sweref';

And to check out the tract:

SELECT * FROM regions.tracts WHERE tractid = 'karttur-sweref';

Get national boundary

In the example used in this post a national projection/grid system is defined (for Sweden). All nations, and their boundaries, are included in a default dataset in Karttur’s GeoImagine Framework. You can thus get the boundary for any country and for any projection by using the Framework process ReprojectDefaultRegionProjSys.

Next step

The new projection system (sweref) is now defined, but you must also update the Postgres database to allow the Framework processes to access the new projection system datasets, the topic of the next post.