leaflet-geoman icon indicating copy to clipboard operation
leaflet-geoman copied to clipboard

Area Preservation when dragging polygons.

Open sheaffe opened this issue 4 years ago β€’ 4 comments

When dragging polygons to different latitudes, area is not being preserved. Specifically, when a polygon is created in towards the poles and brought towards the equator, its width is not adjusting appropriately. Height is adjusting though.

Steps to reproduce the issue: Can be done on main site https://geoman.io/leaflet-geoman

  1. Create a circle over a northern country (like the uk)
  2. Create a polygon over the same circle.
  3. Drag the circle to the equator.
  4. Drag the polygon to the same location at the equator.

In theory they should both remain the same size. However they distort in different ways.

Circle and polygon created in north with same shape. image Circle and polygon with different shapes after being dragged to the equator. image

sheaffe avatar Feb 19 '20 23:02 sheaffe

I don't really have a solution to this but thought I'd offer some findings on the matter.

This is probably due to the curvature of the earth and the way that leaflet handles it's coordinates.

check out the leaflet draw demo

Though you can't reproduce it exactly as polygons aren't draggable. If you draw a circle say over Iceland and a square over the circle:

Capture1

Then drag them both down to the equator, a similar effect can be seen.

Capture2

DazDotOne avatar Feb 20 '20 13:02 DazDotOne

Hmm, interesting. I have had the topic when we fixed this for circles (and I believe they behave correctly currently). The question is if the difference between polygons and circles is correct or not. I COULD imagine this being correct as polygons have dedicated coordinates that are moved while a circle only has a center and a radius and the circle is just... projected... not "real".

But this is purely a guess

codeofsumit avatar Feb 21 '20 13:02 codeofsumit

@codeofsumit that was my thinking on this.

Kind of 'unexpected expected behaviour'.

DazDotOne avatar May 04 '20 07:05 DazDotOne

#585 goes in the similar direction

Falke-Design avatar Nov 07 '20 20:11 Falke-Design