avoid overlapping annotations
This commit is contained in:
parent
be717933e4
commit
5ec09e804d
1 changed files with 5 additions and 1 deletions
|
@ -34,6 +34,9 @@ class Command(BaseCommand):
|
|||
|
||||
annotations = ox.srt.load(filename)
|
||||
print 'importing %d annotations into %s/%s' % (len(annotations), itemId, layer_id)
|
||||
for i in range(len(annotations)-1):
|
||||
if annotations[i]['out'] == annotations[i+1]['in']:
|
||||
annotations[i]['out'] = annotations[i]['out'] - 0.001
|
||||
with transaction.commit_on_success():
|
||||
for a in annotations:
|
||||
if a['value']:
|
||||
|
@ -41,7 +44,8 @@ class Command(BaseCommand):
|
|||
item=item,
|
||||
layer=layer_id,
|
||||
user=user,
|
||||
start=float(a['in']), end=float(a['out']),
|
||||
start=float(a['in']),
|
||||
end=float(a['out']),
|
||||
value=a['value'])
|
||||
annotation.save()
|
||||
#update facets if needed
|
||||
|
|
Loading…
Reference in a new issue