make_shapefile: The main funtion in order to retrieve the data from the iffi

Description Usage Arguments Value Examples

View source: R/make_shapefile.R

Description

Generate a shapefile from a given spatial data-object and attributes as produced by a query on the iffi database

Usage

1
2
3
4
5
6
7
8
make_shapefile(
  database_dir = NULL,
  attribute_database_name = "tbl_frane",
  dictionary_database_name = "diz_frane",
  shapefile = NULL,
  attri = NULL,
  joins = NULL
)

Arguments

database_dir

Path to the directory of the databases

attribute_database_name

Name without extension of the attributes database

dictionary_database_name

Name without extension of the dictionary database

shapefile

A shape that contains the iffi_kodex in a column called PIFF_ID

attri

A vector of attributes to query directly from the attributes database

join

A named list of the tables that need to be joined in order to get the desciptions from the dictionary

Value

An sf-oject

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 
database_dir = "data/database/",
attribute_database_name = "tbl_frane",
dictionary_database_name = "diz_frane",
shapefile = "data/Shapefiles/IFFI10_5.shp",
attri = c(
  "anno_min",
  "anno_max",
  "mese_min",
  "mese_max",
  "giorno_min",
  "giorno_max"
),
joins = list(
  "tbl_frane.Geologia.litologia" = c(
     "diz_frane.diz_litologie.litologia",
     "diz_frane.diz_litologie.nome_litologia"
  ),

  "tbl_frane.clas_ii_liv.movimento" = c(
     "diz_frane.diz_movimenti.movimento",
     "diz_frane.diz_movimenti.nome_movimento"
  ),
  "tbl_frane.Uso_Suolo.uso_suolo" = c(
     "diz_frane.diz_usi_suolo.uso_suolo",
     "diz_frane.diz_usi_suolo.nome_uso_suolo"
  )
),
plot = FALSE
)

## End(Not run)

RobinKohrs/iffitoR documentation built on Sept. 7, 2021, 11:31 p.m.