[GRASS-SVN] r57640 - grass/trunk/lib/python/temporal
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Sep 11 11:29:43 PDT 2013
Author: huhabla
Date: 2013-09-11 11:29:43 -0700 (Wed, 11 Sep 2013)
New Revision: 57640
Modified:
grass/trunk/lib/python/temporal/spatio_temporal_relationships.py
Log:
Fixed topology computation
Modified: grass/trunk/lib/python/temporal/spatio_temporal_relationships.py
===================================================================
--- grass/trunk/lib/python/temporal/spatio_temporal_relationships.py 2013-09-11 15:53:53 UTC (rev 57639)
+++ grass/trunk/lib/python/temporal/spatio_temporal_relationships.py 2013-09-11 18:29:43 UTC (rev 57640)
@@ -340,21 +340,17 @@
(datetime.datetime(2000, 1, 1, 0, 0), datetime.datetime(2000, 1, 1, 0, 0, 2))
('OVERLAPS', (datetime.datetime(2000, 1, 1, 0, 0, 1), datetime.datetime(2000, 1, 1, 0, 0, 3)))
('PRECEDES', (datetime.datetime(2000, 1, 1, 0, 0, 2), datetime.datetime(2000, 1, 1, 0, 0, 4)))
- ('EQUAL', (datetime.datetime(2000, 1, 1, 0, 0), datetime.datetime(2000, 1, 1, 0, 0, 2)))
(datetime.datetime(2000, 1, 1, 0, 0, 1), datetime.datetime(2000, 1, 1, 0, 0, 3))
('OVERLAPS', (datetime.datetime(2000, 1, 1, 0, 0, 2), datetime.datetime(2000, 1, 1, 0, 0, 4)))
('OVERLAPPED', (datetime.datetime(2000, 1, 1, 0, 0), datetime.datetime(2000, 1, 1, 0, 0, 2)))
('PRECEDES', (datetime.datetime(2000, 1, 1, 0, 0, 3), datetime.datetime(2000, 1, 1, 0, 0, 5)))
- ('EQUAL', (datetime.datetime(2000, 1, 1, 0, 0, 1), datetime.datetime(2000, 1, 1, 0, 0, 3)))
(datetime.datetime(2000, 1, 1, 0, 0, 2), datetime.datetime(2000, 1, 1, 0, 0, 4))
('OVERLAPS', (datetime.datetime(2000, 1, 1, 0, 0, 3), datetime.datetime(2000, 1, 1, 0, 0, 5)))
- ('OVERLAPPED', (datetime.datetime(2000, 1, 1, 0, 0, 1), datetime.datetime(2000, 1, 1, 0, 0, 3)))
('FOLLOWS', (datetime.datetime(2000, 1, 1, 0, 0), datetime.datetime(2000, 1, 1, 0, 0, 2)))
- ('EQUAL', (datetime.datetime(2000, 1, 1, 0, 0, 2), datetime.datetime(2000, 1, 1, 0, 0, 4)))
+ ('OVERLAPPED', (datetime.datetime(2000, 1, 1, 0, 0, 1), datetime.datetime(2000, 1, 1, 0, 0, 3)))
(datetime.datetime(2000, 1, 1, 0, 0, 3), datetime.datetime(2000, 1, 1, 0, 0, 5))
('FOLLOWS', (datetime.datetime(2000, 1, 1, 0, 0, 1), datetime.datetime(2000, 1, 1, 0, 0, 3)))
('OVERLAPPED', (datetime.datetime(2000, 1, 1, 0, 0, 2), datetime.datetime(2000, 1, 1, 0, 0, 4)))
- ('EQUAL', (datetime.datetime(2000, 1, 1, 0, 0, 3), datetime.datetime(2000, 1, 1, 0, 0, 5)))
@endcode
@@ -590,14 +586,15 @@
def set_temoral_relationship(A, B, relation):
if relation == "equal" or relation == "equals":
- if not B.get_equal() or \
- (B.get_equal() and \
- A not in B.get_equal()):
- B.append_equal(A)
- if not A.get_equal() or \
- (A.get_equal() and \
- B not in A.get_equal()):
- A.append_equal(B)
+ if A != B:
+ if not B.get_equal() or \
+ (B.get_equal() and \
+ A not in B.get_equal()):
+ B.append_equal(A)
+ if not A.get_equal() or \
+ (A.get_equal() and \
+ B not in A.get_equal()):
+ A.append_equal(B)
elif relation == "follows":
if not B.get_follows() or \
(B.get_follows() and \
More information about the grass-commit
mailing list