Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pesekon2 committed Aug 14, 2017
2 parents e028f3d + 746d0ae commit 0c15705
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions t.vect.in.sos/t.vect.in.sos.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
import tempfile
try:
from owslib.sos import SensorObservationService
from grass.script import parser, run_command, overwrite
from grass.script import parser, run_command, overwrite, pipe_command
from grass.script import core as grass
from grass.script import vector
from grass.pygrass.vector import VectorTopo
Expand Down Expand Up @@ -321,8 +321,18 @@ def create_maps(parsed_obs, offering):
if new.exist() is False:
new.open(mode='w', layer=i, tab_name=tableName,
tab_cols=cols, overwrite=True)

i += 1
else:
new.open(mode='rw', layer=i, tab_name=tableName,
b = pipe_command('db.tables')
if tableName not in b.communicate()[0]:
new.open(mode='rw', layer=i, tab_name=tableName,
tab_cols=cols, link_name=tableName,
overwrite=True)

i += 1
else:
new.open(mode='rw', tab_name=tableName,
tab_cols=cols, link_name=tableName,
overwrite=True)

Expand All @@ -332,7 +342,6 @@ def create_maps(parsed_obs, offering):
new.close(build=False)
run_command('v.build', map=mapName, quiet=True)

i += 1

if len(cols) > 2000:
grass.warning(
Expand Down

0 comments on commit 0c15705

Please sign in to comment.