Do not create SVG files when redirected to sdout#287
Open
amishn2008 wants to merge 4 commits intomgastner:mainfrom
Open
Do not create SVG files when redirected to sdout#287amishn2008 wants to merge 4 commits intomgastner:mainfrom
amishn2008 wants to merge 4 commits intomgastner:mainfrom
Conversation
🚦 Performance Comparison (α=0.05, ±3%)
❌ FailuresNone 😎 🚀 Speed-ups (11)
🐢 Slow-downs (2)
⚖️ No significant change (21)
|
Collaborator
|
Couple of things are needed before I can merge this pull request.
|
adisidev
requested changes
Jul 3, 2025
Collaborator
adisidev
left a comment
There was a problem hiding this comment.
Make changes to pull request comment and code as requested.
While we're at it, see if you can change the following line (in the same pull request) according to the issue described in #243
cart_info.reposition_insets(args.redirect_exports_to_stdout);
…l being created despite the flag's purpose being to redirect all exports to stdout and avoid file creation. This violated the principle that when --redirect_exports_to_stdout is enabled, no files should be written to disk.
nihalzp
reviewed
Aug 4, 2025
Collaborator
nihalzp
left a comment
There was a problem hiding this comment.
Thank you for working on the issues. Looks good to me! I think the file sample_data/australia_by_state_and_territory_since_1942/australia_population_by_state_and_territory_2021_cartogram.geojson has been added mistakenly. Once that's removed, we can merge it.
Collaborator
There was a problem hiding this comment.
Seems like this file has been mistakenly added.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Modified all SVG file creation functions to check for args_.redirect_exports_to_stdout in addition to their existing plot flags. When --redirect_exports_to_stdout is enabled, SVG files are no longer created regardless of other plot flag settings.
To test:
Test with redirect_exports_to_stdout flag
./cartogram sample_data/world_by_country_since_2022/world_by_country_since_2022.geojson sample_data/world_by_country_since_2022/world_population_by_country_2010.csv --redirect_exports_to_stdout --plot_polygons --add_grid --plot_density --plot_quadtree --plot_intersections
no svg files are created and only geojson output is printed to sdout
@adisidev