Project

General

Profile

« Previous | Next » 

Revision 4753

schemas/vegbien.sql: Added units suffix to all core VegBIEN fields that have units. It is the responsibility of the mappings to ensure that all units are properly translated.

View differences:

vegbien.sql
485 485
    authorlocationcode text,
486 486
    confidentialitystatus integer DEFAULT 0 NOT NULL,
487 487
    confidentialityreason text,
488
    sublocationxposition double precision,
489
    sublocationyposition double precision,
488
    sublocationxposition_m double precision,
489
    sublocationyposition_m double precision,
490 490
    authorzone text,
491 491
    authordatum text,
492 492
    authorlocation text,
493 493
    locationnarrative text,
494 494
    azimuth double precision,
495 495
    shape text,
496
    area double precision,
496
    area_m2 double precision,
497 497
    standsize text,
498 498
    placementmethod text,
499 499
    permanence boolean,
500 500
    layoutnarrative text,
501
    elevation double precision,
502
    elevationaccuracy double precision,
503
    elevationrange double precision,
504
    slopeaspect double precision,
505
    minslopeaspect double precision,
506
    maxslopeaspect double precision,
507
    slopegradient double precision,
508
    minslopegradient double precision,
509
    maxslopegradient double precision,
501
    elevation_m double precision,
502
    elevationaccuracy_m double precision,
503
    elevationrange_m double precision,
504
    slopeaspect_deg double precision,
505
    minslopeaspect_deg double precision,
506
    maxslopeaspect_deg double precision,
507
    slopegradient_frac double precision,
508
    minslopegradient_frac double precision,
509
    maxslopegradient_frac double precision,
510 510
    topoposition text,
511 511
    landform text,
512 512
    surficialdeposits text,
......
538 538
CREATE TABLE locationcoords (
539 539
    locationcoords_id integer NOT NULL,
540 540
    location_id integer NOT NULL,
541
    latitude double precision,
542
    longitude double precision,
541
    latitude_deg double precision,
542
    longitude_deg double precision,
543 543
    verbatimlatitude text,
544 544
    verbatimlongitude text,
545 545
    verbatimcoordinates text,
546 546
    footprintgeometry_dwc text,
547
    coordsaccuracy double precision,
547
    coordsaccuracy_deg double precision,
548 548
    identifier_id integer,
549 549
    determinationdate timestamp with time zone,
550 550
    isoriginal boolean DEFAULT false NOT NULL,
......
561 561

  
562 562

  
563 563
--
564
-- Name: COLUMN locationcoords.coordsaccuracy; Type: COMMENT; Schema: public; Owner: -
564
-- Name: COLUMN locationcoords.coordsaccuracy_deg; Type: COMMENT; Schema: public; Owner: -
565 565
--
566 566

  
567
COMMENT ON COLUMN locationcoords.coordsaccuracy IS 'Accuracy of latitude/longitude or footprint geometry, in meters. This should generally be at least 1 m, which is the accuracy of the best GPSes.';
567
COMMENT ON COLUMN locationcoords.coordsaccuracy_deg IS 'Accuracy of latitude/longitude or footprint geometry, in meters. This should generally be at least 1 m, which is the accuracy of the best GPSes.';
568 568

  
569 569

  
570 570
--
......
582 582
    previous_id integer,
583 583
    dateaccuracy text,
584 584
    method_id integer,
585
    temperature double precision,
586
    precipitation double precision,
585
    temperature_c double precision,
586
    precipitation_m double precision,
587 587
    autotaxoncover boolean,
588 588
    originaldata text,
589 589
    effortlevel text,
......
602 602
    soilmoistureregime text,
603 603
    soildrainage text,
604 604
    watersalinity text,
605
    waterdepth double precision,
605
    waterdepth_m double precision,
606 606
    shoredistance double precision,
607 607
    soildepth double precision,
608 608
    organicdepth double precision,
......
952 952
    datasource_id integer NOT NULL,
953 953
    sourceaccessioncode text,
954 954
    aggregateoccurrence_id integer NOT NULL,
955
    overallheight double precision,
956
    overallheightaccuracy double precision,
955
    overallheight_m double precision,
956
    overallheightaccuracy_m double precision,
957 957
    collectionnumber text,
958 958
    stemcount integer,
959 959
    plant_id integer,
......
1142 1142
--
1143 1143

  
1144 1144
CREATE VIEW analytical_db_view AS
1145
    SELECT datasource.organizationname AS "dataSourceName", taxonpath.family, taxonpath.genus, taxonpath.species, COALESCE(taxonpath.scientificnamewithauthor, taxonpath.scientificname) AS taxon, taxonpath.scientificnameauthor AS "taxonAuthor", taxonpath.variety AS "taxonMorphospecies", placepath.country, placepath.stateprovince AS "stateProvince", placepath.county AS "countyParish", taxonoccurrence.verbatimcollectorname AS collector, plantobservation.collectionnumber AS "collectionNumber", array_to_string(ARRAY[identifiedby.givenname, identifiedby.middlename, identifiedby.surname], ' '::text) AS "identifiedBy", aggregateoccurrence.collectiondate AS "observationDate", location.authorlocationcode AS "plotCode", location.area AS "plotAreaHa", method.name AS "plotMethod", locationcoords.latitude, locationcoords.longitude, location.elevation AS elevation_m, taxonoccurrence.iscultivated AS "isCultivated", taxonoccurrence.cultivatedbasis AS "isCultivatedReason", aggregateoccurrence.cover AS "pctCover" FROM (((((((((((((location JOIN party datasource ON (((datasource.party_id = location.datasource_id) AND (datasource.organizationname IS NOT NULL)))) LEFT JOIN locationcoords USING (location_id)) LEFT JOIN locationplace USING (location_id)) LEFT JOIN placepath USING (placepath_id)) JOIN locationevent USING (location_id)) LEFT JOIN method USING (method_id)) JOIN taxonoccurrence USING (locationevent_id)) JOIN taxondetermination USING (taxonoccurrence_id)) LEFT JOIN party identifiedby ON ((identifiedby.party_id = taxondetermination.party_id))) JOIN taxonpath USING (taxonpath_id)) LEFT JOIN aggregateoccurrence USING (taxonoccurrence_id)) LEFT JOIN plantobservation USING (aggregateoccurrence_id)) LEFT JOIN specimenreplicate USING (plantobservation_id));
1145
    SELECT datasource.organizationname AS "dataSourceName", taxonpath.family, taxonpath.genus, taxonpath.species, COALESCE(taxonpath.scientificnamewithauthor, taxonpath.scientificname) AS taxon, taxonpath.scientificnameauthor AS "taxonAuthor", taxonpath.variety AS "taxonMorphospecies", placepath.country, placepath.stateprovince AS "stateProvince", placepath.county AS "countyParish", taxonoccurrence.verbatimcollectorname AS collector, plantobservation.collectionnumber AS "collectionNumber", array_to_string(ARRAY[identifiedby.givenname, identifiedby.middlename, identifiedby.surname], ' '::text) AS "identifiedBy", aggregateoccurrence.collectiondate AS "observationDate", location.authorlocationcode AS "plotCode", location.area_m2 AS "plotAreaHa", method.name AS "plotMethod", locationcoords.latitude_deg AS latitude, locationcoords.longitude_deg AS longitude, location.elevation_m, taxonoccurrence.iscultivated AS "isCultivated", taxonoccurrence.cultivatedbasis AS "isCultivatedReason", aggregateoccurrence.cover AS "pctCover" FROM (((((((((((((location JOIN party datasource ON (((datasource.party_id = location.datasource_id) AND (datasource.organizationname IS NOT NULL)))) LEFT JOIN locationcoords USING (location_id)) LEFT JOIN locationplace USING (location_id)) LEFT JOIN placepath USING (placepath_id)) JOIN locationevent USING (location_id)) LEFT JOIN method USING (method_id)) JOIN taxonoccurrence USING (locationevent_id)) JOIN taxondetermination USING (taxonoccurrence_id)) LEFT JOIN party identifiedby ON ((identifiedby.party_id = taxondetermination.party_id))) JOIN taxonpath USING (taxonpath_id)) LEFT JOIN aggregateoccurrence USING (taxonoccurrence_id)) LEFT JOIN plantobservation USING (aggregateoccurrence_id)) LEFT JOIN specimenreplicate USING (plantobservation_id));
1146 1146

  
1147 1147

  
1148 1148
--
......
2800 2800
    sourceaccessioncode text,
2801 2801
    plantobservation_id integer NOT NULL,
2802 2802
    authorstemcode text,
2803
    xposition double precision,
2804
    yposition double precision,
2805
    diameterbreastheight double precision,
2806
    basaldiameter double precision,
2807
    diameteraccuracy double precision,
2808
    height double precision,
2809
    heightfirstbranch double precision,
2810
    heightaccuracy double precision,
2803
    xposition_m double precision,
2804
    yposition_m double precision,
2805
    diameterbreastheight_m double precision,
2806
    basaldiameter_m double precision,
2807
    diameteraccuracy_m double precision,
2808
    height_m double precision,
2809
    heightfirstbranch_m double precision,
2810
    heightaccuracy_m double precision,
2811 2811
    health text,
2812 2812
    age double precision,
2813 2813
    accessioncode text
......
4368 4368
-- Name: location_unique_within_parent; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4369 4369
--
4370 4370

  
4371
CREATE UNIQUE INDEX location_unique_within_parent ON location USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(authorlocationcode, '\\N'::text)), (COALESCE(sublocationxposition, 'NaN'::double precision)), (COALESCE(sublocationyposition, 'NaN'::double precision))) WHERE ((parent_id IS NOT NULL) AND (sourceaccessioncode IS NULL));
4371
CREATE UNIQUE INDEX location_unique_within_parent ON location USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(authorlocationcode, '\\N'::text)), (COALESCE(sublocationxposition_m, 'NaN'::double precision)), (COALESCE(sublocationyposition_m, 'NaN'::double precision))) WHERE ((parent_id IS NOT NULL) AND (sourceaccessioncode IS NULL));
4372 4372

  
4373 4373

  
4374 4374
--

Also available in: Unified diff