dbca-wa / wastdr

An R Client for the WA Sea Turtles and Strandings Database WAStD
https://dbca-wa.github.io/wastdr/
Other
3 stars 0 forks source link

Map odkc_data$mwi and related tables to AnimalEncounters and related Observations #16

Closed florianm closed 4 years ago

florianm commented 4 years ago

AnimalEncounter

https://tsc.dbca.wa.gov.au/api/1/animal-encounters/

Source odkc$mwi

"id" > source_id               

incident time: 
"incident_incident_time" > if set, use this, else use
"observation_start_time"

"reporter" > map to user_mapping

meta:
"device_id" > add to comments
"observation_end_time" > add to comments
"system_submission_date" > add to comments
"system_submitter_id" > add to comments
"system_submitter_name" > add to comments
"meta_instance_id" > add to comments

location: 
"incident_observed_at_accuracy" > GPS accuracy metres
"incident_observed_at"
"incident_observed_at_manual_accuracy" > acc
"incident_observed_at_manual"

"incident_location_comment" > add to comments

"incident_habitat"     

"details_taxon"                                
"details_species"
"details_maturity"
"details_sex"                                  
"status_activity"
"status_health"
"status_behaviour"                             
"death_cause_of_death"
"death_cause_of_death_confidence"
"checks_checked_for_injuries"                  
"checks_scanned_for_pit_tags"
"checks_checked_for_flipper_tags"
"checks_samples_taken"                         
"animal_fate_animal_fate_comment" > add to comments

Target

"comments": null,
"latitude": -20.61337,
"longitude": 117.15197,
"crs": "WGS 84",
"location_accuracy": "10",
"when": "2015-01-21T08:00:00+08:00",
"name": null,
"taxon": "Cheloniidae",
"species": "chelonia-mydas",
"health": "dead-disarticulated",
"sex": "na",
"maturity": "juvenile",
"behaviour": "",
"habitat": "beach",
"activity": "na",
"nesting_event": "na",
"checked_for_injuries": "na",
"scanned_for_pit_tags": "na",
"checked_for_flipper_tags": "na",
"cause_of_death": "indeterminate-decomposed",
"cause_of_death_confidence": "expert-opinion",

TurtleMorphometricObservation

https://tsc.dbca.wa.gov.au/api/1/turtle-morphometrics/

Source odkc$mwi

source, 
source_id,
"morphometrics_curved_carapace_length_mm"      
"morphometrics_curved_carapace_length_accuracy" 
"morphometrics_curved_carapace_width_mm"
"morphometrics_curved_carapace_width_accuracy" 
"morphometrics_tail_length_carapace_accuracy" 
"morphometrics_maximum_head_width_accuracy"
"morphometrics_tail_length_carapace_mm"        
"morphometrics_maximum_head_width_mm"

Target

source, source_id,
"curved_carapace_length_mm": 905,
"curved_carapace_length_accuracy": "10",
"straight_carapace_length_mm": null,
"straight_carapace_length_accuracy": null,
"curved_carapace_width_mm": 830,
"curved_carapace_width_accuracy": "10",
"tail_length_carapace_mm": null,
"tail_length_carapace_accuracy": null,
"tail_length_vent_mm": null,
"tail_length_vent_accuracy": null,
"tail_length_plastron_mm": null,
"tail_length_plastron_accuracy": null,
"maximum_head_width_mm": null,
"maximum_head_width_accuracy": null,
"maximum_head_length_mm": null,
"maximum_head_length_accuracy": null,
"body_depth_mm": null,
"body_depth_accuracy": null,
"body_weight_g": null,
"body_weight_accuracy": null,
"handler": 12,
"recorder": 12

Media Attachments

https://tsc.dbca.wa.gov.au/api/1/media-attachments/

Source odkc_data$mwi

"incident_photo_habitat"     
"habitat_photos_photo_habitat_2"
"habitat_photos_photo_habitat_3"
"habitat_photos_photo_habitat_4"               
"photos_turtle_photo_carapace_top"
"photos_turtle_photo_head_top"                 
"photos_turtle_photo_head_side"
"photos_turtle_photo_head_front"

Target

source, source_id
"media_type": "photograph",
"title": "...",
"attachment": FILE

Source odkc_data$mwi_dmg

Target turtle-damage-observations

Needs new WAStD API endpoint turtle-damage-observations

Source odkc_data$mwi_tag

Target tag-observations

https://tsc.dbca.wa.gov.au/api/1/tag-observations/

"tag_type": "flipper-tag",
"name": "WA49138",
"tag_location": "flipper-front-left-1",
"status": "removed",
"comments": ""
florianm commented 4 years ago

Done, remaining media see #10