1 |
14949
|
aaronmk
|
#!/bin/bash -e
|
2 |
|
|
. "$(dirname "${BASH_SOURCE[0]}")"/../lib/runscripts/extract.run "$@"
|
3 |
|
|
|
4 |
14950
|
aaronmk
|
# runtime: 1:10 min ("69m6.944s") @r14827 @vegbiendev
|
5 |
|
|
|
6 |
|
|
# export_only() runtime: 1:10 min ("68m31.489s") @r14827 @vegbiendev
|
7 |
|
|
|
8 |
|
|
# rowcount: 2 million observations (`wc -l`:1814106)
|
9 |
|
|
|
10 |
14949
|
aaronmk
|
# view SQL:
|
11 |
|
|
if false; then : <<'eof'
|
12 |
|
|
CREATE OR REPLACE VIEW "2015-1-16.Bob_Peet.sPlot" AS
|
13 |
|
|
SELECT view_full_occurrence_individual.plot_name AS "PlotName",
|
14 |
|
|
view_full_occurrence_individual.locationevent_id AS "plot GUID",
|
15 |
|
|
_ha_to_m2(view_full_occurrence_individual.plot_area_ha) AS "Plot.Area (m2)",
|
16 |
|
|
view_full_occurrence_individual.latitude AS "decimalLatitude",
|
17 |
|
|
view_full_occurrence_individual.longitude AS "decimalLongitude",
|
18 |
|
|
view_full_occurrence_individual.coord_uncertainty_m AS "coordinateUncertaintyInMeters",
|
19 |
|
|
view_full_occurrence_individual.scrubbed_species_binomial AS "Species name",
|
20 |
|
|
view_full_occurrence_individual.scrubbed_taxon_name_no_author AS "Scrubbed_taxon_name_no_author",
|
21 |
|
|
view_full_occurrence_individual.cover_percent AS "coverPercent",
|
22 |
|
|
view_full_occurrence_individual.event_date AS "EventDate",
|
23 |
|
|
view_full_occurrence_individual.elevation_m AS "ElevationInMeters",
|
24 |
|
|
view_full_occurrence_individual.slope_gradient_deg AS "SlopeGradient",
|
25 |
|
|
view_full_occurrence_individual.slope_aspect_deg AS "SlopeAspect",
|
26 |
|
|
view_full_occurrence_individual.country AS "Country",
|
27 |
|
|
view_full_occurrence_individual.community_concept_name AS "CommunityConcept.Name",
|
28 |
|
|
view_full_occurrence_individual.datasource,
|
29 |
|
|
view_full_occurrence_individual.project_id,
|
30 |
|
|
view_full_occurrence_individual.project_contributors
|
31 |
|
|
FROM view_full_occurrence_individual
|
32 |
|
|
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);
|
33 |
|
|
GRANT SELECT ON TABLE "2015-1-16.Bob_Peet.sPlot" TO bien_read;
|
34 |
|
|
eof
|
35 |
|
|
fi
|