Revision 14949
Added by Aaron Marcuse-Kubitza almost 10 years ago
trunk/exports/2015-1-16.Bob_Peet.sPlot.csv.run | ||
---|---|---|
1 |
#!/bin/bash -e |
|
2 |
. "$(dirname "${BASH_SOURCE[0]}")"/../lib/runscripts/extract.run "$@" |
|
3 |
|
|
4 |
# view SQL: |
|
5 |
if false; then : <<'eof' |
|
6 |
CREATE OR REPLACE VIEW "2015-1-16.Bob_Peet.sPlot" AS |
|
7 |
SELECT view_full_occurrence_individual.plot_name AS "PlotName", |
|
8 |
view_full_occurrence_individual.locationevent_id AS "plot GUID", |
|
9 |
_ha_to_m2(view_full_occurrence_individual.plot_area_ha) AS "Plot.Area (m2)", |
|
10 |
view_full_occurrence_individual.latitude AS "decimalLatitude", |
|
11 |
view_full_occurrence_individual.longitude AS "decimalLongitude", |
|
12 |
view_full_occurrence_individual.coord_uncertainty_m AS "coordinateUncertaintyInMeters", |
|
13 |
view_full_occurrence_individual.scrubbed_species_binomial AS "Species name", |
|
14 |
view_full_occurrence_individual.scrubbed_taxon_name_no_author AS "Scrubbed_taxon_name_no_author", |
|
15 |
view_full_occurrence_individual.cover_percent AS "coverPercent", |
|
16 |
view_full_occurrence_individual.event_date AS "EventDate", |
|
17 |
view_full_occurrence_individual.elevation_m AS "ElevationInMeters", |
|
18 |
view_full_occurrence_individual.slope_gradient_deg AS "SlopeGradient", |
|
19 |
view_full_occurrence_individual.slope_aspect_deg AS "SlopeAspect", |
|
20 |
view_full_occurrence_individual.country AS "Country", |
|
21 |
view_full_occurrence_individual.community_concept_name AS "CommunityConcept.Name", |
|
22 |
view_full_occurrence_individual.datasource, |
|
23 |
view_full_occurrence_individual.project_id, |
|
24 |
view_full_occurrence_individual.project_contributors |
|
25 |
FROM view_full_occurrence_individual |
|
26 |
WHERE (view_full_occurrence_individual.datasource = ANY ('{CVS,SALVIAS,VegBank}'::text[])) AND COALESCE(view_full_occurrence_individual.is_geovalid::boolean, true) AND NOT COALESCE(view_full_occurrence_individual.is_cultivated::boolean, false); |
|
27 |
GRANT SELECT ON TABLE "2015-1-16.Bob_Peet.sPlot" TO bien_read; |
|
28 |
eof |
|
29 |
fi |
|
0 | 30 |
Also available in: Unified diff
added exports/2015-1-16.Bob_Peet.sPlot.csv.run, plus view SQL because exporting the schema is not possible on a DB with data in it (due to the presence of constant tables whose contents need to be exported, while the data tables need to be empty)