code: def test_stitch(self):
      # The following LinearRing wanders in/out of the map domain
      # but importantly the "vertical" lines at 0'E and 360'E are both
      # chopped by the map boundary. This results in their ends being
      # *very* close to each other and confusion over which occurs
      # first when navigating around the boundary.
      # Check that these ends are stitched together to avoid the
      # boundary ordering ambiguity.
      # NB. This kind of polygon often occurs with MPL's contouring.
      coords = [
          (0.0, -70.70499926182919),
          (0.0, -71.25),
          (0.0, -72.5),
          (0.0, -73.49076371657017),
          (360.0, -73.49076371657017),
          (360.0, -72.5),
          (360.0, -71.25),
          (360.0, -70.70499926182919),
          (350, -73),
          (10, -73),
      ]
      src_proj = ccrs.PlateCarree()
      target_proj = ccrs.Stereographic(80)
  
      linear_ring = sgeom.LinearRing(coords)
      rings, mlinestr = target_proj.project_geometry(
          linear_ring, src_proj
      )
      assert len(mlinestr.geoms) == 1
      assert len(rings) == 0
  
      # Check the stitch works in either direction.
      linear_ring = sgeom.LinearRing(coords[::-1])
      rings, mlinestr = target_proj.project_geometry(
          linear_ring, src_proj
      )
      assert len(mlinestr.geoms) == 1
      assert len(rings) == 0
  
file_path: cartopy/lib/cartopy/tests/test_linear_ring.py
imports: import numpy
  import pytest
  import shapely.geometry
  import cartopy.crs
label_desc: Use image node_id 3 for calling the TestMisc obj's underlying member method code with example usage: obj.test_stitch() without return types