From 9fc3005a2bbd0beba5e4744bcb95f8753f1a4524 Mon Sep 17 00:00:00 2001 From: Tiago Marques Godinho Date: Wed, 3 Apr 2019 16:44:49 +0100 Subject: [PATCH] added land type script --- land_type.py | 12 +- ocean-coordinates | 764 ---------------------------------------------- 2 files changed, 6 insertions(+), 770 deletions(-) delete mode 100644 ocean-coordinates diff --git a/land_type.py b/land_type.py index 94698ac..f85528d 100644 --- a/land_type.py +++ b/land_type.py @@ -1,7 +1,7 @@ import numpy import json import requests - +import progressbar import multiprocessing as mp OCEAN_MAP = [] @@ -43,8 +43,8 @@ def is_ocean_local(lat, long): # for lat in numpy.arange(41.131386, 41.208026, 0.0018): # for lon in numpy.arange(-8.712680, -8.558663, 0.0025): - for lat in numpy.arange(41.131386, 41.208026, 0.0015): - for lon in numpy.arange(-8.712680, -8.558663, 0.0015): + for lat in numpy.arange(41.140385968610644, 41.18538597598672, 0.0010): + for lon in numpy.arange(-8.687680028378963, -8.5601800493896, 0.0010): coords.append((lat, lon)) session = requests.Session() @@ -56,7 +56,7 @@ def is_ocean_local(lat, long): # Step 1: Init multiprocessing.Pool() with open("ocean-coordinates", "a") as f: - for lat, long in coords: + for lat, long in progressbar.progressbar(coords): st = "{},{}".format(lat, long) if st in data: @@ -65,10 +65,10 @@ def is_ocean_local(lat, long): #b = pool.apply_async(is_ocean, args=(lat,lon,session)) b = is_ocean(lat, long, session) data[st] = b - print("Found", st, "-", b) + #print("Found", st, "-", b) if b: f.write(st+"\n") - f.flush() + f.flush() diff --git a/ocean-coordinates b/ocean-coordinates deleted file mode 100644 index a54cc25..0000000 --- a/ocean-coordinates +++ /dev/null @@ -1,764 +0,0 @@ -41.131386,-8.71268 -41.131386,-8.71118 -41.131386,-8.70968 -41.131386,-8.70818 -41.131386,-8.70668 -41.131386,-8.70518 -41.131386,-8.70368 -41.131386,-8.70218 -41.131386,-8.70068 -41.131386,-8.69918 -41.131386,-8.69768 -41.131386,-8.69618 -41.131386,-8.69468 -41.131386,-8.69318 -41.131386,-8.69168 -41.131386,-8.69018 -41.131386,-8.68868 -41.131386,-8.68718 -41.131386,-8.68568 -41.131386,-8.68418 -41.131386,-8.68268 -41.131386,-8.68118 -41.131386,-8.67968 -41.131386,-8.67818 -41.131386,-8.67668 -41.131386,-8.67518 -41.131386,-8.67368 -41.131386,-8.672179999999999 -41.131386,-8.670679999999999 -41.132886,-8.71268 -41.132886,-8.71118 -41.132886,-8.70968 -41.132886,-8.70818 -41.132886,-8.70668 -41.132886,-8.70518 -41.132886,-8.70368 -41.132886,-8.70218 -41.132886,-8.70068 -41.132886,-8.69918 -41.132886,-8.69768 -41.132886,-8.69618 -41.132886,-8.69468 -41.132886,-8.69318 -41.132886,-8.69168 -41.132886,-8.69018 -41.132886,-8.68868 -41.132886,-8.68718 -41.132886,-8.68568 -41.132886,-8.68418 -41.132886,-8.68268 -41.132886,-8.68118 -41.132886,-8.67968 -41.132886,-8.67818 -41.132886,-8.67668 -41.132886,-8.67518 -41.132886,-8.67368 -41.132886,-8.672179999999999 -41.134386,-8.71268 -41.134386,-8.71118 -41.134386,-8.70968 -41.134386,-8.70818 -41.134386,-8.70668 -41.134386,-8.70518 -41.134386,-8.70368 -41.134386,-8.70218 -41.134386,-8.70068 -41.134386,-8.69918 -41.134386,-8.69768 -41.134386,-8.69618 -41.134386,-8.69468 -41.134386,-8.69318 -41.134386,-8.69168 -41.134386,-8.69018 -41.134386,-8.68868 -41.134386,-8.68718 -41.134386,-8.68568 -41.134386,-8.68418 -41.134386,-8.68268 -41.134386,-8.68118 -41.134386,-8.67968 -41.134386,-8.67818 -41.134386,-8.67668 -41.134386,-8.67518 -41.134386,-8.67368 -41.134386,-8.672179999999999 -41.135886,-8.71268 -41.135886,-8.71118 -41.135886,-8.70968 -41.135886,-8.70818 -41.135886,-8.70668 -41.135886,-8.70518 -41.135886,-8.70368 -41.135886,-8.70218 -41.135886,-8.70068 -41.135886,-8.69918 -41.135886,-8.69768 -41.135886,-8.69618 -41.135886,-8.69468 -41.135886,-8.69318 -41.135886,-8.69168 -41.135886,-8.69018 -41.135886,-8.68868 -41.135886,-8.68718 -41.135886,-8.68568 -41.135886,-8.68418 -41.135886,-8.68268 -41.135886,-8.68118 -41.135886,-8.67968 -41.135886,-8.67818 -41.135886,-8.67668 -41.135886,-8.67518 -41.135886,-8.67368 -41.135886,-8.672179999999999 -41.135886,-8.670679999999999 -41.137386,-8.71268 -41.137386,-8.71118 -41.137386,-8.70968 -41.137386,-8.70818 -41.137386,-8.70668 -41.137386,-8.70518 -41.137386,-8.70368 -41.137386,-8.70218 -41.137386,-8.70068 -41.137386,-8.69918 -41.137386,-8.69768 -41.137386,-8.69618 -41.137386,-8.69468 -41.137386,-8.69318 -41.137386,-8.69168 -41.137386,-8.69018 -41.137386,-8.68868 -41.137386,-8.68718 -41.137386,-8.68568 -41.137386,-8.68418 -41.137386,-8.68268 -41.137386,-8.68118 -41.137386,-8.67968 -41.137386,-8.67818 -41.137386,-8.67668 -41.137386,-8.67518 -41.137386,-8.67368 -41.137386,-8.672179999999999 -41.137386,-8.670679999999999 -41.137386,-8.669179999999999 -41.138886,-8.71268 -41.138886,-8.71118 -41.138886,-8.70968 -41.138886,-8.70818 -41.138886,-8.70668 -41.138886,-8.70518 -41.138886,-8.70368 -41.138886,-8.70218 -41.138886,-8.70068 -41.138886,-8.69918 -41.138886,-8.69768 -41.138886,-8.69618 -41.138886,-8.69468 -41.138886,-8.69318 -41.138886,-8.69168 -41.138886,-8.69018 -41.138886,-8.68868 -41.138886,-8.68718 -41.138886,-8.68568 -41.138886,-8.68418 -41.138886,-8.68268 -41.138886,-8.68118 -41.138886,-8.67968 -41.138886,-8.67818 -41.138886,-8.67668 -41.138886,-8.67518 -41.138886,-8.67368 -41.138886,-8.672179999999999 -41.138886,-8.670679999999999 -41.138886,-8.669179999999999 -41.138886,-8.667679999999999 -41.140386,-8.71268 -41.140386,-8.71118 -41.140386,-8.70968 -41.140386,-8.70818 -41.140386,-8.70668 -41.140386,-8.70518 -41.140386,-8.70368 -41.140386,-8.70218 -41.140386,-8.70068 -41.140386,-8.69918 -41.140386,-8.69768 -41.140386,-8.69618 -41.140386,-8.69468 -41.140386,-8.69318 -41.140386,-8.69168 -41.140386,-8.69018 -41.140386,-8.68868 -41.140386,-8.68718 -41.140386,-8.68568 -41.140386,-8.68418 -41.140386,-8.68268 -41.140386,-8.68118 -41.140386,-8.67968 -41.140386,-8.67818 -41.140386,-8.67668 -41.140386,-8.67518 -41.140386,-8.67368 -41.140386,-8.672179999999999 -41.140386,-8.670679999999999 -41.140386,-8.669179999999999 -41.140386,-8.667679999999999 -41.141886,-8.71268 -41.141886,-8.71118 -41.141886,-8.70968 -41.141886,-8.70818 -41.141886,-8.70668 -41.141886,-8.70518 -41.141886,-8.70368 -41.141886,-8.70218 -41.141886,-8.70068 -41.141886,-8.69918 -41.141886,-8.69768 -41.141886,-8.69618 -41.141886,-8.69468 -41.141886,-8.69318 -41.141886,-8.69168 -41.141886,-8.69018 -41.141886,-8.68868 -41.141886,-8.68718 -41.141886,-8.68568 -41.141886,-8.68418 -41.141886,-8.68268 -41.141886,-8.68118 -41.141886,-8.67968 -41.141886,-8.67818 -41.141886,-8.67668 -41.141886,-8.67518 -41.141886,-8.67368 -41.141886,-8.670679999999999 -41.141886,-8.669179999999999 -41.143386,-8.71268 -41.143386,-8.71118 -41.143386,-8.70968 -41.143386,-8.70818 -41.143386,-8.70668 -41.143386,-8.70518 -41.143386,-8.70368 -41.143386,-8.70218 -41.143386,-8.70068 -41.143386,-8.69918 -41.143386,-8.69768 -41.143386,-8.69618 -41.143386,-8.69468 -41.143386,-8.69318 -41.143386,-8.69168 -41.143386,-8.69018 -41.143386,-8.68868 -41.143386,-8.68718 -41.143386,-8.68568 -41.143386,-8.68418 -41.143386,-8.68268 -41.143386,-8.68118 -41.143386,-8.67968 -41.143386,-8.67818 -41.143386,-8.67668 -41.143386,-8.67518 -41.143386,-8.67368 -41.143386,-8.672179999999999 -41.144886,-8.71268 -41.144886,-8.71118 -41.144886,-8.70968 -41.144886,-8.70818 -41.144886,-8.70668 -41.144886,-8.70518 -41.144886,-8.70368 -41.144886,-8.70218 -41.144886,-8.70068 -41.144886,-8.69918 -41.144886,-8.69768 -41.144886,-8.69618 -41.144886,-8.69468 -41.144886,-8.69318 -41.144886,-8.69168 -41.144886,-8.69018 -41.144886,-8.68868 -41.144886,-8.68718 -41.144886,-8.68568 -41.144886,-8.68418 -41.144886,-8.68268 -41.144886,-8.68118 -41.144886,-8.67968 -41.144886,-8.67818 -41.144886,-8.67668 -41.144886,-8.67518 -41.144886,-8.67368 -41.146386,-8.71268 -41.146386,-8.71118 -41.146386,-8.70968 -41.146386,-8.70818 -41.146386,-8.70668 -41.146386,-8.70518 -41.146386,-8.70368 -41.146386,-8.70218 -41.146386,-8.70068 -41.146386,-8.69918 -41.146386,-8.69768 -41.146386,-8.69618 -41.146386,-8.69468 -41.146386,-8.69318 -41.146386,-8.69168 -41.146386,-8.69018 -41.146386,-8.68868 -41.146386,-8.68718 -41.146386,-8.68568 -41.146386,-8.68418 -41.146386,-8.68268 -41.146386,-8.68118 -41.146386,-8.67968 -41.146386,-8.67818 -41.146386,-8.67668 -41.146386,-8.67518 -41.147886,-8.71268 -41.147886,-8.71118 -41.147886,-8.70968 -41.147886,-8.70818 -41.147886,-8.70668 -41.147886,-8.70518 -41.147886,-8.70368 -41.147886,-8.70218 -41.147886,-8.70068 -41.147886,-8.69918 -41.147886,-8.69768 -41.147886,-8.69618 -41.147886,-8.69468 -41.147886,-8.69318 -41.147886,-8.69168 -41.147886,-8.69018 -41.147886,-8.68868 -41.147886,-8.68718 -41.147886,-8.68568 -41.147886,-8.68418 -41.147886,-8.68268 -41.147886,-8.68118 -41.147886,-8.67968 -41.147886,-8.67818 -41.147886,-8.67668 -41.147886,-8.67518 -41.149386,-8.71268 -41.149386,-8.71118 -41.149386,-8.70968 -41.149386,-8.70818 -41.149386,-8.70668 -41.149386,-8.70518 -41.149386,-8.70368 -41.149386,-8.70218 -41.149386,-8.70068 -41.149386,-8.69918 -41.149386,-8.69768 -41.149386,-8.69618 -41.149386,-8.69468 -41.149386,-8.69318 -41.149386,-8.69168 -41.149386,-8.69018 -41.149386,-8.68868 -41.149386,-8.68718 -41.149386,-8.68568 -41.149386,-8.68418 -41.149386,-8.68268 -41.149386,-8.68118 -41.149386,-8.67968 -41.149386,-8.67818 -41.149386,-8.67668 -41.150886,-8.71268 -41.150886,-8.71118 -41.150886,-8.70968 -41.150886,-8.70818 -41.150886,-8.70668 -41.150886,-8.70518 -41.150886,-8.70368 -41.150886,-8.70218 -41.150886,-8.70068 -41.150886,-8.69918 -41.150886,-8.69768 -41.150886,-8.69618 -41.150886,-8.69468 -41.150886,-8.69318 -41.150886,-8.69168 -41.150886,-8.69018 -41.150886,-8.68868 -41.150886,-8.68718 -41.150886,-8.68568 -41.150886,-8.68418 -41.150886,-8.68268 -41.150886,-8.68118 -41.150886,-8.67968 -41.150886,-8.67818 -41.152386,-8.71268 -41.152386,-8.71118 -41.152386,-8.70968 -41.152386,-8.70818 -41.152386,-8.70668 -41.152386,-8.70518 -41.152386,-8.70368 -41.152386,-8.70218 -41.152386,-8.70068 -41.152386,-8.69918 -41.152386,-8.69768 -41.152386,-8.69618 -41.152386,-8.69468 -41.152386,-8.69318 -41.152386,-8.69168 -41.152386,-8.69018 -41.152386,-8.68868 -41.152386,-8.68718 -41.152386,-8.68568 -41.152386,-8.68418 -41.152386,-8.68268 -41.152386,-8.68118 -41.152386,-8.67968 -41.153886,-8.71268 -41.153886,-8.71118 -41.153886,-8.70968 -41.153886,-8.70818 -41.153886,-8.70668 -41.153886,-8.70518 -41.153886,-8.70368 -41.153886,-8.70218 -41.153886,-8.70068 -41.153886,-8.69918 -41.153886,-8.69768 -41.153886,-8.69618 -41.153886,-8.69468 -41.153886,-8.69318 -41.153886,-8.69168 -41.153886,-8.69018 -41.153886,-8.68868 -41.153886,-8.68718 -41.153886,-8.68568 -41.153886,-8.68418 -41.153886,-8.68268 -41.153886,-8.68118 -41.155386,-8.71268 -41.155386,-8.71118 -41.155386,-8.70968 -41.155386,-8.70818 -41.155386,-8.70668 -41.155386,-8.70518 -41.155386,-8.70368 -41.155386,-8.70218 -41.155386,-8.70068 -41.155386,-8.69918 -41.155386,-8.69768 -41.155386,-8.69618 -41.155386,-8.69468 -41.155386,-8.69318 -41.155386,-8.69168 -41.155386,-8.69018 -41.155386,-8.68868 -41.155386,-8.68718 -41.155386,-8.68568 -41.155386,-8.68418 -41.155386,-8.68268 -41.155386,-8.68118 -41.156886,-8.71268 -41.156886,-8.71118 -41.156886,-8.70968 -41.156886,-8.70818 -41.156886,-8.70668 -41.156886,-8.70518 -41.156886,-8.70368 -41.156886,-8.70218 -41.156886,-8.70068 -41.156886,-8.69918 -41.156886,-8.69768 -41.156886,-8.69618 -41.156886,-8.69468 -41.156886,-8.69318 -41.156886,-8.69168 -41.156886,-8.69018 -41.156886,-8.68868 -41.156886,-8.68718 -41.156886,-8.68568 -41.156886,-8.68418 -41.156886,-8.68268 -41.158386,-8.71268 -41.158386,-8.71118 -41.158386,-8.70968 -41.158386,-8.70818 -41.158386,-8.70668 -41.158386,-8.70518 -41.158386,-8.70368 -41.158386,-8.70218 -41.158386,-8.70068 -41.158386,-8.69918 -41.158386,-8.69768 -41.158386,-8.69618 -41.158386,-8.69468 -41.158386,-8.69318 -41.158386,-8.69168 -41.158386,-8.69018 -41.158386,-8.68868 -41.158386,-8.68718 -41.158386,-8.68568 -41.159886,-8.71268 -41.159886,-8.71118 -41.159886,-8.70968 -41.159886,-8.70818 -41.159886,-8.70668 -41.159886,-8.70518 -41.159886,-8.70368 -41.159886,-8.70218 -41.159886,-8.70068 -41.159886,-8.69918 -41.159886,-8.69768 -41.159886,-8.69618 -41.159886,-8.69468 -41.159886,-8.69318 -41.159886,-8.69168 -41.159886,-8.69018 -41.159886,-8.68868 -41.159886,-8.68718 -41.161386,-8.71268 -41.161386,-8.71118 -41.161386,-8.70968 -41.161386,-8.70818 -41.161386,-8.70668 -41.161386,-8.70518 -41.161386,-8.70368 -41.161386,-8.70218 -41.161386,-8.70068 -41.161386,-8.69918 -41.161386,-8.69768 -41.161386,-8.69618 -41.161386,-8.69468 -41.161386,-8.69318 -41.161386,-8.69168 -41.161386,-8.69018 -41.161386,-8.68868 -41.161386,-8.68718 -41.162886,-8.71268 -41.162886,-8.71118 -41.162886,-8.70968 -41.162886,-8.70818 -41.162886,-8.70668 -41.162886,-8.70518 -41.162886,-8.70368 -41.162886,-8.70218 -41.162886,-8.70068 -41.162886,-8.69918 -41.162886,-8.69768 -41.162886,-8.69618 -41.162886,-8.69468 -41.162886,-8.69318 -41.162886,-8.69168 -41.162886,-8.69018 -41.162886,-8.68868 -41.162886,-8.68718 -41.164386,-8.71268 -41.164386,-8.71118 -41.164386,-8.70968 -41.164386,-8.70818 -41.164386,-8.70668 -41.164386,-8.70518 -41.164386,-8.70368 -41.164386,-8.70218 -41.164386,-8.70068 -41.164386,-8.69918 -41.164386,-8.69768 -41.164386,-8.69618 -41.164386,-8.69468 -41.164386,-8.69318 -41.164386,-8.69168 -41.164386,-8.69018 -41.164386,-8.68868 -41.165886,-8.71268 -41.165886,-8.71118 -41.165886,-8.70968 -41.165886,-8.70818 -41.165886,-8.70668 -41.165886,-8.70518 -41.165886,-8.70368 -41.165886,-8.70218 -41.165886,-8.70068 -41.165886,-8.69918 -41.165886,-8.69768 -41.165886,-8.69618 -41.165886,-8.69468 -41.165886,-8.69318 -41.165886,-8.69168 -41.165886,-8.69018 -41.167386,-8.71268 -41.167386,-8.71118 -41.167386,-8.70968 -41.167386,-8.70818 -41.167386,-8.70668 -41.167386,-8.70518 -41.167386,-8.70368 -41.167386,-8.70218 -41.167386,-8.70068 -41.167386,-8.69918 -41.167386,-8.69768 -41.167386,-8.69618 -41.167386,-8.69468 -41.167386,-8.69318 -41.167386,-8.69168 -41.168886,-8.71268 -41.168886,-8.71118 -41.168886,-8.70968 -41.168886,-8.70818 -41.168886,-8.70668 -41.168886,-8.70518 -41.168886,-8.70368 -41.168886,-8.70218 -41.168886,-8.70068 -41.168886,-8.69918 -41.168886,-8.69768 -41.168886,-8.69618 -41.168886,-8.69468 -41.168886,-8.69318 -41.168886,-8.69168 -41.170386,-8.71268 -41.170386,-8.71118 -41.170386,-8.70968 -41.170386,-8.70818 -41.170386,-8.70668 -41.170386,-8.70518 -41.170386,-8.70368 -41.170386,-8.70218 -41.170386,-8.70068 -41.170386,-8.69918 -41.170386,-8.69768 -41.170386,-8.69618 -41.170386,-8.69468 -41.170386,-8.69318 -41.170386,-8.69168 -41.170386,-8.69018 -41.171886,-8.71268 -41.171886,-8.71118 -41.171886,-8.70968 -41.171886,-8.70818 -41.171886,-8.70668 -41.171886,-8.70518 -41.171886,-8.70368 -41.171886,-8.70218 -41.171886,-8.70068 -41.171886,-8.69918 -41.171886,-8.69768 -41.171886,-8.69618 -41.171886,-8.69468 -41.171886,-8.69318 -41.171886,-8.69168 -41.171886,-8.69018 -41.173386,-8.71268 -41.173386,-8.71118 -41.173386,-8.70968 -41.173386,-8.70668 -41.173386,-8.70518 -41.173386,-8.70368 -41.173386,-8.70218 -41.173386,-8.70068 -41.173386,-8.69918 -41.173386,-8.69768 -41.173386,-8.69618 -41.173386,-8.69468 -41.173386,-8.69318 -41.173386,-8.69168 -41.173386,-8.69018 -41.174886,-8.71268 -41.174886,-8.71118 -41.174886,-8.70968 -41.174886,-8.70818 -41.174886,-8.70668 -41.174886,-8.70518 -41.174886,-8.70368 -41.174886,-8.70218 -41.174886,-8.70068 -41.174886,-8.69918 -41.174886,-8.69768 -41.174886,-8.69618 -41.174886,-8.69468 -41.174886,-8.69318 -41.174886,-8.69168 -41.176386,-8.71268 -41.176386,-8.71118 -41.176386,-8.70818 -41.176386,-8.70668 -41.176386,-8.70518 -41.176386,-8.70368 -41.176386,-8.70218 -41.176386,-8.70068 -41.176386,-8.69918 -41.176386,-8.69768 -41.176386,-8.69618 -41.176386,-8.69468 -41.176386,-8.69318 -41.177886,-8.71268 -41.177886,-8.71118 -41.177886,-8.70968 -41.177886,-8.70818 -41.177886,-8.70668 -41.177886,-8.70518 -41.177886,-8.70368 -41.177886,-8.70218 -41.177886,-8.70068 -41.177886,-8.69918 -41.177886,-8.69768 -41.177886,-8.69618 -41.179386,-8.71268 -41.179386,-8.71118 -41.179386,-8.70818 -41.179386,-8.70668 -41.179386,-8.70518 -41.179386,-8.70368 -41.179386,-8.70218 -41.179386,-8.70068 -41.179386,-8.69918 -41.179386,-8.69768 -41.180886,-8.71268 -41.180886,-8.70968 -41.180886,-8.70818 -41.180886,-8.70668 -41.180886,-8.70518 -41.180886,-8.70368 -41.180886,-8.70218 -41.180886,-8.70068 -41.182386,-8.71268 -41.182386,-8.70968 -41.182386,-8.70818 -41.182386,-8.70668 -41.182386,-8.70518 -41.182386,-8.70368 -41.183886,-8.71268 -41.183886,-8.70968 -41.183886,-8.70818 -41.183886,-8.70668 -41.183886,-8.70518 -41.183886,-8.70368 -41.185386,-8.71268 -41.185386,-8.71118 -41.185386,-8.70968 -41.185386,-8.70818 -41.185386,-8.70668 -41.185386,-8.70518 -41.186886,-8.71268 -41.186886,-8.71118 -41.186886,-8.70968 -41.186886,-8.70818 -41.188386,-8.71268 -41.188386,-8.71118 -41.188386,-8.70968 -41.188386,-8.70818 -41.189886,-8.71268 -41.189886,-8.71118 -41.189886,-8.70968 -41.189886,-8.70818 -41.191386,-8.71268 -41.191386,-8.71118 -41.191386,-8.70968 -41.191386,-8.70818 -41.192886,-8.71268 -41.192886,-8.71118 -41.192886,-8.70968 -41.194386,-8.71268 -41.194386,-8.71118 -41.194386,-8.70968 -41.195886,-8.71268 -41.195886,-8.71118 -41.197386,-8.71268 -41.198886,-8.71268