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

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

Closed
treee111 opened this issue Jan 13, 2022 · 0 comments · Fixed by #78
Closed

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

treee111 opened this issue Jan 13, 2022 · 0 comments · Fixed by #78
Labels
bug Something isn't working
Milestone

Comments

@treee111
Copy link
Owner

treee111 commented Jan 13, 2022

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).

@treee111 treee111 added the bug Something isn't working label Jan 13, 2022
@treee111 treee111 changed the title tbd tool does not work with latest osmium-tool v1.13.2 under macOS Jan 13, 2022
@treee111 treee111 changed the title tool does not work with latest osmium-tool v1.13.2 under macOS Error when using latest osmium-tool v1.13.2 under macOS Jan 13, 2022
@treee111 treee111 added this to the v0.12.0 milestone Jan 13, 2022
treee111 added a commit that referenced this issue Jan 13, 2022
treee111 added a commit that referenced this issue Jan 15, 2022
…merging (#78)

- sorts land*.osm files to be in this order: nodes, then ways, then relations.
- for osmium-merge of the osmium-tool on macOS, this is mandatory since https://github.com/osmcode/osmium-tool/releases/tag/v1.13.2


* fix lint findings in shape2osm.py

- new version is from https://github.com/mapsforge/mapsforge-creator/blob/master/shape2osm.py

* sort land* osm files before merging

closes #77

* extract output dir for tile to variable

* sort land* osm files before merging on Windows

- adoption of 8f1e46b

* move Osmosis to tooling_windows & extract path to file to variable

- Osmosis is only used in Windows. macOS uses osmium-tool
- three ocurrences of the path were replaced
treee111 added a commit that referenced this issue Jan 15, 2022
…before merging (#78)

- sorts land*.osm files to be in this order: nodes, then ways, then relations.
- for osmium-merge of the osmium-tool on macOS, this is mandatory since https://github.com/osmcode/osmium-tool/releases/tag/v1.13.2

* fix lint findings in shape2osm.py

- new version is from https://github.com/mapsforge/mapsforge-creator/blob/master/shape2osm.py

* sort land* osm files before merging

closes #77

* extract output dir for tile to variable

* sort land* osm files before merging on Windows

- adoption of 8f1e46b

* move Osmosis to tooling_windows & extract path to file to variable

- Osmosis is only used in Windows. macOS uses osmium-tool
- three ocurrences of the path were replaced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant