Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

GeometryException: internal error from within GeometryEngine.Difference(...)

オープン
#316 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
backend

調査の方向性

GeometryEngine.Difference から開始し、提供された p1 と p2 の入力を使って失敗を再現しながら、スタックを OperatorDifferenceLocal と TopologicalOperations.RestorePolylineParts_ まで追跡します。失敗している分岐を追跡し、Difference が GeometryInternalError を発生させずにこのケースを処理し、期待される操作結果を維持することを確認します。

索引モデルが issue の本文から書いたものです。

説明

cannot reproduce

I've been using the project https://github.com/EchoParkLabs/geometry-api-cs which seems to be derived from here. I ran into the error GeometryException: internal error in a specific case.

The error occurs from running the following:

com.epl.geometry.GeometryEngine.Difference(p1, p2, null)

where p1 and p2are specified below. The exception is thrown here within TopologicalOperations.RestorePolylineParts_():

int fromEdgeTwinNext = m_topo_graph.GetHalfEdgeNext(fromEdgeTwin);
if (m_topo_graph.GetHalfEdgeTwin(toEdge) != fromEdgeTwinNext)
{
	// Crossroads is here. Pass through the crossroad.
	toEdge = TryMoveThroughCrossroadBackwards_(fromEdge);
	if (toEdge == -1)
	{
		throw com.epl.geometry.GeometryException.GeometryInternalError(); // ⁂⁂⁂⁂⁂
	}
}

with the full stack trace below.

Using OperatorDifference.Local()... does the same thing.

I'd be happy to provide any other information that might be helpful. I've tried step-tracing the code but really don't have enough context to understand where it's going wrong.

I'm looking for a workaround, if possible, and also just wanted to report the potential problem in this repository. (Despite this code coming from the other repo as noted above, it could be that the same issue exists here).

Thank you!


p1 is:

MULTILINESTRING((113100 -141099, 113100 -153451, 113100 -208900, 78990 -208900, 78990 -153451), (146232 -155878, 147692 -155878), (78990 -153451, 87004 -153451, 87004 -142059), (78990 -153451, 78990 -142059), (78990 -142059, 82837 -142059), (78990 -142059, 78990 -133150), (82837 -142059, 87004 -142059), (82837 -142059, 82837 -133150, 78990 -133150), (87004 -142059, 90190 -142059, 90190 -133799, 90190 -133150), (108983 -133799, 93962 -133799, 93962 -141099, 108983 -141099), (108983 -141099, 113100 -141099), (108983 -141099, 108983 -133799), (123511 -141099, 113100 -141099), (130712 -141099, 123511 -141099), (123511 -133570, 123511 -141099), (134078 -141099, 130712 -141099), (130712 -141099, 130712 -133570, 134078 -133570), (138075 -141099, 134078 -141099), (134078 -141099, 134078 -133570), (152794 -141099, 138075 -141099), (138075 -141099, 138075 -133570, 134078 -133570), (152794 -141099, 160621 -141099, 160621 -133570, 163710 -133570), (152794 -133570, 152794 -141099), (163710 -141099, 163710 -133570), (181990 -141099, 167364 -141099, 167364 -133570, 163710 -133570), (185987 -141099, 181990 -141099), (181990 -141099, 181990 -133570, 185987 -133570, 185987 -141099), (193040 -141099, 185987 -141099), (196724 -141099, 193040 -141099), (193040 -141099, 193040 -133570, 196724 -133570, 196724 -141099), (211356 -141099, 196724 -141099), (218759 -141099, 211356 -141099), (211356 -141099, 211356 -133570, 218759 -133570), (222026 -141099, 218759 -141099), (218759 -141099, 218759 -133570), (225988 -141099, 222026 -141099), (222026 -141099, 222026 -133570), (240910 -141099, 225988 -141099), (225988 -141099, 225988 -133570, 222026 -133570), (108983 -133799, 108983 -130225), (218759 -133570, 222026 -133570), (239732 -111827, 240910 -111827, 240910 -133570), (78990 -133150, 78990 -119153), (82348 -130225, 108983 -130225), (108983 -130225, 108983 -123937), (82348 -126591, 85522 -126591, 104245 -126591), (104245 -123937, 108983 -123937), (108983 -123937, 108983 -119153, 108983 -108235), (78990 -119153, 82348 -119153), (78990 -119153, 78990 -108235), (85522 -119153, 85522 -108235), (78990 -108235, 85522 -108235), (78990 -108235, 78990 -100975, 78990 -89738, 78990 -82547, 86813 -82547), (85522 -108235, 108983 -108235), (108983 -108235, 108983 -100975, 108983 -74778), (78990 -79816, 78990 -72050, 78990 -60514), (86813 -74778, 108983 -74778), (108983 -74778, 108983 -66235), (240910 -46061, 240910 -67831, 238910 -67831), (108983 -62106, 104699 -62106, 104699 -66235, 108983 -66235), (108983 -66235, 108983 -62106), (82636 -60514, 82636 -63125, 94126 -63125, 94126 -64094, 101376 -64094, 101376 -59622), (108983 -62106, 108983 -59622), (78990 -60514, 82636 -60514), (78990 -60514, 73065 -59457, 79357 -24381, 110845 -29924, 109462 -37956), (82636 -60514, 82636 -59622, 86813 -59622, 101376 -59622), (101376 -59622, 108983 -59622), (108983 -59622, 108983 -53603), (91912 -53603, 91912 -56476, 86813 -56476, 86813 -52933), (86813 -52933, 91912 -52933, 91912 -53603), (91912 -53603, 104538 -53603), (104538 -53603, 108983 -53603), (104538 -53603, 104538 -48078, 108983 -48078), (108983 -53603, 108983 -48078), (92336 -45588, 92336 -50430), (95865 -47913, 95865 -50430, 102623 -50430, 102623 -47913), (108983 -48078, 108983 -45588), (95865 -47913, 102623 -47913), (95865 -47913, 95865 -45588), (102623 -47913, 102623 -45588, 101829 -45588), (123143 -46190, 123143 -37956), (130877 -37956, 130877 -46190, 134583 -46190), (134583 -46190, 138283 -46190, 138283 -37956), (134583 -46190, 134583 -37956), (152772 -37956, 152772 -46190, 156813 -46190, 156813 -37956), (167487 -37956, 167487 -46190), (181994 -37956, 181994 -46190, 189488 -46190, 189488 -37956), (192756 -37956, 192756 -46190, 196811 -46190, 196811 -37956), (211197 -37956, 211197 -46190, 215014 -46190), (215014 -46190, 218661 -46190, 218661 -37956), (215014 -46190, 215014 -37956), (221998 -37956, 221998 -46190, 226099 -46190, 226099 -37956), (240910 -46061, 239748 -46061), (226099 -37956, 240910 -37956, 240910 -46061), (87057 -37956, 81777 -37956, 81777 -45588, 87057 -45588), (87057 -45588, 92336 -45588), (87057 -45588, 87057 -37956), (92336 -45588, 95400 -45588), (95400 -45588, 95865 -45588), (95400 -45588, 95400 -37956), (95865 -45588, 98875 -45588), (98875 -45588, 101829 -45588), (98875 -45588, 98875 -37956), (101829 -45588, 101829 -37956, 98875 -37956), (108983 -37956, 104819 -37956, 104819 -45588, 108983 -45588), (108983 -45588, 108983 -37956), (87057 -37956, 95400 -37956), (95400 -37956, 98875 -37956), (108983 -37956, 109462 -37956), (109462 -37956, 123143 -37956), (123143 -37956, 130877 -37956), (130877 -37956, 134583 -37956), (134583 -37956, 138283 -37956), (138283 -37956, 152772 -37956), (152772 -37956, 156813 -37956), (156813 -37956, 167487 -37956), (167487 -37956, 181994 -37956), (181994 -37956, 189488 -37956), (189488 -37956, 192756 -37956), (192756 -37956, 196811 -37956), (196811 -37956, 211197 -37956), (211197 -37956, 215014 -37956), (215014 -37956, 218661 -37956), (218661 -37956, 221998 -37956), (221998 -37956, 226099 -37956))

and p2 is:

MULTILINESTRING((87004 -142059, 90190 -142059, 90190 -133799, 90190 -133150), (108983 -133799, 93962 -133799, 93962 -141099, 108983 -141099), (134078 -133570, 130712 -133570, 130712 -141099), (160621 -141099, 160621 -133570, 163710 -133570), (163710 -141099, 163710 -133570), (193040 -141099, 193040 -133570, 196724 -133570), (218759 -141099, 218759 -133570), (163710 -133570, 167364 -133570), (211356 -133570, 218759 -133570), (218759 -133570, 222026 -133570), (82348 -130225, 108983 -130225), (82348 -126591, 85522 -126591, 104245 -126591), (86813 -74778, 108983 -74778), (91912 -53603, 104538 -53603), (104538 -53603, 108983 -53603), (104538 -53603, 104538 -48078, 108983 -48078), (92336 -45588, 92336 -50430), (95865 -47913, 95865 -50430, 102623 -50430, 102623 -47913), (95865 -47913, 102623 -47913), (95865 -47913, 95865 -45588), (102623 -47913, 102623 -45588, 101829 -45588), (134583 -46190, 130877 -46190, 130877 -37956), (134583 -46190, 138283 -46190), (134583 -46190, 134583 -37956), (189488 -37956, 189488 -46190, 181994 -46190), (211197 -46190, 215014 -46190), (215014 -46190, 218661 -46190, 218661 -37956), (215014 -46190, 215014 -37956), (87057 -37956, 81777 -37956, 81777 -45588, 87057 -45588), (87057 -45588, 92336 -45588), (87057 -45588, 87057 -37956), (92336 -45588, 95400 -45588), (95400 -45588, 95865 -45588), (95400 -45588, 95400 -37956), (95865 -45588, 98875 -45588), (87057 -37956, 95400 -37956), (95400 -37956, 98875 -37956))

Stack trace:

   at com.epl.geometry.TopologicalOperations.RestorePolylineParts_(Int32 first_edge, Int32 newGeometry, Int32 visitedEdges, Int32 visitedClusters, Int32 geometry_dominant)
   at com.epl.geometry.TopologicalOperations.TopoOperationPolylinePolylineOrPolygon_(Int32 geometry_dominant)
   at com.epl.geometry.TopologicalOperations.Difference(Int32 geometry_a, Int32 geometry_b)
   at com.epl.geometry.TopologicalOperations.Difference(Geometry geometry_a, Geometry geometry_b, SpatialReference sr, ProgressTracker progress_tracker)
   at com.epl.geometry.OperatorDifferenceLocal.Difference(Geometry geometry_a, Geometry geometry_b, SpatialReference spatial_reference, ProgressTracker progress_tracker)
   at com.epl.geometry.OperatorDifferenceCursor.Next()
   at com.epl.geometry.OperatorDifferenceLocal.Execute(Geometry inputGeometry, Geometry subtractor, SpatialReference sr, ProgressTracker progressTracker)
   at com.epl.geometry.GeometryEngine.Difference(Geometry geometry1, Geometry substractor, SpatialReference spatialReference)
主要言語
Java
スター
710
フォーク
268
平均マージ
7日 23時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Esri/geometry-api-java のほかの issue

Esri/geometry-api-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。