Package chunmap.model.geom

Examples of chunmap.model.geom.Polygon


  @Override
  protected boolean within(Geometry g1, Geometry g2) {
    if (im.get(Inner, Inner) == EmptyDim)
      return false;

    Polygon a1 = (Polygon) g1;
    Polygon a2 = (Polygon) g2;
    ComputeIm r2r = new LinearRing_LinearRing(a1.getShell(), a2
        .getShell());
    IntersectionMatrix tim = r2r.getIM();

    if (tim.get(Inner, Outer) != EmptyDim)
      return false;

    for (Ring r2 : a2.getHoles()) {
      ComputeIm r2r2 = new LinearRing_LinearRing(a1.getShell(), r2);
      IntersectionMatrix tim2 = r2r2.getIM();
      if (tim2.get(Inner, Inner) != EmptyDim)
        if (inHoles(r2, a1))
          return false;
View Full Code Here


            LineString ls = (LineString)geom ;
            return env.toRing().hasIntersection(ls);
        }
        else if (geom instanceof Polygon)
        {
            Polygon pg = (Polygon)geom;
            Ring r = env.toRing();
            if (pg.getShell().containIn(env.getCenter()))
            {
                if (inHoles(r, pg))
                {
                    return false;
                }
                return true;
            }
            else
            {
                if (r.hasIntersection(pg.getShell())) return true;

                return false;
            }
        }
        else if (geom instanceof GeometryCollection)
View Full Code Here

  public void drawGeo(Graphics g, Geometry geo, View renderer) {
    if (geo instanceof LineString) {
      LineString ls = (LineString) geo;
      drawLineSymbol((Graphics2D) g, ls);
    } else if (geo instanceof Polygon) {
      Polygon pg = (Polygon) geo;
      drawLineSymbol((Graphics2D) g, pg.getShell());
      for (Ring r : pg.getHoles()) {
        drawLineSymbol((Graphics2D) g, r);
      }
    } else if (geo instanceof GeometryCollection) {
      GeometryCollection gs = (GeometryCollection) geo;
      for (Geometry ge : gs) {
View Full Code Here

    if (im.get(Inner, Border) != EmptyDim) {
      return EmptyDim;
    }

    GeoPoint p1 = (GeoPoint) g1;
    Polygon a2 = (Polygon) g2;
    if (a2.getShell().containIn(p1.getCoordinate())) {
      for (Ring r : a2.getHoles()) {
        if (r.containIn(p1.getCoordinate())) {
          return EmptyDim;
        }
      }
      return PointDim;
View Full Code Here

TOP

Related Classes of chunmap.model.geom.Polygon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.