Skip to content

Commit df139a9

Browse files
authored
Additional pipelines geocodeConfig, vocabularies and location configuration (#591)
* Additional geocodeConfig variables * Added download of vocabularies and configuration. Customization of stateProvinces centroids * Added tag
1 parent 077be9d commit df139a9

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

ansible/roles/pipelines/tasks/main.yml

+40
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
tags:
147147
- pipelines
148148
- la-pipelines
149+
- la-pipelines-apt
149150
- apt
150151

151152
- name: Install pipelines config
@@ -362,6 +363,45 @@
362363
- hadoop
363364
- hadoop_dir
364365

366+
- name: Get Gbif API vocabularies
367+
run_once: true
368+
uri:
369+
url: "http://api.gbif.org/v1/vocabularies/{{ item }}/releases/latest/export"
370+
dest: /tmp/{{ item }}.json
371+
with_items:
372+
- LifeStage
373+
- DegreeOfEstablishment
374+
- EstablishmentMeans
375+
- Pathway
376+
tags:
377+
- pipelines
378+
- hadoop
379+
- hadoop_vocab
380+
381+
- name: Copy Gbif API vocabularies to dfs
382+
run_once: true
383+
shell: "{{ hadoop_install_dir }}/bin/hdfs dfs -copyFromLocal -f /tmp/{{ item }}.json /pipelines-vocabularies/ "
384+
with_items:
385+
- LifeStage
386+
- DegreeOfEstablishment
387+
- EstablishmentMeans
388+
- Pathway
389+
become_user: "{{ hadoop.user }}"
390+
tags:
391+
- pipelines
392+
- hadoop
393+
- hadoop_vocab
394+
395+
- name: Copy state/province vocab
396+
copy: src={{ item.src }} dest={{ data_dir }}/la-pipelines/config/{{ item.dest }} mode=0644
397+
with_items:
398+
- { src: "{{ state_province_centre_points_file }}", dest: stateProvinceCentrePoints.txt }
399+
when: state_province_centre_points_file is defined
400+
tags:
401+
- pipelines
402+
- hadoop
403+
- hadoop_vocab
404+
365405
- name: Download SHP files (includes global layer and EEZ derived from GBIFs geocode DB)
366406
get_url:
367407
url: "{{ pipelines_shapefiles_url | default('https://pipelines-shp.s3-ap-southeast-2.amazonaws.com/pipelines-shapefiles.zip') }}"

ansible/roles/pipelines/templates/la-pipelines-local.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,22 @@ speciesListService:
3434

3535
geocodeConfig:
3636
country:
37+
path: {{ data_dir }}/pipelines-shp/{{ geocode_country_layer | default('political') }}
38+
field: {{ geocode_country_field | default('ISO_A2') }}
3739
intersectMapping:
3840
CX: {{geocode_region | default('AU')}}
3941
CC: {{geocode_region | default('AU')}}
4042
HM: {{geocode_region | default('AU')}}
4143
NF: {{geocode_region | default('AU')}}
4244
stateProvince:
4345
path: /data/pipelines-shp/{{ geocode_state_province_layer | default('cw_state_poly') }}
46+
field: {{ geocode_state_province_field | default('FEATURE') }}
4447

48+
{% if state_province_centre_points_file is defined %}
49+
locationInfoConfig:
50+
stateProvinceCentrePointsFile : {{ data_dir }}/la-pipelines/config/stateProvinceCentrePoints.txt
51+
52+
{% endif %}
4553
gbifConfig:
4654
vocabularyConfig:
4755
vocabulariesPath: hdfs://{{ hadoop_master }}:{{ hadoop_port }}{{ vocabulary_dir }}

0 commit comments

Comments
 (0)