Skip to content

Polygon / rectangle intersection returns empty polygon #149

@manuschiller

Description

@manuschiller

I am trying to get the intersection between a rectangle and a polygon.

illustration

However, the result is always { POLYGON EMPTY }
What am I doing wrong?

var wktreader = new WKTReader();
var polygon = wktreader.Read(@"POLYGON ((-62.327500000000008 77.777166176470587,
 -62.327500000000008 191.08,
 -39.425176714633878 191.08,
 30.449401394787785 111.06902734290135,
 34.240621449176217 85.17199763498823,
 32.474968591813237 66.628747810197453,
 29.724407935551895 56.755281980420541,
 10.963366463822565 52.502595315049426,
 -62.327500000000008 77.777166176470587))");

var boundingbox = wktreader.Read(@"POLYGON ((-52.5 -34, -52.5 34, 52.5 34, 52.5 -34, -52.5 -34))");
var result = boundingbox.Intersection(polygon); // =>{ POLYGON EMPTY }
var resultInverted = polygon.Intersection(boundingbox); // => { POLYGON EMPTY }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions