#NEWLINE# def snap( g1 , g2 , tolerance ) : #NEWLINE# #INDENT# "Snap one geometry to another with a given tolerance\n\n    Vertices of the first geometry are snapped to vertices of the second\n    geometry. The resulting snapped geometry is returned. The input geometries\n    are not modified.\n\n    Parameters\n    ----------\n    g1 : geometry\n        The first geometry\n    g2 : geometry\n        The second geometry\n    tolerence : float\n        The snapping tolerance\n\n    Example\n    -------\n    >>> square = Polygon([(1,1), (2, 1), (2, 2), (1, 2), (1, 1)])\n    >>> line = LineString([(0,0), (0.8, 0.8), (1.8, 0.95), (2.6, 0.5)])\n    >>> result = snap(line, square, 0.5)\n    >>> result.wkt\n    'LINESTRING (0 0, 1 1, 2 1, 2.6 0.5)'\n    " #NEWLINE# return geom_factory ( lgeos . methods [ 'snap' ] ( g1 . _geom , g2 . _geom , tolerance ) )