3

As you might know there's a really awesome algorithm for finding the largest area rectangle that lies inside a given polygon in the D3plus library.

If I use this algorithm with EPSG:4326 (WGS84) coordinates the result looks pretty reasonable as you can see in the following image:

enter image description here

My problem is that I have to work with the swiss CRS which is EPSG:2056 (LV95). If I use the same algorithm but with swiss coordinates the following happens:

enter image description here

You might think to solve this problem I could just convert the coordinates between the CRS. But this doesn't work because of the distortions:

enter image description here

I've created an example where the problem is shown: https://stackblitz.com/edit/largest-rectangle

Does somebody know why it doesn't work with swiss coordinates? Or even better, has a solution that works?

Ruben
  • 151
  • 1
  • 7

0 Answers0