예제 #1
0
    def test_trackrows2kml_idirectionnoneispeednone(self):
        self.maxDiff = None
        kml = simplekml.Kml()
        task = PyKML()
        rows = [[355, datetime(2013, 5, 15, 8, 33, 34, tzinfo=UTC),
                 4.485608, 52.412252, 84,
                 None, 9.91, None, 14.2,
                 4.0,
                 ],
                ]
        style = {'shape': 'iarrow',
                 'size': 'medium',
                 'sizebyalt': False,
                 'colorby': 'ispeed',
                 'speedthresholds': [5, 10, 20],
                 'alpha': 100,
                 'altitudemode': 'absolute',
                 }
        tracker = {'id': 355,
                   'color': {'slowest': '#FFFF50',
                             'slow': '#FDD017',
                             'fast': '#C68E17',
                             'fastest': '#733C00'
                             }
                   }

        task.trackrows2kml(kml, rows, tracker, style)

        self.assertKml('directionnone', kml)
예제 #2
0
    def test_trackrows2kml_absoluteClampBelowGround(self):
        self.maxDiff = None
        kml = simplekml.Kml()
        task = PyKML()
        rows = [[355, datetime(2013, 5, 15, 8, 33, 34, tzinfo=UTC),
                 4.485608, 52.412252, 84,
                 8.90, 8.91, 14.1, 14.2,
                 50,
                 ],
                [355, datetime(2013, 5, 15, 8, 34, 34, tzinfo=UTC),
                 4.485608, 52.415252, 34,
                 8.90, 9.91, 14.1, 14.2,
                 50,
                 ],
                ]
        style = {'shape': 'circle',
                 'size': 'medium',
                 'sizebyalt': False,
                 'colorby': 'ispeed',
                 'speedthresholds': [5, 10, 20],
                 'alpha': 100,
                 'altitudemode': 'absoluteClampBelowGround',
                 }
        tracker = {'id': 355,
                   'color': {'slowest': '#FFFF50',
                             'slow': '#FDD017',
                             'fast': '#C68E17',
                             'fastest': '#733C00'
                             }
                   }

        task.trackrows2kml(kml, rows, tracker, style)

        self.assertKml('absoluteclampbelowground', kml)
예제 #3
0
    def test_trackrows2kml_sizebyaltonsmallsize_iconsizebig(self):
        kml = simplekml.Kml()
        task = PyKML()
        rows = [[355, datetime(2013, 5, 15, 8, 33, 34, tzinfo=UTC),
                 4.485608, 52.412252, 84,
                 8.90, 9.91, 14.1, 14.2,
                 4.0,
                 ],
                ]
        style = {'shape': 'circle',
                 'size': 'small',
                 'sizebyalt': True,
                 'colorby': 'ispeed',
                 'speedthresholds': [5, 10, 20],
                 'alpha': 100,
                 'altitudemode': 'absolute',
                 }
        tracker = {'id': 355,
                   'color': {'slowest': '#FFFF50',
                             'slow': '#FDD017',
                             'fast': '#C68E17',
                             'fastest': '#733C00'
                             }
                   }

        task.trackrows2kml(kml, rows, tracker, style)

        self.assertKml('sizebyaltonsmallsize', kml)