def test_on_map_array(self): """ a little bit more complex tests and test of arrays of points """ # a concave map boundary map_bounds = ((-40.0, 50.0), (-40.0, 58.0), (-30.0, 58.0), (-35.0, 53.0), (-30.0, 50.0)) gmap = GnomeMap(map_bounds=map_bounds) points = ((-35, 55, 0.), (-45, 55, 0.)) result = gmap.on_map(points) # some points on the map: assert np.array_equal(result, (True, False))
def test_on_map(self): gmap = GnomeMap() assert gmap.on_map((0., 0., 0.)) is True # too big latitude print gmap.on_map((0., 91.0, 0.)) assert gmap.on_map((0., 91.0, 0.)) is False # too small latitude assert gmap.on_map((0., -91.0, 0.)) is False # too big langitude assert gmap.on_map((0., 361.0, 0.)) is False # too small langitude assert gmap.on_map((0., -361.0, 0.)) is False