from geotools.utils.polygon import Polygon
import time


def main():
    p = Polygon([
            [2.3957061767578125, 48.89812957181126],
            [2.399139404296875, 48.890906639609454],
            [2.3996543884277344, 48.88413419286922],
            [2.4090957641601562, 48.8801831753449],
            [2.412700653076172, 48.876570543321755],
            [2.414073944091797, 48.8712640169951],
            [2.414073944091797, 48.86358549323598],
            [2.4164772033691406, 48.849354525964365],
            [2.4125289916992188, 48.83466754148594],
            [2.4109840393066406, 48.833989576686],
            [2.4151039123535156, 48.83342459901093],
            [2.4224853515625, 48.83591045312373],
            [2.4199104309082027, 48.8414466848806],
            [2.4199104309082027, 48.84359322235957],
            [2.422313690185547, 48.84460997116046],
            [2.4247169494628906, 48.84189859515306],
            [2.4372482299804688, 48.84099477053062],
            [2.4381065368652344, 48.84483591253515],
            [2.440166473388672, 48.844497000090826],
            [2.4406814575195312, 48.845965604118284],
            [2.4465179443359375, 48.84585263610676],
            [2.4468612670898438, 48.844948882840264],
            [2.4631690979003906, 48.842689428318415],
            [2.466602325439453, 48.83997794833464],
            [2.4702072143554688, 48.83647540276501],
            [2.469348907470703, 48.833876581660704],
            [2.4657440185546875, 48.83184262762493],
            [2.4647140502929688, 48.827774471831894],
            [2.466602325439453, 48.827322434132746],
            [2.4631690979003906, 48.81884597223549],
            [2.4587059020996094, 48.81681140805428],
            [2.4494361877441406, 48.81805476264432],
            [2.441883087158203, 48.81794173168324],
            [2.4339866638183594, 48.81941111429733],
            [2.4302101135253906, 48.823140892101684],
            [2.4199104309082027, 48.82415805606007],
            [2.4114990234375, 48.82483615389669],
            [2.4025726318359375, 48.829695586560575],
            [2.364120483398437, 48.81590713080018],
            [2.3557090759277344, 48.81579409499648],
            [2.351932525634765, 48.81828082380189],
            [2.346954345703125, 48.81579409499648],
            [2.33184814453125, 48.816924441564105],
            [2.332019805908203, 48.818393853998344],
            [2.291507720947265, 48.826983403182346],
            [2.2789764404296875, 48.832407623139915],
            [2.272796630859375, 48.82788748061953],
            [2.267303466796875, 48.827774471831894],
            [2.2667884826660156, 48.83161662763493],
            [2.270050048828125, 48.832972612283456],
            [2.267475128173828, 48.83466754148594],
            [2.2630119323730464, 48.833876581660704],
            [2.25494384765625, 48.83466754148594],
            [2.2513389587402344, 48.838961105496054],
            [2.2508239746093746, 48.84291537835776],
            [2.252025604248047, 48.84517482268593],
            [2.2420692443847656, 48.847773057644694],
            [2.2394943237304688, 48.850145241393776],
            [2.2235298156738277, 48.85342092943525],
            [2.2279930114746094, 48.86584400488787],
            [2.2322845458984375, 48.87024780944447],
            [2.239837646484375, 48.87171565817035],
            [2.245502471923828, 48.876570543321755],
            [2.255115509033203, 48.87408670745326],
            [2.2585487365722656, 48.88063473600221],
            [2.2774314880371094, 48.87815110193676],
            [2.279834747314453, 48.87894136251639],
            [2.2806930541992188, 48.883005362568866],
            [2.2848129272460938, 48.886617529842795],
            [2.2930526733398438, 48.890455171696374],
            [2.294769287109375, 48.889890831072385],
            [2.310047149658203, 48.897113910028416],
            [2.3186302185058594, 48.89982229558958],
            [2.3201751708984375, 48.90106358992757],
            [2.384033203125, 48.902417694046676],
            [2.3919296264648438, 48.90106358992757],
            [2.3957061767578125, 48.89812957181126]
    ])
    t = time.time()
    print((p.hashcodes(min_precision=2, max_precision=7, cover=False)))
    print("elapsed time: {0:.2f}s".format(time.time() - t))

if __name__ == "__main__":
    main()
