IDEA
|
Hi, We will add it in the next release. Thank you for the suggestion. Annette
... View more
yesterday
|
0
|
0
|
35
|
POST
|
Hi, This will be fixed in the ArcGIS Pro 3.3. Annette
... View more
01-08-2024
03:47 PM
|
0
|
0
|
81
|
POST
|
If you set HasZ = true in the builder, then all start and end points will have the HasZ property set to true too. Here is some code to set the z-values in the points while still preserving the curve segments. ///////////////////////////////// LineSegment line = LineBuilderEx.CreateLineSegment(new Coordinate2D(0, 0), new Coordinate2D(3, 3)); MapPoint start = MapPointBuilderEx.CreateMapPoint(3, 3); MapPoint end = MapPointBuilderEx.CreateMapPoint(7, 3); Coordinate2D center = new Coordinate2D(5, 5); EllipticArcSegment arc = EllipticArcBuilderEx.CreateCircularArc(start, end, center, ArcOrientation.ArcCounterClockwise); Polyline polyline = PolylineBuilderEx.CreatePolyline(new Segment[] { line, arc }); Assert.IsFalse(polyline.HasZ); PolylineBuilderEx polylineBuilder = new PolylineBuilderEx(polyline); polylineBuilder.HasZ = true; Polyline polyline3D = polylineBuilder.ToGeometry(); var points = polyline3D.Points; foreach (MapPoint p in points) Assert.IsTrue(p.HasZ); var part = polyline3D.Parts[0]; int numSegments = part.Count; for (int i = 0; i < numSegments; i++) { Segment segment = part[i]; MapPointBuilderEx pointBuilder = new MapPointBuilderEx(segment.StartPoint); pointBuilder.Z = i + 1; MapPoint startPoint = pointBuilder.ToGeometry(); pointBuilder = new MapPointBuilderEx(segment.EndPoint); pointBuilder.Z = i + 2; MapPoint endPoint = pointBuilder.ToGeometry(); SegmentType segmentType = segment.SegmentType; SegmentBuilderEx segmentBuilder = null; switch (segmentType) { case SegmentType.Line: segmentBuilder = new LineBuilderEx((LineSegment)segment); break; case SegmentType.Bezier: segmentBuilder = new CubicBezierBuilderEx((CubicBezierSegment)segment); break; case SegmentType.EllipticArc: segmentBuilder = new EllipticArcBuilderEx((EllipticArcSegment)segment); break; } segmentBuilder.StartPoint = startPoint; segmentBuilder.EndPoint = endPoint; segment = segmentBuilder.ToSegment(); polylineBuilder.ReplaceSegment(0, i, segment); } polyline3D = polylineBuilder.ToGeometry(); /////////////////////////////////
... View more
09-08-2023
04:06 PM
|
0
|
1
|
300
|
POST
|
Can you use this workaround? private Multipart GetOffsetUsingGraphicBuffer(Multipart multipart, double offsetDistance, LineJoinType joinType)
{
Polygon graphicBuffer = GeometryEngine.Instance.GraphicBuffer(multipart, Math.Abs(offsetDistance), joinType, LineCapType.Square, 4, 0, 96) as Polygon;
Polyline boundary = GeometryEngine.Instance.Boundary(graphicBuffer) as Polyline;
ProximityResult startResult = GeometryEngine.Instance.NearestPoint(boundary, multipart.Points[0]);
Coordinate2D coord = (Coordinate2D)(startResult.Point);
Segment firstSegment = multipart.Parts[0][0];
// Negative offset distance means the offset line will be on the left side
bool isOnRightSide = PointIsOnRightSide(firstSegment.StartCoordinate, coord, firstSegment.EndCoordinate);
if (offsetDistance > 0 && !isOnRightSide)
coord.Rotate(Math.PI, (Coordinate2D)(multipart.Points[0]));
double distanceAlongCurve1, distanceFromCurve;
LeftOrRightSide whichSide;
MapPoint point = GeometryEngine.Instance.QueryPointAndDistance(boundary, SegmentExtensionType.NoExtension, coord.ToMapPoint(), AsRatioOrLength.AsRatio, out distanceAlongCurve1, out distanceFromCurve, out whichSide);
ProximityResult endResult = GeometryEngine.Instance.NearestPoint(boundary, multipart.Points.Last());
coord = (Coordinate2D)(endResult.Point);
if (offsetDistance > 0 && !isOnRightSide)
coord.Rotate(Math.PI, (Coordinate2D)(multipart.Points.Last()));
double distanceAlongCurve2;
point = GeometryEngine.Instance.QueryPointAndDistance(boundary, SegmentExtensionType.NoExtension, coord.ToMapPoint(), AsRatioOrLength.AsRatio, out distanceAlongCurve2, out distanceFromCurve, out whichSide);
double d1 = Math.Min(distanceAlongCurve1, distanceAlongCurve2);
double d2 = Math.Max(distanceAlongCurve1, distanceAlongCurve2);
Polyline subCurve = GeometryEngine.Instance.GetSubCurve(boundary, d1, d2, AsRatioOrLength.AsRatio) as Polyline;
return subCurve;
}
private bool PointIsOnRightSide(Coordinate2D origin, Coordinate2D p1, Coordinate2D p2)
{
// The result is positive if p1 lies on right side of origin-->p2;
double part1 = (p1.X - origin.X) * (p2.Y - origin.Y),
part2 = (p1.Y - origin.Y) * (p2.X - origin.X),
result = part1 - part2;
return result > 0;
}
// Here is a test
public void GEOffsetWorkaroundTest()
{
SpatialReference spatialReference = SpatialReferences.WGS84;
var coords = new List<Coordinate2D>
{
new Coordinate2D(0.1, 0.1),
new Coordinate2D(0.2, 0.5),
new Coordinate2D(0.3, 0.1),
new Coordinate2D(0.4, 0.1),
new Coordinate2D(0.5, 0.8)
};
Polyline polyline = PolylineBuilderEx.CreatePolyline(coords, spatialReference) as Polyline;
Polyline outputOffsetPolyline = GetOffsetUsingGraphicBuffer(polyline, 0.1, LineJoinType.Miter) as Polyline;
File.WriteAllText("C:\\temp\\outputOffsetPolyline_1_.txt", outputOffsetPolyline.ToJson());
outputOffsetPolyline = GetOffsetUsingGraphicBuffer(polyline, -0.1, LineJoinType.Miter) as Polyline;
File.WriteAllText("C:\\temp\\outputOffsetPolyline_2_.txt", outputOffsetPolyline.ToJson());
outputOffsetPolyline = GetOffsetUsingGraphicBuffer(polyline, 0.1, LineJoinType.Bevel) as Polyline;
File.WriteAllText("C:\\temp\\outputOffsetPolyline_3_.txt", outputOffsetPolyline.ToJson());
outputOffsetPolyline = GetOffsetUsingGraphicBuffer(polyline, -0.1, LineJoinType.Bevel) as Polyline;
File.WriteAllText("C:\\temp\\outputOffsetPolyline_4_.txt", outputOffsetPolyline.ToJson());
outputOffsetPolyline = GetOffsetUsingGraphicBuffer(polyline, 0.1, LineJoinType.Round) as Polyline;
File.WriteAllText("C:\\temp\\outputOffsetPolyline_5_.txt", outputOffsetPolyline.ToJson());
}
... View more
03-15-2023
01:53 PM
|
0
|
0
|
224
|
POST
|
This is a bug that will be addressed in a future release. Unfortunately, I can't give you an exact date at this time. I am working on a workaround for you, but I want to test it a little bit more. It will be ready tomorrow. Regarding SideBuffer, the corners of the buffer will always be round. The LineCapType refers only to the start and end of the line.
... View more
03-14-2023
04:30 PM
|
0
|
1
|
234
|
POST
|
Hi, I am looking into this. I will respond shortly. Thank you, Annette
... View more
03-06-2023
09:43 AM
|
0
|
1
|
912
|
POST
|
Hi Steve, the patch has not been released yet, but it is coming soon. If you have the SDK installed, Visual Studio has a notification icon that will tell you that an update is available. Also, there is an option in the IDE to "automatically update extensions". If that option is turned on, then you don't have to do anything - it will get automatically updated. Thanks, Annette
... View more
12-12-2022
09:33 AM
|
0
|
0
|
461
|
POST
|
Yes, it works with all the cases that you mention. There is more information here: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geometry#simplifyasfeature-and-issimpleasfeature
... View more
11-30-2022
09:54 AM
|
0
|
0
|
533
|
POST
|
Hi, currently we don't return a reason from the simplify operator, but we do have a backlog issue for it. I have changed it to a high priority item, so it will go into ArcGIS Pro SDK 3.2. In the meantime, if you call GeometryEngine.SimplifyAsFeature, the duplicate vertices will be removed. If that's not what you want, then call GeometryEngine.IsSimpleAsFeature. If false is returned, you can loop through the vertices to find the duplicates.
... View more
11-29-2022
02:02 PM
|
2
|
2
|
561
|
POST
|
Matthias, I see. Yes, it is a bug which will be fixed in the next release. SplitAtPoint is a good workaround in the meantime. Thank you so much, Annette
... View more
11-08-2022
09:14 AM
|
1
|
0
|
433
|
POST
|
Hi Matthias, The input polyline should be known simple before calling Cut. You can do this by calling either GeometryEngine.Instance.IsSimpleAsFeature (if you know that it is simple) or GeometryEngine.Instance.SimplifyAsFeature (if you're not sure if it is simple or not). For future reference, if a GeometryEngine method throws a GeometryObjectException with the message "GeometryObjectException: The operation cannot be performed on a non-simple geometry.", then the geometry needs to be known simple. The doc should explicitly mention this, so we will update it. Thank you for pointing it out. Let me know if you have any questions. Annette
... View more
11-07-2022
10:07 AM
|
0
|
0
|
456
|
POST
|
In the meantime, you could insert the geometries into a feature class in a geodatabase and use the GeoProcessing tool CheckGeometry. https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/check-geometry.htm
... View more
10-17-2022
10:18 AM
|
0
|
0
|
302
|
POST
|
Hi Kirk, The Pro SDK doesn't have it, but we do have an issue in our queue to add it. I will update the priority to include it in an upcoming release. Thanks, Annette
... View more
10-17-2022
10:11 AM
|
0
|
1
|
303
|
POST
|
Hi Konstantin, This has been fixed and will be included in an upcoming patch. Thank you for reporting it. Annette
... View more
10-11-2022
08:18 AM
|
1
|
2
|
578
|
POST
|
Hi Kris, The domain extent is different than the valid area of a coordinate system. The domain extent is an arbitrary square used to delimit valid coordinates for a spatial reference system and determine their resolution. It is possible that the domain extent is larger than the usable area of a coordinate system (a UTM zone, for example). I suspect that what you are looking for is the horizon. We plan to add a method to get the horizon in a near-term release. In the meantime, you can take a look at https://community.esri.com/message/935357-re-how-to-get-the-spatialreference-horizon-polygon for a possible workaround. I hope that helps. Thanks, Annette
... View more
06-24-2020
11:08 AM
|
0
|
0
|
440
|
Title | Kudos | Posted |
---|---|---|
2 | 11-29-2022 02:02 PM | |
1 | 11-08-2022 09:14 AM | |
1 | 10-11-2022 08:18 AM | |
1 | 09-18-2017 02:27 PM | |
1 | 12-20-2017 10:16 AM |
Online Status |
Offline
|
Date Last Visited |
yesterday
|