Skip to content

Commit

Permalink
import vectors and values in one step
Browse files Browse the repository at this point in the history
fix #22
  • Loading branch information
pesekon2 committed Aug 3, 2017
1 parent ff6923a commit 9cad14e
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions r.in.sos/r.in.sos.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def cleanup():


def main():
fl = ''
parsed_obs = dict()
service = SensorObservationService(options['url'],
version=options['version'])
Expand Down Expand Up @@ -310,25 +309,18 @@ def create_maps(parsed_obs, offering):
tableName = '_'.join(tableName.split('.'))

new = VectorTopo(tableName)
new.open('w')
new.write(Point(*a['geometry']['coordinates']))
new.open('w', tab_cols=cols)
new.write(Point(*a['geometry']['coordinates']),
(name, value, ))

link = Link(layer=1, name=tableName, table=tableName,
key='cat')
new.dblinks.add(link)

new.table = new.dblinks.by_layer(1).table()
new.table.create(cols)
new.table.insert([(1, name, value)], many=True)
new.table.conn.commit()

import pdb
pdb.set_trace()
new.close()
new.close()#build=False)
#run_command('v.build', quiet=True, map=tableName)

run_command('g.region', vect=tableName)
run_command('v.to.rast', input=tableName, output=tableName,
use='attr', attribute_column='value', layer=-1)
use='attr', attribute_column='value', layer=1)

if flags['f'] is True:
run_command('g.remove', 'f', type='vector',
Expand Down

0 comments on commit 9cad14e

Please sign in to comment.