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.
Overview
Changes the way map configuration is handled so that rather than maintaining Carto styles that get compiled to Mapnik XML during build/deploy, we'll maintain actual Mapnik XML. Based on making the same move in the People For Bikes version, as recommended on issue 129.
Maintaining the config as XML has the major advantage that it allows adding configuration/optimization parameters to the layer config that aren't supported by Carto. The parameters added here helped improve the performance of PFB's tiles from many seconds to the 300-700ms range. (Different situations will differ, but the ability to tune the database parameters is likely to be important in most or all cases.)
It also reduces the number of moving parts that might do something unexpected. And it doesn't preclude working with Carto layer styling, since the
build-all-xml
command will compile the Carto style files into XML just as before. The difference being that now the XML files are tracked and the generated file will generally be the input to a manual process of validating and improving it.Since compiling the config is no longer required and the XML will be tracked in the repo, filling in environment variables during config compilation won't work. So this also transitions to using environment variables in the Mapnik XML and replacing them with values from the environment at runtime. This should also make it easier to support deployment across multiple environments (e.g. local, staging, production).
Notes
I originally had more changes in this branch, toward facilitating deployment across multiple environments as mentioned above, but I decided to do that separately.
Testing Instructions
scripts/deploy
) should also still work as before.