Beakerboy / OSMBuilding

render an individual OSM building
MIT License
45 stars 5 forks source link

Use a rotation instead of a translation to "center" the structure #2

Closed Beakerboy closed 2 years ago

Beakerboy commented 2 years ago

Currently, the first node of the way is moved to 0,0 by subtracting it's values from the lat/lon of every other point. It is perfectly cromulent to change the longitude this way, but the latitude should be modified with a true rotation.

this is because at higher latitude, the arclength of each degree longitude is smaller.

First "rotate" the data to move the home point into the prime meridian. Then use trig to move each point towards the equator.