Hi,
I want to ask if it is possible to split a polyline without creating a new FeatureLayer? I have a Polygon boundary (rectangle) redesigned to PolyLine and a Point on every corner, and I would like to divide Polyline by these points.
await QueuedTask.Run(() =>
{
var minX = "ExtentMinX";
var minY = "ExtentMinY";
var maxX = "ExtentMaxX";
var maxY = "ExtentMaxY";
FeatureClass listFc = lyrList.GetTable() as FeatureClass;
var polyCursor = fc.Search(queryFilter);
cps.Progressor.Max = (uint) steps;
cps.Progressor.Message = "Probíhá ";
var centerPoint = new List<MapPoint>();
Dictionary<string, object> attributes = new Dictionary<string, object>();
List<string> side = new List<string>() {"Dolni", "Levá", "Horní", "Pravá"};
object[] extentMinX = {"ExtentMinX EXTENT_MIN_X"};
object[] extentMinY = {"ExtentMinY EXTENT_MIN_Y"};
object[] extentMaxX = {"ExtentMaxX EXTENT_MAX_X"};
object[] extentMaxY = {"ExtentMaxY EXTENT_MAX_Y"};
object[] extent = {extentMinX, extentMinY, extentMaxX, extentMaxY};
object[] listParameter = {lyrList, extent};
StartATask("management.CalculateGeometryAttributes", listParameter);
while (polyCursor.MoveNext() && !cps.Progressor.CancellationToken.IsCancellationRequested)
{
cps.Progressor.Value += 1;
cps.Progressor.Status = cps.Progressor.Value + @" z " + cps.Progressor.Max + @" hotovo.";
var polygons = new List<Polygon>();
var editOperation = new EditOperation();
var polyFeature1 = polyCursor.Current as Feature;
var oid = polyCursor.Current.GetObjectID();
var polygonGeometry1 = polyFeature1.GetShape() as Polygon;
Row row = polyCursor.Current;
var pointMinX = (double) row[minX];
var pointMinY = (double) row[minY];
var pointMaxX = (double) row[maxX];
var pointMaxY = (double) row[maxY];
TableDefinition tableDefinition = listFc.GetDefinition();
int nameIndex = tableDefinition.FindField(text);
string nameNom = row.GetOriginalValue(nameIndex) as String;
var polylineBorder = new PolylineBuilder(polygonGeometry1).ToGeometry();//I would like to divide this Polyline.
MapPointBuilder minPoint = new MapPointBuilder(pointMinX, pointMinY,
SpatialReferenceBuilder.CreateSpatialReference(5514));
MapPoint mPoint = minPoint.ToGeometry() as MapPoint;
MapPointBuilder midPoint = new MapPointBuilder(pointMinX, pointMaxY,
SpatialReferenceBuilder.CreateSpatialReference(5514));
MapPoint midlePoint = midPoint.ToGeometry() as MapPoint;
MapPointBuilder maxPoint = new MapPointBuilder(pointMaxX, pointMaxY,
SpatialReferenceBuilder.CreateSpatialReference(5514));
MapPoint mxPoint = maxPoint.ToGeometry() as MapPoint;
MapPointBuilder midxPoint = new MapPointBuilder(pointMaxX, pointMinY,
SpatialReferenceBuilder.CreateSpatialReference(5514));
MapPoint mixPoint = midxPoint.ToGeometry() as MapPoint;
List<MapPoint> pointsBorder = new List<MapPoint>() {mPoint, midlePoint, mxPoint, mixPoint};//Divided by these points.
I know about the SplitLineAtPoint division, but a new FeatureClass is being created there.
I will be happy for any advice or idea.
David