title: How to merge two shapes from KML files and get coordinates of overlapped area?
body: <p>There are two KML/KMZ files. As an example one of them has coordinates of black square and another one has coordinates of green square. How can I get coordinates of red square (which is overlapped area)? Looks like ideally this can be scripted or generated using program. </p>
  
  <p>If this can be achieved, then to summarise the goal is to analyse and merge two KML/KMZ files of boundaries and create smaller shapes in one KML/KMZ.</p>
  
  <p>Many thanks</p>
  
  <p><a href="https://i.stack.imgur.com/1SGcW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1SGcW.png" alt="enter image description here"></a></p>