Skip to content

Commit

Permalink
fix v.in.sos working with more layers
Browse files Browse the repository at this point in the history
  • Loading branch information
pesekon2 committed Aug 7, 2017
1 parent 2a1dd7d commit 6ac65b2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions v.in.sos/v.in.sos.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ def handle_not_given_options(service, offering=None):

def create_maps(parsed_obs, offering, layer, new):
i = layer + 1
points = list()

for key, observation in parsed_obs.iteritems():

Expand Down Expand Up @@ -305,11 +304,12 @@ def create_maps(parsed_obs, offering, layer, new):
#new.table.create(cols)

if new.exist() is False:
new.open('w', layer=i, tab_name=tableName, tab_cols=cols)
new.open(mode='w', layer=i, tab_name=tableName, tab_cols=cols, overwrite=True)
else:
new.open('rw', layer=i, tab_name=tableName, tab_cols=cols)
new.open(mode='rw', layer=i, tab_name=tableName, tab_cols=cols, link_name=tableName, overwrite=True)

first = True

first=True
insert = [''] * len(cols)
for a in data['features']:
for item, value in a['properties'].iteritems():
Expand All @@ -321,7 +321,8 @@ def create_maps(parsed_obs, offering, layer, new):
insert[1:])
insert = [''] * len(cols)
insert[cols.index((item, 'VARCHAR'))] = value
first = False
first=False


new.write(Point(*a['geometry']['coordinates']),
insert[1:])
Expand Down

0 comments on commit 6ac65b2

Please sign in to comment.