Example #1
0
    def run3d(self, test_func):

        p1 = GeoTypes.OGmultiPolygonFromOGPolygons(
            GeoTypes.OGpolygonFromOGLines(
                GeoTypes.OGlinearRingFromOGPoints(
                    GeoTypes.OGpointFromValues(1, 2, 3),
                    GeoTypes.OGpointFromValues(2, 2, 3),
                    GeoTypes.OGpointFromValues(2, 1, 3),
                    GeoTypes.OGpointFromValues(1, 2, 3),
                ),
                GeoTypes.OGlinearRingFromOGPoints(
                    GeoTypes.OGpointFromValues(1, 2, 3),
                    GeoTypes.OGpointFromValues(2, 2, 3),
                    GeoTypes.OGpointFromValues(2, 1, 3),
                    GeoTypes.OGpointFromValues(1, 2, 3),
                )),
            GeoTypes.OGpolygonFromOGLines(
                GeoTypes.OGlinearRingFromOGPoints(
                    GeoTypes.OGpointFromValues(3, 4, 3),
                    GeoTypes.OGpointFromValues(4, 4, 3),
                    GeoTypes.OGpointFromValues(4, 3, 3),
                    GeoTypes.OGpointFromValues(3, 4, 3),
                ),
                GeoTypes.OGlinearRingFromOGPoints(
                    GeoTypes.OGpointFromValues(3, 4, 3),
                    GeoTypes.OGpointFromValues(4, 4, 3),
                    GeoTypes.OGpointFromValues(4, 3, 3),
                    GeoTypes.OGpointFromValues(3, 4, 3),
                )))

        p2 = p1

        raw = test_func(self, p1, p2)

        ret = raw[0]

        p3 = ret[0]
        p4 = ret[1]

        assert p3.__class__.__name__ == "OGMultiPolygon"
        assert p4.__class__.__name__ == "OGMultiPolygon"
Example #2
0
    def run3d(self, test_func):

        p1 = GeoTypes.OGgeometryCollectionFromOGGeometries(

            # A Polygon
            GeoTypes.OGpolygonFromOGLines(
                GeoTypes.OGlinearRingFromOGPoints(
                    GeoTypes.OGpointFromValues(1, 2, 3),
                    GeoTypes.OGpointFromValues(2, 2, 3),
                    GeoTypes.OGpointFromValues(2, 1, 3),
                    GeoTypes.OGpointFromValues(1, 2, 3),
                ),
                GeoTypes.OGlinearRingFromOGPoints(
                    GeoTypes.OGpointFromValues(1, 2, 3),
                    GeoTypes.OGpointFromValues(2, 2, 3),
                    GeoTypes.OGpointFromValues(2, 1, 3),
                    GeoTypes.OGpointFromValues(1, 2, 3),
                )),

            # A Linear Ring
            GeoTypes.OGlinearRingFromOGPoints(
                GeoTypes.OGpointFromValues(3, 4, 3),
                GeoTypes.OGpointFromValues(4, 4, 3),
                GeoTypes.OGpointFromValues(4, 3, 3),
                GeoTypes.OGpointFromValues(3, 4, 3),
            ),
        )

        p2 = p1

        raw = test_func(self, p1, p2)

        ret = raw[0]

        p3 = ret[0]
        p4 = ret[1]

        assert p3.__class__.__name__ == "OGGeometryCollection"
        assert p4.__class__.__name__ == "OGGeometryCollection"