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

Custom schemes #140

Open
mfbehrens99 opened this issue Aug 13, 2022 · 5 comments
Open

Custom schemes #140

mfbehrens99 opened this issue Aug 13, 2022 · 5 comments
Assignees
Labels
generator Map generation issues interface User interface and log issues style Issues regarding map style (changes in YAML style files)

Comments

@mfbehrens99
Copy link

Hello,
is there a specific reason why there is no parameter to set a scheme path. I would suggest to use --scheme <path>. Default path would be the default scheme. Any problems with that?

@enzet
Copy link
Owner

enzet commented Aug 14, 2022

No problems at all, I should definitely add this option.

The scheme format however is still under development and not documented. If you want to create custom scheme, please feel free to ask questions.

@enzet enzet self-assigned this Aug 14, 2022
@enzet enzet added generator Map generation issues interface User interface and log issues style Issues regarding map style (changes in YAML style files) labels Aug 14, 2022
enzet added a commit that referenced this issue Aug 15, 2022
enzet added a commit that referenced this issue Aug 15, 2022
Refactoring of `Scheme` and `MapConfiguration` classes.
@mfbehrens99
Copy link
Author

Definitively, do not really understand it. Just tried an empty scheme and I failed. I only added the color definition from the default scheme in what made the program work. However, there are still a lot of objects on the map. Shouldn't an empty scheme result in an empty map?

@enzet
Copy link
Owner

enzet commented Aug 17, 2022

I only added the color definition from the default scheme in what made the program work.

This is indeed a bug. Totally empty scheme file should work. I'll fix it.

Shouldn't an empty scheme result in an empty map?

Hmm... Looks like very legal assumption.

Honestly, I never thought about such a use case. Map Machine just tries to render everything no matter how and this behavior isn't manageable through scheme file.

enzet added a commit that referenced this issue Aug 17, 2022
enzet added a commit that referenced this issue Aug 17, 2022
@mfbehrens99
Copy link
Author

Still throws an error message :(

(.env) C:\Users\mfbeh\Documents\Github\map-machine>map-machine render -b=8.4214801253,49.0197665932,8.4230425121,49.0205831971 -z=21 --scheme=map_machine/scheme/empty.yml
Traceback (most recent call last):
  File "C:\Users\mfbeh\Documents\Github\map-machine\.env\Scripts\map-machine-script.py", line 33, in <module>
    sys.exit(load_entry_point('map-machine', 'console_scripts', 'map-machine')())
  File "c:\users\mfbeh\documents\github\map-machine\map_machine\main.py", line 44, in main
    mapper.render_map(arguments)
  File "c:\users\mfbeh\documents\github\map-machine\map_machine\mapper.py", line 270, in render_map
    scheme: Scheme = Scheme.from_file(scheme_path)
  File "c:\users\mfbeh\documents\github\map-machine\map_machine\scheme.py", line 375, in from_file
    return cls(content)
  File "c:\users\mfbeh\documents\github\map-machine\map_machine\scheme.py", line 319, in __init__
    if "node_icons" in content:
TypeError: argument of type 'NoneType' is not iterable```

@enzet
Copy link
Owner

enzet commented Aug 19, 2022

Hm, seems like YAML failed to load the file. Could you please dump the content of map_machine/scheme/empty.yml?

Update: oh, I see, it is just totally empty, which is presumably a valid YAML file. I'll check this.

enzet added a commit that referenced this issue May 28, 2023
It is now necessary to enable drawing map features in the scheme file.
In the `options` field one should enable the following features in
order to have these features on the map, because they are disabled by
default:
  - `draw_nodes`,
  - `draw_buildings`,
  - `draw_trees`,
  - `draw_craters`,
  - `draw_directions`

Related to #140.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Map generation issues interface User interface and log issues style Issues regarding map style (changes in YAML style files)
Projects
Status: In Progress
Development

No branches or pull requests

2 participants