Commit 00f32975 authored by Eliot Blennerhassett's avatar Eliot Blennerhassett

pyspatialite is not required, python 3 is supported

regular sqlite3 can use spatialite extensionsby by loading mod_spatialite
parent 083843a9
# Currently python2 because pyspatialite is 2 only
""" OSM LINZ Address
Usage: my_program.py [-h -o DIRECTORY --min-nodes=COUNT --max-nodes=COUNT --include-location=LEVEL] [-d DATABASE]
......@@ -16,10 +14,9 @@ Options:
from __future__ import print_function, division, unicode_literals
from lxml import etree as ET
from docopt import docopt
# import itertools
import os
import pyspatialite.dbapi2 as db
# import sys
import sqlite3.dbapi2 as db
def add_tag(node, k, v):
......@@ -37,6 +34,9 @@ def generate_osmchange(dbfile, outdir,
pass
con = db.connect(dbfile)
con.enable_load_extension(True)
con.execute("SELECT load_extension('mod_spatialite')")
cur = con.cursor()
# Select subsets by place
......@@ -136,7 +136,7 @@ def generate_osmchange_place(place, dbcursor, outdir,
if __name__ == '__main__':
opts = docopt(__doc__, version='osmlinzaddr v0.1')
opts = docopt(__doc__, version='osmlinzaddr v0.2')
for k in opts.keys():
try:
opts[k] = int(opts[k])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment