Read the content of geopackage files
The Evasuite allows for calculation of different statistics in different subregions. The shape of this subregions is treated by the Evasuite using so-called geopackage files which is an extension of the former known shape files. If you want to execute the Evasuite, you need to specify a geopackage file and the ID of the attribute used to identify the names of the shapes. Both settings are done in the general configuration (an automatic process within the SPICE installation).
One can start with the geopackage file received with the installation of SPICE. It is located in ${SPDIR/src/eva-suite/geodata/EvaSuite_PRUDENCE.gpkg
. Type the following
evasuite --showpolygons ${geopackage-file}
to receive a list of the content. Please investigate the header of the table shown and identify the attribute name for the region names (which is 'NAME_0' in case of the SPICE geopackage). To get the whole list of regions stored in the geopackage file type
evasuite --showpolygons ${geopackage-file} NAME_0
The output gives you exactly the regions which can be handled by the EvaSuite using the SPICE geopackage file. This subregions have to be specified in the eva-suite_settings under the option SUBREGIONS
.
If you want to handle more regions, you need to extend the geopackage file.
Implementation of user-specified subregions
There are two possibilities to extend the geopackage file delivered with SPICE.
A) Add subregions using another geopackage file
This can be done using the following syntax
evasuite --addpolygondb ${newgeopackage} ${newattrib} ${newregionnames} ${oldgeopackage} ${oldattrib} ${result}
The old geopackage file oldgepackage
with regions stored under the attribute oldattrib
is extended by the content of the new geopackage file newgeopackage
. With respect to the content of the new geopackage file, one has to specify the attribute newattrib
and the values of the attribute newregionnames
, which are simply the names of the regions stored in the new geopackage file. You can specify a single string or a list of strings separated by a comma. The final file is stored in result
and the final attribute is the same as oldattrib
.
After successful execution of the command above, you get a list of all polygons stored in the result
file. The names can then be used as subregions in the eva-suite_settings.
B) Add subregions using a simple ascii file
One can also extend the already existing geopackage file by polygons stored in the so-called wkt-format. This format is suggested if only rectangular polygons or other simply polygons has to be implemented. The wkt format reads like this (PRUDENCE regions):
ID;NAME_0;geometry
1;P_Alps;POLYGON ((5 44, 5 48, 15 48, 15 44, 5 44))
2;P_BritishIslands;POLYGON ((-10.0 50.0, -10.0 59.0, 2.0 59.0, 2.0 50.0, -10.0 50.0 ))
3;P_East-Europe;POLYGON (( 16 44, 16 55, 30 55, 30 44, 16 44 ))
4;P_France;POLYGON (( -5 44, -5 50, 5 50, 5 44, -5 44 ))
5;P_IberianPeninsula;POLYGON (( -10 36, -10 44, 3 44, 3 36, -10 36 ))
6;P_Mediterranean;POLYGON (( 3 36, 3 44, 25 44, 25 36, 3 36 ))
7;P_Mid-Europe;POLYGON (( 2 48, 2 55, 16 55, 16 48, 2 48 ))
8;P_Scandinavia;POLYGON (( 5 55, 5 70, 30 70, 30 55, 5 55 ))
9;P_North-West-Africa;POLYGON (( -10 30, -10 37, 15 37, 15 30, -10 30 ))
It is mandatory to specify an ID, a name for the region and the geometry, which is a comma-seperated list of coordinates of points. The coordinates are given as longitude and latitude in the WGS84 system. The command POLYGON((
indicates the beginning of a polygon definition, which has to be finalized with ))
.
So, you can extend the standard geopackage file by the polygons defined in a user-specified wkt-file using the following syntax
evasuite --addpolygonascii ${newwktfile} ${newattrib} ${oldgeopackage} ${oldattrib} ${result}
It is the nearly the same procedure as for case A), but the final file is extended by ALL regions stored in newwktfile
under the attribute newattrib
.
After successful execution of the command above, you get a list of all polygons stored in the result
file. The names can then be used as subregions in the eva-suite_settings.