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

Keep downloading updated countries file #10

Closed
assofour opened this issue Jun 30, 2021 · 4 comments
Closed

Keep downloading updated countries file #10

assofour opened this issue Jun 30, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@assofour
Copy link

` # ToDo: comment
if len(map_files) == 1 and os.path.isfile(map_files[0]):
file_creation_timestamp = os.path.getctime(map_files[0])
if file_creation_timestamp < to_old_timestamp or self.force_download == 1:
print(f'+ mapfile for {country}: deleted')
os.remove(map_files[0])
need_to_download = True
else:
border_countries[country] = {'map_file':map_files[0]}
print(f'+ mapfile for {country}: up-to-date')

        if len(border_countries[country]) != 1 or not os.path.isfile(border_countries[country]['map_file']):
            # if there exists no file or it is no file --> download
            need_to_download = True`

I need to download China map with many border countries, so len(border_countries[country]) != 1 will always be true and it will always download all map files over times.

@treee111
Copy link
Owner

hi!
thanks for your suggestion.
How are you starting the tool, with which country?

I gonna go into it and will hopefully correct it accordingly

@treee111 treee111 self-assigned this Jun 30, 2021
@treee111 treee111 added the bug Something isn't working label Jun 30, 2021
@assofour
Copy link
Author

assofour commented Jul 1, 2021

hi!
thanks for your suggestion.
How are you starting the tool, with which country?

I gonna go into it and will hopefully correct it accordingly

I am going to build map with China since I just got a Bolt V2. However I found I actually don't need all 'border countries', if there is a parameter to ignore them.

And I found another thing that 'Hong Kong' and 'Macao' are as same as China's map data, the tool downloaded 3 exactly same size file with diff filenames.

@treee111 treee111 added enhancement New feature or request and removed bug Something isn't working labels Jul 1, 2021
@treee111
Copy link
Owner

treee111 commented Jul 1, 2021

Hi, i released a new version: https://github.com/treee111/wahooMapsCreator/releases

Release v0.4.0 changes the download of maps from the selected country and 'border countries'.

Not maps of all countries and border-countries are downloaded if FORCE_DOWNLOAD = False.
If parameter FORCE_DOWNLOAD = False, only these maps are downloaded:

  • deleted maps are downloaded
  • out-of-date maps are downloaded

I would be happy if you could try this release and check if the first issue will be resolved!

Concerning the 'border countries':
These countries are needed to build the parts of the map where another country is involved.
If you think a parameter would be good to generate a country without the border-parts, I can introduce such a parameter!

I also will have a look into 3x the same maps.

I create two separate issues for these two things.

@assofour
Copy link
Author

assofour commented Jul 2, 2021

Hi, i released a new version: https://github.com/treee111/wahooMapsCreator/releases

Release v0.4.0 changes the download of maps from the selected country and 'border countries'.

Not maps of all countries and border-countries are downloaded if FORCE_DOWNLOAD = False.
If parameter FORCE_DOWNLOAD = False, only these maps are downloaded:

  • deleted maps are downloaded
  • out-of-date maps are downloaded

I would be happy if you could try this release and check if the first issue will be resolved!

Concerning the 'border countries':
These countries are needed to build the parts of the map where another country is involved.
If you think a parameter would be good to generate a country without the border-parts, I can introduce such a parameter!

I also will have a look into 3x the same maps.

I create two separate issues for these two things.

I did tried and built map successfully, copied to Bolt V2, also works very well so far.

@treee111 treee111 closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants