Giter VIP home page Giter VIP logo

wahoomapscreator's People

Contributors

alfh avatar ebe66 avatar mweirauch avatar stanw-cg avatar treee111 avatar zenziwerken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wahoomapscreator's Issues

copy generated files to wahoo device via adb

Is your feature request related to a problem? Please describe.

For many users, the process of copying the files to device might be difficult.
There are some possibilities out there:

  • adb via terminal
  • a GUI program which uses adb in the background
  • standard filebrowser functionality in Windows

Describe the solution you'd like

  • a python -m wahoomc.copy function could do the job
  • possibility via GUI

Describe alternatives you've considered

see description in the beginning

Additional context

Add any other context or screenshots about the feature request here.

Change input.py to run under Linux WSL

Expected Behavior

The pass (see further down) should be replaced by a check to see if command line parameters were supplied else it errors out later on (wsl does not have a graphical interface (yet))

Current Behavior

running "python3 wahoo_map_creator.py" using Linux WSL under Windows
grafik

Steps to Reproduce the Issue

  1. run "python3 wahoo_map_creator.py" using Linux WSL under Windows

Context

  • OS/Platform: Linux WSL under Windows
  • Other information regarding your environment (optional): nothing

Log Output / Stack Trace

get it to run in Windows using WSL:

  • Needed to do this sudo apt-get install zip unzip
  • and sudo apt-get install python3.8-tk (python version matters)
  • Install osmium (and pyosmium) with pip install
  • Changed input.py with
         try:
            tk.Tk.__init__(self, *args, **kwargs)

            # self.geometry("420x360")
            self.title("Wahoo map creator")
            self.configure(bg="white")
            self.option_add("*Font", "Calibri 16")

            container = tk.Frame(self)
            container.pack(side = tk.TOP, fill = tk.BOTH, expand = True)

            self.first = ComboboxesEntryField(container, self.o_input_data.max_days_old)
            self.first.pack(side = tk.TOP, fill = tk.X)

            self.third = Checkbuttons(container, self.o_input_data, controller = self)
            self.third.pack(side = tk.TOP, fill = tk.X)

            self.four = Buttons(container, controller = self)
            self.four.pack(side = tk.TOP, fill = tk.X)
        except:
            pass

one vs. two sets of tags in constants.py for filtering out OSM tags

this issue is about discussing the two sets of constants here:

TAGS_TO_KEEP_UNIVERSAL = {
'access': '',
'area': 'yes',
'bicycle': '',
'bridge': '',
'foot': ['ft_yes', 'foot_designated'],
'highway': ['abandoned', 'bus_guideway', 'disused', 'bridleway', 'byway', 'construction', 'cycleway', 'footway', 'living_street', 'motorway', 'motorway_link', 'path', 'pedestrian', 'primary', 'primary_link', 'residential', 'road', 'secondary', 'secondary_link', 'service', 'steps', 'tertiary', 'tertiary_link', 'track', 'trunk', 'trunk_link', 'unclassified'],
'natural': ['coastline', 'nosea', 'sea', 'beach', 'land', 'scrub', 'water', 'wetland', 'wood'],
'leisure': ['park', 'nature_reserve'],
'railway': ['abandoned', 'bus_guideway', 'disused', 'funicular', 'light_rail', 'miniature', 'narrow_gauge', 'preserved', 'rail', 'subway', 'tram'],
'surface': '',
'tracktype': '',
'tunnel': '',
'waterway': ['canal', 'drain', 'river', 'riverbank'],
'wood': 'deciduous'
}
NAME_TAGS_TO_KEEP_UNIVERSAL = {
'admin_level': '2',
'area': 'yes',
'mountain_pass': '',
'natural': '',
'place': ['city', 'hamlet', 'island', 'isolated_dwelling', 'islet', 'locality', 'suburb', 'town', 'village', 'country']
}

Discussion of #108

Can you (or anybody else) remember why we need two distinct sets resulting in two filtered files which are then merged with land and sea on the tile processing/generation?

Was it because of CLI argument length limitations on some platform?

Originally posted by @mweirauch in #108 (comment)


I looked it up.

We introduced the _NAMES constants and corresponding osmium / osmfilter processing in #46.
There are some sentenced about filtering out names of highways etc. with these additions.

I think lately there was a discussion about the need of these two sets in Telegram with no real outcome. In my opinion there might not be a technical need for two sets.

I'll try if my unittests check if there is a knowingly error. If yes, I could refactor that part in another PR.

Originally posted by @treee111 in #108 (comment)


Ah, thanks. I think I have not fully understood the filtering behaviour of the tools entirely.

At least on the non-Windows side this has no effect as the second osmium tags-filter operation does not explicitely list a name= filter expression like the second osmfilter operation does on the Windows side.
But adding it, the filtered germany map for names blows up from 263MB to 1109MB.

No matter what, names are present when checking with osmium tags-count or a custom vmt-elemnt.xml theme displaying highway names. So I dunno if the two tag-sets are really needed.

Perhaps we can take this discussion to a new issue later on.

Originally posted by @mweirauch in #108 (comment)


Just as a heads up ... I just did a little testing. Using osmfilter to only keep tag historic, making sure it's rendered by osmiums mapwriter plugin and the name tag of the historic node I am looking at is displayed just fine. So I dunno if this is just osmfilter magic with that special name handling, on the osmium side one wouldn't need two sets of tags. (I might still be completely missing something here.)

Originally posted by @mweirauch in #108 (comment)

delete unused files from repo & from the builded .zip

Is your feature request related to a problem? Please describe.

  • files which are not needed are blowing up the size of the repo and make it harder to understand

Describe the solution you'd like

  • deletion of not needed files

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

move `common_download` and `output` dir one level up to be release independent

Is your feature request related to a problem? Please describe.

while testing different releases or upgrading the release, the downloaded files either need to be copied from one release folder to the other or newly downloaded.

Describe the solution you'd like

  • move the common_download folder onto the same level as the root-repo folder or downloaded Release .zip is
  • move the output folder also to the same level as the root-repo
    • later on one could include the version in the output folder (because it might be release-dependent)
    • I think it makes sense to leave this folder in the repo because the generated content might be release-dependent

Describe alternatives you've considered

  • moving the folders to the user-directory

Additional context

Add any other context or screenshots about the feature request here.

Maps only containing coastline

I tried to download Norway using this tool, but all of the map files only contain the coastline, lakes and sea. There are no roads, no locations etc.

The screenshot show the city of Trondheim, Norway using Cruiser. As you can see, it sure could use some more detail :)

Uten navn 7

Make Anaconda environment release independent

Is your feature request related to a problem? Please describe.

While testing different releases or upgrading the release, it is not convenient if one has to create a new Anaconda environment for each new release to use

Describe the solution you'd like

Move conda environment from the root of wahooMapsCreator to the standard place for Anaconda environments to use it throughout different releases

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Error when using latest osmium-tool v1.13.2 under macOS

Expected Behavior

This tool should run with the newest version of osmium-tool v1.13.2
With brew under macOS it is a little hassle to insall older formulae versions. E.g. v1.13.1 of osmium-tool.

Current Behavior

when osmium-tool is installed in version 1.13.2 on macOS (and maybe Windows as well) the following error happens:
Objects in input file '/Users/benjamin/VSCode/wahooMapsCreator/output/138/100/land1.osm' out of order (must be nodes, then ways, then relations).

The cause is this new feature of v1.13.2:
- The `osmium merge` command now checks that the input files are ordered
in version https://github.com/osmcode/osmium-tool/releases/tag/v1.13.2
which seams to be made via commit osmcode/osmium-tool@740a565

Somehow our generated land1.osm file seams not like osmium-tool needs it.

The file land1.osm is generated here:

if not os.path.isfile(out_file+'1.osm') or self.force_processing is True:
# Windows
if platform.system() == "Windows":
cmd = ['python', os.path.join(fd_fct.TOOLING_DIR,
'shape2osm.py'), '-l', out_file, land_file]
# new shapefile for python 3 ?!
# 'shape2osm', 'shape2osm.py'), land_file, out_file+'1.osm']
# Non-Windows
else:
cmd = ['python3', os.path.join(fd_fct.TOOLING_DIR,
'shape2osm.py'), '-l', out_file, land_file]
subprocess.run(cmd, check=True)

The error occurs in line 464, the command is built in the lines above

cmd = ['osmium', 'merge', '--overwrite']
# loop through all countries of tile, if border-countries should be processed.
# if border-countries should not be processed, only process the "entered" country
for country in tile['countries']:
if calc_border_countries or country in self.border_countries:
cmd.append(os.path.join(fd_fct.OUTPUT_DIR,
f'{tile["x"]}', f'{tile["y"]}', f'split-{country}.osm.pbf'))
cmd.append(os.path.join(fd_fct.OUTPUT_DIR,
f'{tile["x"]}', f'{tile["y"]}', f'split-{country}-names.osm.pbf'))
land_files = glob.glob(os.path.join(fd_fct.OUTPUT_DIR,
f'{tile["x"]}', f'{tile["y"]}', 'land*.osm'))
for land in land_files:
cmd.append(os.path.join(fd_fct.OUTPUT_DIR,
f'{tile["x"]}', f'{tile["y"]}', f'{land}'))
cmd.append(os.path.join(fd_fct.OUTPUT_DIR,
f'{tile["x"]}', f'{tile["y"]}', 'sea.osm'))
cmd.extend(['-o', out_file])
result = subprocess.run(cmd, check=True)

Steps to Reproduce the Issue

  1. Install all required software including osmium-tool in the current version 1.13.2
  2. Run wahooMapsCreator, e.g with python3 wahoo_map_creator.py malta
  3. The error occurs

Context

  • OS/Platform: macOS Catalina
  • Other information regarding your environment (optional): osmium-tool v1.13.2

Log Output / Stack Trace

when osmium-tool is installed in version 1.13.2 on macOS (and maybe Windows as well) the following error happens:
grafik
Objects in input file '/Users/benjamin/VSCode/wahooMapsCreator/output/138/100/land1.osm' out of order (must be nodes, then ways, then relations).

extract zipping function and call it in `zip_map_files` and `make_cruiser_files`

Is your feature request related to a problem? Please describe.

A clear and concise description of the problem, e.g. "I'm always frustrated when {...}"

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

GUI: Add second tab for "advanced" input parameter

Is your feature request related to a problem? Please describe.

All of the arguments which can be used via CLI should also be usable via GUI.

Describe the solution you'd like

  • make a second "tab" or similar named "advanced settings" or similar
  • put there all the "advaned" input parameters which are available actually

Describe alternatives you've considered

  • putting all settings onto the main window separated by a line or as a separate "group"

Additional context

Add any other context or screenshots about the feature request here.

Keep downloading updated countries file

` # 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.

create / update documentation

Is your feature request related to a problem? Please describe.

New users need assistance.

Describe the solution you'd like

  • Documentation for cruiser usage and map creation for cruiser
  • Creation of .json file for relevant tiles and use this file --> not needed anymore, X/Y CLI argument is possible - via #99
  • Clarify and unify Quickstart docu for macOS and Windows - via #84
  • documentation of cli arguments - via #170
  • document how to restore original maps

Converting map crashes - uncomplete installation (Java)

Expected Behavior

Map should be converted for Wahoo Device

Current Behavior

Converting fails

Steps to Reproduce the Issue

  1. Downloaded latest Anaconda / wahooMapsCreator Version
  2. Extracted wahooMapsCreator to D:\wahooMapsCreator
  3. Created Anaconda environment inside wahooMapsCreator Dir conda env create --prefix ./envs -f ./conda_env/enduser.yml
  4. Activated profile conda activate D:\wahooMapsCreator\envs
  5. Started create process python wahoo_map_creator.py

Context

  • OS/Platform: Windows 10, Anaconda, wahooMapsCreator v.1.0.0

Log Output / Stack Trace

python wahoo_map_creator.py
+ Input country or json file: germany.

# Read json file
+ Use json file D:\wahooMapsCreator\common_resources\json\europe\germany.json with 57 tiles
# Read json file: OK

# check D:\wahooMapsCreator\common_download\land-polygons-split-4326\land_polygons.shp file
# D:\wahooMapsCreator\common_download\land-polygons-split-4326\land_polygons.shp file needs to be downloaded
# Downloading land_polygons.shp file
+ Downloaded: D:\wahooMapsCreator\common_download\land-polygons-split-4326\land_polygons.shp
# check land_polygons.shp file: OK

# check countries .osm.pbf files
+ Checking for old maps and remove them
+ Trying to download missing map of germany.
# Downloading germany-latest.osm.pbf file
+ Downloaded: D:\wahooMapsCreator\common_download\maps\germany-latest.osm.pbf
# Check countries .osm.pbf files: OK

# Filter tags from country osm.pbf files

+ Converting map of germany to o5m format
Traceback (most recent call last):
  File "wahoo_map_creator.py", line 41, in <module>
    oOSMmaps.filter_tags_from_country_osm_pbf_files()
  File "D:\wahooMapsCreator\common_python\osm_maps_functions.py", line 143, in filter_tags_from_country_osm_pbf_files
    result = subprocess.run(cmd, check=True)
  File "D:\wahooMapsCreator\envs\lib\subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['D:\\wahooMapsCreator\\tooling_windows\\osmconvert', '-v', '--hash-memory=2500', '--complete-ways', '--complete-multipolygons', '--complete-boundaries', '--drop-author', '--drop-version', 'D:\\wahooMapsCreator\\common_download\\maps\\germany-latest.osm.pbf', '-o=D:\\wahooMapsCreator\\output\\outFile-germany.o5m']' returned non-zero exit status 3221225781.

GUI support

  • get GUI parts from the snippets below
  • put it into a separate python file
  • Maybe together with the CLI arguments
  • GUI and CLI - can they be used both / exist somehow in parallel?

Existing GUI functionality to be used:

# for gui
import tkinter as tk
from tkinter import ttk
from tkinter import *

# GUI
def create_map():
global country_gui
global region_gui
region_gui = cboContinent.get().replace("-", "")
country_gui = cboCountry.get()
app.destroy()
def callback_continent(event):
continent = cboContinent.get()
cboCountry["values"] = eval(continent.replace("-", ""))
cboCountry.current(0)
if continent == "europe":
cboCountry.current(14)
def switch_reload():
if fp.get() == 0:
enMaxOldDays.configure(state=NORMAL)
else:
enMaxOldDays.configure(state=DISABLED)
app = tk.Tk()
app.geometry("420x360")
app.title("Wahoo map creator")
app.option_add("*Font", "Calibri 16")
country_gui = "none"
region_gui = "none"
app.grid_rowconfigure(3, minsize=30)
app.grid_rowconfigure(6, minsize=10)
app.grid_rowconfigure(8, minsize=10)
labTop = tk.Label(app, text="Select continent and country to create a map")
labContinent = tk.Label(app, text="Select continent:")
labCountry = tk.Label(app, text='Select country:')
labMaxOld = tk.Label(app, text='Max Old Days:')
labTop.grid(column=0, row=0, columnspan=2, sticky=E, padx=5, pady=10)
labContinent.grid(column=0, row=1, sticky=E, padx=5, pady=2)
labCountry.grid(column=0, row=2, sticky=NE, padx=5, pady=2)
labMaxOld.grid(column=0, row=4, sticky=SE, padx=5)
cboContinent = ttk.Combobox(app, values=constants.continents, state="readonly", width=15)
cboCountry = ttk.Combobox(app, values=constants.europe, state="readonly", width=15)
cboContinent.grid(column=1, row=1, sticky=W, padx=10, pady=2)
cboCountry.grid(column=1, row=2, sticky=NW, padx=10, pady=2)
cboContinent.current(0)
cboCountry.current(14)
cboContinent.bind("<<ComboboxSelected>>", callback_continent)
fp = IntVar()
fp.set(FORCE_PROCESSING)
maxdays = StringVar()
maxdays.set(str(MAX_DAYS_OLD))
save_cruiser_maps = IntVar()
save_cruiser_maps.set(SAVE_CRUISER)
enMaxOldDays = tk.Entry(app, textvar=maxdays, width=5)
enMaxOldDays.grid(column=1, row=4, sticky=SW, padx=10)
chkReloadMaps = Checkbutton(app, text="Force reload maps", var=fp, command=switch_reload)
chkReloadMaps.grid(column=1, row=5, sticky=NW, padx=5)
chkSaveCruiser = Checkbutton(app, text="Save uncompressed maps for Cruiser", var=save_cruiser_maps, command=switch_reload)
chkSaveCruiser.grid(columnspan=2, column=0, row=7, sticky=S, pady=5)
btnOK = tk.Button(app, text="Create map", width=15, command=create_map).grid(column=0, row=9, padx=15, pady=10)
btnCancel = tk.Button(app, text="Exit", width=15, command=app.destroy).grid(column=1, row=9, padx=10, pady=10)
switch_reload()
app.mainloop() # show gui
FORCE_PROCESSING = fp.get()
SAVE_CRUISER = save_cruiser_maps.get()
MAX_DAYS_OLD = int(maxdays.get())
print('# Force Processing = ' + str(FORCE_PROCESSING))
print('# Max Days Old = ' + str(MAX_DAYS_OLD))
print('# Save Cruiser maps = ' + str(SAVE_CRUISER))
print(f"# GUI exits with {country_gui} in {region_gui}")
if country_gui == "none":
sys.exit()
# End of GUI

Change order of CHANGELOG commit groups

Expected Behavior

The CHANGELOG groups should be in the following order:

  1. Breaking Changes
  2. Features
  3. Bugfixes
  4. Development/Infrastructure/Test/CI

Current Behavior

The order of CHANGELOG groups is as follows:
image

Steps to Reproduce the Issue

  1. Create the CHANGELOG.md using
  • into file: git-chglog -o CHANGELOG.md --next-tag v0.10.0
  • just output it: git-chglog --next-tag v0.10.0

Context

  • OS/Platform: unknown
  • Other information regarding your environment (optional): nothing

Log Output / Stack Trace

{...}

crash under Windows // osmconvert.exe // zlib1.dll

Expected Behavior

osmconvert.exe should be usable without changes in the OS of Windows

Current Behavior

  • osmconvert.exe can not be used with some Windows installations
  • the programs crashes in line 143, when calling osmconvert.exe

print(f'\n+ Converting map of {key} to o5m format')
cmd = [os.path.join(fd_fct.TOOLING_WIN_DIR, 'osmconvert')]
cmd.extend(['-v', '--hash-memory=2500', '--complete-ways',
'--complete-multipolygons', '--complete-boundaries',
'--drop-author', '--drop-version'])
cmd.append(val['map_file'])
cmd.append('-o='+out_file_o5m)
result = subprocess.run(cmd, check=True)
if result.returncode != 0:
print(f'Error in OSMConvert with country: {key}')
sys.exit()

Steps to Reproduce the Issue

  1. download release v1.0.0 or clone repo in latest state
  2. run python wahoo_map_creator.py malta

Context

  • OS/Platform: Windows
  • Other information regarding your environment (optional): nothing
  • the osmconvert.exe was replaced to the current on in #38

Log Output / Stack Trace

first, this error occurs:
grafik

after performing the steps mentioned in the video https://www.youtube.com/watch?v=P-97qrYdqNA, still this error occurs:

grafik

log using "global" logging-object instad of using `print` for output

Is your feature request related to a problem? Please describe.

A clear and concise description of the problem, e.g. "I'm always frustrated when {...}"

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Convert to correct python module and distribute via Pypy

Is your feature request related to a problem? Please describe.

A clear and concise description of the problem, e.g. "I'm always frustrated when {...}"

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

FileNotFoundError: [Errno 2] No such file or directory: 'osmium': 'osmium'

Hi,

Expected Behavior

according to the documentation, map for example austria should be created with this command:

python wahoo_map_creator.py austria

Current Behavior

Unfortunately, on a fresh installed Ubuntu (Ubuntu 21.10) buil fails with following error message:

python wahoo_map_creator.py austria
+ Input country or json file: austria.

# Read json file
+ Use json file /home/bka/Downloads/common_resources/json/europe/austria.json with 19 tiles
# Read json file: OK

# check land_polygons.shp file
# check land_polygons.shp file: OK

# check countries .osm.pbf files
+ Checking for old maps and remove them
+ mapfile for austria: up-to-date. Input: austria.
# Check countries .osm.pbf files: OK

# Filter tags from country osm.pbf files
+ Create filtered country file for austria
Traceback (most recent call last):
  File "wahoo_map_creator.py", line 41, in <module>
    oOSMmaps.filter_tags_from_country_osm_pbf_files()
  File "/home/bka/Downloads/common_python/osm_maps_functions.py", line 197, in filter_tags_from_country_osm_pbf_files
    result = subprocess.run(cmd, check=True)
  File "/home/bka/Downloads/envs/lib/python3.7/subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/home/bka/Downloads/envs/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/home/bka/Downloads/envs/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'osmium': 'osmium'

Context

  • OS/Platform:
 lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.10
Release:	21.10
Codename:	impish
  • conda
conda -V
conda 4.10.3
  • python
python3 -V
Python 3.7.11

wahooMapsCreator-v2.0.0-Windows.zip: Location of `tooling_win` incorrect

Code to reproduce

Invoke-WebRequest -URI 'https://github.com/treee111/wahooMapsCreator/releases/download/v2.0.0/wahooMapsCreator-v2.0.0-Windows.zip' -OutFile "$DownloadFolder\wahooMapsCreator-current.zip"
$WahooMapsCreatorHome="$DownloadFolder\wahooMapsCreator-current"
New-Item -Type directory -Force -Path $WahooMapsCreatorHome
Expand-Archive -Path "$DownloadFolder\wahooMapsCreator-current.zip" -DestinationPath $WahooMapsCreatorHome

$GdalEnvironment="C:\Program Files\Anaconda3\envs\gdal-user"
$DownloadFolder="$HOME\Desktop\wahooMapsCreator"
$WahooMapsCreatorHome="$DownloadFolder\wahooMapsCreator-current"
cd $WahooMapsCreatorHome
Remove-Item -Recurse -Force $GdalEnvironment
powershell -ExecutionPolicy ByPass -NoExit -Command "& 'C:\Program Files\Anaconda3\shell\condabin\conda-hook.ps1' ; conda activate 'C:\Program Files\Anaconda3'"
conda env create -f .\conda_env\gdal-user.yml

$DownloadFolder="$HOME\Desktop\wahooMapsCreator"
$WahooMapsCreatorHome="$DownloadFolder\wahooMapsCreator-current"

cd $WahooMapsCreatorHome
conda activate gdal-user
python -m wahoomc cli -co malta -fp -fd -tag tag-wahoo.xml

Output:

INFO:--------------------------------------------------------------------------------
INFO:# Input country: malta.
INFO:--------------------------------------------------------------------------------
INFO:# Determine involved/border countries
INFO:+ Involved country: malta
INFO:--------------------------------------------------------------------------------
INFO:# check C:\Users\gercri\wahooMapsCreatorData\_download\land-polygons-split-4326\land_polygons.shp file
INFO:+ Deleting old C:\Users\gercri\wahooMapsCreatorData\_download\land-polygons-split-4326\land_polygons.shp file
INFO:+ C:\Users\gercri\wahooMapsCreatorData\_download\land-polygons-split-4326\land_polygons.shp file needs to be downloaded
INFO:# Need to download land polygons file
INFO:--------------------------------------------------------------------------------
INFO:+ Downloading land_polygons.shp file
INFO:+ Downloaded: C:\Users\gercri\wahooMapsCreatorData\_download\land-polygons-split-4326\land_polygons.shp
INFO:+ check land_polygons.shp file: OK
INFO:--------------------------------------------------------------------------------
INFO:# check countries .osm.pbf files
INFO:+ Checking for old maps and remove them
INFO:+ mapfile for malta: deleted. Input: malta.
INFO:--------------------------------------------------------------------------------
INFO:+ Downloading malta-latest.osm.pbf file
INFO:+ Downloaded: C:\Users\gercri\wahooMapsCreatorData\_download\maps\malta-latest.osm.pbf
INFO:+ Check countries .osm.pbf files: OK
INFO:--------------------------------------------------------------------------------
INFO:# Filter tags from country osm.pbf files
INFO:! cmd.append is ['C:\\Users\\gercri\\Desktop\\wahooMapsCreator\\wahooMapsCreator-current\\wahoomc\\tooling_win\\osmconvert64-0.8.8p', '-v', '--hash-memory=2500', '--complete-ways', '--complete-multipolygons', '--complete-boundaries', '--drop-author', '--drop-version', 'C:\\Users\\gercri\\wahooMapsCreatorData\\_download\\maps\\malta-latest.osm.pbf', '-o=C:\\Users\\gercri\\wahooMapsCreatorData\\_tiles\\outFile-malta.o5m']:
Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\envs\gdal-user\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Program Files\Anaconda3\envs\gdal-user\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\gercri\Desktop\wahooMapsCreator\wahooMapsCreator-current\wahoomc\__main__.py", line 7, in <module>
    main.run()
  File "C:\Users\gercri\Desktop\wahooMapsCreator\wahooMapsCreator-current\wahoomc\main.py", line 47, in run
    o_osm_maps.filter_tags_from_country_osm_pbf_files()
  File "C:\Users\gercri\Desktop\wahooMapsCreator\wahooMapsCreator-current\wahoomc\osm_maps_functions.py", line 269, in filter_tags_from_country_osm_pbf_files
    cmd, '! Error in OSMConvert with country: {key}')
  File "C:\Users\gercri\Desktop\wahooMapsCreator\wahooMapsCreator-current\wahoomc\osm_maps_functions.py", line 79, in run_subprocess_and_log_output
    with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as process:
  File "C:\Program Files\Anaconda3\envs\gdal-user\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files\Anaconda3\envs\gdal-user\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

Solution

  • tooling_win must reside inside wahoomc
$DownloadFolder="$HOME\Desktop\wahooMapsCreator"
$WahooMapsCreatorHome="$DownloadFolder\wahooMapsCreator-current"

Move-Item $WahooMapsCreatorHome/tooling_win $WahooMapsCreatorHome/wahoomc/tooling_win

use relative paths where possible

Is your feature request related to a problem? Please describe.

There are a lot of long os.path.join statements to build paths throughout the repo.
These should be shortened to make the coding more readable.

Describe the solution you'd like

do not build huge os.path.join statements but use that:

dirname_of_file = os.path.dirname(__file__)

and build the path from the location of the current file onwards if possible:

given_osm_pbf_file = os.path.join(
dirname_of_file, 'resources', given_osm_pbf)

Error with GUI on Mac OS

python3 wahoo_map_creator.py

Select 'asia', then....

Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tkinter/__init__.py", line 1883, in __call__ return self.func(*args) File "/Users/edwardwang/Documents/Code/wahooMapsCreator/common_resources/input.py", line 212, in callback_continent self.cb_country["values"] = ast.literal_eval('constants.' + continent.replace("-", "")) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ast.py", line 99, in literal_eval return _convert(node_or_string) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ast.py", line 98, in _convert return _convert_signed_num(node) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ast.py", line 75, in _convert_signed_num return _convert_num(node) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ast.py", line 66, in _convert_num _raise_malformed_node(node) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ast.py", line 63, in _raise_malformed_node raise ValueError(f'malformed node or string: {node!r}') ValueError: malformed node or string: <_ast.Attribute object at 0x7fb6b826fa60>

`filter_tags_from_country_osm_pbf_files` is broken on macOS

Expected Behavior

reset filter_tags_from_country_osm_pbf_files for macOS to version before merging #46

  • make filter_tags_from_country_osm_pbf_files equal for processing in Windows and macOS:
    Windows

    if not os.path.isfile(out_file_o5m_filtered) or self.force_processing is True:

    vs. others / macOS
    if not os.path.isfile(out_file_o5m_filtered):

  • correct constants for <> Windows to be correctly interpreted

    # Tags to keep
    # filtered_tags = ['access', 'admin_level', 'aerialway', 'aeroway', 'barrier',
    # 'boundary', 'bridge', 'highway', 'natural', 'oneway', 'place',
    # 'railway', 'tracktype', 'tunnel', 'waterway']
    FILTERED_TAGS = 'access \
    area=yes \
    bicycle \
    bridge \
    foot=ft_yes, foot_designated \
    highway=abandoned, bus_guideway, disused, bridleway, byway, construction, cycleway, footway, living_street, motorway, motorway_link, path, pedestrian, primary, primary_link, residential, road, secondary, secondary_link, service, steps, tertiary, tertiary_link, track, trunk, trunk_link, unclassified \
    natural=coastline, nosea, sea, beach, land, scrub, water, wetland =wood \
    leisure=park, nature_reserve \
    railway=abandoned, bus_guideway, disused, funicular, light_rail, miniature, narrow_gauge, preserved, rail, subway, tram \
    surface \
    tracktype \
    tunnel \
    waterway=canal, drain, river, riverbank \
    wood=deciduous'

path for zip files is not identical on different OS

Expected Behavior

Identical paths for all OS

Current Behavior

the zip files the max/linux/wsl creates contain full paths. For me that means that the tiles are in \mnt\c\wahoomapscreator\output\netherlands\ the windows version has just the folder netherlands

Steps to Reproduce the Issue

  1. {...}
  2. {...}
  3. {...}

Context

  • OS/Platform: unknown
  • Other information regarding your environment (optional): nothing

Log Output / Stack Trace

zip for malta using macOS
grafik

zip for malta using Windows
image

Calculate relevant tiles using a URL instead of static json files

Use https://download.geofabrik.de/index-v1.json for map creation instead of the wahoo json files in folder common_resources\json

The relevant tiles are calculated here:

json_file_path = os.path.join (COMMON_DIR,
'json', region, input_argument1 + '.json')
with open(json_file_path) as json_file:
tiles_from_json = json.load(json_file)
json_file.close()
if tiles_from_json == '' :
print ('! Json file could not be opened.')
sys.exit()

ERROR:Error in Osmosis with sorting land* osm files of tile: 129,94

Expected Behavior

{That the tiles are sorted}

Current Behavior

{Error thrown in GUI
ERROR:Error in Osmosis with sorting land* osm files of tile: 129,94 }

Steps to Reproduce the Issue

  1. {...}
  2. {...}
  3. {...}

Context

  • OS/Platform: Windows 10 64 bit
  • Other information regarding your environment (optional): nothing

Log Output / Stack Trace

{...}

Split zip files of releases into one per OS & zip certain folders during build

Is your feature request related to a problem? Please describe.

  • the downloaded .zip files are around 50 MB and include both macOS/Linux and Windows files
  • the unzip process takes some time but there might be files which are not needed in the first run, i.e. cruiser

Describe the solution you'd like

  • reduction of the .zip file throught splitting into macOS/Linux and Windows .zip files during build
  • not everyday-used files should be zipped before adding to the builded .zip - i.e. cruiser

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

macOS: automate the installation even more // setup.py file?!

Is your feature request related to a problem? Please describe.

  • on macOS there are some steps during installation that need to be performed manually
  • the check of the successful installations along with giving hints how to perform the installation would be good

Describe the solution you'd like

  • automate this step every time, wahooMapsCreator is running or only the first time (setup.py might help)
    4. Install mapsforge-map-writer plugin (Osmosis Plugin)
    * Download the [mapsforge-map-writer](https://search.maven.org/search?q=a:mapsforge-map-writer) plugin, click on "file_download" and select "jar-with-dependecies.jar".
    * Put the .jar in this directory. Create it when it doesn't exist:
    `~/.openstreetmap/osmosis/plugins`
    * more information: https://github.com/mapsforge/mapsforge/blob/master/docs/Getting-Started-Map-Writer.md#plugin-installation
  • check, if the brew parts can be established via cmd... calls
    • could be done via python -m wahoomc.init function
    • other initialization stuff could be included there as well

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

path of static .json file of Mexico is not correct

Expected Behavior

processing of mexico is not possible.

Current Behavior

maps should be created for mexico.

Steps to Reproduce the Issue

  • python wahoo_maps_creator.py gui --> select north-america and mexico

grafik
or

  • python wahoo_map_creator.py mexico

Context

  • OS/Platform: Windows
  • Other information regarding your environment (optional): nothing

Log Output / Stack Trace

grafik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.