(ob, create_func=None)
return geom, N
Helper function for geos_*_from_py functions in each geom type.

    If a create_func is specified the coodinate sequence is cloned and a new
    geometry is created with it, otherwise the geometry is cloned directly.
    This behaviour is useful for converting between LineString and LinearRing
    objects.
Helper function for geos_*_from_py functions in each geom type.
Helper function for geos_ * _from_py functions in each geom type .
def geos_geom_from_py(ob, create_func=None):
    """Helper function for geos_*_from_py functions in each geom type.

    If a create_func is specified the coodinate sequence is cloned and a new
    geometry is created with it, otherwise the geometry is cloned directly.
    This behaviour is useful for converting between LineString and LinearRing
    objects.
    """
    if create_func is None:
        geom = lgeos.GEOSGeom_clone(ob._geom)
    else:
        cs = lgeos.GEOSGeom_getCoordSeq(ob._geom)
        cs = lgeos.GEOSCoordSeq_clone(cs)
        geom = create_func(cs)

    N = ob._ndim

    return geom, N
def geos_geom_from_py ( ob , create_func = None ) : if create_func is None : geom = lgeos . GEOSGeom_clone ( ob . _geom ) else : cs = lgeos . GEOSGeom_getCoordSeq ( ob . _geom ) cs = lgeos . GEOSCoordSeq_clone ( cs ) geom = create_func ( cs ) N = ob . _ndim return geom , N