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.my.sql
233 233
    authorlocationcode text,
234 234
    confidentialitystatus int(11) DEFAULT 0 NOT NULL,
235 235
    confidentialityreason text,
236
    sublocationxposition double precision,
237
    sublocationyposition double precision,
236
    sublocationxposition_m double precision,
237
    sublocationyposition_m double precision,
238 238
    authorzone text,
239 239
    authordatum text,
240 240
    authorlocation text,
241 241
    locationnarrative text,
242 242
    azimuth double precision,
243 243
    shape text,
244
    area double precision,
244
    area_m2 double precision,
245 245
    standsize text,
246 246
    placementmethod text,
247 247
    permanence int(1),
248 248
    layoutnarrative text,
249
    elevation double precision,
250
    elevationaccuracy double precision,
251
    elevationrange double precision,
252
    slopeaspect double precision,
253
    minslopeaspect double precision,
254
    maxslopeaspect double precision,
255
    slopegradient double precision,
256
    minslopegradient double precision,
257
    maxslopegradient double precision,
249
    elevation_m double precision,
250
    elevationaccuracy_m double precision,
251
    elevationrange_m double precision,
252
    slopeaspect_deg double precision,
253
    minslopeaspect_deg double precision,
254
    maxslopeaspect_deg double precision,
255
    slopegradient_frac double precision,
256
    minslopegradient_frac double precision,
257
    maxslopegradient_frac double precision,
258 258
    topoposition text,
259 259
    landform text,
260 260
    surficialdeposits text,
......
285 285
CREATE TABLE locationcoords (
286 286
    locationcoords_id int(11) NOT NULL,
287 287
    location_id int(11) NOT NULL,
288
    latitude double precision,
289
    longitude double precision,
288
    latitude_deg double precision,
289
    longitude_deg double precision,
290 290
    verbatimlatitude text,
291 291
    verbatimlongitude text,
292 292
    verbatimcoordinates text,
293 293
    footprintgeometry_dwc text,
294
    coordsaccuracy double precision,
294
    coordsaccuracy_deg double precision,
295 295
    identifier_id int(11),
296 296
    determinationdate timestamp NULL,
297 297
    isoriginal int(1) DEFAULT false NOT NULL,
......
308 308

  
309 309

  
310 310
--
311
-- Name: COLUMN locationcoords.coordsaccuracy; Type: COMMENT; Schema: public; Owner: -
311
-- Name: COLUMN locationcoords.coordsaccuracy_deg; Type: COMMENT; Schema: public; Owner: -
312 312
--
313 313

  
314 314

  
......
329 329
    previous_id int(11),
330 330
    dateaccuracy text,
331 331
    method_id int(11),
332
    temperature double precision,
333
    precipitation double precision,
332
    temperature_c double precision,
333
    precipitation_m double precision,
334 334
    autotaxoncover int(1),
335 335
    originaldata text,
336 336
    effortlevel text,
......
349 349
    soilmoistureregime text,
350 350
    soildrainage text,
351 351
    watersalinity text,
352
    waterdepth double precision,
352
    waterdepth_m double precision,
353 353
    shoredistance double precision,
354 354
    soildepth double precision,
355 355
    organicdepth double precision,
......
673 673
    datasource_id int(11) NOT NULL,
674 674
    sourceaccessioncode text,
675 675
    aggregateoccurrence_id int(11) NOT NULL,
676
    overallheight double precision,
677
    overallheightaccuracy double precision,
676
    overallheight_m double precision,
677
    overallheightaccuracy_m double precision,
678 678
    collectionnumber text,
679 679
    stemcount int(11),
680 680
    plant_id int(11),
......
862 862
--
863 863

  
864 864
CREATE VIEW analytical_db_view AS
865
    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], CAST(' ' AS 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));
865
    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], CAST(' ' AS 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));
866 866

  
867 867

  
868 868
--
......
2278 2278
    sourceaccessioncode text,
2279 2279
    plantobservation_id int(11) NOT NULL,
2280 2280
    authorstemcode text,
2281
    xposition double precision,
2282
    yposition double precision,
2283
    diameterbreastheight double precision,
2284
    basaldiameter double precision,
2285
    diameteraccuracy double precision,
2286
    height double precision,
2287
    heightfirstbranch double precision,
2288
    heightaccuracy double precision,
2281
    xposition_m double precision,
2282
    yposition_m double precision,
2283
    diameterbreastheight_m double precision,
2284
    basaldiameter_m double precision,
2285
    diameteraccuracy_m double precision,
2286
    height_m double precision,
2287
    heightfirstbranch_m double precision,
2288
    heightaccuracy_m double precision,
2289 2289
    health text,
2290 2290
    age double precision,
2291 2291
    accessioncode text

Also available in: Unified diff