-
Notifications
You must be signed in to change notification settings - Fork 822
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
Convert layers to YAML #947
Merged
Merged
Commits on Sep 9, 2014
-
Add a script that takes a yaml file and converts it to a JSON file
Requires PyYAML. If this dependency is an issue on a particular platform, pretty much any language allows you to do this. A ruby example is ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' < project.yml > project.json
Configuration menu - View commit details
-
Copy full SHA for 1be5578 - Browse repository at this point
Copy the full SHA 1be5578View commit details
Commits on Sep 10, 2014
-
Convert the MML file from JSON to YAML
This one-time conversion was done with the json2yaml node module, and then substantially reformatted by hand, using mappings and alias to avoid repeating projection and extents information for each layer, and to get consistent ordering of the properties of each layer. The latter does not matter semantically, but makes editing with a text editor cleaner. By using the scripts/yaml2mml.py script, the YAML can be converted back into JSON, which is still what TileMill uses. A JSON-aware diff of the original project.mml and the new generated one shows that the only differences are the new "_parts" property, used for aliases and ignored by TileMill, and layer extents. The script can be invoked with scripts/yaml2mml.py < project.yaml > project.mml The project.mml file remains checked in to git, as TileMill requires it and this allows someone to clone the repo, and immediately have it work. Merge conflicts in project.mml are trivial to solve, as the entire file is just regenerated by running the script again. This does mean that the .MML file should not be edited directly, but this is fine, as editing the JSON by hand is extremely difficult anyways! The HOT OSM style has a similar workflow, making use of cartocc.
Configuration menu - View commit details
-
Copy full SHA for 9918536 - Browse repository at this point
Copy the full SHA 9918536View commit details -
Use alias to avoid duplicating SQL connection information
By using aliases, we can avoid having to specify the same information repeatedly, saving lines, avoiding mistakes, and making it easier to use a differently named database. The last is evident in that the landcover extents changed slightly in this, because they were different than all the other layers.
Configuration menu - View commit details
-
Copy full SHA for 45dbf13 - Browse repository at this point
Copy the full SHA 45dbf13View commit details -
Conver SQL from in-line escaped scalars to block scalars
Block scalars allow you to use newlines, and are far more readable This commit also catches some extents that were missed previously.
Configuration menu - View commit details
-
Copy full SHA for ba95ac9 - Browse repository at this point
Copy the full SHA ba95ac9View commit details
Commits on Sep 13, 2014
-
A lot of the SQL was badly formatted, with random tabs, caps, and lines of 5000 characters. This commit cleans up about half of them but is not complete.
Configuration menu - View commit details
-
Copy full SHA for 95a56f0 - Browse repository at this point
Copy the full SHA 95a56f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for d31bd93 - Browse repository at this point
Copy the full SHA d31bd93View commit details
Commits on Sep 14, 2014
-
Configuration menu - View commit details
-
Copy full SHA for 72d5baa - Browse repository at this point
Copy the full SHA 72d5baaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 08d3fb8 - Browse repository at this point
Copy the full SHA 08d3fb8View commit details -
Configuration menu - View commit details
-
Copy full SHA for dcbdae6 - Browse repository at this point
Copy the full SHA dcbdae6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 56cd8e0 - Browse repository at this point
Copy the full SHA 56cd8e0View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.