Hi,
We have a offset polyline problem I can not offset polyline as you draw (original as drawn) . How can we solve this important problem ? Or are there any alternative solution? We are using all Offset Types (Mitter ,Bevel , Round , Square) but polyline shape changes, we don not want the line to be different shape .We can offset same polyline in ArcObjects but we can not wit ArcgisPro SDK.
Here is in code and pictures in ArcgisPro SDK below :
Mitter left and right offset in the middle green polyline is original polyline
if (result.RightSide)
offsetGeometry = GeometryEngine.Instance.Offset(feature.GetShape(), distance, OffsetType.Miter, 5) as Polyline;
else
offsetGeometry = GeometryEngine.Instance.Offset(feature.GetShape(), -distance, OffsetType.Miter, 5) as Polyline;
Round left and right offset in the middle green polyline is original polyline
if (result.RightSide)
offsetGeometry = GeometryEngine.Instance.Offset(feature.GetShape(), distance, OffsetType.Round, 0) as Polyline;
else
offsetGeometry = GeometryEngine.Instance.Offset(feature.GetShape(), -distance, OffsetType.Round, 0) as Polyline;
Here is below what we want correct left and right offset code and pictures in ArcObjects :
Left and right offset in the middle green polyline is original polyline.
IConstructCurve constructCurve = new PolylineClass();
constructCurve.ConstructOffset(polycurve, Offset, ref esriConstructOffsetEnum, ref bevelRatio);
Thanks for Helping
Hi,
Are there any ide about this question ? Is it bug or not ?
Thanks.
Hi Taner,
This is the same issue as https://community.esri.com/message/732957-draw-arc-line-offset-problem-in-arcgis-pro-sdk?et=watches.... . It will be fixed in the next release. I am looking into a workaround in the meantime and will keep you posted.
Thanks,
Annette
Hi Annette,
Are there any result about this problem ? It is very important for us because it is important for us to draw the right and left offensive roads in our vehicles.
Thanks
Hi Taner, I am still working on this. I should have some more information for you in a couple of days.
Thanks,
Annette
Hi Taner,
Thank you for your patience. The fix for this issue is being considered for ArcGIS Pro 2.1.2 with a targeted release date of March 13. I will keep you posted.
Annette
Hi Annette,
Thanks for helping.
Hi Taner,
I just wanted to let you know that this issue was addressed in ArcGIS Pro 2.1.2.
Annette
@AnnetteLocke - would you know if this functionality is broken in ArcGIS Pro 3.1?
I have been struggling with this issue, specifically with line.
1. For bevel ratio where value is < 1 or 0:
Square, Bevel & Miter produces the following output
Round is good
2. For bevel ratio = 1:
Square, Bevel & Miter produces the following output
Round is same as above.
Any thoughts on what is going on?
Thank you again,
Trushar
Edited:
var spatialReference = SpatialReferenceBuilder.CreateSpatialReference(wkid: 4326);
var linePts = new List<MapPoint>
{
MapPointBuilderEx.CreateMapPoint(00000.10, 00000.10, spatialReference),
MapPointBuilderEx.CreateMapPoint(00000.20, 00000.50, spatialReference),
MapPointBuilderEx.CreateMapPoint(00000.30, 00000.10, spatialReference),
MapPointBuilderEx.CreateMapPoint(00000.40, 00000.10, spatialReference),
MapPointBuilderEx.CreateMapPoint(00000.50, 00000.80, spatialReference)
};
var polyline = PolylineBuilder.CreatePolyline(linePts, spatialReference);
var g1 = GeometryEngine.Instance.Offset(polyline, 0.10, OffsetType.Square, 0);
var g2 = GeometryEngine.Instance.Offset(polyline, 0.10, OffsetType.Bevel, 0.25);
var g3 = GeometryEngine.Instance.Offset(polyline, 0.10, OffsetType.Miter, 0.1);
var g4 = GeometryEngine.Instance.Offset(polyline, 0.10, OffsetType.Round, 0);
graphicsLayer.AddElement(polyline.GetGraphicLineMct());
graphicsLayer.AddElement(g1.GetGraphicLineMct(SymbolHelper.LineSymbolGreen));
graphicsLayer.AddElement(g2.GetGraphicLineMct(SymbolHelper.LineSymbolPink));
graphicsLayer.AddElement(g3.GetGraphicLineMct(SymbolHelper.LineSymbolPurple));
graphicsLayer.AddElement(g4.GetGraphicLineMct());
Hi,
I am looking into this. I will respond shortly.
Thank you,
Annette