
    
i4	                     :    d dl mZmZmZ d dlmZmZ d dlmZ d Z	y)    )
LineStringPointMultiLineString)
polygonizeunary_union)explain_validityc                 :   t        | D cg c]  \  }}t        |      t        |      f c}}      }t        |      }t        t	        |            }t        t        |             i }i }|j                         D ]4  \  }	}
t        |
d   |
d         }d}|D ]  }|j                  |      s|} n |rt        |j                  j                        }t        t        |      dz
        D cg c](  }||   d   ||   d   g||dz      d   ||dz      d   gg* c}||	<   g }|j                  D ]o  }t        |j                        }|j                  t        t        |      dz
        D cg c](  }||   d   ||   d   g||dz      d   ||dz      d   gg* c}       q |||	<   +g ||	<   g ||	<   7 |j                         D ci c]  \  }}||
 }}}|j                         D ci c]  \  }}||r|gng  }}}||fS c c}}w c c}w c c}w c c}}w c c}}w )z
    lines: list of [[[x1, y1], [x2, y2]], ...]
    points_dict: dict like {"a": [x, y], "b": [x, y], ...}

    returns:
      polygon_lines = {"a": [[[x,y],[x,y]], ...], ...}
      hole_lines = {"a": [[[x,y],[x,y]], ...] or []}
    XYN   r   )r   tupler   listr   printlenitemsr   containsexteriorcoordsrange	interiorsextend)linespoints_dictp1p2mlsunionedpolygonspolygon_lines
hole_lineslabelr   pt
found_polypolyexterior_coordsiholesinteriorhole_coordskvsubdivinner_subdivs                          J/home/developers/rajanand/mypropertyqr-fmb-refixing-v2/pydep/get_subdiv.pyextract_polygon_and_holesr/      s    Hvr2U2Yb	2H
IC#GJw'(H	#h-
 MJ %**, ##v 6#;s,
  	D}}R !
	
 ":#6#6#=#=>O s?3A56$  "!$Q');A)>?!!A#&q)?1Q3+?+BCE$M%  E&00 "8??3 #3{#3A#56  "!nQ'Q):;!!A#&q);qs+;A+>?A  !&Ju $&M%  "JuG##N  -2245tq!ad5F54>4D4D4FGDAqAasR'GLG<q I<$ 6Gs    H
+-H(-HH(HN)
shapely.geometryr   r   r   shapely.opsr   r   shapely.validationr   r/        r.   <module>r5      s    ? ? / /F r4   