NSCC-COGS / Aestheta

An Industrial Think Tank Focused on Developing and Promoting AI Technology for Geospatial Applications [Please note this group was formed as an academic exercise for educational purposes and does not represent a real world organization]
MIT License
7 stars 3 forks source link

getTiles_3x3() function does not work with lat/lon as input #74

Closed kkmcgg closed 3 years ago

kkmcgg commented 3 years ago

https://github.com/NSCC-COGS/Aestheta/blob/229dbbfe474a2a7740f5e8bf74b0633c80c5feec/Library/core.py#L180

Running the following test:

import Aestheta.Library.core as core core.getTiles_3x3([-63.5752,44.6488,2],source='google_sat',show=True)

Gives the following result:

image

We can determine the tile for these coordinates using our _tile_fromcords() function:

print(core.tile_from_coords(63.5752,44.6488,2))

which returns:

[2, 1, 2]

If we plug these into the getTiles_3x3() we see the correct results:

core.getTiles_3x3([2,1,2],source='google_sat',show=True) image

Implement a fix in the code base such that this error is resolved

bojiang423 commented 3 years ago

I've updated getTile_3x3. Similar to getTile(), program will check if input x & y are float, if yes, call tile_from_coord() to get tile first.

    # check if input are coordinates (float)
    if isinstance(x, float) and isinstance(y, float):
        x, y, z = tile_from_coords(x, y, z)
kkmcgg commented 3 years ago

great job @bojiang423 thanks!