original_docstring: 
      returns polygon geometry defined by list of points
  
      Parameters
      ----------
      points : list
          points defining the polygon, either...
          2D: [(x1, y1), (x2, y2), ...]
          3D: [(x1, y1, z1), (x2, y2, z2), ...]
      osr_spref : OGRSpatialReference
          spatial reference to what the geometry should be transformed to
      segment : float, optional
          for precision: distance in units of input osr_spref of longest
          segment of the geometry polygon
  
      Returns
      -------
      OGRGeometry
          a geometry projected in the target spatial reference
  
      
docstring: returns polygon geometry defined by list of points
  Parameters
  
  
  
  Returns
  
  OGRGeometry
  a geometry projected in the target spatial reference
docstring_tokens: returns polygon geometry defined by list of points Parameters Returns OGRGeometry a geometry projected in the target spatial reference
code: def create_polygon_geometry(points, osr_spref, segment=None):
      """
      returns polygon geometry defined by list of points
  
      Parameters
      ----------
      points : list
          points defining the polygon, either...
          2D: [(x1, y1), (x2, y2), ...]
          3D: [(x1, y1, z1), (x2, y2, z2), ...]
      osr_spref : OGRSpatialReference
          spatial reference to what the geometry should be transformed to
      segment : float, optional
          for precision: distance in units of input osr_spref of longest
          segment of the geometry polygon
  
      Returns
      -------
      OGRGeometry
          a geometry projected in the target spatial reference
  
      """
      # create ring from all points
      ring = ogr.Geometry(ogr.wkbLinearRing)
      for p in points:
          if len(p) == 2:
              p += (0.0,)
          ring.AddPoint(*p)
      ring.CloseRings()
  
      # create the geometry
      polygon_geometry = ogr.Geometry(ogr.wkbPolygon)
      polygon_geometry.AddGeometry(ring)
  
      # assign spatial reference
      polygon_geometry.AssignSpatialReference(osr_spref)
  
      # modify the geometry such it has no segment longer then the given distance
      if segment is not None:
          polygon_geometry = segmentize_geometry(
              polygon_geometry, segment=segment)
  
      return polygon_geometry
code_tokens: def create_polygon_geometry ( points , osr_spref , segment = None ) : ring = ogr . Geometry ( ogr . wkbLinearRing ) for p in points : if len ( p ) == 2 : p += ( 0.0 , ) ring . AddPoint ( * p ) ring . CloseRings ( ) polygon_geometry = ogr . Geometry ( ogr . wkbPolygon ) polygon_geometry . AddGeometry ( ring ) polygon_geometry . AssignSpatialReference ( osr_spref ) if segment is not None : polygon_geometry = segmentize_geometry ( polygon_geometry , segment = segment ) return polygon_geometry
short_docstring: returns polygon geometry defined by list of points
  Parameters
short_docstring_tokens: returns polygon geometry defined by list of points Parameters
comment: """
      returns polygon geometry defined by list of points
  
      Parameters
      ----------
      points : list
          points defining the polygon, either...
          2D: [(x1, y1), (x2, y2), ...]
          3D: [(x1, y1, z1), (x2, y2, z2), ...]
      osr_spref : OGRSpatialReference
          spatial reference to what the geometry should be transformed to
      segment : float, optional
          for precision: distance in units of input osr_spref of longest
          segment of the geometry polygon
  
      Returns
      -------
      OGRGeometry
          a geometry projected in the target spatial reference
  
      """$SEP$# create ring from all points$SEP$# create the geometry$SEP$# assign spatial reference$SEP$# modify the geometry such it has no segment longer then the given distance