OxfordEcosystemsLab / gemdata

GEM database code, importers, and frontend
5 stars 1 forks source link

forestplots importer allowing duplicates #39

Open ashenkin opened 9 years ago

ashenkin commented 9 years ago

for some reason, the importer seems to be allowing duplicate tree entries. So, if there is an error in forestplots, it gets propagated to our db. In the meantime, we should just manually edit the forestplot exports to remove these duplicates (assuming that's where the problem lies).

> temp = get_trees(con, plot_code = "SPD-01", tree_code = "T231")
> temp
  tree_id tree_code fp_tree_id  fp_species_name fp_species_id fp_genus_name fp_genus_id fp_family_name fp_family_apg_id sub_plot_code plot_code csp_site
1    7484      T231     636913 Lissocarpa indet        643553    Lissocarpa       15244      Ebenaceae              432             7    SPD-01   SPD-01
2    7484      T231     636913 Lissocarpa indet        643553    Lissocarpa       15244      Ebenaceae              432             7    SPD-01   SPD-01
  csp_tree_code   csp_species csp_family            csp_full_name csp_taxon_info
1          T231 sp. 5077(R2T)  Ebenaceae Lissocarpa sp. 5077(R2T)           <NA>
2          T231 sp. 9727(R2T)  Ebenaceae Lissocarpa sp. 9727(R2T)           <NA>
> temp = get_trees(con, plot_code = "PAN-02", tree_code = "T686")
> temp
  tree_id tree_code fp_tree_id    fp_species_name fp_species_id fp_genus_name fp_genus_id  fp_family_name fp_family_apg_id sub_plot_code plot_code csp_site
1    3391      T686    1106476 Bellucia pentamera         67126      Bellucia       15962 Melastomataceae              414             8    PAN-02   PAN-02
2    3391      T686    1106476 Bellucia pentamera         67126      Bellucia       15962 Melastomataceae              414             8    PAN-02   PAN-02
  csp_tree_code     csp_species      csp_family            csp_full_name csp_taxon_info
1          T686            bofo       Lauraceae              Ocotea bofo          Kunth
2          T686 grossularioides Melastomataceae Bellucia grossularioides    (L.) Triana