title: Spring data Mongodb Store and query GIS Circle and Polygon
body: <p>I've a simple use-case to solve using MongoDB with Spring-data connectors.    </p>
  
  <ul>
  <li>Store a polygon or circle (simple Point with radius)</li>
  <li>Check if give point is inside polygon/circle</li>
  </ul>
  
  <p>Now, I've done like this:</p>
  
  <ul>
  <li>Store give Polygon as a geoJSON into a document</li>
  <li>Apply 2dSphere index</li>
  <li>Polygon stored as a Polygon geoJSON type</li>
  <li>Circle stored a single point and radius as separate parameter</li>
  <li>Polygons I'm able to query using $geoIntersects</li>
  <li>Circle I'm able to query using $geoNear with aggregation</li>
  </ul>
  
  <p>Problem:</p>
  
  <ul>
  <li>What is right way to store and index Circle(Point and radius) and Polygon (multiple points)?</li>
  <li>How to do a single query to check if given point reside in Polygon / Circle?</li>
  </ul>