AnsweredAssumed Answered

How to merge multiple polylines in java?

Question asked by km32678 on Apr 11, 2016
Latest reply on Apr 12, 2016 by whe-esristaff

IPolyline newPolyline = (IPolyline) polylineList.get(0).getShape();

  ITopologicalOperator2 topoOperator = (ITopologicalOperator2) newPolyline;

 

  //int lengthindex = pFields.findField("SHAPE_Leng");

  for (int i = 1; i < polylineList.size(); i++){

  //Polyline line=(Polyline) topoOperator.union(polylineList.get(i).getShape());

  newPolyline = (IPolyline) topoOperator.union(polylineList.get(i).getShape());

  double value = newPolyline.getLength();

     polylineList.get(0).setShapeByRef(newPolyline);

    // polylineList.get(0).setValue(lengthindex, value);

  polylineList.get(0).store();

  polylineList.get(i).delete();

  }

Outcomes