Beispiel #1
0
def test_map_linestring():
    g = geojson.LineString(
        [(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)])
    result = map_coords(lambda x: x, g)
    assert result['type'] == 'LineString'
    assert result['coordinates'][0] == (3.78, 9.28)
    assert result['coordinates'][-1] == (3.78, 9.28)
Beispiel #2
0
def test_map_polygon():
    g = geojson.Polygon([
        [(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)],])
    result = map_coords(lambda x: x, g)
    assert result['type'] == 'Polygon'
    assert result['coordinates'][0][0] == (3.78, 9.28)
    assert result['coordinates'][0][-1] == (3.78, 9.28)
Beispiel #3
0
 def test_map_linestring(self):
     g = geojson.LineString(
         [(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)])
     result = map_coords(lambda x: x, g)
     self.assertEqual(result['type'], 'LineString')
     self.assertEqual(result['coordinates'][0], (3.78, 9.28))
     self.assertEqual(result['coordinates'][-1], (3.78, 9.28))
Beispiel #4
0
 def test_map_polygon(self):
     g = geojson.Polygon([
         [(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)],])
     result = map_coords(lambda x: x, g)
     self.assertEqual(result['type'], 'Polygon')
     self.assertEqual(result['coordinates'][0][0], (3.78, 9.28))
     self.assertEqual(result['coordinates'][0][-1], (3.78, 9.28))
Beispiel #5
0
 def test_map_polygon(self):
     g = geojson.Polygon([
         [(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)],])
     result = map_coords(lambda x: x, g)
     self.assertEqual(result['type'], 'Polygon')
     self.assertEqual(result['coordinates'][0][0], (3.78, 9.28))
     self.assertEqual(result['coordinates'][0][-1], (3.78, 9.28))
Beispiel #6
0
 def test_map_linestring(self):
     g = geojson.LineString(
         [(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)])
     result = map_coords(lambda x: x, g)
     self.assertEqual(result['type'], 'LineString')
     self.assertEqual(result['coordinates'][0], (3.78, 9.28))
     self.assertEqual(result['coordinates'][-1], (3.78, 9.28))
Beispiel #7
0
def test_map_multipolygon():
    g = geojson.MultiPolygon([
        ([(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)],),
        ([(23.18, -34.29), (-1.31, -4.61), (3.41, 77.91), (23.18, -34.29)],)])
    result = map_coords(lambda x: x, g)
    assert result['type'] == 'MultiPolygon'
    assert result['coordinates'][0][0][0] == (3.78, 9.28)
    assert result['coordinates'][-1][-1][-1] == (23.18, -34.29)
Beispiel #8
0
 def test_map_multipolygon(self):
     g = geojson.MultiPolygon([
         ([(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)],),
         ([(23.18, -34.29), (-1.31, -4.61), (3.41, 77.91), (23.18, -34.29)],)])
     result = map_coords(lambda x: x, g)
     self.assertEqual(result['type'], 'MultiPolygon')
     self.assertEqual(result['coordinates'][0][0][0], (3.78, 9.28))
     self.assertEqual(result['coordinates'][-1][-1][-1], (23.18, -34.29))
Beispiel #9
0
 def test_map_multipolygon(self):
     g = geojson.MultiPolygon([
         ([(3.78, 9.28), (-130.91, 1.52), (35.12, 72.234), (3.78, 9.28)],),
         ([(23.18, -34.29), (-1.31, -4.61), (3.41, 77.91), (23.18, -34.29)],)])
     result = map_coords(lambda x: x, g)
     self.assertEqual(result['type'], 'MultiPolygon')
     self.assertEqual(result['coordinates'][0][0][0], (3.78, 9.28))
     self.assertEqual(result['coordinates'][-1][-1][-1], (23.18, -34.29))
Beispiel #10
0
def test_map_point():
    result = map_coords(lambda x: x, geojson.Point((-115.81, 37.24)))
    assert result['type'] == 'Point'
    assert result['coordinates'] == (-115.81, 37.24)
Beispiel #11
0
 def test_map_point(self):
     result = map_coords(lambda x: x, geojson.Point((-115.81, 37.24)))
     self.assertEqual(result['type'], 'Point')
     self.assertEqual(result['coordinates'], (-115.81, 37.24))
Beispiel #12
0
 def test_map_point(self):
     result = map_coords(lambda x: x, geojson.Point((-115.81, 37.24)))
     self.assertEqual(result['type'], 'Point')
     self.assertEqual(result['coordinates'], (-115.81, 37.24))