This is the code I used to generate the images for City Placement in the 2023 MIT Mystery Hunt.
It contains spoilers for the puzzle, so read at your own risk! The code is somewhat hacky given the nature of writing and rewriting a puzzle, but hopefully it is a useful resource if someone wants to create similar maps.