REGLISTS

From Agri4castWiki
Jump to: navigation, search


Introduction

REGLISTS is a generic tool, installed as oracle package, to create lists of regions and some details per region. You can design the resulting list using input parameters. These lists are mostly used in other applications. You can also use this tool in a (sql) query.

Interface

To create a list a function needs to be started. With arguments the result can be affected:


Select list1, list2,...
from table(reglists.function(argument 1, argument 2,...))

Lists

Depending on the function a number of lists can be selected as output.

Lists (function 'reg_mappings') Lists (function 'regions') Full attribute name Description
MAP_ID MAP_ID REG_MAP_ID unique region mapping id
MAP_ID_BT MAP_ID_BT REG_MAP_ID_BT relation to REG_MAP_ID
DES_ID DES_ID REG_DES_ID unique region description id
REG_LEVEL REG_LEVEL REG_LEVEL administrative level
REG_CD REG_CD REG_CODE region code
REG_CD_BT BELONGS_TO relation to REG_CODE
REGION REGION region name
ROI_CD ROI_CD ROI_CODE code of region of interest
AREA AREA area in m2
XMIN XMIN left most coordinate of region
XMAX XMAX right most coordinate of region
YMIN YMIN lower most coordinate of region
YMAX YMAX upper most coordinate of region
SHAPE SHAPE reference to shape file
CODE_CHAIN CODE_CHAIN
SID SID

Functions

  • regions
  • reg_mappings

Arguments

  • Argument 1 = Unique region mapping id = REG_MAP_ID
  • Argument 2 = Lowest administrative level = REG_LEVEL
  • Argument 3 = Highest administrative level = REG_LEVEL
  • ....

Examples

Create a list of administrative region codes at level 1 that belong to France

  • Output list = administrative region codes = REG_CD
  • Function = reg_mappings (or regions)
  • France = reg_map_id = 10488
  • Lowest administrative level = REG_LEVEL = 1
  • Highest administrative level = REG_LEVEL = 1

Query:

SELECT REG_CD
FROM TABLE(reglists.reg_mappings (10488, 1, 1))

Result:

FR1        
FR2        
FR3        
FR4        
FR5        
FR6        
FR7        
FR8

Create a list of country codes and reg_map_id's that belong to Europe

  • Output list = reg_code and reg_map_id = REG_CD, MAP_ID
  • Function = reg_mappings (or regions)
  • Europe = reg_map_id = 10470
  • Lowest administrative level = country = REG_LEVEL = 0
  • Highest administrative level = country = REG_LEVEL = 0

Query:

SELECT REG_CD, MAP_ID
FROM TABLE(reglists.regions (10470, 0, 0))

Result:

AD	10487
AT	10518
BE	10490
BG	10519
CH	10480
CY	10499
CZ	10485
DE	10515
DK	10503
EE	10494
ES	10479
FI	10497
FR	10488
GG	10501
GI	10483
GR	10500
HR	10498
HU	10505
IE	10510
IT	10491
JE	10533
LI	10520
LT	10472
LU	10489
LV	10506
MC	10502
MK	10513
MT	10516
NL	10532
NO	10512
PL	10529
PT	10511
RO	10521
SE	10507
SI	10475
SK	10534
SM	10524
TR	10476
UK	10527
10471	10471
10473	10473
10474	10474
10477	10477
10478	10478
10481	10481
10482	10482
10484	10484
10486	10486
10492	10492
10493	10493
10495	10495
10496	10496
10504	10504
10508	10508
10509	10509
10514	10514
10517	10517
10522	10522
10523	10523
10525	10525
10526	10526
10528	10528
10530	10530
10531	10531