Changes between Version 11 and Version 12 of electrofishing data


Ignore:
Timestamp:
Jan 19, 2012 11:35:09 AM (13 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • electrofishing data

    v11 v12  
    160160}}} 
    161161 
     162 
     163{{{ 
     164 
     165/* 
     166CHECKING FOR SPATIAL DUPLICATES 
     167*/ 
     168 
     169 
     170--select * from wrbd.stationdbeel s1 join ireland.stations S2 on st_dwithin(s1.the_geom,s2.the_geom,100); 
     171--select  distinct on (locationcode) op_id, locationcode from wrbd.stationdbeel s1 join ireland.stations S2 on st_dwithin(s1.the_geom,s2.the_geom,20); 
     172-- first step I copy the code of the stations from wrbd.stationdbeel where the stations are less than 20 m apart. These are doubles 
     173alter table ireland.stations add column dbeel_op_id uuid; 
     174update ireland.stations set dbeel_op_id=op_id from ( 
     175        select  distinct on (locationcode) op_id, locationcode from wrbd.stationdbeel s1 join ireland.stations S2 on st_dwithin(s1.the_geom,s2.the_geom,20))as sub 
     176where sub.locationcode=stations.locationcode; --86 
     177 
     178--select t.dbeel_op_id, surveyid from ireland.stations t join ireland.survey s on s.locationcode=t.locationcode where t.dbeel_op_id is not null; 
     179-- second step I copy the same code but to the survey file, I'll know that I have a survey located on a station for which I have already entered data 
     180alter table ireland.survey add column dbeel_op_id uuid; 
     181update ireland.survey set dbeel_op_id=sub.dbeel_op_id from ( 
     182        select t.dbeel_op_id, surveyid from ireland.stations t join ireland.survey s on s.locationcode=t.locationcode where t.dbeel_op_id is not null) as sub 
     183where sub.surveyid=survey.surveyid;--298 
     184 
     185select max(op_year) from wrbd.operation_op where op_st_id like '%MI%'; --2009 there might be double indeed 
     186 
     187/* 
     188TODO for the stations that have duplicates, check whether the year has been entered or if there is something we can reckon about the code 
     189*/ 
     190}}}