Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlapping edges still a problem #35

Open
croonerg opened this issue Jun 30, 2017 · 6 comments
Open

Overlapping edges still a problem #35

croonerg opened this issue Jun 30, 2017 · 6 comments

Comments

@croonerg
Copy link

croonerg commented Jun 30, 2017

Look at this codepen:
https://codepen.io/anon/pen/LLdEbM

Polygon 1:

[
	[
		[
			-492.1913921306456,
			-246.09569606532278
		],
		[
			-492.1913921306456,
			246.09569606532278
		],
		[
			328.12759475376373,
			164.06379737688187
		],
		[
			328.12759475376373,
			82.03189868844093
		],
		[
			0,
			98.43827842612912
		],
		[
			0,
			-98.43827842612912
		],
		[
			328.12759475376373,
			-82.03189868844093
		],
		[
			328.12759475376373,
			-164.06379737688187
		],
		[
			-492.1913921306456,
			-246.09569606532278
		]
	]
]

Polygon 2:

[
	[
		[
			118.12593411135472,
			92.53198172056138
		],
		[
			328.12759475376373,
			82.03189868844093
		],
		[
			328.12759475376373,
			92.53198172056136
		],
		[
			118.12593411135472,
			92.53198172056138
		]
	]
]
@w8r
Copy link
Owner

w8r commented Dec 20, 2017

still not fixed after #42

@liamdebeasi
Copy link

Has there been any progress made on this issue? This would be a nice bug to have fixed as it resolves several issues for a project I'm working on.

@w8r
Copy link
Owner

w8r commented Jan 24, 2018

We tried to tackle it, but so far to no avail. Of course it would be nice!

@mfogel
Copy link
Contributor

mfogel commented Jan 26, 2018

I'm running into what I think is this issue as well. Here's a simple test case that demonstrates the problem. Run 'Difference A-B' to see the problem: https://codepen.io/mfogel/pen/jYgxmm

Poly A:

[[
  [0,0],
  [3,0],
  [3,3],
  [0,3],
  [0,0]
]]

Poly B:

[[
  [1,0],
  [2,0],
  [2,4],
  [1,4],
  [1,0]
]]

@w8r
Copy link
Owner

w8r commented Jan 26, 2018

Thanks for a simple testcase

@mfogel
Copy link
Contributor

mfogel commented Jan 26, 2018

@w8r no prob, happy to help

Just want to mention that it appears this bug can also manifest itself as a heap overflow, crashing the browser/node altogether. Here's an example, similar to the case I posted earlier. Run 'Difference A-B': https://codepen.io/mfogel/pen/baXjGO

Poly A: (a Polygon, same as before)

[[  [0,0],  [3,0],  [3,3],  [0,3],  [0,0]  ]]

Poly B: (a MultiPolygon)

[
  [[  [1,0],  [2,0],  [2,4],  [1,4],  [1,0]  ]],
  [[  [2,0],  [3,0],  [3,1],  [2,1],  [2,0]  ]]
]

Seems possible to me that martinez is:

  • computing diff(PolyA, PolyB[0]) -> getting invalid coordinate result
  • computing diff(that invalid coord. result, PolyB[1]) -> crashing in heap overflow

I'll try to find some time this weekend to help out on this.

mfogel added a commit to mfogel/geojson-cli-difference that referenced this issue Jan 26, 2018
Martinez still has at least one blocking issue, namely
w8r/martinez#35
mfogel added a commit to mfogel/polygon-clipping that referenced this issue Jan 27, 2018
w8r added a commit that referenced this issue Jan 28, 2018
mfogel added a commit to mfogel/polygon-clipping that referenced this issue Feb 2, 2018
grassick added a commit to grassick/martinez that referenced this issue Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants