Examples of CentroidLine


Examples of org.geotools.geometry.iso.util.algorithmND.CentroidLine

    // MultiCurve: the average of the weighted line segments of all contained curves
    // Ring: the average of the weighted line segments of the contained curves
    if (this instanceof CurveImpl ||
      this instanceof MultiCurveImpl ||
      this instanceof RingImpl) {
      CentroidLine cl = new CentroidLine(this.crs);
      cl.add(this);
      return cl.getCentroid();
    } else
     
    // SurfaceBoundary: the average of the weighted line segments of all curves of the exterior and interior rings
    if (this instanceof SurfaceBoundaryImpl) {
        CentroidLine cl = new CentroidLine(this.crs);
        cl.add(((SurfaceBoundaryImpl)this).getExterior());
        Iterator<Ring> interiors = ((SurfaceBoundaryImpl)this).getInteriors().iterator();
        while (interiors.hasNext()) {
          cl.add((GeometryImpl) interiors.next());
        }
        return cl.getCentroid();
         
    } else
     
    // Surface: the average of the surface (considers holes)
    // MultiSurface: the average of all contained surfaces (considers holes)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.