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

Use json.dumps() for yaml2mml.py #2459

Closed
wants to merge 3 commits into from

Conversation

jojo4u
Copy link

@jojo4u jojo4u commented Nov 22, 2016

Fixes #2447. Direct binary mode file output using json.dump() does not work with python 3. Other tricks like newline parameter for open() or using io.open() where not successful. Best solution is to use json.dumps() and convert to bytes afterwards for python 2 & 3 compatibility.

Yields the same sha256sum for python2 and python3. The parameter sort_keys=True has been introduced because python3 output had different sorting after every execution.

Not yet tested on Windows.

…ython 3. Use json.dumps() and convert to bytes afterwards for python 2 & 3 compatibility.
@jojo4u
Copy link
Author

jojo4u commented Nov 22, 2016

from #2279:

It also generates project.mml with Windows and with #2459 (just project.mml, without updating the script program). I see that Travis CI does not like it (possibly because the tags are not in the expected order).

What does "travis does not like" mean?
https://travis-ci.org/gravitystorm/openstreetmap-carto/builds/177898294
The command "./scripts/travis_check_project_files" exited with 1.

-> will investigate.

@jojo4u
Copy link
Author

jojo4u commented Nov 26, 2016

Has been refined and now been tested with Linux and Windows. Python 2&3 on Linux and Windows are producing same output (with LF newline). Only exception is redirecting output of --check parameter to file, but this is not what this switch is for.

Ircama added a commit to Ircama/openstreetmap-carto that referenced this pull request Nov 26, 2016
amenity-points.mss and symbols/wilderness_hut.svg are ready for revision.

I have now changed the file naming of wilderness_hut.svg (with icon produced by @nebulon42) following @nebulon42's convention in gravitystorm#2451.

This commit also would like to help @jojo4u in testing his last update at gravitystorm#2459. I generated project.mml with Windows; I temporarily added the new yaml2mml.py, just to allow testing. Due to the inclusion of the new project.mml and new yaml2mml.py with this commit, please, do not merge by now.
Ircama added a commit to Ircama/openstreetmap-carto that referenced this pull request Nov 26, 2016
amenity-points.mss and symbols/wilderness_hut.svg are ready for revision.

I have now changed the file naming of wilderness_hut.svg (with icon produced by @nebulon42) following @nebulon42's convention in gravitystorm#2451.

This commit also would like to help @jojo4u in testing his last update at gravitystorm#2459. I generated project.mml with Windows; I temporarily added the new yaml2mml.py, just to allow testing. Due to the inclusion of the new project.mml and new yaml2mml.py with this commit, please, do not merge by now.

______________________________________________________________________

**Rendering of tag tourism=wilderness_hut**

Latest changes:

- Use wilderness-hut.svg icon by @nebulon42
- Rebased to master

______________________________________________________________________

To summarize, the following different kind of huts have specific symbols now:

- amenity=shelter (only shown at zoom >=16)
- tourism=alpine_hut  (not modified within this drop)
- tourism=wilderness_hut (zoom>=13)

Symbols:
- wilderness_hut: symbols/wilderness_hut.svg (new)
- alpine_hut: symbols/alpinehut.p.16.png (unmodified)
- generic shelter: symbols/shelter.svg (unmodified)
@Ircama
Copy link
Contributor

Ircama commented Nov 26, 2016

@jojo4u: it looks working with Windows (tested travis and tilemill)

@nebulon42
Copy link
Contributor

Obsolete by #2473. Thanks nevertheless!

@nebulon42 nebulon42 closed this Dec 4, 2016
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.

3 participants