-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
18 lines (14 loc) · 5.13 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# This is a sample Python script.
# Press Maj+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
from hydrowebnext_utils import download_watershed
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
niger_bbox = "POLYGON((-11.60039306698639372 5.28531067974414803, -11.60039306698639372 23.95752330026016708, 15.88485121691020474 23.95752330026016708, 15.88485121691020474 5.28531067974414803, -11.60039306698639372 5.28531067974414803))"
niger_bbox2 = "Polygon ((6.5435365369999996 5.28531067970000024, 6.46436932160000044 5.29781076609999957, 6.46127915160000033 5.29830020089999998, -8.74348324169999991 8.54938886509999918, -9.22264990679999919 8.65355553190000037, -10.73514990470000008 9.07022219799999974, -10.73793758729999936 9.07164259319999999, -10.74014990470000086 9.07385491059999971, -11.59639990350000005 10.45302157479999927, -11.59782029870000031 10.45580925740000033, -11.59990363210000019 10.45997592440000012, -11.60039306700000061 10.46306609430000023, -11.60039306700000061 10.46723276130000002, -11.59990363210000019 10.47032293120000013, -11.58532029869999924 10.53490626369999994, -11.58323696519999935 10.54323959759999951, -11.57907029829999956 10.55573959760000058, -11.55407029829999921 10.6078229309999994, -11.55264990310000073 10.61061061350000045, -11.19848323769999965 11.25436061179999925, -10.96931657120000025 11.48769394530000021, -10.96502092030000064 11.49198959619999982, -6.29627092740000016 15.60240625630000011, -6.2671042614000001 15.62323958930000067, -6.26085426100000042 15.62740625620000046, 6.11473908700000024 23.57436082739999961, 6.11752676960000041 23.57578122259999986, 6.64669710380000023 23.81328286879999823, 7.07378339789999977 23.94661712699999967, 7.10086691840000039 23.95495051760000038, 7.10920030990000029 23.95703386539999968, 7.1122904798000004 23.9575233003000001, 7.13104060970000031 23.9575233003000001, 7.17687426100000003 23.95127325760000048, 7.17996443100000015 23.95078382270000006, 7.31329868829999974 23.92370030129999847, 7.31608637079999991 23.92227990610000177, 7.56192140849999994 23.73061191120000046, 7.57442149480000015 23.7201951718999986, 7.87025687860000023 23.46394339580000121, 7.87246919599999995 23.46173107839999972, 8.11830423369999998 23.07839508769999881, 9.29956242099999919 21.17213187460000157, 15.86002456119999948 9.71996916109999987, 15.86144495639999974 9.71718147850000058, 15.88227843419999985 9.60051400330000071, 15.88276786900000026 9.5974238333000006, 15.88485121689999957 9.57034031200000079, 15.88485121689999957 9.56409026839999932, 15.88436178209999916 9.5610000983999992, 15.80519456669999911 9.29849827960000042, 15.79269448039999979 9.27349810609999992, 15.79127408509999952 9.27071042350000063, 15.27668718510000012 8.28112023109999917, 15.12460279699999965 7.9894515421000003, 15.12239047959999994 7.9872392246999997, 15.10989039330000061 7.97682248629999968, 13.06404287930000052 6.88514825279999965, 13.0161258801000006 6.86014807930000003, 13.01333819759999955 6.85872768399999977, 13.00917150179999915 6.85664433619999958, 12.9779212856000008 6.84206090200000006, 10.10498470479999966 5.79205362410000024, 10.09873466210000004 5.78997027620000004, 10.09564449219999993 5.78948084139999963, 10.06856097080000012 5.78531414560000012, 6.54978658060000019 5.28531067970000024, 6.5435365369999996 5.28531067970000024))"
niger_bbox3 = "Polygon ((-11.69995034979711868 10.95039819943551862, -10.19429770027033122 12.39814113167281562, -8.08059301920387618 13.67215491204163591, -6.54598551103234172 15.87272416904232841, -3.30304134282079787 17.14673794941114693, -0.34964576105670986 19.57894607556981015, 3.58821501462873726 21.02668900780710715, 6.07833285807688739 23.9800845895711916, 7.23652720386672499 24.21172345872916054, 8.33681183236707213 23.37203255803152757, 9.58187075409114541 21.14250844238608806, 9.72664504731487511 16.59659563516097691, 9.7555999059596239 14.13543265035757202, 7.96039866998537349 11.58740508961992788, 9.29232216764368602 10.48712046111958429, 11.69557543515760045 12.05068282793586221, 16.27044310102746039 10.16861701602737611, 15.40179734168508219 7.8811831830924497, 13.11436350875015222 6.5782145440788824, 10.21887764427555823 5.50688477422328049, 6.4257911618138408 5.04360703590734616, 1.32973604033855253 10.02384272280364641, -2.66603445263638505 14.28020694358130172, -6.08270777271640739 9.06833238752703252, -8.71759990938828722 8.19968662818465432, -10.91816916638897972 8.86564837701380881, -11.84472464302084838 10.28443645060636058, -11.84472464302084838 10.28443645060636058, -11.69995034979711868 10.95039819943551862))"
download_watershed.download_over_extent("HYDROWEB_RIVERS_OPE", "NIGER", niger_bbox3, "/tmp/bassin_niger")
download_watershed.download_over_extent("HYDROWEB_LAKES_OPE", "NIGER", niger_bbox3, "/tmp/bassin_niger")
download_watershed.download_over_extent("HYDROWEB_RIVERS_RESEARCH", "NIGER", niger_bbox3, "/tmp/bassin_niger")
download_watershed.download_over_extent("HYDROWEB_LAKES_RESEARCH", "NIGER", niger_bbox3, "/tmp/bassin_niger")
# See PyCharm help at https://www.jetbrains.com/help/pycharm/