Offset Polyline(original as drawn) problem in Arcgis pro sdk

2399
13
12-12-2017 11:34 PM
tanerkoka
Occasional Contributor II

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;

Miter Ofset

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;

Round offset

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);

ArcObjects Offset

Thanks for Helping 

0 Kudos
13 Replies
tanerkoka
Occasional Contributor II

Hi,

Are there any ide about this question ? Is it bug or not ?

Thanks.

0 Kudos
AnnetteLocke
Esri Contributor

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

tanerkoka
Occasional Contributor II

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

0 Kudos
AnnetteLocke
Esri Contributor

Hi Taner, I am still working on this. I should have some more information for you in a couple of days. 

Thanks,

Annette

0 Kudos
AnnetteLocke
Esri Contributor

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

tanerkoka
Occasional Contributor II

Hi Annette,

Thanks for helping.

0 Kudos
AnnetteLocke
Esri Contributor

Hi Taner,

I just wanted to let you know that this issue was addressed in ArcGIS Pro 2.1.2. 

Annette

0 Kudos
trushar
New Contributor

@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 

trushar_0-1677858336550.png

Round is good

trushar_1-1677858571400.png

2. For bevel ratio = 1:

Square, Bevel & Miter produces the following output 

trushar_2-1677858710568.png

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());
0 Kudos
AnnetteLocke
Esri Contributor

Hi,

I am looking into this. I will respond shortly.

Thank you,

Annette

0 Kudos