Project

General

Profile

« Previous | Next » 

Revision 13147

bugfix: inputs/NY/validations.sql, schemas/vegbien.sql: _specimens_13*: also need to include coordinate pairs which have one of their coordinates NULL, by using OR instead of AND

View differences:

trunk/inputs/NY/validations.sql
255 255
CREATE VIEW _specimens_13_count_of_all_verbatim_and_decimal_lat_long AS
256 256
 SELECT ( SELECT count(DISTINCT ROW("Ecatalog_all"."decimalLatitude", "Ecatalog_all"."decimalLongitude")) AS count
257 257
           FROM "Ecatalog_all"
258
          WHERE (("Ecatalog_all"."decimalLatitude" IS NOT NULL) AND ("Ecatalog_all"."decimalLongitude" IS NOT NULL))) AS "allLatLongs", 
258
          WHERE (("Ecatalog_all"."decimalLatitude" IS NOT NULL) OR ("Ecatalog_all"."decimalLongitude" IS NOT NULL))) AS "allLatLongs", 
259 259
    ( SELECT count(DISTINCT ROW("Ecatalog_all"."decimalLatitude", "Ecatalog_all"."decimalLongitude")) AS count
260 260
           FROM "Ecatalog_all"
261 261
          WHERE (is_castable("Ecatalog_all"."decimalLatitude", NULL::double precision) AND is_castable("Ecatalog_all"."decimalLongitude", NULL::double precision))) AS "decimalLatLongs";
......
278 278
 SELECT DISTINCT "Ecatalog_all"."decimalLatitude" AS "verbatimLatitude", 
279 279
    "Ecatalog_all"."decimalLongitude" AS "verbatimLongitude"
280 280
   FROM "Ecatalog_all"
281
  WHERE (("Ecatalog_all"."decimalLatitude" IS NOT NULL) AND ("Ecatalog_all"."decimalLongitude" IS NOT NULL));
281
  WHERE (("Ecatalog_all"."decimalLatitude" IS NOT NULL) OR ("Ecatalog_all"."decimalLongitude" IS NOT NULL));
282 282

  
283 283

  
284 284
--
trunk/schemas/vegbien.sql
9490 9490
CREATE VIEW _specimens_13_count_of_all_verbatim_and_decimal_lat_long AS
9491 9491
 SELECT ( SELECT count(DISTINCT ROW(coordinates.latitude_deg, coordinates.longitude_deg, coordinates.verbatimlatitude, coordinates.verbatimlongitude, coordinates.coordsaccuracy_m)) AS count
9492 9492
           FROM public.coordinates
9493
          WHERE (((coordinates.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname)) AND ((coordinates.verbatimlatitude IS NOT NULL) OR (coordinates.latitude_deg IS NOT NULL))) AND ((coordinates.verbatimlongitude IS NOT NULL) OR (coordinates.longitude_deg IS NOT NULL)))) AS "allLatLongs", 
9493
          WHERE ((coordinates.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname)) AND (((coordinates.verbatimlatitude IS NOT NULL) OR (coordinates.latitude_deg IS NOT NULL)) OR ((coordinates.verbatimlongitude IS NOT NULL) OR (coordinates.longitude_deg IS NOT NULL))))) AS "allLatLongs", 
9494 9494
    ( SELECT count(DISTINCT ROW(coordinates.latitude_deg, coordinates.longitude_deg, coordinates.verbatimlatitude, coordinates.verbatimlongitude, coordinates.coordsaccuracy_m)) AS count
9495 9495
           FROM public.coordinates
9496 9496
          WHERE (((coordinates.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname)) AND (coordinates.latitude_deg IS NOT NULL)) AND (coordinates.longitude_deg IS NOT NULL))) AS "decimalLatLongs";
......
9504 9504
 SELECT DISTINCT COALESCE(coordinates.verbatimlatitude, (coordinates.latitude_deg)::text) AS "verbatimLatitude", 
9505 9505
    COALESCE(coordinates.verbatimlatitude, (coordinates.longitude_deg)::text) AS "verbatimLongitude"
9506 9506
   FROM public.coordinates
9507
  WHERE (((coordinates.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname)) AND ((coordinates.verbatimlatitude IS NOT NULL) OR (coordinates.latitude_deg IS NOT NULL))) AND ((coordinates.verbatimlongitude IS NOT NULL) OR (coordinates.longitude_deg IS NOT NULL)));
9507
  WHERE ((coordinates.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname)) AND (((coordinates.verbatimlatitude IS NOT NULL) OR (coordinates.latitude_deg IS NOT NULL)) OR ((coordinates.verbatimlongitude IS NOT NULL) OR (coordinates.longitude_deg IS NOT NULL))));
9508 9508

  
9509 9509

  
9510 9510
--
......
9515 9515
 SELECT DISTINCT coordinates.latitude_deg AS "decimalLatitude", 
9516 9516
    coordinates.longitude_deg AS "decimalLongitude"
9517 9517
   FROM public.coordinates
9518
  WHERE (((coordinates.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname)) AND (coordinates.latitude_deg IS NOT NULL)) AND (coordinates.longitude_deg IS NOT NULL));
9518
  WHERE ((coordinates.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname)) AND ((coordinates.latitude_deg IS NOT NULL) OR (coordinates.longitude_deg IS NOT NULL)));
9519 9519

  
9520 9520

  
9521 9521
--

Also available in: Unified diff