test_mapping.py 395 B

1234567891011121314
  1. import unittest
  2. from shapely.geometry import Point, Polygon, mapping
  3. class MappingTestCase(unittest.TestCase):
  4. def test_point(self):
  5. m = mapping(Point(0, 0))
  6. assert m["type"] == "Point"
  7. assert m["coordinates"] == (0.0, 0.0)
  8. def test_empty_polygon(self):
  9. """Empty polygons will round trip without error"""
  10. assert mapping(Polygon()) is not None