|
POST
|
Hi Radek, I am able to reproduce this and have identified the problem. The fix will be in a future release. Thank you for reporting it. Annette
... View more
02-21-2025
11:20 AM
|
1
|
1
|
584
|
|
IDEA
|
Eugene, thank you for the suggestion. The Relation method will be added to ArcPy in a future release.
... View more
01-08-2025
12:41 PM
|
0
|
0
|
872
|
|
IDEA
|
By definition, if two polylines cross, then they don't touch and vice versa. Here's how it works. The interior of a polyline is the set of points in the polyline that are not start or end points of a path. If the intersection of the interiors is empty, but the intersection of the polylines is not empty (they intersect only at start or end points of a path), then the polylines touch. Two polylines cross if they meet at points only, and at least one of the shared points is internal to both polylines. See https://github.com/ArcGIS/arcgis-pro-sdk/wiki/ProConcepts-Geometry#predefined-relational-operations For your case, you can use the Relation operator. See https://developers.arcgis.com/python/latest/api-reference/arcgis.geometry.html#relation
... View more
01-02-2025
10:21 AM
|
0
|
0
|
921
|
|
IDEA
|
Hi, We will add it in the next release. Thank you for the suggestion. Annette
... View more
04-22-2024
09:35 AM
|
0
|
0
|
1233
|
|
POST
|
Hi, This will be fixed in the ArcGIS Pro 3.3. Annette
... View more
01-08-2024
03:47 PM
|
0
|
0
|
764
|
|
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
|
1588
|
|
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
|
907
|
|
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
|
917
|
|
POST
|
Hi, I am looking into this. I will respond shortly. Thank you, Annette
... View more
03-06-2023
09:43 AM
|
0
|
1
|
2649
|
|
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
|
1287
|
|
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
|
1732
|
|
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
|
1760
|
|
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
|
1429
|
|
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
|
1452
|
|
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
|
914
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-30-2025 01:40 PM | |
| 1 | 02-21-2025 11:20 AM | |
| 2 | 11-29-2022 02:02 PM | |
| 1 | 11-08-2022 09:14 AM | |
| 1 | 10-11-2022 08:18 AM |
| Online Status |
Online
|
| Date Last Visited |
4 hours ago
|