Skip to content

Instantly share code, notes, and snippets.

@keithamoss
Created November 27, 2016 12:01
Show Gist options
  • Save keithamoss/8fe228d2c2e4b11808fe76338dbde481 to your computer and use it in GitHub Desktop.
Save keithamoss/8fe228d2c2e4b11808fe76338dbde481 to your computer and use it in GitHub Desktop.
Convert GeoScience Australia XBM files to SVG for QGIS users.
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