コード例 #1
0
  /**
   * Determines the {@link Location} of a point in an areal {@link Geometry}.
   *
   * @param p the point to test
   * @return the location of the point in the geometry
   */
  public int locate(Coordinate p) {
    RayCrossingCounter rcc = new RayCrossingCounter(p);
    MCSegmentCounter mcSegCounter = new MCSegmentCounter(rcc);
    Envelope rayEnv = new Envelope(p.x, maxXExtent, p.y, p.y);
    List mcs = index.query(rayEnv);
    countSegs(rcc, rayEnv, mcs, mcSegCounter);

    return rcc.getLocation();
  }