The folder `code` contains RStidio project to process Twitter messages, extract
hashtags and filter them. Resulting hashtag list for every event is saved into
the folder `result`.

Two files from the `classification` project are used:

* model.final.rds
* vocabulary.rds

They should be placed into the subfolder `code/saved`.


Twitter messages are not distributed with this project, because of their big
size (about 40 Gb per month). These files can be freely downloaded from the
"Archive Team" website:

* https://archive.org/details/archiveteam-twitter-stream-2013-10
* https://archive.org/details/archiveteam-twitter-stream-2013-11

Script in the folder `import` was used to extract English messages and import
them into PostgreSQL database. The expected database structure is:

CREATE TABLE tweets (
  tweet_id   bigint NOT NULL,
  created_at timestamp with time zone,
  geom       geography(Point,4326),
  hashtags   text[],
  message    text,
  CONSTRAINT tweets_pkey PRIMARY KEY (tweet_id)
)


Disaster database should contain "GEOMETRY" field. For easy reproduction of the
research, requests were replaced by values (see `02_disasters.csv` file).


For example, cyclone database IBTrACS, should be prepared the next way:

* download data in Shapefile format (Points):
  https://www.ncdc.noaa.gov/ibtracs/index.php?name=ibtracs-data
* import file into PostgreSQL, using `shp2pgsql-gui` tool.
* build 34-knot buffer (see file `import/ibtracs.sql`)

