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

When performing union in several multipolygons, some of them are lost. #4

Open
ifsnop opened this issue Oct 18, 2023 · 0 comments
Open

Comments

@ifsnop
Copy link

ifsnop commented Oct 18, 2023

mpoly1.json
mpoly2.json

$arr1 = json_decode(file_get_contents("mpoly1.json"));
$arr2 = json_decode(file_get_contents("mpoly2.json"));

$subject = new \MartinezRueda\Polygon($arr1);
$clipping = new \MartinezRueda\Polygon($arr2);

$result = (new \MartinezRueda\Algorithm())->getUnion($subject, $clipping);
echo json_encode($result->toArray()), PHP_EOL;

Differences of polygons or other unions works as expected, but with this particular files, some output is missing, see attached output.jpg.

output

Using the martinez-rueda javascript implementation, everything goes well.
js_output

codepen javscript implementation

Can anybody offer some help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant