Created
November 27, 2016 12:01
-
-
Save keithamoss/8fe228d2c2e4b11808fe76338dbde481 to your computer and use it in GitHub Desktop.
Convert GeoScience Australia XBM files to SVG for QGIS users.
This file contains 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
import os | |
from wand.image import Image | |
xbm_path = os.path.join(os.getcwd(), "xbm") | |
for infile in os.listdir(xbm_path): | |
infile_path = os.path.join(xbm_path, infile) | |
if os.path.isfile(infile_path): | |
print infile | |
with Image(filename=infile_path) as img: | |
img.format = 'svg' | |
img.save(filename='out/{}'.format(infile.replace('xbm', 'svg'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment