Exemple #1
0
 def test_explode_multi_point_geometry(self):
     """Test exploding POINT multipart to single part geometries works"""
     geometry = QgsGeometry.fromWkt('MULTIPOINT((-0.966314 0.445890),'
                                    '(-0.281133 0.555729))')
     collection = explode_multipart_geometry(geometry)
     message = 'Expected 2 parts from multipart point geometry'
     assert len(collection) == 2, message
 def test_explode_multi_point_geometry(self):
     """Test exploding POINT multipart to single part geometries works"""
     geometry = QgsGeometry.fromWkt(
         'MULTIPOINT((-0.966314 0.445890),'
         '(-0.281133 0.555729))')
     collection = explode_multipart_geometry(geometry)
     message = 'Expected 2 parts from multipart point geometry'
     assert len(collection) == 2, message
 def test_explode_multi_line_geometry(self):
     """Test exploding LINES multipart to single part geometries works."""
     geometry = QgsGeometry.fromWkt(
         'MULTILINESTRING((-0.974159 0.526961,'
         ' -0.291594 0.644645), (-0.411893 0.728331,'
         ' -0.160834 0.568804))')
     collection = explode_multipart_geometry(geometry)
     message = 'Expected 2 parts from multipart line geometry'
     assert len(collection) == 2, message
Exemple #4
0
 def test_explode_multi_line_geometry(self):
     """Test exploding LINES multipart to single part geometries works."""
     geometry = QgsGeometry.fromWkt(
         'MULTILINESTRING((-0.974159 0.526961,'
         ' -0.291594 0.644645), (-0.411893 0.728331,'
         ' -0.160834 0.568804))')
     collection = explode_multipart_geometry(geometry)
     message = 'Expected 2 parts from multipart line geometry'
     assert len(collection) == 2, message
 def test_explode_multi_polygon_geometry(self):
     """Test exploding POLY multipart to single part geometries works."""
     geometry = QgsGeometry.fromWkt(
         'MULTIPOLYGON(((-0.966314 0.445890,'
         '-0.281133 0.555729,-0.092839 0.218369,-0.908780 0.035305,'
         '-0.966314 0.445890)),((-0.906164 0.003923,-0.077148 0.197447,'
         '0.043151 -0.074533,-0.882628 -0.296824,-0.906164 0.003923)))')
     collection = explode_multipart_geometry(geometry)
     message = 'Expected 2 parts from multipart polygon geometry'
     assert len(collection) == 2, message
Exemple #6
0
 def test_explode_multi_polygon_geometry(self):
     """Test exploding POLY multipart to single part geometries works."""
     geometry = QgsGeometry.fromWkt(
         'MULTIPOLYGON(((-0.966314 0.445890,'
         '-0.281133 0.555729,-0.092839 0.218369,-0.908780 0.035305,'
         '-0.966314 0.445890)),((-0.906164 0.003923,-0.077148 0.197447,'
         '0.043151 -0.074533,-0.882628 -0.296824,-0.906164 0.003923)))')
     collection = explode_multipart_geometry(geometry)
     message = 'Expected 2 parts from multipart polygon geometry'
     assert len(collection) == 2, message