sascha@1046: sascha@1046: sascha@1046: ingo@1181: ingo@1181: ingo@1181: ingo@1181: SELECT id AS river_id, name as river_name FROM rivers ingo@1181: WHERE lower(name) LIKE lower(${river}) ingo@1181: ingo@1181: felix@1790: felix@1790: Base-data macros (mostly data imported from wst-files) felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: SELECT id AS prot_id, felix@1790: description AS prot_description felix@1790: FROM wsts WHERE kind = 0 AND river_id = ${river_id} felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: SELECT id AS prot_column_id, felix@1790: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@1790: FROM wst_columns WHERE wst_id = ${prot_id} felix@1790: ORDER by position felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@3570: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: SELECT id AS prot_id, felix@1916: description AS prot_description felix@1916: FROM wsts WHERE kind = 0 AND river_id = ${river_id} felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: SELECT id AS prot_column_id, felix@1916: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@1916: FROM wst_columns WHERE wst_id = ${prot_id} felix@1916: ORDER by position felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@3570: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1790: felix@1790: felix@2085: felix@1790: felix@1790: felix@1790: SELECT id AS prot_id, felix@1790: description AS prot_description felix@1790: FROM wsts WHERE kind = 1 AND river_id = ${river_id} felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: SELECT id AS prot_column_id, felix@1790: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@1790: FROM wst_columns WHERE wst_id = ${prot_id} felix@1790: ORDER by position felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@3570: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@1790: felix@2085: felix@1790: felix@1869: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: SELECT id AS prot_id, felix@2761: description AS prot_description felix@2761: FROM wsts WHERE kind = 1 AND river_id = ${river_id} felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: SELECT id AS prot_column_id, felix@2761: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@2761: FROM wst_columns WHERE wst_id = ${prot_id} felix@2761: ORDER by position felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@3570: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@2761: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: SELECT id AS prot_id, felix@1905: description AS prot_description felix@1905: FROM wsts WHERE kind = 2 AND river_id = ${river_id} felix@1905: felix@1905: felix@1905: felix@2572: felix@2572: felix@2572: felix@2572: felix@2572: SELECT id AS prot_column_id, felix@2572: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@2572: FROM wst_columns WHERE wst_id = ${prot_id} felix@2572: ORDER by position felix@2572: felix@2572: felix@2572: felix@2572: felix@2572: felix@2572: felix@3570: felix@2572: felix@2572: felix@2572: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: SELECT id AS prot_id, felix@1905: description AS prot_description felix@1905: FROM wsts WHERE kind = 2 AND river_id = ${river_id} felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: SELECT id AS prot_column_id, felix@1905: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: desciption AS info felix@1905: FROM wst_columns WHERE wst_id = ${prot_id} felix@1905: ORDER by position felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@3570: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: SELECT id AS prot_id, felix@1872: description AS prot_description felix@1872: FROM wsts WHERE kind = 2 AND river_id = ${river_id} felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: SELECT id AS prot_column_id, felix@1872: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@1872: FROM wst_columns WHERE wst_id = ${prot_id} felix@1872: ORDER by position felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@3570: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@1872: felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: SELECT id AS prot_id, felix@2749: description AS prot_description felix@2749: FROM wsts WHERE kind = 2 AND river_id = ${river_id} felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: SELECT id AS prot_column_id, felix@2749: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@2749: FROM wst_columns WHERE wst_id = ${prot_id} felix@2749: ORDER by position felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: felix@3570: felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: felix@2749: felix@2751: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: SELECT id AS prot_id, felix@3283: description AS prot_description felix@3283: FROM wsts WHERE kind = 3 AND river_id = ${river_id} felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: SELECT id AS prot_column_id, felix@3283: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@3283: FROM wst_columns WHERE wst_id = ${prot_id} felix@3283: ORDER by position felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3570: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@3283: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: SELECT id AS prot_id, felix@2751: description AS prot_description felix@2751: FROM wsts WHERE kind = 4 AND river_id = ${river_id} felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: SELECT id AS prot_column_id, felix@2751: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@2751: FROM wst_columns WHERE wst_id = ${prot_id} felix@2751: ORDER by position felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@3570: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: SELECT id AS prot_id, felix@1869: description AS prot_description felix@1869: FROM wsts WHERE kind = 4 AND river_id = ${river_id} felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: SELECT id AS prot_column_id, felix@1869: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@1869: FROM wst_columns WHERE wst_id = ${prot_id} felix@1869: ORDER by position felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@3570: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1978: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: SELECT id AS prot_id, felix@1916: description AS prot_description felix@1916: FROM wsts WHERE kind = 4 AND river_id = ${river_id} felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: SELECT id AS prot_column_id, felix@1916: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@1916: FROM wst_columns WHERE wst_id = ${prot_id} felix@1916: ORDER by position felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@3570: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1916: felix@1869: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: SELECT id AS prot_id, felix@2751: description AS prot_description felix@2751: FROM wsts WHERE kind = 5 AND river_id = ${river_id} felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: SELECT id AS prot_column_id, felix@2751: name AS prot_column_name, felix@3570: position AS prot_rel_pos, felix@3570: description AS info felix@2751: FROM wst_columns WHERE wst_id = ${prot_id} felix@2751: ORDER by position felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@3570: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@2751: felix@1905: felix@2086: felix@1905: felix@1905: felix@1905: felix@1905: SELECT id AS prot_id, felix@1905: description AS prot_description felix@1905: FROM wsts WHERE kind = 5 AND river_id = ${river_id} felix@1905: felix@1905: felix@2086: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: SELECT id AS prot_column_id, felix@1905: name AS prot_column_name, felix@1905: position AS prot_rel_pos felix@1905: FROM wst_columns WHERE wst_id = ${prot_id} felix@1905: ORDER by position felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@2086: felix@1905: felix@1905: felix@2086: felix@1905: felix@1905: felix@1851: felix@1851: felix@1851: felix@1851: felix@1851: felix@1851: felix@1865: felix@3574: felix@3574: felix@3574: felix@3574: felix@3574: felix@3574: felix@3574: felix@1865: felix@1865: felix@1865: felix@1865: felix@1865: felix@1865: felix@1865: felix@1978: felix@2324: felix@1978: felix@1978: felix@1978: felix@1978: SELECT id AS prot_id, felix@1978: description AS prot_description felix@1978: FROM cross_sections WHERE river_id = ${river_id} felix@1978: felix@1978: felix@2324: felix@1978: felix@1978: felix@1978: felix@2324: felix@1978: felix@1978: felix@2324: felix@1978: felix@1978: felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: SELECT id AS hyk_id, felix@2140: description AS hyk_description felix@2140: FROM hyks WHERE river_id = ${river_id} felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: felix@2140: felix@1869: felix@1869: felix@1869: felix@1869: + River-Node felix@1869: felix@1869: felix@1869: ingo@1181: ingo@1181: felix@1865: felix@1865: felix@1865: felix@1865: felix@2101: Recommendations (client shall load immediately). felix@1865: felix@1865: felix@2101: felix@1865: felix@1978: felix@1978: felix@2140: felix@1978: felix@2721: felix@2721: felix@2770: felix@2721: felix@3574: felix@3574: felix@3574: felix@3579: felix@3579: felix@3579: felix@1865: felix@1865: felix@1869: felix@1869: Non - Recommendations. felix@1869: felix@1869: felix@2101: felix@2101: felix@2736: felix@3570: felix@2736: raimund@2153: felix@2689: felix@1869: felix@1869: felix@1869: felix@2732: felix@2732: felix@3314: felix@1869: felix@2732: felix@1869: felix@3627: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@1869: felix@3283: felix@3283: felix@2101: felix@1869: felix@2721: felix@2721: felix@2761: felix@2761: felix@2721: felix@2755: felix@2721: felix@2761: felix@2761: felix@2721: felix@3579: felix@3585: felix@3579: felix@3587: felix@3587: felix@3587: felix@3587: felix@3579: felix@3585: felix@3585: felix@3579: felix@3579: felix@3579: felix@1869: felix@1865: felix@1865: felix@1872: felix@1764: felix@1728: felix@1905: felix@1875: felix@1875: felix@1905: felix@1905: felix@1875: felix@1875: felix@1875: felix@1875: felix@1875: felix@1875: felix@1875: felix@1905: felix@1905: felix@1905: felix@1905: felix@1728: felix@1905: felix@1905: felix@1905: felix@1905: felix@1773: felix@2324: felix@2324: ingo@1181: ingo@1181: ingo@1181: SELECT id AS gauge_id, ingo@1181: name AS gauge_name ingo@1181: FROM gauges WHERE river_id = ${river_id} ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: felix@3051: felix@3051: felix@3051: felix@3051: felix@3051: felix@3051: ingo@1181: ingo@1181: felix@2324: felix@1872: felix@2324: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@1905: felix@2324: felix@1851: felix@2324: ingo@1181: felix@1905: felix@1851: felix@2717: felix@2717: felix@2717: felix@2717: felix@2717: felix@2717: felix@2749: felix@2751: felix@2751: felix@2717: felix@2717: felix@1851: felix@1872: felix@3592: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: SELECT id AS gauge_id, felix@3585: name AS gauge_name felix@3585: FROM gauges WHERE river_id = ${river_id} felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: felix@3585: raimund@2100: raimund@2100: raimund@2100: raimund@2100: raimund@2100: raimund@2100: raimund@2100: raimund@2100: raimund@2100: raimund@2100: raimund@2100: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1185: ingo@1185: ingo@1185: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: FIXME: Following two macros look identical to me. ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1185: ingo@1185: ingo@1185: ingo@1185: ingo@1185: SELECT id AS dem_id, ingo@1185: lower AS dem_lower, ingo@1185: upper AS dem_upper ingo@1185: FROM dem WHERE river_id = ${river_id} ingo@1185: ingo@1185: ingo@1186: ingo@1186: ingo@1186: ingo@1186: ingo@1186: ingo@1185: ingo@1185: ingo@1185: ingo@1185: ingo@1805: ingo@1805: ingo@1805: ingo@1805: SELECT count(*) as km_exists ingo@1805: FROM river_axes_km WHERE river_id = ${river_id} ingo@1805: ingo@1805: ingo@1805: ingo@1805: ingo@1805: ingo@1805: ingo@1805: ingo@1805: ingo@1805: ingo@1805: ingo@1805: ingo@1836: ingo@1836: ingo@1836: ingo@1836: SELECT count(*) as km_exists ingo@1836: FROM cross_section_tracks WHERE river_id = ${river_id} ingo@1836: ingo@1836: ingo@1836: ingo@1836: ingo@1836: ingo@1836: ingo@1836: ingo@1836: ingo@1836: ingo@1836: ingo@1836: ingo@1855: ingo@1855: ingo@1855: ingo@2672: SELECT count(*) as km_exists, name as name ingo@2672: FROM hws WHERE river_id = ${river_id} GROUP BY name ingo@1855: ingo@1855: ingo@1855: ingo@1855: ingo@1855: ingo@2672: ingo@2672: ingo@1855: ingo@1855: ingo@1855: ingo@1855: ingo@1855: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: SELECT count(*) as km_exists, name as name ingo@2683: FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 1 GROUP BY name ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: SELECT count(*) as km_exists, name as name ingo@2683: FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 2 GROUP BY name ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: SELECT count(*) as km_exists, name as name ingo@2683: FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 1 GROUP BY name ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: SELECT count(*) as km_exists, name as name ingo@2683: FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 2 GROUP BY name ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@1856: ingo@1856: ingo@1856: ingo@2671: SELECT count(*) as km_exists, name as name ingo@2671: FROM catchment WHERE river_id = ${river_id} GROUP BY name ingo@1856: ingo@1856: ingo@1856: ingo@2683: ingo@1856: ingo@2671: ingo@2671: ingo@2683: ingo@1856: ingo@1856: ingo@1856: ingo@1856: ingo@1857: ingo@1857: ingo@1857: ingo@1857: SELECT count(*) as km_exists ingo@1857: FROM floodplain WHERE river_id = ${river_id} ingo@1857: ingo@1857: ingo@1857: ingo@1857: ingo@1857: ingo@1857: ingo@1857: ingo@1857: ingo@1857: ingo@1857: ingo@1857: ingo@1870: ingo@1870: ingo@1870: ingo@2683: SELECT count(*) as km_exists, name as name ingo@2683: FROM lines WHERE river_id = ${river_id} GROUP BY name ingo@1870: ingo@1870: ingo@1870: ingo@2683: ingo@1870: ingo@2683: ingo@2683: ingo@2683: ingo@1870: ingo@1870: ingo@1870: ingo@1870: ingo@1871: ingo@1871: ingo@1871: ingo@2683: SELECT count(*) as km_exists, name as name ingo@2683: FROM buildings WHERE river_id = ${river_id} GROUP BY name ingo@1871: ingo@1871: ingo@1871: ingo@2683: ingo@1871: ingo@2683: ingo@2683: ingo@2683: ingo@1871: ingo@1871: ingo@1871: ingo@1871: ingo@1873: ingo@1873: ingo@1873: ingo@2683: SELECT count(*) as km_exists, name as name ingo@2683: FROM fixpoints WHERE river_id = ${river_id} GROUP BY name ingo@1873: ingo@1873: ingo@1873: ingo@2683: ingo@1873: ingo@2683: ingo@2683: ingo@2683: ingo@1873: ingo@1873: ingo@1873: ingo@1873: ingo@2684: ingo@2684: ingo@2684: ingo@2684: SELECT count(*) as km_exists, name as name ingo@2684: FROM gauge_location WHERE river_id = ${river_id} GROUP BY name ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2684: ingo@2580: ingo@2580: ingo@2580: ingo@2580: ingo@2582: ingo@2582: ingo@2582: ingo@2582: SELECT count(*) as uesg_exist, name as name ingo@2582: FROM floodmaps ingo@2582: WHERE river_id = ${river_id} AND kind = 111 ingo@2582: GROUP BY name, kind ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2683: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: SELECT count(*) as uesg_exist, name as name ingo@2582: FROM floodmaps ingo@2582: WHERE river_id = ${river_id} AND kind = 112 ingo@2582: GROUP BY name, kind ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2683: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2580: ingo@2580: ingo@2582: ingo@2582: ingo@2582: ingo@2582: SELECT count(*) as uesg_exist, name as name ingo@2582: FROM floodmaps ingo@2582: WHERE river_id = ${river_id} AND kind = 121 ingo@2582: GROUP BY name, kind ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2683: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: SELECT count(*) as uesg_exist, name as name ingo@2582: FROM floodmaps ingo@2582: WHERE river_id = ${river_id} AND kind = 122 ingo@2582: GROUP BY name, kind ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2683: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2582: ingo@2580: ingo@2580: ingo@2580: ingo@2580: ingo@1181: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@2683: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1805: ingo@1836: ingo@2683: ingo@2683: ingo@1870: ingo@2683: ingo@2595: ingo@2684: ingo@2684: ingo@2684: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: SELECT id AS bedh_id, raimund@3614: year AS bedh_year, raimund@3614: description AS bedh_descr raimund@3614: FROM bed_height_single WHERE river_id = ${river_id} raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: SELECT id AS bedh_id, raimund@3614: time_interval_id AS bedh_interval_id, raimund@3614: description AS bedh_descr raimund@3614: FROM bed_height_epoch WHERE river_id = ${river_id} raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: raimund@3614: ingo@1181: ingo@1181: ingo@1181: ingo@1181: ingo@1181: sascha@1046: sascha@1046: sascha@1046: User specific part sascha@1046: ------------------ sascha@1046: sascha@1046: felix@1879: felix@1905: felix@1879: felix@1879: felix@1879: felix@1879: Get the user and collection-id. felix@1879: felix@1760: felix@1879: SELECT u.id AS user_id, c.id AS collection_id, c.name as collection_name felix@1879: FROM collections c JOIN users u ON c.user_id = u.id felix@1879: WHERE u.gid = CAST(${user-id} AS uuid) felix@1879: ORDER BY c.creation DESC felix@1760: ingo@1657: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation, ardg.v as gaugy, arv.v as wqsingle felix@3307: FROM master_artifacts m, artifact_data ardg, artifact_data arv felix@3307: WHERE m.collection_id = ${collection_id} AND m.gid = CAST(${artifact-id} AS uuid) AND ardg.artifact_id = m.id AND ardg.k = 'ld_gaugename' AND arv.artifact_id = m.id AND arv.k = 'wq_single' felix@3307: AND EXISTS ( felix@3307: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: SELECT ol.wst_id AS wstid, ol.wst_column_pos AS wstcolpos, ol.name AS olname, ol.value AS oval felix@3307: FROM official_q_values ol felix@3307: WHERE ol.value = CAST(${wqsingle} AS NUMERIC(10,2)) AND ol.gauge_name = ${gaugy} felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3307: felix@3570: ingo@1657: felix@1879: felix@1879: SHOW W-DIFFERENCES felix@1879: ingo@1657: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@1879: FROM master_artifacts m felix@1879: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@1879: AND EXISTS ( felix@1879: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description felix@1879: FROM outs as o, facets as f, artifacts as a felix@1879: WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: ingo@1657: felix@2722: felix@2722: SHOW REFERENCE CURVE felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@2722: FROM master_artifacts m felix@2722: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@2722: AND EXISTS ( felix@2722: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description felix@2722: FROM outs as o, facets as f, artifacts as a felix@2722: WHERE f.name = 'reference_curve' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: felix@2722: SHOW COMPUTED DISCHARGE CURVES felix@2722: felix@2722: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@1880: FROM master_artifacts m felix@1880: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@1880: AND EXISTS ( felix@1880: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description felix@1880: FROM outs as o, facets as f, artifacts as a felix@1880: WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: felix@1880: sascha@3219: felix@2736: felix@2736: CROSS SECTION felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@2736: FROM master_artifacts m felix@2736: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@2736: AND EXISTS ( felix@2736: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: SELECT id AS out_id felix@2736: FROM outs felix@2736: WHERE artifact_id = ${a_id} AND name = 'cross_section' felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: SELECT name AS facet_name, num as facet_num, description AS facet_description felix@2736: FROM facets felix@2736: WHERE out_id = ${out_id} felix@2736: ORDER BY num ASC, name DESC felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@2736: felix@1880: felix@1880: felix@2736: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@1879: FROM master_artifacts m felix@1879: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@1879: AND EXISTS ( felix@1879: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: SELECT id AS out_id felix@1879: FROM outs felix@1879: WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: SELECT name AS facet_name, num as facet_num, description AS facet_description felix@1879: FROM facets felix@1879: WHERE out_id = ${out_id} felix@1879: ORDER BY num ASC, name DESC felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@3579: FROM master_artifacts m felix@3579: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@3579: AND EXISTS ( felix@3579: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT id AS out_id felix@3579: FROM outs felix@3579: WHERE artifact_id = ${a_id} AND name = 'fix_longitudinal_section_curve' felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT name AS facet_name, num as facet_num, description AS facet_description felix@3579: FROM facets felix@3589: WHERE out_id = ${out_id} AND ( name LIKE 'fix_deviation_ls%' OR name LIKE 'fix_sector_average_ls%' OR name LIKE 'fix_analysis_events_ls%' OR name LIKE 'fix_reference_events_ls%' ) felix@3579: ORDER BY num ASC, name DESC felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@3579: FROM master_artifacts m felix@3579: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@3579: AND EXISTS ( felix@3579: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT id AS out_id felix@3579: FROM outs felix@3582: WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve' felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT name AS facet_name, num as facet_num, description AS facet_description felix@3579: FROM facets felix@3590: WHERE out_id = ${out_id} and ( name LIKE 'fix_sector_average_dwt%' OR name LIKE 'fix_deviation_dwt%' OR name = 'fix_analysis_events_dwt' OR name = 'fix_reference_events_dwt' OR name = 'fix_analysis_periods_dwt' ) felix@3579: ORDER BY num ASC, name DESC felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3582: felix@3579: felix@3582: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@3589: FROM master_artifacts m felix@3589: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@3589: AND EXISTS ( felix@3589: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: SELECT id AS out_id felix@3589: FROM outs felix@3589: WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve' felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: SELECT name AS facet_name, num as facet_num, description AS facet_description felix@3589: FROM facets felix@3589: WHERE out_id = ${out_id} and name = 'fix_derivate' felix@3589: ORDER BY num ASC, name DESC felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3589: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@3579: FROM master_artifacts m felix@3579: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@3579: AND EXISTS ( felix@3579: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT id AS out_id felix@3579: FROM outs felix@3583: WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve' felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: SELECT name AS facet_name, num as facet_num, description AS facet_description felix@3579: FROM facets felix@3588: WHERE out_id = ${out_id} and ( name LIKE 'fix_sector_average_wq%' OR name = 'fix_wq_curve' OR name LIKE 'fix_analysis_events_wq%' OR name LIKE 'fix_reference_events_wq%' ) felix@3579: ORDER BY num ASC, name DESC felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3583: felix@3579: felix@3583: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@3579: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@2690: FROM master_artifacts m felix@2690: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@2690: AND EXISTS ( felix@2690: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description felix@2690: FROM outs as o, facets as f, artifacts as a felix@2717: WHERE (f.name = 'duration_curve.q' or f.name = 'duration_curve.w') and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@2690: felix@1879: felix@1879: WATERLEVELS - ONLY SHOW Ws felix@1879: felix@1879: felix@3589: felix@3589: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation felix@1879: FROM master_artifacts m felix@1879: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) felix@1879: AND EXISTS ( felix@1879: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: SELECT id AS out_id felix@1879: FROM outs felix@1879: WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: SELECT name AS facet_name, num as facet_num, description AS facet_description felix@1879: FROM facets felix@1879: WHERE out_id = ${out_id} and name = 'longitudinal_section.w' felix@1879: ORDER BY num ASC, name DESC felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: felix@1879: ingo@2096: ingo@2096: SHOW FLOODMAPS ingo@2096: ingo@2096: ingo@2114: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation ingo@2096: FROM master_artifacts m ingo@2096: WHERE m.collection_id = ${collection_id} AND m.gid <> CAST(${artifact-id} AS uuid) ingo@2096: AND EXISTS ( ingo@2096: SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river}) ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description ingo@2096: FROM outs as o, facets as f, artifacts as a ingo@2096: WHERE f.name = 'floodmap.wsplgen' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id} ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: ingo@2096: felix@1879: sascha@1046: ingo@1657: ingo@1657: ingo@1181: ingo@1657: Include System specific part when 'load-system' is in parameters. ingo@1657: ----------------------------------------------------------------- ingo@1181: ingo@1657: ingo@1657: ingo@1657: ingo@1657: ingo@1657: sascha@1046: ingo@1657: ingo@1657: sascha@1046: ingo@1657: Include System specific part only if no user ID is given. ingo@1657: --------------------------------------------------------- sascha@1046: sascha@1046: ingo@1181: sascha@1046: sascha@1046: sascha@1046: sascha@1046: