Open
Conversation
Created a Python Script that - parses svg files - calculates coordinates - declares node types - generates JSON objects - organizes nodes and types and tested the script with the IST first floor svg by using: python3 svg_to_graph.py istF1.svg 1
DJFreer92
requested changes
Nov 13, 2025
Member
There was a problem hiding this comment.
I do not believe there should not be any negative coordinates. The values are also all very small while I'd expect them to be more spread out. The range for the coordinates in Inkscape is 0 - ~695 for x, and 0 - ~458 for y. This may have been caused by a miscalculation of the points relative to their parent(s). You could try plotting the coordinates with (0, 0) in the top left corner as a way to verify the correct translation.
I'd suggest putting the svg_to_graph.py file in a new scripts/ directory in the root directory of the project instead of with the data.
I like your code, it has good documentation and type annotations 👍🏻
Signed-off-by: Daniel Freer <deletes_minimal.0w@icloud.com>
Signed-off-by: Daniel Freer <deletes_minimal.0w@icloud.com>
Signed-off-by: Daniel Freer <deletes_minimal.0w@icloud.com>
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.
Created a python script that
I tested this with the first floor of the IST with the script.
python3 svg_to_graph.py istF1.svg 1