Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/moving.txt @ 113:606010d1d9a4
corrected errors in trajectories (if empty) and getTrajectoryInPolygon
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 18 Jul 2011 14:29:07 -0400 |
| parents | 916678481896 |
| children | 74b1fc68d4df |
comparison
equal
deleted
inserted
replaced
| 112:67555e968b5e | 113:606010d1d9a4 |
|---|---|
| 41 >>> Point(3,2).inPolygon([Point(0,0),Point(1,0),Point(1,1),Point(0,1)]) | 41 >>> Point(3,2).inPolygon([Point(0,0),Point(1,0),Point(1,1),Point(0,1)]) |
| 42 False | 42 False |
| 43 >>> Point(3,2).inPolygon([Point(0,0),Point(4,0),Point(4,3),Point(0,3)]) | 43 >>> Point(3,2).inPolygon([Point(0,0),Point(4,0),Point(4,3),Point(0,3)]) |
| 44 True | 44 True |
| 45 | 45 |
| 46 >>> Trajectory().length() | |
| 47 0 | |
| 46 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) | 48 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) |
| 47 >>> t1.length() == 3. | 49 >>> t1.length() == 3. |
| 48 True | 50 True |
| 49 >>> t1[1] | 51 >>> t1[1] |
| 50 (1.500000,3.500000) | 52 (1.500000,3.500000) |
| 51 >>> t1.getTrajectoryInPolygon(np.array([[0,0],[4,0],[4,3],[0,3]])) | 53 >>> t1.getTrajectoryInPolygon(np.array([[0,0],[4,0],[4,3],[0,3]])) |
| 52 (0.500000,0.500000) | 54 (0.500000,0.500000) |
| 55 >>> t1.getTrajectoryInPolygon(np.array([[10,10],[14,10],[14,13],[10,13]])).length() | |
| 56 0 | |
| 53 | 57 |
| 54 >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6)) | 58 >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6)) |
| 55 >>> indic1.empty() | 59 >>> indic1.empty() |
| 56 False | 60 False |
| 57 >>> indic1[5] | 61 >>> indic1[5] |
