Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import errors #54

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft

Conversation

chriskilding
Copy link

Fix the import errors that arose from the renaming of the modules.

Addresses #53

@ARobinsonAtTTC
Copy link

Damn though I had caught most of theses. Good catch.

@chriskilding
Copy link
Author

I'm doing a single-tile build for +51+000 (i.e. the East London tile) to see how far I can get it through the process.

With a few more fixes I have got as far as

Step 3 : Building DSF/Imagery for tile <lat/long> : 
--------

-> Initializing providers with potential data on this tile.
-> Opening download queue.
-> Opening convert queue and 4 conversion workers.
-> Computing the pool quadtree
     Number of buckets: 67
     Average depth: 3.0597014925373136 , Average bucket size: 9543.223880597016
     Largest depth: 4

However it then fails with

  File "/Users/chris/Documents/Git/Ortho4XP/Ortho4XP/src/filenames.py", line 394, in jpeg_file_dir_from_attributes
    provider["code"] + "_" + str(zoomlevel),
KeyError: 'code'

The snippet of code around this point is:

def jpeg_file_dir_from_attributes(lat, lon, zoomlevel, provider):
    # ...
    elif provider["imagery_dir"] == "grouped":
        file_dir = os.path.join(
            Imagery_dir,
            long_latlon(lat, lon),
            provider["code"] + "_" + str(zoomlevel),     # the line where it fails
        )

The contents of the provider dictionary at that point are:

{
'grid_type': 'webmercator',
'directory': 'Global',
'in_GUI': True,
'image_type': 'jpeg',
'extent': 'global',
'color_filters': 'none',
'imagery_dir': 'grouped',
'request_type': 'tms',
'tile_size': 256,
'epsg_code': '3857',
'top_left_corner': [[-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34], [-20037508.34, 20037508.34]],
'resolutions': array([1.56543034e+05, 7.82715170e+04, 3.91357585e+04, 1.95678792e+04,
       9.78393962e+03, 4.89196981e+03, 2.44598490e+03, 1.22299245e+03,
       6.11496226e+02, 3.05748113e+02, 1.52874057e+02, 7.64370283e+01,
       3.82185141e+01, 1.91092571e+01, 9.55462853e+00, 4.77731427e+00,
       2.38865713e+00, 1.19432857e+00, 5.97164283e-01, 2.98582142e-01,
       1.49291071e-01]),
'url_template': 'http://r{switch:0,1,2,3}.ortho.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=136'
}

So, indeed, the code property is not present in the dictionary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants